cqi.CQiClient = class CQiClient { /** * @param {string} host * @param {string} corpusId * @param {number} [timeout=60] timeout * @param {string} [version=0.1] version */ constructor(host, corpusId, timeout = 60, version = '0.1') { /** @type {cqi.api.APIClient} */ this.api = new cqi.api.APIClient(host, corpusId, timeout, version); } /** * @returns {cqi.models.corpora.CorpusCollection} */ get corpora() { return new cqi.models.corpora.CorpusCollection(this); } /** * @returns {Promise} */ async bye() { return await this.api.ctrl_bye(); } /** * @param {string} username * @param {string} password * @returns {Promise} */ async connect(username, password) { return await this.api.ctrl_connect(username, password); } /** * @returns {Promise} */ async ping() { return await this.api.ctrl_ping(); } /** * @returns {Promise} */ async userAbort() { return await this.api.ctrl_user_abort(); } /** * Alias for "bye" method * * @returns {Promise} */ async disconnect() { return await this.api.ctrl_bye(); } };