@juzi/wechaty-grpc 1.0.2 → 1.0.5

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 (38) hide show
  1. package/dist/cjs/out/wechaty/puppet/message_pb.d.ts +57 -8
  2. package/dist/cjs/out/wechaty/puppet/message_pb.js +364 -9
  3. package/dist/cjs/out/wechaty/puppet.openapi.yaml +33 -4
  4. package/dist/cjs/out/wechaty/puppet.swagger.json +49 -5
  5. package/dist/cjs/out/wechaty/puppet_grpc_pb.d.ts +17 -0
  6. package/dist/cjs/out/wechaty/puppet_grpc_pb.js +33 -0
  7. package/dist/cjs/out/wechaty/puppet_pb_service.d.ts +19 -0
  8. package/dist/cjs/out/wechaty/puppet_pb_service.js +40 -0
  9. package/dist/cjs/proto/wechaty/puppet/message.proto +19 -8
  10. package/dist/cjs/proto/wechaty/puppet.proto +7 -0
  11. package/dist/cjs/src/package-json.js +1 -1
  12. package/dist/cjs/tests/puppet-server-impl.d.ts.map +1 -1
  13. package/dist/cjs/tests/puppet-server-impl.js +5 -0
  14. package/dist/cjs/tests/puppet-server-impl.js.map +1 -1
  15. package/dist/esm/out/wechaty/puppet/message_pb.d.ts +57 -8
  16. package/dist/esm/out/wechaty/puppet/message_pb.js +364 -9
  17. package/dist/esm/out/wechaty/puppet.openapi.yaml +33 -4
  18. package/dist/esm/out/wechaty/puppet.swagger.json +49 -5
  19. package/dist/esm/out/wechaty/puppet_grpc_pb.d.ts +17 -0
  20. package/dist/esm/out/wechaty/puppet_grpc_pb.js +33 -0
  21. package/dist/esm/out/wechaty/puppet_pb_service.d.ts +19 -0
  22. package/dist/esm/out/wechaty/puppet_pb_service.js +40 -0
  23. package/dist/esm/proto/wechaty/puppet/message.proto +19 -8
  24. package/dist/esm/proto/wechaty/puppet.proto +7 -0
  25. package/dist/esm/src/package-json.js +1 -1
  26. package/dist/esm/tests/puppet-server-impl.d.ts.map +1 -1
  27. package/dist/esm/tests/puppet-server-impl.js +5 -0
  28. package/dist/esm/tests/puppet-server-impl.js.map +1 -1
  29. package/out/wechaty/puppet/message_pb.d.ts +57 -8
  30. package/out/wechaty/puppet/message_pb.js +364 -9
  31. package/out/wechaty/puppet.openapi.yaml +33 -4
  32. package/out/wechaty/puppet.swagger.json +49 -5
  33. package/out/wechaty/puppet_grpc_pb.d.ts +17 -0
  34. package/out/wechaty/puppet_grpc_pb.js +33 -0
  35. package/out/wechaty/puppet_pb_service.d.ts +19 -0
  36. package/out/wechaty/puppet_pb_service.js +40 -0
  37. package/package.json +1 -1
  38. package/src/package-json.ts +1 -1
@@ -402,6 +402,15 @@ type PuppetMessageSendChannel = {
402
402
  readonly responseType: typeof wechaty_puppet_message_pb.MessageSendChannelResponse;
403
403
  };
404
404
 
405
+ type PuppetMessagePreview = {
406
+ readonly methodName: string;
407
+ readonly service: typeof Puppet;
408
+ readonly requestStream: false;
409
+ readonly responseStream: false;
410
+ readonly requestType: typeof wechaty_puppet_message_pb.MessagePreviewRequest;
411
+ readonly responseType: typeof wechaty_puppet_message_pb.MessagePreviewResponse;
412
+ };
413
+
405
414
  type PuppetRoomPayload = {
406
415
  readonly methodName: string;
407
416
  readonly service: typeof Puppet;
@@ -627,6 +636,7 @@ export class Puppet {
627
636
  static readonly MessageSendUrl: PuppetMessageSendUrl;
628
637
  static readonly MessageSendLocation: PuppetMessageSendLocation;
629
638
  static readonly MessageSendChannel: PuppetMessageSendChannel;
639
+ static readonly MessagePreview: PuppetMessagePreview;
630
640
  static readonly RoomPayload: PuppetRoomPayload;
631
641
  static readonly RoomList: PuppetRoomList;
632
642
  static readonly RoomAdd: PuppetRoomAdd;
@@ -1036,6 +1046,15 @@ export class PuppetClient {
1036
1046
  requestMessage: wechaty_puppet_message_pb.MessageSendChannelRequest,
1037
1047
  callback: (error: ServiceError|null, responseMessage: wechaty_puppet_message_pb.MessageSendChannelResponse|null) => void
1038
1048
  ): UnaryResponse;
1049
+ messagePreview(
1050
+ requestMessage: wechaty_puppet_message_pb.MessagePreviewRequest,
1051
+ metadata: grpc.Metadata,
1052
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_message_pb.MessagePreviewResponse|null) => void
1053
+ ): UnaryResponse;
1054
+ messagePreview(
1055
+ requestMessage: wechaty_puppet_message_pb.MessagePreviewRequest,
1056
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_message_pb.MessagePreviewResponse|null) => void
1057
+ ): UnaryResponse;
1039
1058
  roomPayload(
1040
1059
  requestMessage: wechaty_puppet_room_pb.RoomPayloadRequest,
1041
1060
  metadata: grpc.Metadata,
@@ -408,6 +408,15 @@ Puppet.MessageSendChannel = {
408
408
  responseType: wechaty_puppet_message_pb.MessageSendChannelResponse
409
409
  };
410
410
 
411
+ Puppet.MessagePreview = {
412
+ methodName: "MessagePreview",
413
+ service: Puppet,
414
+ requestStream: false,
415
+ responseStream: false,
416
+ requestType: wechaty_puppet_message_pb.MessagePreviewRequest,
417
+ responseType: wechaty_puppet_message_pb.MessagePreviewResponse
418
+ };
419
+
411
420
  Puppet.RoomPayload = {
412
421
  methodName: "RoomPayload",
413
422
  service: Puppet,
@@ -1962,6 +1971,37 @@ PuppetClient.prototype.messageSendChannel = function messageSendChannel(requestM
1962
1971
  };
1963
1972
  };
1964
1973
 
1974
+ PuppetClient.prototype.messagePreview = function messagePreview(requestMessage, metadata, callback) {
1975
+ if (arguments.length === 2) {
1976
+ callback = arguments[1];
1977
+ }
1978
+ var client = grpc.unary(Puppet.MessagePreview, {
1979
+ request: requestMessage,
1980
+ host: this.serviceHost,
1981
+ metadata: metadata,
1982
+ transport: this.options.transport,
1983
+ debug: this.options.debug,
1984
+ onEnd: function (response) {
1985
+ if (callback) {
1986
+ if (response.status !== grpc.Code.OK) {
1987
+ var err = new Error(response.statusMessage);
1988
+ err.code = response.status;
1989
+ err.metadata = response.trailers;
1990
+ callback(err, null);
1991
+ } else {
1992
+ callback(null, response.message);
1993
+ }
1994
+ }
1995
+ }
1996
+ });
1997
+ return {
1998
+ cancel: function () {
1999
+ callback = null;
2000
+ client.close();
2001
+ }
2002
+ };
2003
+ };
2004
+
1965
2005
  PuppetClient.prototype.roomPayload = function roomPayload(requestMessage, metadata, callback) {
1966
2006
  if (arguments.length === 2) {
1967
2007
  callback = arguments[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juzi/wechaty-grpc",
3
- "version": "1.0.2",
3
+ "version": "1.0.5",
4
4
  "description": "gRPC for Wechaty",
5
5
  "type": "module",
6
6
  "exports": {
@@ -4,7 +4,7 @@
4
4
  import type { PackageJson } from 'type-fest'
5
5
  export const packageJson: PackageJson = {
6
6
  "name": "@juzi/wechaty-grpc",
7
- "version": "1.0.2",
7
+ "version": "1.0.5",
8
8
  "description": "gRPC for Wechaty",
9
9
  "type": "module",
10
10
  "exports": {