import { EventEmitter } from "events"; import { Logger } from "../common/Logger"; import { Core } from "../Core"; import { GenericService } from "./GenericService"; import { RPCManager } from "../common/RPCManager.js"; export {}; declare class RPCoverXMPPService extends GenericService { private avatarDomain; private readonly _protocol; private readonly _host; private readonly _port; private RPCoverXMPPHandlerToken; rpcManager: RPCManager; static getClassName(): string; getClassName(): string; static getAccessorName(): string; getAccessorName(): string; constructor(_core: Core, _eventEmitter: EventEmitter, _http: any, _logger: Logger, _startConfig: { start_up: boolean; optional: boolean; }); start(_options: any): Promise; stop(): Promise; init(useRestAtStartup: boolean): Promise; attachHandlers(): void; initRPCSystemMethods(): Promise; /** * @public * @nodered true * @method addRPCMethod * @since 2.22.0 * @instance * @async * @category Rainbow RPCoverXMPP RPC Server * @description * This API allows to expose an RPC method to requests from an XMPP party.
* @param {string} methodName The name of the method to be added in RPC server. This is the name used by the RPC Client to call it. * @param {string} methodCallback The callback of the method to be added in RPC server.
It is this method which is called when the SDK receives an RPC request for the linked methodName.
The method signature is built from this parameter. * @param {string} methodDescription The description of the method to be added in RPC server * @param {string} methodHelp The help of the method to be added in RPC server * @return {Promise} An object of the result */ addRPCMethod(methodName?: string, methodCallback?: any, methodDescription?: string, methodHelp?: string): Promise; /** * @public * @nodered true * @method removeRPCMethod * @since 2.22.0 * @instance * @async * @category Rainbow RPCoverXMPP RPC Server * @description * This API allows to remove an RPC method from RPC Server.
* @param {string} methodName The name of the method to be removed from RPC server * @return {Promise} An object of the result */ removeRPCMethod(methodName?: string): Promise; /** * @public * @nodered true * @method discoverRPCoverXMPP * @since 2.22.0 * @instance * @async * @category Rainbow RPCoverXMPP RPC Client * @description * This API allows to send a discover presence to a bare jid to find the resources availables.
* @param {Object} headers The Http Headers used to web request. * @param {string} rpcoverxmppserver_jid the jid of the http over xmpp server used to retrieve the HTTP web request. default value is the jid of the account running the SDK. * @return {Promise} An object of the result */ discoverRPCoverXMPP(headers?: any, rpcoverxmppserver_jid?: string): Promise; /** * @public * @nodered true * @method callRPCMethod * @since 2.22.0 * @instance * @async * @category Rainbow RPCoverXMPP RPC Client * @description * This API allows to send a request to call a rpc method to a bare jid. The result is the result of the method called on RPC server.
* @param {string} rpcoverxmppserver_jid the jid of the rpc server used to retrieve the request. default value is the jid of the account running the SDK.
**Note :** only a full JID (with resource) is possible to used. * @param {string} methodName="system.listMethods" method name of the rpc shared method on server used to retrieve the request.
default value is `system.listMethods` for listing the available methods on RPC server.
use `system.methodHelp` with the name of a method as parameter to get informations about it.
Use `system.methodSignature` with the name of a method as parameter to get it's signature. * @param {Array} params Array with the parameters for the RPC request. This Array will be splitted in each parameters to the method shared on RPC Server when it is ran. * @return {Promise} An object of the result */ callRPCMethod(rpcoverxmppserver_jid?: string, methodName?: string, params?: Array): Promise; /** * @private * @method discover * @since 2.10.0 * @instance * @async * @category Rainbow RPCoverXMPP RPC Client * @description * This API allows to get the supported XMPP services.
* @return {Promise} An object of the result */ discover(): Promise; } export { RPCoverXMPPService as RPCoverXMPPService };