@juzi/wechaty-grpc 1.0.101 → 1.0.103

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 (68) hide show
  1. package/dist/cjs/out/wechaty/puppet/base_pb.d.ts +3 -0
  2. package/dist/cjs/out/wechaty/puppet/base_pb.js +4 -1
  3. package/dist/cjs/out/wechaty/puppet/call_pb.d.ts +361 -0
  4. package/dist/cjs/out/wechaty/puppet/call_pb.js +2869 -79
  5. package/dist/cjs/out/wechaty/puppet/channel_pb.d.ts +70 -0
  6. package/dist/cjs/out/wechaty/puppet/channel_pb.js +544 -2
  7. package/dist/cjs/out/wechaty/puppet/event_pb.d.ts +1 -0
  8. package/dist/cjs/out/wechaty/puppet/event_pb.js +2 -1
  9. package/dist/cjs/out/wechaty/puppet.openapi.yaml +376 -2
  10. package/dist/cjs/out/wechaty/puppet.swagger.json +537 -10
  11. package/dist/cjs/out/wechaty/puppet_grpc_pb.d.ts +137 -0
  12. package/dist/cjs/out/wechaty/puppet_grpc_pb.js +266 -0
  13. package/dist/cjs/out/wechaty/puppet_pb.d.ts +1 -0
  14. package/dist/cjs/out/wechaty/puppet_pb.js +2 -0
  15. package/dist/cjs/out/wechaty/puppet_pb_service.d.ts +153 -0
  16. package/dist/cjs/out/wechaty/puppet_pb_service.js +321 -0
  17. package/dist/cjs/proto/wechaty/puppet/base.proto +4 -0
  18. package/dist/cjs/proto/wechaty/puppet/call.proto +101 -1
  19. package/dist/cjs/proto/wechaty/puppet/channel.proto +19 -0
  20. package/dist/cjs/proto/wechaty/puppet/event.proto +1 -0
  21. package/dist/cjs/proto/wechaty/puppet.proto +49 -0
  22. package/dist/cjs/src/package-json.js +1 -1
  23. package/dist/cjs/tests/puppet-server-impl.d.ts.map +1 -1
  24. package/dist/cjs/tests/puppet-server-impl.js +40 -0
  25. package/dist/cjs/tests/puppet-server-impl.js.map +1 -1
  26. package/dist/esm/out/wechaty/puppet/base_pb.d.ts +3 -0
  27. package/dist/esm/out/wechaty/puppet/base_pb.js +4 -1
  28. package/dist/esm/out/wechaty/puppet/call_pb.d.ts +361 -0
  29. package/dist/esm/out/wechaty/puppet/call_pb.js +2869 -79
  30. package/dist/esm/out/wechaty/puppet/channel_pb.d.ts +70 -0
  31. package/dist/esm/out/wechaty/puppet/channel_pb.js +544 -2
  32. package/dist/esm/out/wechaty/puppet/event_pb.d.ts +1 -0
  33. package/dist/esm/out/wechaty/puppet/event_pb.js +2 -1
  34. package/dist/esm/out/wechaty/puppet.openapi.yaml +376 -2
  35. package/dist/esm/out/wechaty/puppet.swagger.json +537 -10
  36. package/dist/esm/out/wechaty/puppet_grpc_pb.d.ts +137 -0
  37. package/dist/esm/out/wechaty/puppet_grpc_pb.js +266 -0
  38. package/dist/esm/out/wechaty/puppet_pb.d.ts +1 -0
  39. package/dist/esm/out/wechaty/puppet_pb.js +2 -0
  40. package/dist/esm/out/wechaty/puppet_pb_service.d.ts +153 -0
  41. package/dist/esm/out/wechaty/puppet_pb_service.js +321 -0
  42. package/dist/esm/proto/wechaty/puppet/base.proto +4 -0
  43. package/dist/esm/proto/wechaty/puppet/call.proto +101 -1
  44. package/dist/esm/proto/wechaty/puppet/channel.proto +19 -0
  45. package/dist/esm/proto/wechaty/puppet/event.proto +1 -0
  46. package/dist/esm/proto/wechaty/puppet.proto +49 -0
  47. package/dist/esm/src/package-json.js +1 -1
  48. package/dist/esm/tests/puppet-server-impl.d.ts.map +1 -1
  49. package/dist/esm/tests/puppet-server-impl.js +40 -0
  50. package/dist/esm/tests/puppet-server-impl.js.map +1 -1
  51. package/out/wechaty/puppet/base_pb.d.ts +3 -0
  52. package/out/wechaty/puppet/base_pb.js +4 -1
  53. package/out/wechaty/puppet/call_pb.d.ts +361 -0
  54. package/out/wechaty/puppet/call_pb.js +2869 -79
  55. package/out/wechaty/puppet/channel_pb.d.ts +70 -0
  56. package/out/wechaty/puppet/channel_pb.js +544 -2
  57. package/out/wechaty/puppet/event_pb.d.ts +1 -0
  58. package/out/wechaty/puppet/event_pb.js +2 -1
  59. package/out/wechaty/puppet.openapi.yaml +376 -2
  60. package/out/wechaty/puppet.swagger.json +537 -10
  61. package/out/wechaty/puppet_grpc_pb.d.ts +137 -0
  62. package/out/wechaty/puppet_grpc_pb.js +266 -0
  63. package/out/wechaty/puppet_pb.d.ts +1 -0
  64. package/out/wechaty/puppet_pb.js +2 -0
  65. package/out/wechaty/puppet_pb_service.d.ts +153 -0
  66. package/out/wechaty/puppet_pb_service.js +321 -0
  67. package/package.json +1 -1
  68. package/src/package-json.ts +1 -1
@@ -3,6 +3,7 @@
3
3
 
4
4
  import * as wechaty_puppet_pb from "../wechaty/puppet_pb";
5
5
  import * as wechaty_puppet_base_pb from "../wechaty/puppet/base_pb";
6
+ import * as wechaty_puppet_call_pb from "../wechaty/puppet/call_pb";
6
7
  import * as wechaty_puppet_contact_pb from "../wechaty/puppet/contact_pb";
7
8
  import * as wechaty_puppet_download_upload_pb from "../wechaty/puppet/download-upload_pb";
8
9
  import * as wechaty_puppet_event_pb from "../wechaty/puppet/event_pb";
@@ -415,6 +416,78 @@ type PuppetMessageCallRecord = {
415
416
  readonly responseType: typeof wechaty_puppet_message_pb.MessageCallRecordResponse;
416
417
  };
417
418
 
419
+ type PuppetCallInvite = {
420
+ readonly methodName: string;
421
+ readonly service: typeof Puppet;
422
+ readonly requestStream: false;
423
+ readonly responseStream: false;
424
+ readonly requestType: typeof wechaty_puppet_call_pb.CallInviteRequest;
425
+ readonly responseType: typeof wechaty_puppet_call_pb.CallInviteResponse;
426
+ };
427
+
428
+ type PuppetCallAdd = {
429
+ readonly methodName: string;
430
+ readonly service: typeof Puppet;
431
+ readonly requestStream: false;
432
+ readonly responseStream: false;
433
+ readonly requestType: typeof wechaty_puppet_call_pb.CallAddRequest;
434
+ readonly responseType: typeof wechaty_puppet_call_pb.CallAddResponse;
435
+ };
436
+
437
+ type PuppetCallAccept = {
438
+ readonly methodName: string;
439
+ readonly service: typeof Puppet;
440
+ readonly requestStream: false;
441
+ readonly responseStream: false;
442
+ readonly requestType: typeof wechaty_puppet_call_pb.CallAcceptRequest;
443
+ readonly responseType: typeof wechaty_puppet_call_pb.CallAcceptResponse;
444
+ };
445
+
446
+ type PuppetCallReject = {
447
+ readonly methodName: string;
448
+ readonly service: typeof Puppet;
449
+ readonly requestStream: false;
450
+ readonly responseStream: false;
451
+ readonly requestType: typeof wechaty_puppet_call_pb.CallRejectRequest;
452
+ readonly responseType: typeof wechaty_puppet_call_pb.CallRejectResponse;
453
+ };
454
+
455
+ type PuppetCallCancel = {
456
+ readonly methodName: string;
457
+ readonly service: typeof Puppet;
458
+ readonly requestStream: false;
459
+ readonly responseStream: false;
460
+ readonly requestType: typeof wechaty_puppet_call_pb.CallCancelRequest;
461
+ readonly responseType: typeof wechaty_puppet_call_pb.CallCancelResponse;
462
+ };
463
+
464
+ type PuppetCallHangup = {
465
+ readonly methodName: string;
466
+ readonly service: typeof Puppet;
467
+ readonly requestStream: false;
468
+ readonly responseStream: false;
469
+ readonly requestType: typeof wechaty_puppet_call_pb.CallHangupRequest;
470
+ readonly responseType: typeof wechaty_puppet_call_pb.CallHangupResponse;
471
+ };
472
+
473
+ type PuppetCallMediaEndpoint = {
474
+ readonly methodName: string;
475
+ readonly service: typeof Puppet;
476
+ readonly requestStream: false;
477
+ readonly responseStream: false;
478
+ readonly requestType: typeof wechaty_puppet_call_pb.CallMediaEndpointRequest;
479
+ readonly responseType: typeof wechaty_puppet_call_pb.CallMediaEndpointResponse;
480
+ };
481
+
482
+ type PuppetCallPayload = {
483
+ readonly methodName: string;
484
+ readonly service: typeof Puppet;
485
+ readonly requestStream: false;
486
+ readonly responseStream: false;
487
+ readonly requestType: typeof wechaty_puppet_call_pb.CallPayloadRequest;
488
+ readonly responseType: typeof wechaty_puppet_call_pb.CallPayloadResponse;
489
+ };
490
+
418
491
  type PuppetMessageChatHistory = {
419
492
  readonly methodName: string;
420
493
  readonly service: typeof Puppet;
@@ -1172,6 +1245,14 @@ export class Puppet {
1172
1245
  static readonly MessageChannel: PuppetMessageChannel;
1173
1246
  static readonly MessageChannelCard: PuppetMessageChannelCard;
1174
1247
  static readonly MessageCallRecord: PuppetMessageCallRecord;
1248
+ static readonly CallInvite: PuppetCallInvite;
1249
+ static readonly CallAdd: PuppetCallAdd;
1250
+ static readonly CallAccept: PuppetCallAccept;
1251
+ static readonly CallReject: PuppetCallReject;
1252
+ static readonly CallCancel: PuppetCallCancel;
1253
+ static readonly CallHangup: PuppetCallHangup;
1254
+ static readonly CallMediaEndpoint: PuppetCallMediaEndpoint;
1255
+ static readonly CallPayload: PuppetCallPayload;
1175
1256
  static readonly MessageChatHistory: PuppetMessageChatHistory;
1176
1257
  static readonly MessageRecall: PuppetMessageRecall;
1177
1258
  static readonly MessageForward: PuppetMessageForward;
@@ -1673,6 +1754,78 @@ export class PuppetClient {
1673
1754
  requestMessage: wechaty_puppet_message_pb.MessageCallRecordRequest,
1674
1755
  callback: (error: ServiceError|null, responseMessage: wechaty_puppet_message_pb.MessageCallRecordResponse|null) => void
1675
1756
  ): UnaryResponse;
1757
+ callInvite(
1758
+ requestMessage: wechaty_puppet_call_pb.CallInviteRequest,
1759
+ metadata: grpc.Metadata,
1760
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_call_pb.CallInviteResponse|null) => void
1761
+ ): UnaryResponse;
1762
+ callInvite(
1763
+ requestMessage: wechaty_puppet_call_pb.CallInviteRequest,
1764
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_call_pb.CallInviteResponse|null) => void
1765
+ ): UnaryResponse;
1766
+ callAdd(
1767
+ requestMessage: wechaty_puppet_call_pb.CallAddRequest,
1768
+ metadata: grpc.Metadata,
1769
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_call_pb.CallAddResponse|null) => void
1770
+ ): UnaryResponse;
1771
+ callAdd(
1772
+ requestMessage: wechaty_puppet_call_pb.CallAddRequest,
1773
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_call_pb.CallAddResponse|null) => void
1774
+ ): UnaryResponse;
1775
+ callAccept(
1776
+ requestMessage: wechaty_puppet_call_pb.CallAcceptRequest,
1777
+ metadata: grpc.Metadata,
1778
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_call_pb.CallAcceptResponse|null) => void
1779
+ ): UnaryResponse;
1780
+ callAccept(
1781
+ requestMessage: wechaty_puppet_call_pb.CallAcceptRequest,
1782
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_call_pb.CallAcceptResponse|null) => void
1783
+ ): UnaryResponse;
1784
+ callReject(
1785
+ requestMessage: wechaty_puppet_call_pb.CallRejectRequest,
1786
+ metadata: grpc.Metadata,
1787
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_call_pb.CallRejectResponse|null) => void
1788
+ ): UnaryResponse;
1789
+ callReject(
1790
+ requestMessage: wechaty_puppet_call_pb.CallRejectRequest,
1791
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_call_pb.CallRejectResponse|null) => void
1792
+ ): UnaryResponse;
1793
+ callCancel(
1794
+ requestMessage: wechaty_puppet_call_pb.CallCancelRequest,
1795
+ metadata: grpc.Metadata,
1796
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_call_pb.CallCancelResponse|null) => void
1797
+ ): UnaryResponse;
1798
+ callCancel(
1799
+ requestMessage: wechaty_puppet_call_pb.CallCancelRequest,
1800
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_call_pb.CallCancelResponse|null) => void
1801
+ ): UnaryResponse;
1802
+ callHangup(
1803
+ requestMessage: wechaty_puppet_call_pb.CallHangupRequest,
1804
+ metadata: grpc.Metadata,
1805
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_call_pb.CallHangupResponse|null) => void
1806
+ ): UnaryResponse;
1807
+ callHangup(
1808
+ requestMessage: wechaty_puppet_call_pb.CallHangupRequest,
1809
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_call_pb.CallHangupResponse|null) => void
1810
+ ): UnaryResponse;
1811
+ callMediaEndpoint(
1812
+ requestMessage: wechaty_puppet_call_pb.CallMediaEndpointRequest,
1813
+ metadata: grpc.Metadata,
1814
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_call_pb.CallMediaEndpointResponse|null) => void
1815
+ ): UnaryResponse;
1816
+ callMediaEndpoint(
1817
+ requestMessage: wechaty_puppet_call_pb.CallMediaEndpointRequest,
1818
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_call_pb.CallMediaEndpointResponse|null) => void
1819
+ ): UnaryResponse;
1820
+ callPayload(
1821
+ requestMessage: wechaty_puppet_call_pb.CallPayloadRequest,
1822
+ metadata: grpc.Metadata,
1823
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_call_pb.CallPayloadResponse|null) => void
1824
+ ): UnaryResponse;
1825
+ callPayload(
1826
+ requestMessage: wechaty_puppet_call_pb.CallPayloadRequest,
1827
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_call_pb.CallPayloadResponse|null) => void
1828
+ ): UnaryResponse;
1676
1829
  messageChatHistory(
1677
1830
  requestMessage: wechaty_puppet_message_pb.MessageChatHistoryRequest,
1678
1831
  metadata: grpc.Metadata,
@@ -3,6 +3,7 @@
3
3
 
4
4
  var wechaty_puppet_pb = require("../wechaty/puppet_pb");
5
5
  var wechaty_puppet_base_pb = require("../wechaty/puppet/base_pb");
6
+ var wechaty_puppet_call_pb = require("../wechaty/puppet/call_pb");
6
7
  var wechaty_puppet_contact_pb = require("../wechaty/puppet/contact_pb");
7
8
  var wechaty_puppet_download_upload_pb = require("../wechaty/puppet/download-upload_pb");
8
9
  var wechaty_puppet_event_pb = require("../wechaty/puppet/event_pb");
@@ -421,6 +422,78 @@ Puppet.MessageCallRecord = {
421
422
  responseType: wechaty_puppet_message_pb.MessageCallRecordResponse
422
423
  };
423
424
 
425
+ Puppet.CallInvite = {
426
+ methodName: "CallInvite",
427
+ service: Puppet,
428
+ requestStream: false,
429
+ responseStream: false,
430
+ requestType: wechaty_puppet_call_pb.CallInviteRequest,
431
+ responseType: wechaty_puppet_call_pb.CallInviteResponse
432
+ };
433
+
434
+ Puppet.CallAdd = {
435
+ methodName: "CallAdd",
436
+ service: Puppet,
437
+ requestStream: false,
438
+ responseStream: false,
439
+ requestType: wechaty_puppet_call_pb.CallAddRequest,
440
+ responseType: wechaty_puppet_call_pb.CallAddResponse
441
+ };
442
+
443
+ Puppet.CallAccept = {
444
+ methodName: "CallAccept",
445
+ service: Puppet,
446
+ requestStream: false,
447
+ responseStream: false,
448
+ requestType: wechaty_puppet_call_pb.CallAcceptRequest,
449
+ responseType: wechaty_puppet_call_pb.CallAcceptResponse
450
+ };
451
+
452
+ Puppet.CallReject = {
453
+ methodName: "CallReject",
454
+ service: Puppet,
455
+ requestStream: false,
456
+ responseStream: false,
457
+ requestType: wechaty_puppet_call_pb.CallRejectRequest,
458
+ responseType: wechaty_puppet_call_pb.CallRejectResponse
459
+ };
460
+
461
+ Puppet.CallCancel = {
462
+ methodName: "CallCancel",
463
+ service: Puppet,
464
+ requestStream: false,
465
+ responseStream: false,
466
+ requestType: wechaty_puppet_call_pb.CallCancelRequest,
467
+ responseType: wechaty_puppet_call_pb.CallCancelResponse
468
+ };
469
+
470
+ Puppet.CallHangup = {
471
+ methodName: "CallHangup",
472
+ service: Puppet,
473
+ requestStream: false,
474
+ responseStream: false,
475
+ requestType: wechaty_puppet_call_pb.CallHangupRequest,
476
+ responseType: wechaty_puppet_call_pb.CallHangupResponse
477
+ };
478
+
479
+ Puppet.CallMediaEndpoint = {
480
+ methodName: "CallMediaEndpoint",
481
+ service: Puppet,
482
+ requestStream: false,
483
+ responseStream: false,
484
+ requestType: wechaty_puppet_call_pb.CallMediaEndpointRequest,
485
+ responseType: wechaty_puppet_call_pb.CallMediaEndpointResponse
486
+ };
487
+
488
+ Puppet.CallPayload = {
489
+ methodName: "CallPayload",
490
+ service: Puppet,
491
+ requestStream: false,
492
+ responseStream: false,
493
+ requestType: wechaty_puppet_call_pb.CallPayloadRequest,
494
+ responseType: wechaty_puppet_call_pb.CallPayloadResponse
495
+ };
496
+
424
497
  Puppet.MessageChatHistory = {
425
498
  methodName: "MessageChatHistory",
426
499
  service: Puppet,
@@ -2511,6 +2584,254 @@ PuppetClient.prototype.messageCallRecord = function messageCallRecord(requestMes
2511
2584
  };
2512
2585
  };
2513
2586
 
2587
+ PuppetClient.prototype.callInvite = function callInvite(requestMessage, metadata, callback) {
2588
+ if (arguments.length === 2) {
2589
+ callback = arguments[1];
2590
+ }
2591
+ var client = grpc.unary(Puppet.CallInvite, {
2592
+ request: requestMessage,
2593
+ host: this.serviceHost,
2594
+ metadata: metadata,
2595
+ transport: this.options.transport,
2596
+ debug: this.options.debug,
2597
+ onEnd: function (response) {
2598
+ if (callback) {
2599
+ if (response.status !== grpc.Code.OK) {
2600
+ var err = new Error(response.statusMessage);
2601
+ err.code = response.status;
2602
+ err.metadata = response.trailers;
2603
+ callback(err, null);
2604
+ } else {
2605
+ callback(null, response.message);
2606
+ }
2607
+ }
2608
+ }
2609
+ });
2610
+ return {
2611
+ cancel: function () {
2612
+ callback = null;
2613
+ client.close();
2614
+ }
2615
+ };
2616
+ };
2617
+
2618
+ PuppetClient.prototype.callAdd = function callAdd(requestMessage, metadata, callback) {
2619
+ if (arguments.length === 2) {
2620
+ callback = arguments[1];
2621
+ }
2622
+ var client = grpc.unary(Puppet.CallAdd, {
2623
+ request: requestMessage,
2624
+ host: this.serviceHost,
2625
+ metadata: metadata,
2626
+ transport: this.options.transport,
2627
+ debug: this.options.debug,
2628
+ onEnd: function (response) {
2629
+ if (callback) {
2630
+ if (response.status !== grpc.Code.OK) {
2631
+ var err = new Error(response.statusMessage);
2632
+ err.code = response.status;
2633
+ err.metadata = response.trailers;
2634
+ callback(err, null);
2635
+ } else {
2636
+ callback(null, response.message);
2637
+ }
2638
+ }
2639
+ }
2640
+ });
2641
+ return {
2642
+ cancel: function () {
2643
+ callback = null;
2644
+ client.close();
2645
+ }
2646
+ };
2647
+ };
2648
+
2649
+ PuppetClient.prototype.callAccept = function callAccept(requestMessage, metadata, callback) {
2650
+ if (arguments.length === 2) {
2651
+ callback = arguments[1];
2652
+ }
2653
+ var client = grpc.unary(Puppet.CallAccept, {
2654
+ request: requestMessage,
2655
+ host: this.serviceHost,
2656
+ metadata: metadata,
2657
+ transport: this.options.transport,
2658
+ debug: this.options.debug,
2659
+ onEnd: function (response) {
2660
+ if (callback) {
2661
+ if (response.status !== grpc.Code.OK) {
2662
+ var err = new Error(response.statusMessage);
2663
+ err.code = response.status;
2664
+ err.metadata = response.trailers;
2665
+ callback(err, null);
2666
+ } else {
2667
+ callback(null, response.message);
2668
+ }
2669
+ }
2670
+ }
2671
+ });
2672
+ return {
2673
+ cancel: function () {
2674
+ callback = null;
2675
+ client.close();
2676
+ }
2677
+ };
2678
+ };
2679
+
2680
+ PuppetClient.prototype.callReject = function callReject(requestMessage, metadata, callback) {
2681
+ if (arguments.length === 2) {
2682
+ callback = arguments[1];
2683
+ }
2684
+ var client = grpc.unary(Puppet.CallReject, {
2685
+ request: requestMessage,
2686
+ host: this.serviceHost,
2687
+ metadata: metadata,
2688
+ transport: this.options.transport,
2689
+ debug: this.options.debug,
2690
+ onEnd: function (response) {
2691
+ if (callback) {
2692
+ if (response.status !== grpc.Code.OK) {
2693
+ var err = new Error(response.statusMessage);
2694
+ err.code = response.status;
2695
+ err.metadata = response.trailers;
2696
+ callback(err, null);
2697
+ } else {
2698
+ callback(null, response.message);
2699
+ }
2700
+ }
2701
+ }
2702
+ });
2703
+ return {
2704
+ cancel: function () {
2705
+ callback = null;
2706
+ client.close();
2707
+ }
2708
+ };
2709
+ };
2710
+
2711
+ PuppetClient.prototype.callCancel = function callCancel(requestMessage, metadata, callback) {
2712
+ if (arguments.length === 2) {
2713
+ callback = arguments[1];
2714
+ }
2715
+ var client = grpc.unary(Puppet.CallCancel, {
2716
+ request: requestMessage,
2717
+ host: this.serviceHost,
2718
+ metadata: metadata,
2719
+ transport: this.options.transport,
2720
+ debug: this.options.debug,
2721
+ onEnd: function (response) {
2722
+ if (callback) {
2723
+ if (response.status !== grpc.Code.OK) {
2724
+ var err = new Error(response.statusMessage);
2725
+ err.code = response.status;
2726
+ err.metadata = response.trailers;
2727
+ callback(err, null);
2728
+ } else {
2729
+ callback(null, response.message);
2730
+ }
2731
+ }
2732
+ }
2733
+ });
2734
+ return {
2735
+ cancel: function () {
2736
+ callback = null;
2737
+ client.close();
2738
+ }
2739
+ };
2740
+ };
2741
+
2742
+ PuppetClient.prototype.callHangup = function callHangup(requestMessage, metadata, callback) {
2743
+ if (arguments.length === 2) {
2744
+ callback = arguments[1];
2745
+ }
2746
+ var client = grpc.unary(Puppet.CallHangup, {
2747
+ request: requestMessage,
2748
+ host: this.serviceHost,
2749
+ metadata: metadata,
2750
+ transport: this.options.transport,
2751
+ debug: this.options.debug,
2752
+ onEnd: function (response) {
2753
+ if (callback) {
2754
+ if (response.status !== grpc.Code.OK) {
2755
+ var err = new Error(response.statusMessage);
2756
+ err.code = response.status;
2757
+ err.metadata = response.trailers;
2758
+ callback(err, null);
2759
+ } else {
2760
+ callback(null, response.message);
2761
+ }
2762
+ }
2763
+ }
2764
+ });
2765
+ return {
2766
+ cancel: function () {
2767
+ callback = null;
2768
+ client.close();
2769
+ }
2770
+ };
2771
+ };
2772
+
2773
+ PuppetClient.prototype.callMediaEndpoint = function callMediaEndpoint(requestMessage, metadata, callback) {
2774
+ if (arguments.length === 2) {
2775
+ callback = arguments[1];
2776
+ }
2777
+ var client = grpc.unary(Puppet.CallMediaEndpoint, {
2778
+ request: requestMessage,
2779
+ host: this.serviceHost,
2780
+ metadata: metadata,
2781
+ transport: this.options.transport,
2782
+ debug: this.options.debug,
2783
+ onEnd: function (response) {
2784
+ if (callback) {
2785
+ if (response.status !== grpc.Code.OK) {
2786
+ var err = new Error(response.statusMessage);
2787
+ err.code = response.status;
2788
+ err.metadata = response.trailers;
2789
+ callback(err, null);
2790
+ } else {
2791
+ callback(null, response.message);
2792
+ }
2793
+ }
2794
+ }
2795
+ });
2796
+ return {
2797
+ cancel: function () {
2798
+ callback = null;
2799
+ client.close();
2800
+ }
2801
+ };
2802
+ };
2803
+
2804
+ PuppetClient.prototype.callPayload = function callPayload(requestMessage, metadata, callback) {
2805
+ if (arguments.length === 2) {
2806
+ callback = arguments[1];
2807
+ }
2808
+ var client = grpc.unary(Puppet.CallPayload, {
2809
+ request: requestMessage,
2810
+ host: this.serviceHost,
2811
+ metadata: metadata,
2812
+ transport: this.options.transport,
2813
+ debug: this.options.debug,
2814
+ onEnd: function (response) {
2815
+ if (callback) {
2816
+ if (response.status !== grpc.Code.OK) {
2817
+ var err = new Error(response.statusMessage);
2818
+ err.code = response.status;
2819
+ err.metadata = response.trailers;
2820
+ callback(err, null);
2821
+ } else {
2822
+ callback(null, response.message);
2823
+ }
2824
+ }
2825
+ }
2826
+ });
2827
+ return {
2828
+ cancel: function () {
2829
+ callback = null;
2830
+ client.close();
2831
+ }
2832
+ };
2833
+ };
2834
+
2514
2835
  PuppetClient.prototype.messageChatHistory = function messageChatHistory(requestMessage, metadata, callback) {
2515
2836
  if (arguments.length === 2) {
2516
2837
  callback = arguments[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juzi/wechaty-grpc",
3
- "version": "1.0.101",
3
+ "version": "1.0.103",
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.101",
7
+ "version": "1.0.103",
8
8
  "description": "gRPC for Wechaty",
9
9
  "type": "module",
10
10
  "exports": {