syntax = "proto3";
package wechaty.puppet;

option go_package       = "github.com/wechaty/go-grpc/wechaty/puppet";
option java_package     = "io.github.wechaty.grpc.puppet";
option csharp_namespace = "github.wechaty.grpc.puppet";

// 数值必须与 @juzi/wechaty-puppet 的 DirtyType 严格一致。
enum PayloadType {
  PAYLOAD_TYPE_UNSPECIFIED = 0;
  PAYLOAD_TYPE_MESSAGE     = 1;
  PAYLOAD_TYPE_CONTACT     = 2;
  PAYLOAD_TYPE_ROOM        = 3;
  PAYLOAD_TYPE_ROOM_MEMBER = 4;
  PAYLOAD_TYPE_FRIENDSHIP  = 5;
  PAYLOAD_TYPE_POST        = 6;
  PAYLOAD_TYPE_TAG         = 7;
  PAYLOAD_TYPE_TAG_GROUP   = 8;
  PAYLOAD_TYPE_WXXD_PRODUCT = 9;
  PAYLOAD_TYPE_WXXD_ORDER   = 10;
  PAYLOAD_TYPE_CALL         = 11;
}

message StartRequest {}
message StartResponse {}

message StopRequest {}
message StopResponse {}

message VersionRequest {}
message VersionResponse {
  string version = 1;
}

message LogoutRequest {}
message LogoutResponse {}

message DingRequest {
  string data = 1;
}
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 {}

message CurrentUserRequest {
}

message CurrentUserResponse {
  string user_id = 1;
}

message RefreshQRCodeRequest {
}

message RefreshQRCodeResponse {
}
