import { EventEmitter } from "events"; import { Logger } from "../common/Logger"; import { ProxyImpl } from "../ProxyImpl"; import { GenericService } from "./GenericService"; import { Core } from "../Core.js"; declare class S2SService extends GenericService { private serverURL; private host; version: any; jid_im: any; jid_tel: any; jid_password: any; fullJid: any; jid: any; userId: any; private proxy; private xmppUtils; private generatedRandomId; private hash; private hostCallback; private expressEngine; private app; private locallistenningport; private s2sEventHandler; private _contacts; private _conversations; static getClassName(): string; getClassName(): string; static getAccessorName(): string; getAccessorName(): string; constructor(_core: Core, _s2s: { hostCallback: string; locallistenningport: string; expressEngine: any; }, _im: any, _application: any, _eventEmitter: EventEmitter, _logger: Logger, _proxy: ProxyImpl, _startConfig: { start_up: boolean; optional: boolean; }); start(_options: any): Promise; /** * @private * @name signin * @param account * @param headers */ signin(account: any, headers: any): Promise; /** * @private * @param forceStop */ stop(forceStop?: boolean): Promise; init(useRestAtStartup: boolean): Promise; /** * @public * @nodered true * @method listConnectionsS2S * @instance * @category S2S Management * @description * List all the connected user's connexions.
* @async * @return {Promise} * @fulfil {Object} - List of connexions or an error object depending on the result */ listConnectionsS2S(): Promise; /** * @public * @nodered true * @method checkS2Sconnection * @instance * @category S2S Management * @description * check the S2S connection with a head request.
* @async * @return {Promise} * @fulfil {Object} - List of connexions or an error object depending on the result */ checkS2Sconnection(): Promise; /** * @private * @nodered true * @method deleteConnectionsS2S * @instance * @category S2S Management * @param {Array} connexions a List of connections S2S to delete * @description * Delete one by one a list of S2S connections of the connected user.
* @async * @return {Promise} * @fulfil {Object} - List of connexions or an error object depending on the result */ deleteConnectionsS2S(connexions: any): Promise; /** * @public * @nodered true * @method deleteAllConnectionsS2S * @instance * @category S2S Management * @description * Delete all the connected user's S2S connexions.
* @async * @return {Promise} * @fulfil {Object} - List of connexions or an error object depending on the result */ deleteAllConnectionsS2S(): Promise; /** * @private * @method loginS2S * @instance * @category S2S Management * @param {string} callback_url The web site which is the callback where the S2S events are sent by Rainbow server * @description * Login to S2S event server the already connected user to REST API server.
* @async * @return {Promise} * @fulfil {Object} - List of connexions or an error object depending on the result */ loginS2S(callback_url: string): Promise; /** * @public * @nodered true * @method infoS2S * @instance * @category S2S Management * @param {string} s2sConnectionId The id of the S2S conneexion to retrieve information about. * @description * Get information about a S2S connexions.
* @async * @return {Promise} * @fulfil {Object} - List of connexions or an error object depending on the result */ infoS2S(s2sConnectionId: string): Promise; onS2SReady(event: any): Promise; /** * @private * @method sendS2SPresence * @instance * @category S2S Methods * @param {Object} obj Object {show, status} describing the presence :
* To put presence to cases :
* "online": {show = undefined, status = "mode=auto"}
* "away": {show = "xa", status = "away"}
* "dnd": {show = "dnd", status = ""}
* "invisible": {show = "xa", status = ""}
* @description * set the presence of the connected user with s2s api .
* @async * @return {Promise} * @fulfil {Object} - List of connexions or an error object depending on the result */ sendS2SPresence(obj: any): Promise; /** * @public * @nodered true * @method sendMessageInConversation * @instance * @category S2S Methods * @param {string} conversationId * @param {any} msg The message object to send.
* {
* "message": {
* "subject": "Greeting",
* "lang": "en",
* "contents": [
* {
* "type": "text/markdown",
* "data": "## Hello Bob"
* }
* ],
* "body": "Hello world"
* }
* }
* @description * Send a message in a conversation. Note, corrected message is not yet supported.
* @async * @return {Promise} * @fulfil {Object} - result or an error object depending on the result */ sendMessageInConversation(conversationId: string, msg: any): Promise; /** * @public * @nodered true * @method sendCorrectedChatMessage * @instance * @category S2S Methods * @param {string} conversationId id of the conversation * @param {string} origMsgId id of the original message * @param {any} msg The message object update.
* {
* "message": {
* "subject": "Greeting",
* "lang": "en",
* "contents": [
* {
* "type": "text/markdown",
* "data": "## Hello Bob"
* }
* ],
* "body": "Hello world"
* }
* }
* @description * Send a corrected message in a conversation.
* @async * @return {Promise} * @fulfil {Object} - result or an error object depending on the result */ sendCorrectedChatMessage(conversationId: string, origMsgId: string, msg: any): Promise; /** * @public * @nodered true * @method sendForwardChatMessage * @instance * @category S2S Methods * @param {string} conversationId id of the conversation. * @param {string} msgId Message id. * @param {string} msg The message object to send.
* {
* "message": {
* "subject": "Greeting",
* "lang": "en",
* "contents": [
* {
* "type": "text/markdown",
* "data": "## Hello Bob"
* }
* ],
* "body": "Hello world"
* }
* }
* @param {string} conversationDestId the id of the destination conversation * * * Destination conversation id * @description * Forward a message from a conversation to another one.
* @async * @return {Promise} * @fulfil {Object} - result or an error object depending on the result */ sendForwardChatMessage(conversationId: string, msgId: string, msg: any, conversationDestId: string): Promise; /** * @private * @method joinRoom * @param {string} bubbleId The id of the bubble to open the conversation. * @param {ROOMROLE} role Enum: "member" "moderator" of your role in this room * @category S2S Methods * @instance * @description * send presence in S2S to join a bubble conversation
* @async * @return {Promise} * @fulfil {Object} - List of connexions or an error object depending on the result */ joinRoom(bubbleId: string, role: ROOMROLE): Promise; } /** * The role of the Contact in the Bubble. * @public * @enum {string} * @readonly */ declare enum ROOMROLE { MODERATOR = "moderator", MEMBER = "member" } /** * The state of the Chat in the conversation. * @public * @enum {string} * @readonly */ declare enum CHATSTATE { ACTIVE = "active", COMPOSING = "composing", PAUSED = "paused", INACTIVE = "inactive", GONE = "gone" } export { S2SService, ROOMROLE, CHATSTATE };