@juzi/wechaty-grpc 1.0.4 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/cjs/out/wechaty/puppet/base_pb.d.ts +36 -0
  2. package/dist/cjs/out/wechaty/puppet/base_pb.js +275 -0
  3. package/dist/cjs/out/wechaty/puppet/contact_pb.d.ts +4 -0
  4. package/dist/cjs/out/wechaty/puppet/contact_pb.js +31 -1
  5. package/dist/cjs/out/wechaty/puppet/message_pb.d.ts +40 -0
  6. package/dist/cjs/out/wechaty/puppet/message_pb.js +304 -0
  7. package/dist/cjs/out/wechaty/puppet/room-member_pb.d.ts +4 -0
  8. package/dist/cjs/out/wechaty/puppet/room-member_pb.js +31 -1
  9. package/dist/cjs/out/wechaty/puppet/room_pb.d.ts +4 -0
  10. package/dist/cjs/out/wechaty/puppet/room_pb.js +31 -1
  11. package/dist/cjs/out/wechaty/puppet.openapi.yaml +50 -1
  12. package/dist/cjs/out/wechaty/puppet.swagger.json +78 -1
  13. package/dist/cjs/out/wechaty/puppet_grpc_pb.d.ts +34 -0
  14. package/dist/cjs/out/wechaty/puppet_grpc_pb.js +66 -0
  15. package/dist/cjs/out/wechaty/puppet_pb_service.d.ts +38 -0
  16. package/dist/cjs/out/wechaty/puppet_pb_service.js +80 -0
  17. package/dist/cjs/proto/wechaty/puppet/base.proto +7 -0
  18. package/dist/cjs/proto/wechaty/puppet/contact.proto +19 -18
  19. package/dist/cjs/proto/wechaty/puppet/message.proto +7 -0
  20. package/dist/cjs/proto/wechaty/puppet/room-member.proto +6 -5
  21. package/dist/cjs/proto/wechaty/puppet/room.proto +6 -5
  22. package/dist/cjs/proto/wechaty/puppet.proto +12 -0
  23. package/dist/cjs/src/package-json.js +1 -1
  24. package/dist/cjs/tests/puppet-server-impl.d.ts.map +1 -1
  25. package/dist/cjs/tests/puppet-server-impl.js +10 -0
  26. package/dist/cjs/tests/puppet-server-impl.js.map +1 -1
  27. package/dist/esm/out/wechaty/puppet/base_pb.d.ts +36 -0
  28. package/dist/esm/out/wechaty/puppet/base_pb.js +275 -0
  29. package/dist/esm/out/wechaty/puppet/contact_pb.d.ts +4 -0
  30. package/dist/esm/out/wechaty/puppet/contact_pb.js +31 -1
  31. package/dist/esm/out/wechaty/puppet/message_pb.d.ts +40 -0
  32. package/dist/esm/out/wechaty/puppet/message_pb.js +304 -0
  33. package/dist/esm/out/wechaty/puppet/room-member_pb.d.ts +4 -0
  34. package/dist/esm/out/wechaty/puppet/room-member_pb.js +31 -1
  35. package/dist/esm/out/wechaty/puppet/room_pb.d.ts +4 -0
  36. package/dist/esm/out/wechaty/puppet/room_pb.js +31 -1
  37. package/dist/esm/out/wechaty/puppet.openapi.yaml +50 -1
  38. package/dist/esm/out/wechaty/puppet.swagger.json +78 -1
  39. package/dist/esm/out/wechaty/puppet_grpc_pb.d.ts +34 -0
  40. package/dist/esm/out/wechaty/puppet_grpc_pb.js +66 -0
  41. package/dist/esm/out/wechaty/puppet_pb_service.d.ts +38 -0
  42. package/dist/esm/out/wechaty/puppet_pb_service.js +80 -0
  43. package/dist/esm/proto/wechaty/puppet/base.proto +7 -0
  44. package/dist/esm/proto/wechaty/puppet/contact.proto +19 -18
  45. package/dist/esm/proto/wechaty/puppet/message.proto +7 -0
  46. package/dist/esm/proto/wechaty/puppet/room-member.proto +6 -5
  47. package/dist/esm/proto/wechaty/puppet/room.proto +6 -5
  48. package/dist/esm/proto/wechaty/puppet.proto +12 -0
  49. package/dist/esm/src/package-json.js +1 -1
  50. package/dist/esm/tests/puppet-server-impl.d.ts.map +1 -1
  51. package/dist/esm/tests/puppet-server-impl.js +10 -0
  52. package/dist/esm/tests/puppet-server-impl.js.map +1 -1
  53. package/out/wechaty/puppet/base_pb.d.ts +36 -0
  54. package/out/wechaty/puppet/base_pb.js +275 -0
  55. package/out/wechaty/puppet/contact_pb.d.ts +4 -0
  56. package/out/wechaty/puppet/contact_pb.js +31 -1
  57. package/out/wechaty/puppet/message_pb.d.ts +40 -0
  58. package/out/wechaty/puppet/message_pb.js +304 -0
  59. package/out/wechaty/puppet/room-member_pb.d.ts +4 -0
  60. package/out/wechaty/puppet/room-member_pb.js +31 -1
  61. package/out/wechaty/puppet/room_pb.d.ts +4 -0
  62. package/out/wechaty/puppet/room_pb.js +31 -1
  63. package/out/wechaty/puppet.openapi.yaml +50 -1
  64. package/out/wechaty/puppet.swagger.json +78 -1
  65. package/out/wechaty/puppet_grpc_pb.d.ts +34 -0
  66. package/out/wechaty/puppet_grpc_pb.js +66 -0
  67. package/out/wechaty/puppet_pb_service.d.ts +38 -0
  68. package/out/wechaty/puppet_pb_service.js +80 -0
  69. package/package.json +1 -1
  70. package/src/package-json.ts +1 -1
@@ -3,7 +3,7 @@
3
3
  "info": {
4
4
  "title": "Wechaty Puppet Service OpenAPI Specification",
5
5
  "description": "Wechaty is a Conversational RPA SDK for chatbot makers. With only 6 lines of code, you can create a bot on the most popular IMs like WeChat, Whatsapp, WeCom, Gitter, etc.\n\nWechaty Puppet Service is the RESTful API for Wechaty API, which is build on top of the Wechaty Puppet Abstraction and the gRPC proto definition.",
6
- "version": "1.0.4",
6
+ "version": "1.0.7",
7
7
  "contact": {
8
8
  "name": "Wechaty",
9
9
  "url": "https://github.com/wechaty/openapi",
@@ -890,6 +890,28 @@
890
890
  ]
891
891
  }
892
892
  },
893
+ "/currentUser": {
894
+ "get": {
895
+ "operationId": "Puppet_CurrentUser",
896
+ "responses": {
897
+ "200": {
898
+ "description": "A successful response.",
899
+ "schema": {
900
+ "$ref": "#/definitions/puppetCurrentUserResponse"
901
+ }
902
+ },
903
+ "default": {
904
+ "description": "An unexpected error response.",
905
+ "schema": {
906
+ "$ref": "#/definitions/rpcStatus"
907
+ }
908
+ }
909
+ },
910
+ "tags": [
911
+ "Puppet"
912
+ ]
913
+ }
914
+ },
893
915
  "/ding": {
894
916
  "post": {
895
917
  "operationId": "Puppet_Ding",
@@ -1445,6 +1467,36 @@
1445
1467
  ]
1446
1468
  }
1447
1469
  },
1470
+ "/message/{id}/preview": {
1471
+ "get": {
1472
+ "operationId": "Puppet_MessagePreview",
1473
+ "responses": {
1474
+ "200": {
1475
+ "description": "A successful response.",
1476
+ "schema": {
1477
+ "$ref": "#/definitions/puppetMessagePreviewResponse"
1478
+ }
1479
+ },
1480
+ "default": {
1481
+ "description": "An unexpected error response.",
1482
+ "schema": {
1483
+ "$ref": "#/definitions/rpcStatus"
1484
+ }
1485
+ }
1486
+ },
1487
+ "parameters": [
1488
+ {
1489
+ "name": "id",
1490
+ "in": "path",
1491
+ "required": true,
1492
+ "type": "string"
1493
+ }
1494
+ ],
1495
+ "tags": [
1496
+ "Puppet"
1497
+ ]
1498
+ }
1499
+ },
1448
1500
  "/message/{id}/recall": {
1449
1501
  "put": {
1450
1502
  "operationId": "Puppet_MessageRecall",
@@ -2647,6 +2699,9 @@
2647
2699
  "items": {
2648
2700
  "type": "string"
2649
2701
  }
2702
+ },
2703
+ "additionalInfo": {
2704
+ "type": "string"
2650
2705
  }
2651
2706
  }
2652
2707
  },
@@ -2693,6 +2748,14 @@
2693
2748
  ],
2694
2749
  "default": "CONTACT_TYPE_UNSPECIFIED"
2695
2750
  },
2751
+ "puppetCurrentUserResponse": {
2752
+ "type": "object",
2753
+ "properties": {
2754
+ "userId": {
2755
+ "type": "string"
2756
+ }
2757
+ }
2758
+ },
2696
2759
  "puppetDingRequest": {
2697
2760
  "type": "object",
2698
2761
  "properties": {
@@ -3056,6 +3119,14 @@
3056
3119
  }
3057
3120
  }
3058
3121
  },
3122
+ "puppetMessagePreviewResponse": {
3123
+ "type": "object",
3124
+ "properties": {
3125
+ "fileBox": {
3126
+ "type": "string"
3127
+ }
3128
+ }
3129
+ },
3059
3130
  "puppetMessageRecallResponse": {
3060
3131
  "type": "object",
3061
3132
  "properties": {
@@ -3400,6 +3471,9 @@
3400
3471
  },
3401
3472
  "name": {
3402
3473
  "type": "string"
3474
+ },
3475
+ "additionalInfo": {
3476
+ "type": "string"
3403
3477
  }
3404
3478
  }
3405
3479
  },
@@ -3432,6 +3506,9 @@
3432
3506
  },
3433
3507
  "handle": {
3434
3508
  "type": "string"
3509
+ },
3510
+ "additionalInfo": {
3511
+ "type": "string"
3435
3512
  }
3436
3513
  }
3437
3514
  },
@@ -28,6 +28,7 @@ interface IPuppetService extends grpc.ServiceDefinition<grpc.UntypedServiceImple
28
28
  stop: IPuppetService_IStop;
29
29
  logout: IPuppetService_ILogout;
30
30
  ding: IPuppetService_IDing;
31
+ currentUser: IPuppetService_ICurrentUser;
31
32
  version: IPuppetService_IVersion;
32
33
  event: IPuppetService_IEvent;
33
34
  dirtyPayload: IPuppetService_IDirtyPayload;
@@ -64,6 +65,7 @@ interface IPuppetService extends grpc.ServiceDefinition<grpc.UntypedServiceImple
64
65
  messageSendUrl: IPuppetService_IMessageSendUrl;
65
66
  messageSendLocation: IPuppetService_IMessageSendLocation;
66
67
  messageSendChannel: IPuppetService_IMessageSendChannel;
68
+ messagePreview: IPuppetService_IMessagePreview;
67
69
  roomPayload: IPuppetService_IRoomPayload;
68
70
  roomList: IPuppetService_IRoomList;
69
71
  roomAdd: IPuppetService_IRoomAdd;
@@ -149,6 +151,15 @@ interface IPuppetService_IDing extends grpc.MethodDefinition<wechaty_puppet_base
149
151
  responseSerialize: grpc.serialize<wechaty_puppet_base_pb.DingResponse>;
150
152
  responseDeserialize: grpc.deserialize<wechaty_puppet_base_pb.DingResponse>;
151
153
  }
154
+ interface IPuppetService_ICurrentUser extends grpc.MethodDefinition<wechaty_puppet_base_pb.CurrentUserRequest, wechaty_puppet_base_pb.CurrentUserResponse> {
155
+ path: "/wechaty.Puppet/CurrentUser";
156
+ requestStream: false;
157
+ responseStream: false;
158
+ requestSerialize: grpc.serialize<wechaty_puppet_base_pb.CurrentUserRequest>;
159
+ requestDeserialize: grpc.deserialize<wechaty_puppet_base_pb.CurrentUserRequest>;
160
+ responseSerialize: grpc.serialize<wechaty_puppet_base_pb.CurrentUserResponse>;
161
+ responseDeserialize: grpc.deserialize<wechaty_puppet_base_pb.CurrentUserResponse>;
162
+ }
152
163
  interface IPuppetService_IVersion extends grpc.MethodDefinition<wechaty_puppet_base_pb.VersionRequest, wechaty_puppet_base_pb.VersionResponse> {
153
164
  path: "/wechaty.Puppet/Version";
154
165
  requestStream: false;
@@ -473,6 +484,15 @@ interface IPuppetService_IMessageSendChannel extends grpc.MethodDefinition<wecha
473
484
  responseSerialize: grpc.serialize<wechaty_puppet_message_pb.MessageSendChannelResponse>;
474
485
  responseDeserialize: grpc.deserialize<wechaty_puppet_message_pb.MessageSendChannelResponse>;
475
486
  }
487
+ interface IPuppetService_IMessagePreview extends grpc.MethodDefinition<wechaty_puppet_message_pb.MessagePreviewRequest, wechaty_puppet_message_pb.MessagePreviewResponse> {
488
+ path: "/wechaty.Puppet/MessagePreview";
489
+ requestStream: false;
490
+ responseStream: false;
491
+ requestSerialize: grpc.serialize<wechaty_puppet_message_pb.MessagePreviewRequest>;
492
+ requestDeserialize: grpc.deserialize<wechaty_puppet_message_pb.MessagePreviewRequest>;
493
+ responseSerialize: grpc.serialize<wechaty_puppet_message_pb.MessagePreviewResponse>;
494
+ responseDeserialize: grpc.deserialize<wechaty_puppet_message_pb.MessagePreviewResponse>;
495
+ }
476
496
  interface IPuppetService_IRoomPayload extends grpc.MethodDefinition<wechaty_puppet_room_pb.RoomPayloadRequest, wechaty_puppet_room_pb.RoomPayloadResponse> {
477
497
  path: "/wechaty.Puppet/RoomPayload";
478
498
  requestStream: false;
@@ -664,6 +684,7 @@ export interface IPuppetServer extends grpc.UntypedServiceImplementation {
664
684
  stop: grpc.handleUnaryCall<wechaty_puppet_base_pb.StopRequest, wechaty_puppet_base_pb.StopResponse>;
665
685
  logout: grpc.handleUnaryCall<wechaty_puppet_base_pb.LogoutRequest, wechaty_puppet_base_pb.LogoutResponse>;
666
686
  ding: grpc.handleUnaryCall<wechaty_puppet_base_pb.DingRequest, wechaty_puppet_base_pb.DingResponse>;
687
+ currentUser: grpc.handleUnaryCall<wechaty_puppet_base_pb.CurrentUserRequest, wechaty_puppet_base_pb.CurrentUserResponse>;
667
688
  version: grpc.handleUnaryCall<wechaty_puppet_base_pb.VersionRequest, wechaty_puppet_base_pb.VersionResponse>;
668
689
  event: grpc.handleServerStreamingCall<wechaty_puppet_event_pb.EventRequest, wechaty_puppet_event_pb.EventResponse>;
669
690
  dirtyPayload: grpc.handleUnaryCall<wechaty_puppet_base_pb.DirtyPayloadRequest, wechaty_puppet_base_pb.DirtyPayloadResponse>;
@@ -700,6 +721,7 @@ export interface IPuppetServer extends grpc.UntypedServiceImplementation {
700
721
  messageSendUrl: grpc.handleUnaryCall<wechaty_puppet_message_pb.MessageSendUrlRequest, wechaty_puppet_message_pb.MessageSendUrlResponse>;
701
722
  messageSendLocation: grpc.handleUnaryCall<wechaty_puppet_message_pb.MessageSendLocationRequest, wechaty_puppet_message_pb.MessageSendLocationResponse>;
702
723
  messageSendChannel: grpc.handleUnaryCall<wechaty_puppet_message_pb.MessageSendChannelRequest, wechaty_puppet_message_pb.MessageSendChannelResponse>;
724
+ messagePreview: grpc.handleUnaryCall<wechaty_puppet_message_pb.MessagePreviewRequest, wechaty_puppet_message_pb.MessagePreviewResponse>;
703
725
  roomPayload: grpc.handleUnaryCall<wechaty_puppet_room_pb.RoomPayloadRequest, wechaty_puppet_room_pb.RoomPayloadResponse>;
704
726
  roomList: grpc.handleUnaryCall<wechaty_puppet_room_pb.RoomListRequest, wechaty_puppet_room_pb.RoomListResponse>;
705
727
  roomAdd: grpc.handleUnaryCall<wechaty_puppet_room_pb.RoomAddRequest, wechaty_puppet_room_pb.RoomAddResponse>;
@@ -743,6 +765,9 @@ export interface IPuppetClient {
743
765
  ding(request: wechaty_puppet_base_pb.DingRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_base_pb.DingResponse) => void): grpc.ClientUnaryCall;
744
766
  ding(request: wechaty_puppet_base_pb.DingRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_base_pb.DingResponse) => void): grpc.ClientUnaryCall;
745
767
  ding(request: wechaty_puppet_base_pb.DingRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_base_pb.DingResponse) => void): grpc.ClientUnaryCall;
768
+ currentUser(request: wechaty_puppet_base_pb.CurrentUserRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_base_pb.CurrentUserResponse) => void): grpc.ClientUnaryCall;
769
+ currentUser(request: wechaty_puppet_base_pb.CurrentUserRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_base_pb.CurrentUserResponse) => void): grpc.ClientUnaryCall;
770
+ currentUser(request: wechaty_puppet_base_pb.CurrentUserRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_base_pb.CurrentUserResponse) => void): grpc.ClientUnaryCall;
746
771
  version(request: wechaty_puppet_base_pb.VersionRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_base_pb.VersionResponse) => void): grpc.ClientUnaryCall;
747
772
  version(request: wechaty_puppet_base_pb.VersionRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_base_pb.VersionResponse) => void): grpc.ClientUnaryCall;
748
773
  version(request: wechaty_puppet_base_pb.VersionRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_base_pb.VersionResponse) => void): grpc.ClientUnaryCall;
@@ -850,6 +875,9 @@ export interface IPuppetClient {
850
875
  messageSendChannel(request: wechaty_puppet_message_pb.MessageSendChannelRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageSendChannelResponse) => void): grpc.ClientUnaryCall;
851
876
  messageSendChannel(request: wechaty_puppet_message_pb.MessageSendChannelRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageSendChannelResponse) => void): grpc.ClientUnaryCall;
852
877
  messageSendChannel(request: wechaty_puppet_message_pb.MessageSendChannelRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageSendChannelResponse) => void): grpc.ClientUnaryCall;
878
+ messagePreview(request: wechaty_puppet_message_pb.MessagePreviewRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessagePreviewResponse) => void): grpc.ClientUnaryCall;
879
+ messagePreview(request: wechaty_puppet_message_pb.MessagePreviewRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessagePreviewResponse) => void): grpc.ClientUnaryCall;
880
+ messagePreview(request: wechaty_puppet_message_pb.MessagePreviewRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessagePreviewResponse) => void): grpc.ClientUnaryCall;
853
881
  roomPayload(request: wechaty_puppet_room_pb.RoomPayloadRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_room_pb.RoomPayloadResponse) => void): grpc.ClientUnaryCall;
854
882
  roomPayload(request: wechaty_puppet_room_pb.RoomPayloadRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_room_pb.RoomPayloadResponse) => void): grpc.ClientUnaryCall;
855
883
  roomPayload(request: wechaty_puppet_room_pb.RoomPayloadRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_room_pb.RoomPayloadResponse) => void): grpc.ClientUnaryCall;
@@ -934,6 +962,9 @@ export class PuppetClient extends grpc.Client implements IPuppetClient {
934
962
  public ding(request: wechaty_puppet_base_pb.DingRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_base_pb.DingResponse) => void): grpc.ClientUnaryCall;
935
963
  public ding(request: wechaty_puppet_base_pb.DingRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_base_pb.DingResponse) => void): grpc.ClientUnaryCall;
936
964
  public ding(request: wechaty_puppet_base_pb.DingRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_base_pb.DingResponse) => void): grpc.ClientUnaryCall;
965
+ public currentUser(request: wechaty_puppet_base_pb.CurrentUserRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_base_pb.CurrentUserResponse) => void): grpc.ClientUnaryCall;
966
+ public currentUser(request: wechaty_puppet_base_pb.CurrentUserRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_base_pb.CurrentUserResponse) => void): grpc.ClientUnaryCall;
967
+ public currentUser(request: wechaty_puppet_base_pb.CurrentUserRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_base_pb.CurrentUserResponse) => void): grpc.ClientUnaryCall;
937
968
  public version(request: wechaty_puppet_base_pb.VersionRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_base_pb.VersionResponse) => void): grpc.ClientUnaryCall;
938
969
  public version(request: wechaty_puppet_base_pb.VersionRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_base_pb.VersionResponse) => void): grpc.ClientUnaryCall;
939
970
  public version(request: wechaty_puppet_base_pb.VersionRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_base_pb.VersionResponse) => void): grpc.ClientUnaryCall;
@@ -1041,6 +1072,9 @@ export class PuppetClient extends grpc.Client implements IPuppetClient {
1041
1072
  public messageSendChannel(request: wechaty_puppet_message_pb.MessageSendChannelRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageSendChannelResponse) => void): grpc.ClientUnaryCall;
1042
1073
  public messageSendChannel(request: wechaty_puppet_message_pb.MessageSendChannelRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageSendChannelResponse) => void): grpc.ClientUnaryCall;
1043
1074
  public messageSendChannel(request: wechaty_puppet_message_pb.MessageSendChannelRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageSendChannelResponse) => void): grpc.ClientUnaryCall;
1075
+ public messagePreview(request: wechaty_puppet_message_pb.MessagePreviewRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessagePreviewResponse) => void): grpc.ClientUnaryCall;
1076
+ public messagePreview(request: wechaty_puppet_message_pb.MessagePreviewRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessagePreviewResponse) => void): grpc.ClientUnaryCall;
1077
+ public messagePreview(request: wechaty_puppet_message_pb.MessagePreviewRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessagePreviewResponse) => void): grpc.ClientUnaryCall;
1044
1078
  public roomPayload(request: wechaty_puppet_room_pb.RoomPayloadRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_room_pb.RoomPayloadResponse) => void): grpc.ClientUnaryCall;
1045
1079
  public roomPayload(request: wechaty_puppet_room_pb.RoomPayloadRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_room_pb.RoomPayloadResponse) => void): grpc.ClientUnaryCall;
1046
1080
  public roomPayload(request: wechaty_puppet_room_pb.RoomPayloadRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_room_pb.RoomPayloadResponse) => void): grpc.ClientUnaryCall;
@@ -249,6 +249,28 @@ function deserialize_wechaty_puppet_ContactSelfSignatureResponse(buffer_arg) {
249
249
  return wechaty_puppet_contact_pb.ContactSelfSignatureResponse.deserializeBinary(new Uint8Array(buffer_arg));
250
250
  }
251
251
 
252
+ function serialize_wechaty_puppet_CurrentUserRequest(arg) {
253
+ if (!(arg instanceof wechaty_puppet_base_pb.CurrentUserRequest)) {
254
+ throw new Error('Expected argument of type wechaty.puppet.CurrentUserRequest');
255
+ }
256
+ return Buffer.from(arg.serializeBinary());
257
+ }
258
+
259
+ function deserialize_wechaty_puppet_CurrentUserRequest(buffer_arg) {
260
+ return wechaty_puppet_base_pb.CurrentUserRequest.deserializeBinary(new Uint8Array(buffer_arg));
261
+ }
262
+
263
+ function serialize_wechaty_puppet_CurrentUserResponse(arg) {
264
+ if (!(arg instanceof wechaty_puppet_base_pb.CurrentUserResponse)) {
265
+ throw new Error('Expected argument of type wechaty.puppet.CurrentUserResponse');
266
+ }
267
+ return Buffer.from(arg.serializeBinary());
268
+ }
269
+
270
+ function deserialize_wechaty_puppet_CurrentUserResponse(buffer_arg) {
271
+ return wechaty_puppet_base_pb.CurrentUserResponse.deserializeBinary(new Uint8Array(buffer_arg));
272
+ }
273
+
252
274
  function serialize_wechaty_puppet_DingRequest(arg) {
253
275
  if (!(arg instanceof wechaty_puppet_base_pb.DingRequest)) {
254
276
  throw new Error('Expected argument of type wechaty.puppet.DingRequest');
@@ -689,6 +711,28 @@ function deserialize_wechaty_puppet_MessagePayloadResponse(buffer_arg) {
689
711
  return wechaty_puppet_message_pb.MessagePayloadResponse.deserializeBinary(new Uint8Array(buffer_arg));
690
712
  }
691
713
 
714
+ function serialize_wechaty_puppet_MessagePreviewRequest(arg) {
715
+ if (!(arg instanceof wechaty_puppet_message_pb.MessagePreviewRequest)) {
716
+ throw new Error('Expected argument of type wechaty.puppet.MessagePreviewRequest');
717
+ }
718
+ return Buffer.from(arg.serializeBinary());
719
+ }
720
+
721
+ function deserialize_wechaty_puppet_MessagePreviewRequest(buffer_arg) {
722
+ return wechaty_puppet_message_pb.MessagePreviewRequest.deserializeBinary(new Uint8Array(buffer_arg));
723
+ }
724
+
725
+ function serialize_wechaty_puppet_MessagePreviewResponse(arg) {
726
+ if (!(arg instanceof wechaty_puppet_message_pb.MessagePreviewResponse)) {
727
+ throw new Error('Expected argument of type wechaty.puppet.MessagePreviewResponse');
728
+ }
729
+ return Buffer.from(arg.serializeBinary());
730
+ }
731
+
732
+ function deserialize_wechaty_puppet_MessagePreviewResponse(buffer_arg) {
733
+ return wechaty_puppet_message_pb.MessagePreviewResponse.deserializeBinary(new Uint8Array(buffer_arg));
734
+ }
735
+
692
736
  function serialize_wechaty_puppet_MessageRecallRequest(arg) {
693
737
  if (!(arg instanceof wechaty_puppet_message_pb.MessageRecallRequest)) {
694
738
  throw new Error('Expected argument of type wechaty.puppet.MessageRecallRequest');
@@ -1478,6 +1522,17 @@ start: {
1478
1522
  responseSerialize: serialize_wechaty_puppet_DingResponse,
1479
1523
  responseDeserialize: deserialize_wechaty_puppet_DingResponse,
1480
1524
  },
1525
+ currentUser: {
1526
+ path: '/wechaty.Puppet/CurrentUser',
1527
+ requestStream: false,
1528
+ responseStream: false,
1529
+ requestType: wechaty_puppet_base_pb.CurrentUserRequest,
1530
+ responseType: wechaty_puppet_base_pb.CurrentUserResponse,
1531
+ requestSerialize: serialize_wechaty_puppet_CurrentUserRequest,
1532
+ requestDeserialize: deserialize_wechaty_puppet_CurrentUserRequest,
1533
+ responseSerialize: serialize_wechaty_puppet_CurrentUserResponse,
1534
+ responseDeserialize: deserialize_wechaty_puppet_CurrentUserResponse,
1535
+ },
1481
1536
  version: {
1482
1537
  path: '/wechaty.Puppet/Version',
1483
1538
  requestStream: false,
@@ -1900,6 +1955,17 @@ messageFile: {
1900
1955
  responseSerialize: serialize_wechaty_puppet_MessageSendChannelResponse,
1901
1956
  responseDeserialize: deserialize_wechaty_puppet_MessageSendChannelResponse,
1902
1957
  },
1958
+ messagePreview: {
1959
+ path: '/wechaty.Puppet/MessagePreview',
1960
+ requestStream: false,
1961
+ responseStream: false,
1962
+ requestType: wechaty_puppet_message_pb.MessagePreviewRequest,
1963
+ responseType: wechaty_puppet_message_pb.MessagePreviewResponse,
1964
+ requestSerialize: serialize_wechaty_puppet_MessagePreviewRequest,
1965
+ requestDeserialize: deserialize_wechaty_puppet_MessagePreviewRequest,
1966
+ responseSerialize: serialize_wechaty_puppet_MessagePreviewResponse,
1967
+ responseDeserialize: deserialize_wechaty_puppet_MessagePreviewResponse,
1968
+ },
1903
1969
  // *
1904
1970
  //
1905
1971
  // Room
@@ -78,6 +78,15 @@ type PuppetDing = {
78
78
  readonly responseType: typeof wechaty_puppet_base_pb.DingResponse;
79
79
  };
80
80
 
81
+ type PuppetCurrentUser = {
82
+ readonly methodName: string;
83
+ readonly service: typeof Puppet;
84
+ readonly requestStream: false;
85
+ readonly responseStream: false;
86
+ readonly requestType: typeof wechaty_puppet_base_pb.CurrentUserRequest;
87
+ readonly responseType: typeof wechaty_puppet_base_pb.CurrentUserResponse;
88
+ };
89
+
81
90
  type PuppetVersion = {
82
91
  readonly methodName: string;
83
92
  readonly service: typeof Puppet;
@@ -402,6 +411,15 @@ type PuppetMessageSendChannel = {
402
411
  readonly responseType: typeof wechaty_puppet_message_pb.MessageSendChannelResponse;
403
412
  };
404
413
 
414
+ type PuppetMessagePreview = {
415
+ readonly methodName: string;
416
+ readonly service: typeof Puppet;
417
+ readonly requestStream: false;
418
+ readonly responseStream: false;
419
+ readonly requestType: typeof wechaty_puppet_message_pb.MessagePreviewRequest;
420
+ readonly responseType: typeof wechaty_puppet_message_pb.MessagePreviewResponse;
421
+ };
422
+
405
423
  type PuppetRoomPayload = {
406
424
  readonly methodName: string;
407
425
  readonly service: typeof Puppet;
@@ -591,6 +609,7 @@ export class Puppet {
591
609
  static readonly Stop: PuppetStop;
592
610
  static readonly Logout: PuppetLogout;
593
611
  static readonly Ding: PuppetDing;
612
+ static readonly CurrentUser: PuppetCurrentUser;
594
613
  static readonly Version: PuppetVersion;
595
614
  static readonly Event: PuppetEvent;
596
615
  static readonly DirtyPayload: PuppetDirtyPayload;
@@ -627,6 +646,7 @@ export class Puppet {
627
646
  static readonly MessageSendUrl: PuppetMessageSendUrl;
628
647
  static readonly MessageSendLocation: PuppetMessageSendLocation;
629
648
  static readonly MessageSendChannel: PuppetMessageSendChannel;
649
+ static readonly MessagePreview: PuppetMessagePreview;
630
650
  static readonly RoomPayload: PuppetRoomPayload;
631
651
  static readonly RoomList: PuppetRoomList;
632
652
  static readonly RoomAdd: PuppetRoomAdd;
@@ -720,6 +740,15 @@ export class PuppetClient {
720
740
  requestMessage: wechaty_puppet_base_pb.DingRequest,
721
741
  callback: (error: ServiceError|null, responseMessage: wechaty_puppet_base_pb.DingResponse|null) => void
722
742
  ): UnaryResponse;
743
+ currentUser(
744
+ requestMessage: wechaty_puppet_base_pb.CurrentUserRequest,
745
+ metadata: grpc.Metadata,
746
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_base_pb.CurrentUserResponse|null) => void
747
+ ): UnaryResponse;
748
+ currentUser(
749
+ requestMessage: wechaty_puppet_base_pb.CurrentUserRequest,
750
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_base_pb.CurrentUserResponse|null) => void
751
+ ): UnaryResponse;
723
752
  version(
724
753
  requestMessage: wechaty_puppet_base_pb.VersionRequest,
725
754
  metadata: grpc.Metadata,
@@ -1036,6 +1065,15 @@ export class PuppetClient {
1036
1065
  requestMessage: wechaty_puppet_message_pb.MessageSendChannelRequest,
1037
1066
  callback: (error: ServiceError|null, responseMessage: wechaty_puppet_message_pb.MessageSendChannelResponse|null) => void
1038
1067
  ): UnaryResponse;
1068
+ messagePreview(
1069
+ requestMessage: wechaty_puppet_message_pb.MessagePreviewRequest,
1070
+ metadata: grpc.Metadata,
1071
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_message_pb.MessagePreviewResponse|null) => void
1072
+ ): UnaryResponse;
1073
+ messagePreview(
1074
+ requestMessage: wechaty_puppet_message_pb.MessagePreviewRequest,
1075
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_message_pb.MessagePreviewResponse|null) => void
1076
+ ): UnaryResponse;
1039
1077
  roomPayload(
1040
1078
  requestMessage: wechaty_puppet_room_pb.RoomPayloadRequest,
1041
1079
  metadata: grpc.Metadata,
@@ -84,6 +84,15 @@ Puppet.Ding = {
84
84
  responseType: wechaty_puppet_base_pb.DingResponse
85
85
  };
86
86
 
87
+ Puppet.CurrentUser = {
88
+ methodName: "CurrentUser",
89
+ service: Puppet,
90
+ requestStream: false,
91
+ responseStream: false,
92
+ requestType: wechaty_puppet_base_pb.CurrentUserRequest,
93
+ responseType: wechaty_puppet_base_pb.CurrentUserResponse
94
+ };
95
+
87
96
  Puppet.Version = {
88
97
  methodName: "Version",
89
98
  service: Puppet,
@@ -408,6 +417,15 @@ Puppet.MessageSendChannel = {
408
417
  responseType: wechaty_puppet_message_pb.MessageSendChannelResponse
409
418
  };
410
419
 
420
+ Puppet.MessagePreview = {
421
+ methodName: "MessagePreview",
422
+ service: Puppet,
423
+ requestStream: false,
424
+ responseStream: false,
425
+ requestType: wechaty_puppet_message_pb.MessagePreviewRequest,
426
+ responseType: wechaty_puppet_message_pb.MessagePreviewResponse
427
+ };
428
+
411
429
  Puppet.RoomPayload = {
412
430
  methodName: "RoomPayload",
413
431
  service: Puppet,
@@ -838,6 +856,37 @@ PuppetClient.prototype.ding = function ding(requestMessage, metadata, callback)
838
856
  };
839
857
  };
840
858
 
859
+ PuppetClient.prototype.currentUser = function currentUser(requestMessage, metadata, callback) {
860
+ if (arguments.length === 2) {
861
+ callback = arguments[1];
862
+ }
863
+ var client = grpc.unary(Puppet.CurrentUser, {
864
+ request: requestMessage,
865
+ host: this.serviceHost,
866
+ metadata: metadata,
867
+ transport: this.options.transport,
868
+ debug: this.options.debug,
869
+ onEnd: function (response) {
870
+ if (callback) {
871
+ if (response.status !== grpc.Code.OK) {
872
+ var err = new Error(response.statusMessage);
873
+ err.code = response.status;
874
+ err.metadata = response.trailers;
875
+ callback(err, null);
876
+ } else {
877
+ callback(null, response.message);
878
+ }
879
+ }
880
+ }
881
+ });
882
+ return {
883
+ cancel: function () {
884
+ callback = null;
885
+ client.close();
886
+ }
887
+ };
888
+ };
889
+
841
890
  PuppetClient.prototype.version = function version(requestMessage, metadata, callback) {
842
891
  if (arguments.length === 2) {
843
892
  callback = arguments[1];
@@ -1962,6 +2011,37 @@ PuppetClient.prototype.messageSendChannel = function messageSendChannel(requestM
1962
2011
  };
1963
2012
  };
1964
2013
 
2014
+ PuppetClient.prototype.messagePreview = function messagePreview(requestMessage, metadata, callback) {
2015
+ if (arguments.length === 2) {
2016
+ callback = arguments[1];
2017
+ }
2018
+ var client = grpc.unary(Puppet.MessagePreview, {
2019
+ request: requestMessage,
2020
+ host: this.serviceHost,
2021
+ metadata: metadata,
2022
+ transport: this.options.transport,
2023
+ debug: this.options.debug,
2024
+ onEnd: function (response) {
2025
+ if (callback) {
2026
+ if (response.status !== grpc.Code.OK) {
2027
+ var err = new Error(response.statusMessage);
2028
+ err.code = response.status;
2029
+ err.metadata = response.trailers;
2030
+ callback(err, null);
2031
+ } else {
2032
+ callback(null, response.message);
2033
+ }
2034
+ }
2035
+ }
2036
+ });
2037
+ return {
2038
+ cancel: function () {
2039
+ callback = null;
2040
+ client.close();
2041
+ }
2042
+ };
2043
+ };
2044
+
1965
2045
  PuppetClient.prototype.roomPayload = function roomPayload(requestMessage, metadata, callback) {
1966
2046
  if (arguments.length === 2) {
1967
2047
  callback = arguments[1];
@@ -44,3 +44,10 @@ message DirtyPayloadRequest {
44
44
  }
45
45
 
46
46
  message DirtyPayloadResponse {}
47
+
48
+ message CurrentUserRequest {
49
+ }
50
+
51
+ message CurrentUserResponse {
52
+ string user_id = 1;
53
+ }
@@ -29,18 +29,18 @@ message ContactPayloadRequest {
29
29
  string id = 1;
30
30
  }
31
31
  message ContactPayloadResponse {
32
- string id = 1;
33
- ContactGender gender = 2;
34
- ContactType type = 3;
35
- string name = 4;
36
- string avatar = 5;
37
- string address = 6;
38
- string alias = 7;
39
- string city = 8;
40
- bool friend = 9;
41
- string province = 10;
42
- string signature = 11;
43
- bool star = 12;
32
+ string id = 1;
33
+ ContactGender gender = 2;
34
+ ContactType type = 3;
35
+ string name = 4;
36
+ string avatar = 5;
37
+ string address = 6;
38
+ string alias = 7;
39
+ string city = 8;
40
+ bool friend = 9;
41
+ string province = 10;
42
+ string signature = 11;
43
+ bool star = 12;
44
44
  /**
45
45
  * Huan(202203): in gRPC, we can freely rename the field name as long as the number keep consistent.
46
46
  * so we can just rename `weixin` to `handle` here.
@@ -52,12 +52,13 @@ message ContactPayloadResponse {
52
52
  *
53
53
  * TODO: rename `weixin` to `handle` in v2.0.0
54
54
  */
55
- string weixin = 13;
56
- string corporation = 14;
57
- string title = 15;
58
- string description = 16;
59
- bool coworker = 17;
60
- repeated string phones = 18;
55
+ string weixin = 13;
56
+ string corporation = 14;
57
+ string title = 15;
58
+ string description = 16;
59
+ bool coworker = 17;
60
+ repeated string phones = 18;
61
+ string additional_info = 19;
61
62
  }
62
63
 
63
64
  message ContactSelfQRCodeRequest {}
@@ -249,3 +249,10 @@ message MessageSendChannelResponse {
249
249
  string id = 1;
250
250
  }
251
251
 
252
+ message MessagePreviewRequest {
253
+ string id = 1;
254
+ }
255
+
256
+ message MessagePreviewResponse {
257
+ string file_box = 1;
258
+ }
@@ -10,11 +10,12 @@ message RoomMemberPayloadRequest {
10
10
  string member_id = 2;
11
11
  }
12
12
  message RoomMemberPayloadResponse {
13
- string id = 1;
14
- string room_alias = 2;
15
- string inviter_id = 3;
16
- string avatar = 4;
17
- string name = 5;
13
+ string id = 1;
14
+ string room_alias = 2;
15
+ string inviter_id = 3;
16
+ string avatar = 4;
17
+ string name = 5;
18
+ string additional_info = 6;
18
19
  }
19
20
 
20
21
  message RoomMemberListRequest {
@@ -16,13 +16,14 @@ message RoomPayloadRequest {
16
16
  string id = 1;
17
17
  }
18
18
  message RoomPayloadResponse {
19
- string id = 1;
20
- string topic = 2;
21
- string avatar = 3;
22
- string owner_id = 4;
19
+ string id = 1;
20
+ string topic = 2;
21
+ string avatar = 3;
22
+ string owner_id = 4;
23
23
  repeated string admin_ids = 5;
24
24
  repeated string member_ids = 6;
25
- string handle = 7;
25
+ string handle = 7;
26
+ string additional_info = 8;
26
27
  }
27
28
 
28
29
  message RoomAddRequest {
@@ -100,6 +100,11 @@ service Puppet {
100
100
  body: "*"
101
101
  };
102
102
  }
103
+ rpc CurrentUser (puppet.CurrentUserRequest) returns (puppet.CurrentUserResponse) {
104
+ option (google.api.http) = {
105
+ get: "/currentUser"
106
+ };
107
+ }
103
108
  rpc Version (puppet.VersionRequest) returns (puppet.VersionResponse) {
104
109
  option (google.api.http) = {
105
110
  get: "/version"
@@ -371,6 +376,13 @@ service Puppet {
371
376
  };
372
377
  }
373
378
 
379
+ rpc MessagePreview (puppet.MessagePreviewRequest) returns (puppet.MessagePreviewResponse) {
380
+ option (google.api.http) = {
381
+ get: "/message/{id}/preview"
382
+ };
383
+ }
384
+
385
+
374
386
  /**
375
387
  *
376
388
  * Room
@@ -1,6 +1,6 @@
1
1
  export const packageJson = {
2
2
  "name": "@juzi/wechaty-grpc",
3
- "version": "1.0.4",
3
+ "version": "1.0.7",
4
4
  "description": "gRPC for Wechaty",
5
5
  "type": "module",
6
6
  "exports": {