提交 b234bb74 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

Upgrade hostie

上级 4dcd2eb3
......@@ -23,9 +23,9 @@
import { StateSwitch } from 'state-switch'
import {
PuppetHostieServer,
PuppetHostieGrpcServerOptions,
} from 'wechaty-puppet-hostie'
PuppetServer,
PuppetServerOptions,
} from 'wechaty-puppet-hostie'
import { Message } from './user'
......@@ -47,7 +47,7 @@ export class IoClient {
* Huan(202002): make it optional.
*/
private io?: Io
private hostieServer?: PuppetHostieServer
private puppetServer?: PuppetServer
private state: StateSwitch
......@@ -64,28 +64,28 @@ export class IoClient {
private async startHostie () {
log.verbose('IoClient', 'startHostie()')
if (this.hostieServer) {
if (this.puppetServer) {
throw new Error('hostie server exists')
}
const options: PuppetHostieGrpcServerOptions = {
const options: PuppetServerOptions = {
endpoint : '0.0.0.0:8788',
puppet : this.options.wechaty.puppet,
token : this.options.token,
}
this.hostieServer = new PuppetHostieServer(options)
await this.hostieServer.start()
this.puppetServer = new PuppetServer(options)
await this.puppetServer.start()
}
private async stopHostie () {
log.verbose('IoClient', 'stopHostie()')
if (!this.hostieServer) {
if (!this.puppetServer) {
throw new Error('hostie server does not exist')
}
await this.hostieServer.stop()
this.hostieServer = undefined
await this.puppetServer.stop()
this.puppetServer = undefined
}
public async start (): Promise<void> {
......
......@@ -11,8 +11,8 @@ export const PUPPET_DEPENDENCIES = {
* DEPRECATED by Huan(202002): The Above is Alias for the following full NPM module names *
*******************************************************************************************/
'wechaty-puppet-hostie' : '^0.3.21', // https://www.npmjs.com/package/wechaty-puppet-hostie
'wechaty-puppet-mock' : '^0.17.5', // https://www.npmjs.com/package/wechaty-puppet-mock
'wechaty-puppet-hostie' : '^0.3.28', // https://www.npmjs.com/package/wechaty-puppet-hostie
'wechaty-puppet-mock' : '^0.19.0', // https://www.npmjs.com/package/wechaty-puppet-mock
// 'wechaty-puppet-dll' : '^0.3.1', // https://www.npmjs.com/package/wechaty-puppet-dll
// 'wechaty-puppet-ioscat' : '^0.5.22', // https://www.npmjs.com/package/wechaty-puppet-ioscat
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册