Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 2 additions & 0 deletions proto/wechaty/puppet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ service Puppet {
*/
rpc Event (puppet.EventRequest) returns (stream puppet.EventResponse) {}

rpc DirtyPayload (puppet.DirtyPayloadRequest) returns (puppet.DirtyPayloadResponse) {}

/**
*
* Contact Self
Expand Down
16 changes: 16 additions & 0 deletions proto/wechaty/puppet/base.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}

Expand All @@ -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 {}
1 change: 1 addition & 0 deletions proto/wechaty/puppet/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ enum EventType {
EVENT_TYPE_RESET = 24;
EVENT_TYPE_LOGIN = 25;
EVENT_TYPE_LOGOUT = 26;
EVENT_TYPE_DIRTY = 27;
}

message EventRequest {}
Expand Down
6 changes: 6 additions & 0 deletions tests/puppet-server-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down