@juzi/wechaty-grpc 1.0.43 → 1.0.45

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 (50) hide show
  1. package/dist/cjs/out/wechaty/puppet/message_pb.d.ts +105 -0
  2. package/dist/cjs/out/wechaty/puppet/message_pb.js +794 -21
  3. package/dist/cjs/out/wechaty/puppet/post_pb.d.ts +1 -0
  4. package/dist/cjs/out/wechaty/puppet/post_pb.js +2 -1
  5. package/dist/cjs/out/wechaty/puppet.openapi.yaml +71 -1
  6. package/dist/cjs/out/wechaty/puppet.swagger.json +109 -3
  7. package/dist/cjs/out/wechaty/puppet_grpc_pb.d.ts +34 -0
  8. package/dist/cjs/out/wechaty/puppet_grpc_pb.js +66 -0
  9. package/dist/cjs/out/wechaty/puppet_pb_service.d.ts +38 -0
  10. package/dist/cjs/out/wechaty/puppet_pb_service.js +80 -0
  11. package/dist/cjs/proto/wechaty/puppet/message.proto +25 -0
  12. package/dist/cjs/proto/wechaty/puppet/post.proto +1 -0
  13. package/dist/cjs/proto/wechaty/puppet.proto +13 -0
  14. package/dist/cjs/src/package-json.d.ts.map +1 -1
  15. package/dist/cjs/src/package-json.js +3 -2
  16. package/dist/cjs/src/package-json.js.map +1 -1
  17. package/dist/cjs/tests/puppet-server-impl.d.ts.map +1 -1
  18. package/dist/cjs/tests/puppet-server-impl.js +10 -0
  19. package/dist/cjs/tests/puppet-server-impl.js.map +1 -1
  20. package/dist/esm/out/wechaty/puppet/message_pb.d.ts +105 -0
  21. package/dist/esm/out/wechaty/puppet/message_pb.js +794 -21
  22. package/dist/esm/out/wechaty/puppet/post_pb.d.ts +1 -0
  23. package/dist/esm/out/wechaty/puppet/post_pb.js +2 -1
  24. package/dist/esm/out/wechaty/puppet.openapi.yaml +71 -1
  25. package/dist/esm/out/wechaty/puppet.swagger.json +109 -3
  26. package/dist/esm/out/wechaty/puppet_grpc_pb.d.ts +34 -0
  27. package/dist/esm/out/wechaty/puppet_grpc_pb.js +66 -0
  28. package/dist/esm/out/wechaty/puppet_pb_service.d.ts +38 -0
  29. package/dist/esm/out/wechaty/puppet_pb_service.js +80 -0
  30. package/dist/esm/proto/wechaty/puppet/message.proto +25 -0
  31. package/dist/esm/proto/wechaty/puppet/post.proto +1 -0
  32. package/dist/esm/proto/wechaty/puppet.proto +13 -0
  33. package/dist/esm/src/package-json.d.ts.map +1 -1
  34. package/dist/esm/src/package-json.js +3 -2
  35. package/dist/esm/src/package-json.js.map +1 -1
  36. package/dist/esm/tests/puppet-server-impl.d.ts.map +1 -1
  37. package/dist/esm/tests/puppet-server-impl.js +10 -0
  38. package/dist/esm/tests/puppet-server-impl.js.map +1 -1
  39. package/out/wechaty/puppet/message_pb.d.ts +105 -0
  40. package/out/wechaty/puppet/message_pb.js +794 -21
  41. package/out/wechaty/puppet/post_pb.d.ts +1 -0
  42. package/out/wechaty/puppet/post_pb.js +2 -1
  43. package/out/wechaty/puppet.openapi.yaml +71 -1
  44. package/out/wechaty/puppet.swagger.json +109 -3
  45. package/out/wechaty/puppet_grpc_pb.d.ts +34 -0
  46. package/out/wechaty/puppet_grpc_pb.js +66 -0
  47. package/out/wechaty/puppet_pb_service.d.ts +38 -0
  48. package/out/wechaty/puppet_pb_service.js +80 -0
  49. package/package.json +3 -2
  50. package/src/package-json.ts +3 -2
@@ -332,6 +332,7 @@ export interface PostTypeMap {
332
332
  POST_TYPE_MOMENT: 1;
333
333
  POST_TYPE_CHANNEL: 2;
334
334
  POST_TYPE_MESSAGE: 3;
335
+ POST_TYPE_BROADCAST: 4;
335
336
  }
336
337
 
337
338
  export const PostType: PostTypeMap;
@@ -2544,7 +2544,8 @@ proto.wechaty.puppet.PostType = {
2544
2544
  POST_TYPE_UNSPECIFIED: 0,
2545
2545
  POST_TYPE_MOMENT: 1,
2546
2546
  POST_TYPE_CHANNEL: 2,
2547
- POST_TYPE_MESSAGE: 3
2547
+ POST_TYPE_MESSAGE: 3,
2548
+ POST_TYPE_BROADCAST: 4
2548
2549
  };
2549
2550
 
2550
2551
  /**
@@ -9,7 +9,7 @@ info:
9
9
 
10
10
  Wechaty Puppet Service is the RESTful API for Wechaty API, which is build on
11
11
  top of the Wechaty Puppet Abstraction and the gRPC proto definition.
12
- version: 1.0.43
12
+ version: 1.0.45
13
13
  contact:
14
14
  name: Wechaty
15
15
  url: 'https://github.com/wechaty/openapi'
@@ -956,6 +956,40 @@ paths:
956
956
  $ref: '#/definitions/rpcStatus'
957
957
  tags:
958
958
  - Puppet
959
+ /message/broadcast/create:
960
+ post:
961
+ operationId: Puppet_CreateMessageBroadcast
962
+ responses:
963
+ '200':
964
+ description: A successful response.
965
+ schema:
966
+ $ref: '#/definitions/puppetCreateMessageBroadcastResponse'
967
+ default:
968
+ description: An unexpected error response.
969
+ schema:
970
+ $ref: '#/definitions/rpcStatus'
971
+ parameters:
972
+ - name: body
973
+ in: body
974
+ required: true
975
+ schema:
976
+ $ref: '#/definitions/puppetCreateMessageBroadcastRequest'
977
+ tags:
978
+ - Puppet
979
+ /message/broadcast/target:
980
+ get:
981
+ operationId: Puppet_GetMessageBroadcastTarget
982
+ responses:
983
+ '200':
984
+ description: A successful response.
985
+ schema:
986
+ $ref: '#/definitions/puppetGetMessageBroadcastTargetResponse'
987
+ default:
988
+ description: An unexpected error response.
989
+ schema:
990
+ $ref: '#/definitions/rpcStatus'
991
+ tags:
992
+ - Puppet
959
993
  '/message/{id}':
960
994
  get:
961
995
  operationId: Puppet_MessagePayload
@@ -2344,6 +2378,22 @@ definitions:
2344
2378
  properties:
2345
2379
  hasRead:
2346
2380
  type: boolean
2381
+ puppetCreateMessageBroadcastRequest:
2382
+ type: object
2383
+ properties:
2384
+ targetIds:
2385
+ type: array
2386
+ items:
2387
+ type: string
2388
+ type:
2389
+ $ref: '#/definitions/puppetMessageBroadcastTargetType'
2390
+ content:
2391
+ $ref: '#/definitions/puppetPostPayloadClient'
2392
+ puppetCreateMessageBroadcastResponse:
2393
+ type: object
2394
+ properties:
2395
+ id:
2396
+ type: string
2347
2397
  puppetCurrentUserResponse:
2348
2398
  type: object
2349
2399
  properties:
@@ -2513,6 +2563,17 @@ definitions:
2513
2563
  - FRIENDSHIP_TYPE_DELETE: 删除——主动删除好友时触发
2514
2564
  - FRIENDSHIP_TYPE_REMOVED: 被删除——被他人删除好友时触发
2515
2565
  title: 事件类型
2566
+ puppetGetMessageBroadcastTargetResponse:
2567
+ type: object
2568
+ properties:
2569
+ contactIds:
2570
+ type: array
2571
+ items:
2572
+ type: string
2573
+ roomIds:
2574
+ type: array
2575
+ items:
2576
+ type: string
2516
2577
  puppetImageType:
2517
2578
  type: string
2518
2579
  enum:
@@ -2544,6 +2605,13 @@ definitions:
2544
2605
  title: 地址名,例如xx大厦
2545
2606
  puppetLogoutResponse:
2546
2607
  type: object
2608
+ puppetMessageBroadcastTargetType:
2609
+ type: string
2610
+ enum:
2611
+ - MESSAGE_BROADCAST_TARGET_TYPE_UNKNOWN
2612
+ - MESSAGE_BROADCAST_TARGET_TYPE_CONTACT
2613
+ - MESSAGE_BROADCAST_TARGET_TYPE_ROOM
2614
+ default: MESSAGE_BROADCAST_TARGET_TYPE_UNKNOWN
2547
2615
  puppetMessageChannelResponse:
2548
2616
  type: object
2549
2617
  properties:
@@ -3015,11 +3083,13 @@ definitions:
3015
3083
  - POST_TYPE_MOMENT
3016
3084
  - POST_TYPE_CHANNEL
3017
3085
  - POST_TYPE_MESSAGE
3086
+ - POST_TYPE_BROADCAST
3018
3087
  default: POST_TYPE_UNSPECIFIED
3019
3088
  title: |-
3020
3089
  - POST_TYPE_MOMENT: 朋友圈
3021
3090
  - POST_TYPE_CHANNEL: 视频号——原始设计走post,实际目前采用message
3022
3091
  - POST_TYPE_MESSAGE: 消息——富媒体消息
3092
+ - POST_TYPE_BROADCAST: 群发
3023
3093
  puppetReferrer:
3024
3094
  type: object
3025
3095
  properties:
@@ -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.43",
6
+ "version": "1.0.45",
7
7
  "contact": {
8
8
  "name": "Wechaty",
9
9
  "url": "https://github.com/wechaty/openapi",
@@ -1392,6 +1392,60 @@
1392
1392
  ]
1393
1393
  }
1394
1394
  },
1395
+ "/message/broadcast/create": {
1396
+ "post": {
1397
+ "operationId": "Puppet_CreateMessageBroadcast",
1398
+ "responses": {
1399
+ "200": {
1400
+ "description": "A successful response.",
1401
+ "schema": {
1402
+ "$ref": "#/definitions/puppetCreateMessageBroadcastResponse"
1403
+ }
1404
+ },
1405
+ "default": {
1406
+ "description": "An unexpected error response.",
1407
+ "schema": {
1408
+ "$ref": "#/definitions/rpcStatus"
1409
+ }
1410
+ }
1411
+ },
1412
+ "parameters": [
1413
+ {
1414
+ "name": "body",
1415
+ "in": "body",
1416
+ "required": true,
1417
+ "schema": {
1418
+ "$ref": "#/definitions/puppetCreateMessageBroadcastRequest"
1419
+ }
1420
+ }
1421
+ ],
1422
+ "tags": [
1423
+ "Puppet"
1424
+ ]
1425
+ }
1426
+ },
1427
+ "/message/broadcast/target": {
1428
+ "get": {
1429
+ "operationId": "Puppet_GetMessageBroadcastTarget",
1430
+ "responses": {
1431
+ "200": {
1432
+ "description": "A successful response.",
1433
+ "schema": {
1434
+ "$ref": "#/definitions/puppetGetMessageBroadcastTargetResponse"
1435
+ }
1436
+ },
1437
+ "default": {
1438
+ "description": "An unexpected error response.",
1439
+ "schema": {
1440
+ "$ref": "#/definitions/rpcStatus"
1441
+ }
1442
+ }
1443
+ },
1444
+ "tags": [
1445
+ "Puppet"
1446
+ ]
1447
+ }
1448
+ },
1395
1449
  "/message/{id}": {
1396
1450
  "get": {
1397
1451
  "operationId": "Puppet_MessagePayload",
@@ -3451,6 +3505,31 @@
3451
3505
  }
3452
3506
  }
3453
3507
  },
3508
+ "puppetCreateMessageBroadcastRequest": {
3509
+ "type": "object",
3510
+ "properties": {
3511
+ "targetIds": {
3512
+ "type": "array",
3513
+ "items": {
3514
+ "type": "string"
3515
+ }
3516
+ },
3517
+ "type": {
3518
+ "$ref": "#/definitions/puppetMessageBroadcastTargetType"
3519
+ },
3520
+ "content": {
3521
+ "$ref": "#/definitions/puppetPostPayloadClient"
3522
+ }
3523
+ }
3524
+ },
3525
+ "puppetCreateMessageBroadcastResponse": {
3526
+ "type": "object",
3527
+ "properties": {
3528
+ "id": {
3529
+ "type": "string"
3530
+ }
3531
+ }
3532
+ },
3454
3533
  "puppetCurrentUserResponse": {
3455
3534
  "type": "object",
3456
3535
  "properties": {
@@ -3631,6 +3710,23 @@
3631
3710
  "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: 被删除——被他人删除好友时触发",
3632
3711
  "title": "事件类型"
3633
3712
  },
3713
+ "puppetGetMessageBroadcastTargetResponse": {
3714
+ "type": "object",
3715
+ "properties": {
3716
+ "contactIds": {
3717
+ "type": "array",
3718
+ "items": {
3719
+ "type": "string"
3720
+ }
3721
+ },
3722
+ "roomIds": {
3723
+ "type": "array",
3724
+ "items": {
3725
+ "type": "string"
3726
+ }
3727
+ }
3728
+ }
3729
+ },
3634
3730
  "puppetImageType": {
3635
3731
  "type": "string",
3636
3732
  "enum": [
@@ -3672,6 +3768,15 @@
3672
3768
  "puppetLogoutResponse": {
3673
3769
  "type": "object"
3674
3770
  },
3771
+ "puppetMessageBroadcastTargetType": {
3772
+ "type": "string",
3773
+ "enum": [
3774
+ "MESSAGE_BROADCAST_TARGET_TYPE_UNKNOWN",
3775
+ "MESSAGE_BROADCAST_TARGET_TYPE_CONTACT",
3776
+ "MESSAGE_BROADCAST_TARGET_TYPE_ROOM"
3777
+ ],
3778
+ "default": "MESSAGE_BROADCAST_TARGET_TYPE_UNKNOWN"
3779
+ },
3675
3780
  "puppetMessageChannelResponse": {
3676
3781
  "type": "object",
3677
3782
  "properties": {
@@ -4258,10 +4363,11 @@
4258
4363
  "POST_TYPE_UNSPECIFIED",
4259
4364
  "POST_TYPE_MOMENT",
4260
4365
  "POST_TYPE_CHANNEL",
4261
- "POST_TYPE_MESSAGE"
4366
+ "POST_TYPE_MESSAGE",
4367
+ "POST_TYPE_BROADCAST"
4262
4368
  ],
4263
4369
  "default": "POST_TYPE_UNSPECIFIED",
4264
- "title": "- POST_TYPE_MOMENT: 朋友圈\n - POST_TYPE_CHANNEL: 视频号——原始设计走post,实际目前采用message\n - POST_TYPE_MESSAGE: 消息——富媒体消息"
4370
+ "title": "- POST_TYPE_MOMENT: 朋友圈\n - POST_TYPE_CHANNEL: 视频号——原始设计走post,实际目前采用message\n - POST_TYPE_MESSAGE: 消息——富媒体消息\n - POST_TYPE_BROADCAST: 群发"
4265
4371
  },
4266
4372
  "puppetReferrer": {
4267
4373
  "type": "object",
@@ -68,6 +68,8 @@ interface IPuppetService extends grpc.ServiceDefinition<grpc.UntypedServiceImple
68
68
  messageSendLocation: IPuppetService_IMessageSendLocation;
69
69
  messageSendChannel: IPuppetService_IMessageSendChannel;
70
70
  messagePreview: IPuppetService_IMessagePreview;
71
+ getMessageBroadcastTarget: IPuppetService_IGetMessageBroadcastTarget;
72
+ createMessageBroadcast: IPuppetService_ICreateMessageBroadcast;
71
73
  roomPayload: IPuppetService_IRoomPayload;
72
74
  roomList: IPuppetService_IRoomList;
73
75
  roomAdd: IPuppetService_IRoomAdd;
@@ -512,6 +514,24 @@ interface IPuppetService_IMessagePreview extends grpc.MethodDefinition<wechaty_p
512
514
  responseSerialize: grpc.serialize<wechaty_puppet_message_pb.MessagePreviewResponse>;
513
515
  responseDeserialize: grpc.deserialize<wechaty_puppet_message_pb.MessagePreviewResponse>;
514
516
  }
517
+ interface IPuppetService_IGetMessageBroadcastTarget extends grpc.MethodDefinition<wechaty_puppet_message_pb.GetMessageBroadcastTargetRequest, wechaty_puppet_message_pb.GetMessageBroadcastTargetResponse> {
518
+ path: "/wechaty.Puppet/GetMessageBroadcastTarget";
519
+ requestStream: false;
520
+ responseStream: false;
521
+ requestSerialize: grpc.serialize<wechaty_puppet_message_pb.GetMessageBroadcastTargetRequest>;
522
+ requestDeserialize: grpc.deserialize<wechaty_puppet_message_pb.GetMessageBroadcastTargetRequest>;
523
+ responseSerialize: grpc.serialize<wechaty_puppet_message_pb.GetMessageBroadcastTargetResponse>;
524
+ responseDeserialize: grpc.deserialize<wechaty_puppet_message_pb.GetMessageBroadcastTargetResponse>;
525
+ }
526
+ interface IPuppetService_ICreateMessageBroadcast extends grpc.MethodDefinition<wechaty_puppet_message_pb.CreateMessageBroadcastRequest, wechaty_puppet_message_pb.CreateMessageBroadcastResponse> {
527
+ path: "/wechaty.Puppet/CreateMessageBroadcast";
528
+ requestStream: false;
529
+ responseStream: false;
530
+ requestSerialize: grpc.serialize<wechaty_puppet_message_pb.CreateMessageBroadcastRequest>;
531
+ requestDeserialize: grpc.deserialize<wechaty_puppet_message_pb.CreateMessageBroadcastRequest>;
532
+ responseSerialize: grpc.serialize<wechaty_puppet_message_pb.CreateMessageBroadcastResponse>;
533
+ responseDeserialize: grpc.deserialize<wechaty_puppet_message_pb.CreateMessageBroadcastResponse>;
534
+ }
515
535
  interface IPuppetService_IRoomPayload extends grpc.MethodDefinition<wechaty_puppet_room_pb.RoomPayloadRequest, wechaty_puppet_room_pb.RoomPayloadResponse> {
516
536
  path: "/wechaty.Puppet/RoomPayload";
517
537
  requestStream: false;
@@ -894,6 +914,8 @@ export interface IPuppetServer extends grpc.UntypedServiceImplementation {
894
914
  messageSendLocation: grpc.handleUnaryCall<wechaty_puppet_message_pb.MessageSendLocationRequest, wechaty_puppet_message_pb.MessageSendLocationResponse>;
895
915
  messageSendChannel: grpc.handleUnaryCall<wechaty_puppet_message_pb.MessageSendChannelRequest, wechaty_puppet_message_pb.MessageSendChannelResponse>;
896
916
  messagePreview: grpc.handleUnaryCall<wechaty_puppet_message_pb.MessagePreviewRequest, wechaty_puppet_message_pb.MessagePreviewResponse>;
917
+ getMessageBroadcastTarget: grpc.handleUnaryCall<wechaty_puppet_message_pb.GetMessageBroadcastTargetRequest, wechaty_puppet_message_pb.GetMessageBroadcastTargetResponse>;
918
+ createMessageBroadcast: grpc.handleUnaryCall<wechaty_puppet_message_pb.CreateMessageBroadcastRequest, wechaty_puppet_message_pb.CreateMessageBroadcastResponse>;
897
919
  roomPayload: grpc.handleUnaryCall<wechaty_puppet_room_pb.RoomPayloadRequest, wechaty_puppet_room_pb.RoomPayloadResponse>;
898
920
  roomList: grpc.handleUnaryCall<wechaty_puppet_room_pb.RoomListRequest, wechaty_puppet_room_pb.RoomListResponse>;
899
921
  roomAdd: grpc.handleUnaryCall<wechaty_puppet_room_pb.RoomAddRequest, wechaty_puppet_room_pb.RoomAddResponse>;
@@ -1068,6 +1090,12 @@ export interface IPuppetClient {
1068
1090
  messagePreview(request: wechaty_puppet_message_pb.MessagePreviewRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessagePreviewResponse) => void): grpc.ClientUnaryCall;
1069
1091
  messagePreview(request: wechaty_puppet_message_pb.MessagePreviewRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessagePreviewResponse) => void): grpc.ClientUnaryCall;
1070
1092
  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;
1093
+ getMessageBroadcastTarget(request: wechaty_puppet_message_pb.GetMessageBroadcastTargetRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.GetMessageBroadcastTargetResponse) => void): grpc.ClientUnaryCall;
1094
+ getMessageBroadcastTarget(request: wechaty_puppet_message_pb.GetMessageBroadcastTargetRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.GetMessageBroadcastTargetResponse) => void): grpc.ClientUnaryCall;
1095
+ getMessageBroadcastTarget(request: wechaty_puppet_message_pb.GetMessageBroadcastTargetRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.GetMessageBroadcastTargetResponse) => void): grpc.ClientUnaryCall;
1096
+ createMessageBroadcast(request: wechaty_puppet_message_pb.CreateMessageBroadcastRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.CreateMessageBroadcastResponse) => void): grpc.ClientUnaryCall;
1097
+ 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
+ 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;
1071
1099
  roomPayload(request: wechaty_puppet_room_pb.RoomPayloadRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_room_pb.RoomPayloadResponse) => void): grpc.ClientUnaryCall;
1072
1100
  roomPayload(request: wechaty_puppet_room_pb.RoomPayloadRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_room_pb.RoomPayloadResponse) => void): grpc.ClientUnaryCall;
1073
1101
  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;
@@ -1317,6 +1345,12 @@ export class PuppetClient extends grpc.Client implements IPuppetClient {
1317
1345
  public messagePreview(request: wechaty_puppet_message_pb.MessagePreviewRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessagePreviewResponse) => void): grpc.ClientUnaryCall;
1318
1346
  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;
1319
1347
  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;
1348
+ public getMessageBroadcastTarget(request: wechaty_puppet_message_pb.GetMessageBroadcastTargetRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.GetMessageBroadcastTargetResponse) => void): grpc.ClientUnaryCall;
1349
+ public getMessageBroadcastTarget(request: wechaty_puppet_message_pb.GetMessageBroadcastTargetRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.GetMessageBroadcastTargetResponse) => void): grpc.ClientUnaryCall;
1350
+ public getMessageBroadcastTarget(request: wechaty_puppet_message_pb.GetMessageBroadcastTargetRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.GetMessageBroadcastTargetResponse) => void): grpc.ClientUnaryCall;
1351
+ public createMessageBroadcast(request: wechaty_puppet_message_pb.CreateMessageBroadcastRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.CreateMessageBroadcastResponse) => void): grpc.ClientUnaryCall;
1352
+ 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
+ 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;
1320
1354
  public roomPayload(request: wechaty_puppet_room_pb.RoomPayloadRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_room_pb.RoomPayloadResponse) => void): grpc.ClientUnaryCall;
1321
1355
  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;
1322
1356
  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;
@@ -317,6 +317,28 @@ function deserialize_wechaty_puppet_ConversationReadResponse(buffer_arg) {
317
317
  return wechaty_puppet_conversation_pb.ConversationReadResponse.deserializeBinary(new Uint8Array(buffer_arg));
318
318
  }
319
319
 
320
+ function serialize_wechaty_puppet_CreateMessageBroadcastRequest(arg) {
321
+ if (!(arg instanceof wechaty_puppet_message_pb.CreateMessageBroadcastRequest)) {
322
+ throw new Error('Expected argument of type wechaty.puppet.CreateMessageBroadcastRequest');
323
+ }
324
+ return Buffer.from(arg.serializeBinary());
325
+ }
326
+
327
+ function deserialize_wechaty_puppet_CreateMessageBroadcastRequest(buffer_arg) {
328
+ return wechaty_puppet_message_pb.CreateMessageBroadcastRequest.deserializeBinary(new Uint8Array(buffer_arg));
329
+ }
330
+
331
+ function serialize_wechaty_puppet_CreateMessageBroadcastResponse(arg) {
332
+ if (!(arg instanceof wechaty_puppet_message_pb.CreateMessageBroadcastResponse)) {
333
+ throw new Error('Expected argument of type wechaty.puppet.CreateMessageBroadcastResponse');
334
+ }
335
+ return Buffer.from(arg.serializeBinary());
336
+ }
337
+
338
+ function deserialize_wechaty_puppet_CreateMessageBroadcastResponse(buffer_arg) {
339
+ return wechaty_puppet_message_pb.CreateMessageBroadcastResponse.deserializeBinary(new Uint8Array(buffer_arg));
340
+ }
341
+
320
342
  function serialize_wechaty_puppet_CurrentUserRequest(arg) {
321
343
  if (!(arg instanceof wechaty_puppet_base_pb.CurrentUserRequest)) {
322
344
  throw new Error('Expected argument of type wechaty.puppet.CurrentUserRequest');
@@ -537,6 +559,28 @@ function deserialize_wechaty_puppet_FriendshipSearchPhoneResponse(buffer_arg) {
537
559
  return wechaty_puppet_friendship_pb.FriendshipSearchPhoneResponse.deserializeBinary(new Uint8Array(buffer_arg));
538
560
  }
539
561
 
562
+ function serialize_wechaty_puppet_GetMessageBroadcastTargetRequest(arg) {
563
+ if (!(arg instanceof wechaty_puppet_message_pb.GetMessageBroadcastTargetRequest)) {
564
+ throw new Error('Expected argument of type wechaty.puppet.GetMessageBroadcastTargetRequest');
565
+ }
566
+ return Buffer.from(arg.serializeBinary());
567
+ }
568
+
569
+ function deserialize_wechaty_puppet_GetMessageBroadcastTargetRequest(buffer_arg) {
570
+ return wechaty_puppet_message_pb.GetMessageBroadcastTargetRequest.deserializeBinary(new Uint8Array(buffer_arg));
571
+ }
572
+
573
+ function serialize_wechaty_puppet_GetMessageBroadcastTargetResponse(arg) {
574
+ if (!(arg instanceof wechaty_puppet_message_pb.GetMessageBroadcastTargetResponse)) {
575
+ throw new Error('Expected argument of type wechaty.puppet.GetMessageBroadcastTargetResponse');
576
+ }
577
+ return Buffer.from(arg.serializeBinary());
578
+ }
579
+
580
+ function deserialize_wechaty_puppet_GetMessageBroadcastTargetResponse(buffer_arg) {
581
+ return wechaty_puppet_message_pb.GetMessageBroadcastTargetResponse.deserializeBinary(new Uint8Array(buffer_arg));
582
+ }
583
+
540
584
  function serialize_wechaty_puppet_LogoutRequest(arg) {
541
585
  if (!(arg instanceof wechaty_puppet_base_pb.LogoutRequest)) {
542
586
  throw new Error('Expected argument of type wechaty.puppet.LogoutRequest');
@@ -2344,6 +2388,28 @@ messageFile: {
2344
2388
  responseSerialize: serialize_wechaty_puppet_MessagePreviewResponse,
2345
2389
  responseDeserialize: deserialize_wechaty_puppet_MessagePreviewResponse,
2346
2390
  },
2391
+ getMessageBroadcastTarget: {
2392
+ path: '/wechaty.Puppet/GetMessageBroadcastTarget',
2393
+ requestStream: false,
2394
+ responseStream: false,
2395
+ requestType: wechaty_puppet_message_pb.GetMessageBroadcastTargetRequest,
2396
+ responseType: wechaty_puppet_message_pb.GetMessageBroadcastTargetResponse,
2397
+ requestSerialize: serialize_wechaty_puppet_GetMessageBroadcastTargetRequest,
2398
+ requestDeserialize: deserialize_wechaty_puppet_GetMessageBroadcastTargetRequest,
2399
+ responseSerialize: serialize_wechaty_puppet_GetMessageBroadcastTargetResponse,
2400
+ responseDeserialize: deserialize_wechaty_puppet_GetMessageBroadcastTargetResponse,
2401
+ },
2402
+ createMessageBroadcast: {
2403
+ path: '/wechaty.Puppet/CreateMessageBroadcast',
2404
+ requestStream: false,
2405
+ responseStream: false,
2406
+ requestType: wechaty_puppet_message_pb.CreateMessageBroadcastRequest,
2407
+ responseType: wechaty_puppet_message_pb.CreateMessageBroadcastResponse,
2408
+ requestSerialize: serialize_wechaty_puppet_CreateMessageBroadcastRequest,
2409
+ requestDeserialize: deserialize_wechaty_puppet_CreateMessageBroadcastRequest,
2410
+ responseSerialize: serialize_wechaty_puppet_CreateMessageBroadcastResponse,
2411
+ responseDeserialize: deserialize_wechaty_puppet_CreateMessageBroadcastResponse,
2412
+ },
2347
2413
  // *
2348
2414
  //
2349
2415
  // Room
@@ -422,6 +422,24 @@ type PuppetMessagePreview = {
422
422
  readonly responseType: typeof wechaty_puppet_message_pb.MessagePreviewResponse;
423
423
  };
424
424
 
425
+ type PuppetGetMessageBroadcastTarget = {
426
+ readonly methodName: string;
427
+ readonly service: typeof Puppet;
428
+ readonly requestStream: false;
429
+ readonly responseStream: false;
430
+ readonly requestType: typeof wechaty_puppet_message_pb.GetMessageBroadcastTargetRequest;
431
+ readonly responseType: typeof wechaty_puppet_message_pb.GetMessageBroadcastTargetResponse;
432
+ };
433
+
434
+ type PuppetCreateMessageBroadcast = {
435
+ readonly methodName: string;
436
+ readonly service: typeof Puppet;
437
+ readonly requestStream: false;
438
+ readonly responseStream: false;
439
+ readonly requestType: typeof wechaty_puppet_message_pb.CreateMessageBroadcastRequest;
440
+ readonly responseType: typeof wechaty_puppet_message_pb.CreateMessageBroadcastResponse;
441
+ };
442
+
425
443
  type PuppetRoomPayload = {
426
444
  readonly methodName: string;
427
445
  readonly service: typeof Puppet;
@@ -802,6 +820,8 @@ export class Puppet {
802
820
  static readonly MessageSendLocation: PuppetMessageSendLocation;
803
821
  static readonly MessageSendChannel: PuppetMessageSendChannel;
804
822
  static readonly MessagePreview: PuppetMessagePreview;
823
+ static readonly GetMessageBroadcastTarget: PuppetGetMessageBroadcastTarget;
824
+ static readonly CreateMessageBroadcast: PuppetCreateMessageBroadcast;
805
825
  static readonly RoomPayload: PuppetRoomPayload;
806
826
  static readonly RoomList: PuppetRoomList;
807
827
  static readonly RoomAdd: PuppetRoomAdd;
@@ -1270,6 +1290,24 @@ export class PuppetClient {
1270
1290
  requestMessage: wechaty_puppet_message_pb.MessagePreviewRequest,
1271
1291
  callback: (error: ServiceError|null, responseMessage: wechaty_puppet_message_pb.MessagePreviewResponse|null) => void
1272
1292
  ): UnaryResponse;
1293
+ getMessageBroadcastTarget(
1294
+ requestMessage: wechaty_puppet_message_pb.GetMessageBroadcastTargetRequest,
1295
+ metadata: grpc.Metadata,
1296
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_message_pb.GetMessageBroadcastTargetResponse|null) => void
1297
+ ): UnaryResponse;
1298
+ getMessageBroadcastTarget(
1299
+ requestMessage: wechaty_puppet_message_pb.GetMessageBroadcastTargetRequest,
1300
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_message_pb.GetMessageBroadcastTargetResponse|null) => void
1301
+ ): UnaryResponse;
1302
+ createMessageBroadcast(
1303
+ requestMessage: wechaty_puppet_message_pb.CreateMessageBroadcastRequest,
1304
+ metadata: grpc.Metadata,
1305
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_message_pb.CreateMessageBroadcastResponse|null) => void
1306
+ ): UnaryResponse;
1307
+ createMessageBroadcast(
1308
+ requestMessage: wechaty_puppet_message_pb.CreateMessageBroadcastRequest,
1309
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_message_pb.CreateMessageBroadcastResponse|null) => void
1310
+ ): UnaryResponse;
1273
1311
  roomPayload(
1274
1312
  requestMessage: wechaty_puppet_room_pb.RoomPayloadRequest,
1275
1313
  metadata: grpc.Metadata,
@@ -428,6 +428,24 @@ Puppet.MessagePreview = {
428
428
  responseType: wechaty_puppet_message_pb.MessagePreviewResponse
429
429
  };
430
430
 
431
+ Puppet.GetMessageBroadcastTarget = {
432
+ methodName: "GetMessageBroadcastTarget",
433
+ service: Puppet,
434
+ requestStream: false,
435
+ responseStream: false,
436
+ requestType: wechaty_puppet_message_pb.GetMessageBroadcastTargetRequest,
437
+ responseType: wechaty_puppet_message_pb.GetMessageBroadcastTargetResponse
438
+ };
439
+
440
+ Puppet.CreateMessageBroadcast = {
441
+ methodName: "CreateMessageBroadcast",
442
+ service: Puppet,
443
+ requestStream: false,
444
+ responseStream: false,
445
+ requestType: wechaty_puppet_message_pb.CreateMessageBroadcastRequest,
446
+ responseType: wechaty_puppet_message_pb.CreateMessageBroadcastResponse
447
+ };
448
+
431
449
  Puppet.RoomPayload = {
432
450
  methodName: "RoomPayload",
433
451
  service: Puppet,
@@ -2171,6 +2189,68 @@ PuppetClient.prototype.messagePreview = function messagePreview(requestMessage,
2171
2189
  };
2172
2190
  };
2173
2191
 
2192
+ PuppetClient.prototype.getMessageBroadcastTarget = function getMessageBroadcastTarget(requestMessage, metadata, callback) {
2193
+ if (arguments.length === 2) {
2194
+ callback = arguments[1];
2195
+ }
2196
+ var client = grpc.unary(Puppet.GetMessageBroadcastTarget, {
2197
+ request: requestMessage,
2198
+ host: this.serviceHost,
2199
+ metadata: metadata,
2200
+ transport: this.options.transport,
2201
+ debug: this.options.debug,
2202
+ onEnd: function (response) {
2203
+ if (callback) {
2204
+ if (response.status !== grpc.Code.OK) {
2205
+ var err = new Error(response.statusMessage);
2206
+ err.code = response.status;
2207
+ err.metadata = response.trailers;
2208
+ callback(err, null);
2209
+ } else {
2210
+ callback(null, response.message);
2211
+ }
2212
+ }
2213
+ }
2214
+ });
2215
+ return {
2216
+ cancel: function () {
2217
+ callback = null;
2218
+ client.close();
2219
+ }
2220
+ };
2221
+ };
2222
+
2223
+ PuppetClient.prototype.createMessageBroadcast = function createMessageBroadcast(requestMessage, metadata, callback) {
2224
+ if (arguments.length === 2) {
2225
+ callback = arguments[1];
2226
+ }
2227
+ var client = grpc.unary(Puppet.CreateMessageBroadcast, {
2228
+ request: requestMessage,
2229
+ host: this.serviceHost,
2230
+ metadata: metadata,
2231
+ transport: this.options.transport,
2232
+ debug: this.options.debug,
2233
+ onEnd: function (response) {
2234
+ if (callback) {
2235
+ if (response.status !== grpc.Code.OK) {
2236
+ var err = new Error(response.statusMessage);
2237
+ err.code = response.status;
2238
+ err.metadata = response.trailers;
2239
+ callback(err, null);
2240
+ } else {
2241
+ callback(null, response.message);
2242
+ }
2243
+ }
2244
+ }
2245
+ });
2246
+ return {
2247
+ cancel: function () {
2248
+ callback = null;
2249
+ client.close();
2250
+ }
2251
+ };
2252
+ };
2253
+
2174
2254
  PuppetClient.prototype.roomPayload = function roomPayload(requestMessage, metadata, callback) {
2175
2255
  if (arguments.length === 2) {
2176
2256
  callback = arguments[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juzi/wechaty-grpc",
3
- "version": "1.0.43",
3
+ "version": "1.0.45",
4
4
  "description": "gRPC for Wechaty",
5
5
  "type": "module",
6
6
  "exports": {
@@ -75,7 +75,8 @@
75
75
  "request": "^2.88.2",
76
76
  "shx": "^0.3.3",
77
77
  "ts-protoc-gen": "^0.15.0",
78
- "tstest": "^0.7.3"
78
+ "tstest": "^0.7.3",
79
+ "esquery": "1.4.0"
79
80
  },
80
81
  "files": [
81
82
  "bin/",
@@ -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.43",
7
+ "version": "1.0.45",
8
8
  "description": "gRPC for Wechaty",
9
9
  "type": "module",
10
10
  "exports": {
@@ -79,7 +79,8 @@ export const packageJson: PackageJson = {
79
79
  "request": "^2.88.2",
80
80
  "shx": "^0.3.3",
81
81
  "ts-protoc-gen": "^0.15.0",
82
- "tstest": "^0.7.3"
82
+ "tstest": "^0.7.3",
83
+ "esquery": "1.4.0"
83
84
  },
84
85
  "files": [
85
86
  "bin/",