@juzi/wechaty-grpc 1.0.48 → 1.0.49

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 +91 -0
  2. package/dist/cjs/out/wechaty/puppet/message_pb.js +597 -0
  3. package/dist/cjs/out/wechaty/puppet.openapi.yaml +53 -1
  4. package/dist/cjs/out/wechaty/puppet.swagger.json +78 -1
  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 +28 -0
  10. package/dist/cjs/proto/wechaty/puppet.proto +6 -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 +91 -0
  16. package/dist/esm/out/wechaty/puppet/message_pb.js +597 -0
  17. package/dist/esm/out/wechaty/puppet.openapi.yaml +53 -1
  18. package/dist/esm/out/wechaty/puppet.swagger.json +78 -1
  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 +28 -0
  24. package/dist/esm/proto/wechaty/puppet.proto +6 -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 +91 -0
  30. package/out/wechaty/puppet/message_pb.js +597 -0
  31. package/out/wechaty/puppet.openapi.yaml +53 -1
  32. package/out/wechaty/puppet.swagger.json +78 -1
  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
@@ -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.48",
6
+ "version": "1.0.49",
7
7
  "contact": {
8
8
  "name": "Wechaty",
9
9
  "url": "https://github.com/wechaty/openapi",
@@ -1446,6 +1446,36 @@
1446
1446
  ]
1447
1447
  }
1448
1448
  },
1449
+ "/message/broadcast/{id}": {
1450
+ "get": {
1451
+ "operationId": "Puppet_GetMessageBroadcastStatus",
1452
+ "responses": {
1453
+ "200": {
1454
+ "description": "A successful response.",
1455
+ "schema": {
1456
+ "$ref": "#/definitions/puppetGetMessageBroadcastStatusResponse"
1457
+ }
1458
+ },
1459
+ "default": {
1460
+ "description": "An unexpected error response.",
1461
+ "schema": {
1462
+ "$ref": "#/definitions/rpcStatus"
1463
+ }
1464
+ }
1465
+ },
1466
+ "parameters": [
1467
+ {
1468
+ "name": "id",
1469
+ "in": "path",
1470
+ "required": true,
1471
+ "type": "string"
1472
+ }
1473
+ ],
1474
+ "tags": [
1475
+ "Puppet"
1476
+ ]
1477
+ }
1478
+ },
1449
1479
  "/message/{id}": {
1450
1480
  "get": {
1451
1481
  "operationId": "Puppet_MessagePayload",
@@ -3258,6 +3288,39 @@
3258
3288
  },
3259
3289
  "additionalProperties": {}
3260
3290
  },
3291
+ "puppetBroadcastStatus": {
3292
+ "type": "string",
3293
+ "enum": [
3294
+ "BROADCAST_STATUS_UNKNWON",
3295
+ "BROADCAST_STATUS_SENDING",
3296
+ "BROADCAST_STATUS_SENT"
3297
+ ],
3298
+ "default": "BROADCAST_STATUS_UNKNWON"
3299
+ },
3300
+ "puppetBroadcastTarget": {
3301
+ "type": "object",
3302
+ "properties": {
3303
+ "contactId": {
3304
+ "type": "string"
3305
+ },
3306
+ "roomId": {
3307
+ "type": "string"
3308
+ },
3309
+ "status": {
3310
+ "$ref": "#/definitions/puppetBroadcastTargetStatus"
3311
+ }
3312
+ }
3313
+ },
3314
+ "puppetBroadcastTargetStatus": {
3315
+ "type": "string",
3316
+ "enum": [
3317
+ "BROADCAST_TARGET_STATUS_UNSENT",
3318
+ "BROADCAST_TARGET_STATUS_SENT",
3319
+ "BROADCAST_TARGET_STATUS_NOT_FROEND",
3320
+ "BROADCAST_TARGET_STATUS_OCCUPIED"
3321
+ ],
3322
+ "default": "BROADCAST_TARGET_STATUS_UNSENT"
3323
+ },
3261
3324
  "puppetChannelPayload": {
3262
3325
  "type": "object",
3263
3326
  "properties": {
@@ -3707,6 +3770,20 @@
3707
3770
  "description": "- FRIENDSHIP_TYPE_UNSPECIFIED: 不明确\n - FRIENDSHIP_TYPE_CONFIRM: 确认——双方互加后触发\n - FRIENDSHIP_TYPE_RECEIVE: 收到——收到好友请求后触发\n - FRIENDSHIP_TYPE_VERIFY: 验证——主动加他人为好友时触发,wxwork里暂无此事件\n - FRIENDSHIP_TYPE_DELETE: 删除——主动删除好友时触发\n - FRIENDSHIP_TYPE_REMOVED: 被删除——被他人删除好友时触发",
3708
3771
  "title": "事件类型"
3709
3772
  },
3773
+ "puppetGetMessageBroadcastStatusResponse": {
3774
+ "type": "object",
3775
+ "properties": {
3776
+ "status": {
3777
+ "$ref": "#/definitions/puppetBroadcastStatus"
3778
+ },
3779
+ "detail": {
3780
+ "type": "array",
3781
+ "items": {
3782
+ "$ref": "#/definitions/puppetBroadcastTarget"
3783
+ }
3784
+ }
3785
+ }
3786
+ },
3710
3787
  "puppetGetMessageBroadcastTargetResponse": {
3711
3788
  "type": "object",
3712
3789
  "properties": {
@@ -70,6 +70,7 @@ interface IPuppetService extends grpc.ServiceDefinition<grpc.UntypedServiceImple
70
70
  messagePreview: IPuppetService_IMessagePreview;
71
71
  getMessageBroadcastTarget: IPuppetService_IGetMessageBroadcastTarget;
72
72
  createMessageBroadcast: IPuppetService_ICreateMessageBroadcast;
73
+ getMessageBroadcastStatus: IPuppetService_IGetMessageBroadcastStatus;
73
74
  roomPayload: IPuppetService_IRoomPayload;
74
75
  roomList: IPuppetService_IRoomList;
75
76
  roomAdd: IPuppetService_IRoomAdd;
@@ -532,6 +533,15 @@ interface IPuppetService_ICreateMessageBroadcast extends grpc.MethodDefinition<w
532
533
  responseSerialize: grpc.serialize<wechaty_puppet_message_pb.CreateMessageBroadcastResponse>;
533
534
  responseDeserialize: grpc.deserialize<wechaty_puppet_message_pb.CreateMessageBroadcastResponse>;
534
535
  }
536
+ interface IPuppetService_IGetMessageBroadcastStatus extends grpc.MethodDefinition<wechaty_puppet_message_pb.GetMessageBroadcastStatusRequest, wechaty_puppet_message_pb.GetMessageBroadcastStatusResponse> {
537
+ path: "/wechaty.Puppet/GetMessageBroadcastStatus";
538
+ requestStream: false;
539
+ responseStream: false;
540
+ requestSerialize: grpc.serialize<wechaty_puppet_message_pb.GetMessageBroadcastStatusRequest>;
541
+ requestDeserialize: grpc.deserialize<wechaty_puppet_message_pb.GetMessageBroadcastStatusRequest>;
542
+ responseSerialize: grpc.serialize<wechaty_puppet_message_pb.GetMessageBroadcastStatusResponse>;
543
+ responseDeserialize: grpc.deserialize<wechaty_puppet_message_pb.GetMessageBroadcastStatusResponse>;
544
+ }
535
545
  interface IPuppetService_IRoomPayload extends grpc.MethodDefinition<wechaty_puppet_room_pb.RoomPayloadRequest, wechaty_puppet_room_pb.RoomPayloadResponse> {
536
546
  path: "/wechaty.Puppet/RoomPayload";
537
547
  requestStream: false;
@@ -916,6 +926,7 @@ export interface IPuppetServer extends grpc.UntypedServiceImplementation {
916
926
  messagePreview: grpc.handleUnaryCall<wechaty_puppet_message_pb.MessagePreviewRequest, wechaty_puppet_message_pb.MessagePreviewResponse>;
917
927
  getMessageBroadcastTarget: grpc.handleUnaryCall<wechaty_puppet_message_pb.GetMessageBroadcastTargetRequest, wechaty_puppet_message_pb.GetMessageBroadcastTargetResponse>;
918
928
  createMessageBroadcast: grpc.handleUnaryCall<wechaty_puppet_message_pb.CreateMessageBroadcastRequest, wechaty_puppet_message_pb.CreateMessageBroadcastResponse>;
929
+ getMessageBroadcastStatus: grpc.handleUnaryCall<wechaty_puppet_message_pb.GetMessageBroadcastStatusRequest, wechaty_puppet_message_pb.GetMessageBroadcastStatusResponse>;
919
930
  roomPayload: grpc.handleUnaryCall<wechaty_puppet_room_pb.RoomPayloadRequest, wechaty_puppet_room_pb.RoomPayloadResponse>;
920
931
  roomList: grpc.handleUnaryCall<wechaty_puppet_room_pb.RoomListRequest, wechaty_puppet_room_pb.RoomListResponse>;
921
932
  roomAdd: grpc.handleUnaryCall<wechaty_puppet_room_pb.RoomAddRequest, wechaty_puppet_room_pb.RoomAddResponse>;
@@ -1096,6 +1107,9 @@ export interface IPuppetClient {
1096
1107
  createMessageBroadcast(request: wechaty_puppet_message_pb.CreateMessageBroadcastRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.CreateMessageBroadcastResponse) => void): grpc.ClientUnaryCall;
1097
1108
  createMessageBroadcast(request: wechaty_puppet_message_pb.CreateMessageBroadcastRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.CreateMessageBroadcastResponse) => void): grpc.ClientUnaryCall;
1098
1109
  createMessageBroadcast(request: wechaty_puppet_message_pb.CreateMessageBroadcastRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.CreateMessageBroadcastResponse) => void): grpc.ClientUnaryCall;
1110
+ getMessageBroadcastStatus(request: wechaty_puppet_message_pb.GetMessageBroadcastStatusRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.GetMessageBroadcastStatusResponse) => void): grpc.ClientUnaryCall;
1111
+ getMessageBroadcastStatus(request: wechaty_puppet_message_pb.GetMessageBroadcastStatusRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.GetMessageBroadcastStatusResponse) => void): grpc.ClientUnaryCall;
1112
+ getMessageBroadcastStatus(request: wechaty_puppet_message_pb.GetMessageBroadcastStatusRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.GetMessageBroadcastStatusResponse) => void): grpc.ClientUnaryCall;
1099
1113
  roomPayload(request: wechaty_puppet_room_pb.RoomPayloadRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_room_pb.RoomPayloadResponse) => void): grpc.ClientUnaryCall;
1100
1114
  roomPayload(request: wechaty_puppet_room_pb.RoomPayloadRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_room_pb.RoomPayloadResponse) => void): grpc.ClientUnaryCall;
1101
1115
  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;
@@ -1351,6 +1365,9 @@ export class PuppetClient extends grpc.Client implements IPuppetClient {
1351
1365
  public createMessageBroadcast(request: wechaty_puppet_message_pb.CreateMessageBroadcastRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.CreateMessageBroadcastResponse) => void): grpc.ClientUnaryCall;
1352
1366
  public createMessageBroadcast(request: wechaty_puppet_message_pb.CreateMessageBroadcastRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.CreateMessageBroadcastResponse) => void): grpc.ClientUnaryCall;
1353
1367
  public createMessageBroadcast(request: wechaty_puppet_message_pb.CreateMessageBroadcastRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.CreateMessageBroadcastResponse) => void): grpc.ClientUnaryCall;
1368
+ public getMessageBroadcastStatus(request: wechaty_puppet_message_pb.GetMessageBroadcastStatusRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.GetMessageBroadcastStatusResponse) => void): grpc.ClientUnaryCall;
1369
+ public getMessageBroadcastStatus(request: wechaty_puppet_message_pb.GetMessageBroadcastStatusRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.GetMessageBroadcastStatusResponse) => void): grpc.ClientUnaryCall;
1370
+ public getMessageBroadcastStatus(request: wechaty_puppet_message_pb.GetMessageBroadcastStatusRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.GetMessageBroadcastStatusResponse) => void): grpc.ClientUnaryCall;
1354
1371
  public roomPayload(request: wechaty_puppet_room_pb.RoomPayloadRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_room_pb.RoomPayloadResponse) => void): grpc.ClientUnaryCall;
1355
1372
  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;
1356
1373
  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;
@@ -559,6 +559,28 @@ function deserialize_wechaty_puppet_FriendshipSearchPhoneResponse(buffer_arg) {
559
559
  return wechaty_puppet_friendship_pb.FriendshipSearchPhoneResponse.deserializeBinary(new Uint8Array(buffer_arg));
560
560
  }
561
561
 
562
+ function serialize_wechaty_puppet_GetMessageBroadcastStatusRequest(arg) {
563
+ if (!(arg instanceof wechaty_puppet_message_pb.GetMessageBroadcastStatusRequest)) {
564
+ throw new Error('Expected argument of type wechaty.puppet.GetMessageBroadcastStatusRequest');
565
+ }
566
+ return Buffer.from(arg.serializeBinary());
567
+ }
568
+
569
+ function deserialize_wechaty_puppet_GetMessageBroadcastStatusRequest(buffer_arg) {
570
+ return wechaty_puppet_message_pb.GetMessageBroadcastStatusRequest.deserializeBinary(new Uint8Array(buffer_arg));
571
+ }
572
+
573
+ function serialize_wechaty_puppet_GetMessageBroadcastStatusResponse(arg) {
574
+ if (!(arg instanceof wechaty_puppet_message_pb.GetMessageBroadcastStatusResponse)) {
575
+ throw new Error('Expected argument of type wechaty.puppet.GetMessageBroadcastStatusResponse');
576
+ }
577
+ return Buffer.from(arg.serializeBinary());
578
+ }
579
+
580
+ function deserialize_wechaty_puppet_GetMessageBroadcastStatusResponse(buffer_arg) {
581
+ return wechaty_puppet_message_pb.GetMessageBroadcastStatusResponse.deserializeBinary(new Uint8Array(buffer_arg));
582
+ }
583
+
562
584
  function serialize_wechaty_puppet_GetMessageBroadcastTargetRequest(arg) {
563
585
  if (!(arg instanceof wechaty_puppet_message_pb.GetMessageBroadcastTargetRequest)) {
564
586
  throw new Error('Expected argument of type wechaty.puppet.GetMessageBroadcastTargetRequest');
@@ -2410,6 +2432,17 @@ messageFile: {
2410
2432
  responseSerialize: serialize_wechaty_puppet_CreateMessageBroadcastResponse,
2411
2433
  responseDeserialize: deserialize_wechaty_puppet_CreateMessageBroadcastResponse,
2412
2434
  },
2435
+ getMessageBroadcastStatus: {
2436
+ path: '/wechaty.Puppet/GetMessageBroadcastStatus',
2437
+ requestStream: false,
2438
+ responseStream: false,
2439
+ requestType: wechaty_puppet_message_pb.GetMessageBroadcastStatusRequest,
2440
+ responseType: wechaty_puppet_message_pb.GetMessageBroadcastStatusResponse,
2441
+ requestSerialize: serialize_wechaty_puppet_GetMessageBroadcastStatusRequest,
2442
+ requestDeserialize: deserialize_wechaty_puppet_GetMessageBroadcastStatusRequest,
2443
+ responseSerialize: serialize_wechaty_puppet_GetMessageBroadcastStatusResponse,
2444
+ responseDeserialize: deserialize_wechaty_puppet_GetMessageBroadcastStatusResponse,
2445
+ },
2413
2446
  // *
2414
2447
  //
2415
2448
  // Room
@@ -440,6 +440,15 @@ type PuppetCreateMessageBroadcast = {
440
440
  readonly responseType: typeof wechaty_puppet_message_pb.CreateMessageBroadcastResponse;
441
441
  };
442
442
 
443
+ type PuppetGetMessageBroadcastStatus = {
444
+ readonly methodName: string;
445
+ readonly service: typeof Puppet;
446
+ readonly requestStream: false;
447
+ readonly responseStream: false;
448
+ readonly requestType: typeof wechaty_puppet_message_pb.GetMessageBroadcastStatusRequest;
449
+ readonly responseType: typeof wechaty_puppet_message_pb.GetMessageBroadcastStatusResponse;
450
+ };
451
+
443
452
  type PuppetRoomPayload = {
444
453
  readonly methodName: string;
445
454
  readonly service: typeof Puppet;
@@ -822,6 +831,7 @@ export class Puppet {
822
831
  static readonly MessagePreview: PuppetMessagePreview;
823
832
  static readonly GetMessageBroadcastTarget: PuppetGetMessageBroadcastTarget;
824
833
  static readonly CreateMessageBroadcast: PuppetCreateMessageBroadcast;
834
+ static readonly GetMessageBroadcastStatus: PuppetGetMessageBroadcastStatus;
825
835
  static readonly RoomPayload: PuppetRoomPayload;
826
836
  static readonly RoomList: PuppetRoomList;
827
837
  static readonly RoomAdd: PuppetRoomAdd;
@@ -1308,6 +1318,15 @@ export class PuppetClient {
1308
1318
  requestMessage: wechaty_puppet_message_pb.CreateMessageBroadcastRequest,
1309
1319
  callback: (error: ServiceError|null, responseMessage: wechaty_puppet_message_pb.CreateMessageBroadcastResponse|null) => void
1310
1320
  ): UnaryResponse;
1321
+ getMessageBroadcastStatus(
1322
+ requestMessage: wechaty_puppet_message_pb.GetMessageBroadcastStatusRequest,
1323
+ metadata: grpc.Metadata,
1324
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_message_pb.GetMessageBroadcastStatusResponse|null) => void
1325
+ ): UnaryResponse;
1326
+ getMessageBroadcastStatus(
1327
+ requestMessage: wechaty_puppet_message_pb.GetMessageBroadcastStatusRequest,
1328
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_message_pb.GetMessageBroadcastStatusResponse|null) => void
1329
+ ): UnaryResponse;
1311
1330
  roomPayload(
1312
1331
  requestMessage: wechaty_puppet_room_pb.RoomPayloadRequest,
1313
1332
  metadata: grpc.Metadata,
@@ -446,6 +446,15 @@ Puppet.CreateMessageBroadcast = {
446
446
  responseType: wechaty_puppet_message_pb.CreateMessageBroadcastResponse
447
447
  };
448
448
 
449
+ Puppet.GetMessageBroadcastStatus = {
450
+ methodName: "GetMessageBroadcastStatus",
451
+ service: Puppet,
452
+ requestStream: false,
453
+ responseStream: false,
454
+ requestType: wechaty_puppet_message_pb.GetMessageBroadcastStatusRequest,
455
+ responseType: wechaty_puppet_message_pb.GetMessageBroadcastStatusResponse
456
+ };
457
+
449
458
  Puppet.RoomPayload = {
450
459
  methodName: "RoomPayload",
451
460
  service: Puppet,
@@ -2251,6 +2260,37 @@ PuppetClient.prototype.createMessageBroadcast = function createMessageBroadcast(
2251
2260
  };
2252
2261
  };
2253
2262
 
2263
+ PuppetClient.prototype.getMessageBroadcastStatus = function getMessageBroadcastStatus(requestMessage, metadata, callback) {
2264
+ if (arguments.length === 2) {
2265
+ callback = arguments[1];
2266
+ }
2267
+ var client = grpc.unary(Puppet.GetMessageBroadcastStatus, {
2268
+ request: requestMessage,
2269
+ host: this.serviceHost,
2270
+ metadata: metadata,
2271
+ transport: this.options.transport,
2272
+ debug: this.options.debug,
2273
+ onEnd: function (response) {
2274
+ if (callback) {
2275
+ if (response.status !== grpc.Code.OK) {
2276
+ var err = new Error(response.statusMessage);
2277
+ err.code = response.status;
2278
+ err.metadata = response.trailers;
2279
+ callback(err, null);
2280
+ } else {
2281
+ callback(null, response.message);
2282
+ }
2283
+ }
2284
+ }
2285
+ });
2286
+ return {
2287
+ cancel: function () {
2288
+ callback = null;
2289
+ client.close();
2290
+ }
2291
+ };
2292
+ };
2293
+
2254
2294
  PuppetClient.prototype.roomPayload = function roomPayload(requestMessage, metadata, callback) {
2255
2295
  if (arguments.length === 2) {
2256
2296
  callback = arguments[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juzi/wechaty-grpc",
3
- "version": "1.0.48",
3
+ "version": "1.0.49",
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.48",
7
+ "version": "1.0.49",
8
8
  "description": "gRPC for Wechaty",
9
9
  "type": "module",
10
10
  "exports": {