@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];
@@ -5,6 +5,7 @@ option go_package = "github.com/wechaty/go-grpc/wechaty/puppet";
5
5
  option java_package = "io.github.wechaty.grpc.puppet";
6
6
  option csharp_namespace = "github.wechaty.grpc.puppet";
7
7
 
8
+ // 数值必须与 @juzi/wechaty-puppet 的 DirtyType 严格一致。
8
9
  enum PayloadType {
9
10
  PAYLOAD_TYPE_UNSPECIFIED = 0;
10
11
  PAYLOAD_TYPE_MESSAGE = 1;
@@ -15,6 +16,9 @@ enum PayloadType {
15
16
  PAYLOAD_TYPE_POST = 6;
16
17
  PAYLOAD_TYPE_TAG = 7;
17
18
  PAYLOAD_TYPE_TAG_GROUP = 8;
19
+ PAYLOAD_TYPE_WXXD_PRODUCT = 9;
20
+ PAYLOAD_TYPE_WXXD_ORDER = 10;
21
+ PAYLOAD_TYPE_CALL = 11;
18
22
  }
19
23
 
20
24
  message StartRequest {}
@@ -5,6 +5,8 @@ option go_package = "github.com/wechaty/go-grpc/wechaty/puppet";
5
5
  option java_package = "io.github.wechaty.grpc.puppet";
6
6
  option csharp_namespace = "github.wechaty.grpc.puppet";
7
7
 
8
+ import "google/protobuf/timestamp.proto";
9
+
8
10
  enum CallType {
9
11
  CALL_TYPE_UNKNOWN = 0; // 不明确
10
12
  CALL_TYPE_VOICE = 1; // 语音
@@ -15,7 +17,7 @@ enum CallStatus { // 类型枚举
15
17
  CALL_STATUS_UNKNOWN = 0; // 不明确
16
18
  CALL_STATUS_CANCELED = 1; // 自己取消
17
19
  CALL_STATUS_REJECTED = 2; // 对方拒接
18
- CALL_STATUS_MISSED = 3; // 正在通话
20
+ CALL_STATUS_MISSED = 3; // 未接
19
21
  CALL_STATUS_ONGOING = 4; // 正在通话
20
22
  CALL_STATUS_ENDED = 5; // 已结束
21
23
  }
@@ -27,3 +29,101 @@ message CallRecordPayload {
27
29
  CallType type = 4;
28
30
  CallStatus status = 5;
29
31
  }
32
+
33
+ // 通话信令域全貌:
34
+ // - 下行动作(业务侧 → 协议端)= CallInvite / CallAdd / CallAccept / CallReject / CallCancel / CallHangup
35
+ // 六个独立 RPC(对齐 MessageSendText / MessageRecall / FriendshipAccept 的「一动作一 RPC」惯例);
36
+ // - CallMediaEndpoint 为媒体入场券:按需向协议端换取媒体网关协商入口(url/token),刻意不缓存;
37
+ // - 状态面 = CallPayload 查询 + dirty(PAYLOAD_TYPE_CALL, id) 失效通知:协议端在任何通话状态变化时
38
+ // 发 dirty,业务侧再经 CallPayload 拉取最新快照;
39
+ // - 上行回执(ringing/accept/reject/cancel/hangup 及来电 invite)一律经 EVENT_TYPE_CALL 事件上行,
40
+ // payload 为 JSON 序列化的字符串(含 callId/signal/contactId/reason?/timestamp);
41
+ // - Ringing 没有下行 RPC:响铃回执是被叫协议端的自动行为,不是业务动作。
42
+
43
+ // 发起呼叫请求:callId 不由主叫携带,而是由 puppet 实现侧生成并经 CallInviteResponse 返回。
44
+ message CallInviteRequest {
45
+ // 受邀方 contactId 列表(不含发起方):单元素 = 1v1 通话,多元素 = 群通话;
46
+ // 无论几人,一通通话只铸造一个 call_id。
47
+ repeated string contact_ids = 1;
48
+ CallType media = 2; // 必填:媒体类型(VOICE/VIDEO),复用既有 CallType;零值 CALL_TYPE_UNKNOWN 会被 server 拒绝
49
+ }
50
+
51
+ // CallInvite 响应:
52
+ // - call_id 由 puppet 实现侧(协议端)生成并经本响应返回,全链路以此关联控制面与媒体旁路;
53
+ // - 上行 EVENT_TYPE_CALL 事件可能先于本响应到达,客户端须容忍乱序;
54
+ // - 后续控制 RPC(CallAccept/CallReject/CallCancel/CallHangup)凭此 call_id 引用本通通话。
55
+ message CallInviteResponse {
56
+ string call_id = 1;
57
+ }
58
+
59
+ // 通话中途拉人(errors-only 契约):
60
+ // - 新参与者的应答回执(响铃/接听/拒接)一律经 EVENT_TYPE_CALL 事件上行,本响应恒为空;
61
+ // - 拉人特有的失败(通话不存在/已结束、人数上限等)经 gRPC status error 返回。
62
+ message CallAddRequest {
63
+ string call_id = 1; // 由 CallInvite 响应获得
64
+ repeated string contact_ids = 2; // 新增受邀方 contactId 列表(不含已在通话中的参与者)
65
+ }
66
+
67
+ message CallAddResponse {}
68
+
69
+ // 以下四个控制 RPC(CallAccept/CallReject/CallCancel/CallHangup)的信令投递为 errors-only 契约:
70
+ // gRPC status error 仅表示传输失败或 puppet 不支持;对端的业务响应(响铃/接听/拒接/挂断)
71
+ // 一律经 EVENT_TYPE_CALL 事件上行,故四个响应消息恒为空。
72
+
73
+ // 被叫接听来电。
74
+ message CallAcceptRequest {
75
+ string call_id = 1; // 由 CallInvite 响应获得;协议端持有会话状态,凭此即可定位会话(无需 peer/media)
76
+ }
77
+
78
+ message CallAcceptResponse {}
79
+
80
+ // 被叫拒接来电。
81
+ message CallRejectRequest {
82
+ string call_id = 1; // 由 CallInvite 响应获得;协议端持有会话状态,凭此即可定位会话(无需 peer/media)
83
+ string reason = 2; // 可空,空串表示无
84
+ }
85
+
86
+ message CallRejectResponse {}
87
+
88
+ // 接通前主叫取消呼叫。
89
+ message CallCancelRequest {
90
+ string call_id = 1; // 由 CallInvite 响应获得;协议端持有会话状态,凭此即可定位会话(无需 peer/media)
91
+ }
92
+
93
+ message CallCancelResponse {}
94
+
95
+ // 接通后任一方挂断。
96
+ message CallHangupRequest {
97
+ string call_id = 1; // 由 CallInvite 响应获得;协议端持有会话状态,凭此即可定位会话(无需 peer/media)
98
+ string reason = 2; // 可空,空串表示无
99
+ }
100
+
101
+ message CallHangupResponse {}
102
+
103
+ // 媒体入场券:按 call_id 向协议端换取媒体网关协商入口。
104
+ // 签发可能在网关侧预分配媒体会话(有副作用),故服务端不得缓存响应、客户端按需拉取。
105
+ message CallMediaEndpointRequest {
106
+ string call_id = 1; // 由 CallInvite 响应获得
107
+ }
108
+
109
+ message CallMediaEndpointResponse {
110
+ string url = 1; // 媒体网关协商入口(非媒体流地址本身)
111
+ string token = 2; // 短时效凭证,绑定 call_id + 本端身份
112
+ google.protobuf.Timestamp expires_at = 3; // 凭证过期时刻;不设置 = 不过期;过期后重新拉取本 RPC
113
+ string protocol = 4; // 入口方言(如 whip / livekit / 自定义),由媒体 SDK 消费
114
+ }
115
+
116
+ // 通话状态快照查询(对齐 ContactPayload 的实体查询模式):
117
+ // 协议端在任何通话状态变化时须发 dirty(PAYLOAD_TYPE_CALL, id),业务侧凭此失效缓存后重新拉取。
118
+ message CallPayloadRequest {
119
+ string id = 1; // call_id
120
+ }
121
+
122
+ message CallPayloadResponse {
123
+ string id = 1;
124
+ string starter = 2; // 发起方 contactId;空串 = 协议端不可知(如中途被拉入者视角)
125
+ repeated string participants = 3; // 当前全量参与者名册
126
+ CallType media = 4; // 当前媒体类型(语音↔视频切换经 dirty 反映)
127
+ google.protobuf.Timestamp start_time = 5; // 通话发起时刻;接通时刻不在此(等于上行 Accept 事件的 timestamp)
128
+ google.protobuf.Timestamp end_time = 6; // 通话结束时刻;未设置 = 通话进行中
129
+ }
@@ -18,6 +18,25 @@ message ChannelPayload {
18
18
  // 视频号直播专属
19
19
  string object_id = 9;
20
20
  string object_nonce_id = 10;
21
+
22
+ // 个微(phoenix)转发视频号所需补充字段,来自接收视频号的 appmsg.finderFeed
23
+ string username = 11; // 视频号 finder userName
24
+ int32 auth_icon_type = 12; // 认证类型
25
+ string auth_icon_url = 13; // 授权图标地址
26
+ string from_user_name = 14; // 视频号转发自好友 userName
27
+ repeated ChannelMedia media_list = 15; // 媒体资源列表(图片类视频号可多条)
28
+ }
29
+
30
+ // 视频号媒体资源,对应接收视频号 finderFeed.mediaList.media
31
+ message ChannelMedia {
32
+ int32 media_type = 1; // 资源类型 2:图片 4:视频
33
+ string url = 2; // 原始媒体流地址
34
+ string thumb_url = 3; // 视频第一帧缩略图地址
35
+ string full_cover_url = 4; // 封面缩略图地址
36
+ string cover_url = 5; // 封面地址
37
+ int32 width = 6; // 缩略图宽度,默认 1080
38
+ int32 height = 7; // 缩略图高度,默认 1920
39
+ int32 video_play_duration = 8; // 视频播放时长(秒)
21
40
  }
22
41
 
23
42
  enum ChannelFeedType {
@@ -34,6 +34,7 @@ enum EventType {
34
34
  EVENT_TYPE_ROOM_ANNOUNCE = 32;
35
35
  EVENT_TYPE_VERIFY_CODE = 33;
36
36
  EVENT_TYPE_VERIFY_SLIDE = 34;
37
+ EVENT_TYPE_CALL = 35;
37
38
  }
38
39
 
39
40
  message EventRequest {