diff --git a/package.json b/package.json index 77c1b2f4..4a03238e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@chatie/grpc", - "version": "0.17.1", + "version": "0.17.2", "description": "gRPC for Chatie", "main": "dist/src/index.js", "typings": "dist/src/index.d.js", diff --git a/proto/wechaty/puppet.proto b/proto/wechaty/puppet.proto index c5f8fa45..39426d54 100644 --- a/proto/wechaty/puppet.proto +++ b/proto/wechaty/puppet.proto @@ -45,6 +45,8 @@ service Puppet { */ rpc Event (puppet.EventRequest) returns (stream puppet.EventResponse) {} + rpc DirtyPayload (puppet.DirtyPayloadRequest) returns (puppet.DirtyPayloadResponse) {} + /** * * Contact Self diff --git a/proto/wechaty/puppet/base.proto b/proto/wechaty/puppet/base.proto index e72be44e..440d9857 100644 --- a/proto/wechaty/puppet/base.proto +++ b/proto/wechaty/puppet/base.proto @@ -4,6 +4,15 @@ package wechaty.puppet; option go_package="github.com/wechaty/go-grpc/wechaty/puppet"; option java_package="io.github.wechaty.grpc.puppet"; +enum PayloadType { + PAYLOAD_TYPE_UNKNOWN = 0; + PAYLOAD_TYPE_MESSAGE = 1; + PAYLOAD_TYPE_CONTACT = 2; + PAYLOAD_TYPE_ROOM = 3; + PAYLOAD_TYPE_ROOM_MEMBER = 4; + PAYLOAD_TYPE_FRIENDSHIP = 5; +} + message StartRequest {} message StartResponse {} @@ -25,3 +34,10 @@ message DingResponse { // Ding has no return value // Puppet should emit a `ding` event when it receives a `ding()` call } + +message DirtyPayloadRequest { + PayloadType type = 1; + string id = 2; +} + +message DirtyPayloadResponse {} diff --git a/proto/wechaty/puppet/event.proto b/proto/wechaty/puppet/event.proto index 785e5e75..5521524e 100644 --- a/proto/wechaty/puppet/event.proto +++ b/proto/wechaty/puppet/event.proto @@ -24,6 +24,7 @@ enum EventType { EVENT_TYPE_RESET = 24; EVENT_TYPE_LOGIN = 25; EVENT_TYPE_LOGOUT = 26; + EVENT_TYPE_DIRTY = 27; } message EventRequest {} diff --git a/tests/puppet-server-impl.ts b/tests/puppet-server-impl.ts index a27f3031..dee3063f 100644 --- a/tests/puppet-server-impl.ts +++ b/tests/puppet-server-impl.ts @@ -55,6 +55,12 @@ export const puppetServerImpl: IPuppetServer = { throw new Error('not implmented.') }, + dirtyPayload: (call, callback) => { + void call + void callback + throw new Error('not implmented.') + }, + event: (streamnigCall) => { void streamnigCall throw new Error('not implmented.')