@juzi/wechaty-grpc 1.0.66 → 1.0.68

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 (67) hide show
  1. package/dist/cjs/commonjs/generated/puppet.cjs +1 -0
  2. package/dist/cjs/commonjs/generated/puppet.cjs.d.ts +1 -0
  3. package/dist/cjs/out/wechaty/puppet/call_pb.d.ts +3 -2
  4. package/dist/cjs/out/wechaty/puppet/call_pb.js +3 -2
  5. package/dist/cjs/out/wechaty/puppet/chat-history_grpc_pb.js +1 -0
  6. package/dist/cjs/out/wechaty/puppet/chat-history_pb.d.ts +121 -0
  7. package/dist/cjs/out/wechaty/puppet/chat-history_pb.js +839 -0
  8. package/dist/cjs/out/wechaty/puppet/chat-history_pb_service.d.ts +3 -0
  9. package/dist/cjs/out/wechaty/puppet/chat-history_pb_service.js +3 -0
  10. package/dist/cjs/out/wechaty/puppet/message_pb.d.ts +49 -0
  11. package/dist/cjs/out/wechaty/puppet/message_pb.js +394 -2
  12. package/dist/cjs/out/wechaty/puppet.openapi.yaml +103 -3
  13. package/dist/cjs/out/wechaty/puppet.swagger.json +139 -4
  14. package/dist/cjs/out/wechaty/puppet_grpc_pb.d.ts +17 -0
  15. package/dist/cjs/out/wechaty/puppet_grpc_pb.js +33 -0
  16. package/dist/cjs/out/wechaty/puppet_pb_service.d.ts +19 -0
  17. package/dist/cjs/out/wechaty/puppet_pb_service.js +40 -0
  18. package/dist/cjs/proto/wechaty/puppet/call.proto +3 -2
  19. package/dist/cjs/proto/wechaty/puppet/chat-history.proto +42 -0
  20. package/dist/cjs/proto/wechaty/puppet/message.proto +11 -1
  21. package/dist/cjs/proto/wechaty/puppet.proto +5 -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 +5 -0
  25. package/dist/cjs/tests/puppet-server-impl.js.map +1 -1
  26. package/dist/esm/commonjs/generated/puppet.cjs +1 -0
  27. package/dist/esm/commonjs/generated/puppet.cjs.d.ts +1 -0
  28. package/dist/esm/out/wechaty/puppet/call_pb.d.ts +3 -2
  29. package/dist/esm/out/wechaty/puppet/call_pb.js +3 -2
  30. package/dist/esm/out/wechaty/puppet/chat-history_grpc_pb.js +1 -0
  31. package/dist/esm/out/wechaty/puppet/chat-history_pb.d.ts +121 -0
  32. package/dist/esm/out/wechaty/puppet/chat-history_pb.js +839 -0
  33. package/dist/esm/out/wechaty/puppet/chat-history_pb_service.d.ts +3 -0
  34. package/dist/esm/out/wechaty/puppet/chat-history_pb_service.js +3 -0
  35. package/dist/esm/out/wechaty/puppet/message_pb.d.ts +49 -0
  36. package/dist/esm/out/wechaty/puppet/message_pb.js +394 -2
  37. package/dist/esm/out/wechaty/puppet.openapi.yaml +103 -3
  38. package/dist/esm/out/wechaty/puppet.swagger.json +139 -4
  39. package/dist/esm/out/wechaty/puppet_grpc_pb.d.ts +17 -0
  40. package/dist/esm/out/wechaty/puppet_grpc_pb.js +33 -0
  41. package/dist/esm/out/wechaty/puppet_pb_service.d.ts +19 -0
  42. package/dist/esm/out/wechaty/puppet_pb_service.js +40 -0
  43. package/dist/esm/proto/wechaty/puppet/call.proto +3 -2
  44. package/dist/esm/proto/wechaty/puppet/chat-history.proto +42 -0
  45. package/dist/esm/proto/wechaty/puppet/message.proto +11 -1
  46. package/dist/esm/proto/wechaty/puppet.proto +5 -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 +5 -0
  50. package/dist/esm/tests/puppet-server-impl.js.map +1 -1
  51. package/out/wechaty/puppet/call_pb.d.ts +3 -2
  52. package/out/wechaty/puppet/call_pb.js +3 -2
  53. package/out/wechaty/puppet/chat-history_grpc_pb.js +1 -0
  54. package/out/wechaty/puppet/chat-history_pb.d.ts +121 -0
  55. package/out/wechaty/puppet/chat-history_pb.js +839 -0
  56. package/out/wechaty/puppet/chat-history_pb_service.d.ts +3 -0
  57. package/out/wechaty/puppet/chat-history_pb_service.js +3 -0
  58. package/out/wechaty/puppet/message_pb.d.ts +49 -0
  59. package/out/wechaty/puppet/message_pb.js +394 -2
  60. package/out/wechaty/puppet.openapi.yaml +103 -3
  61. package/out/wechaty/puppet.swagger.json +139 -4
  62. package/out/wechaty/puppet_grpc_pb.d.ts +17 -0
  63. package/out/wechaty/puppet_grpc_pb.js +33 -0
  64. package/out/wechaty/puppet_pb_service.d.ts +19 -0
  65. package/out/wechaty/puppet_pb_service.js +40 -0
  66. package/package.json +1 -1
  67. package/src/package-json.ts +1 -1
@@ -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.66
12
+ version: 1.0.68
13
13
  contact:
14
14
  name: Wechaty
15
15
  url: https://github.com/wechaty/openapi
@@ -583,10 +583,21 @@ paths:
583
583
  required: true
584
584
  type: string
585
585
  - name: messageId
586
- description: 要转发的消息id
586
+ description: |-
587
+ @deprecated: use message_ids instead.
588
+
589
+ 要转发的消息id
587
590
  in: path
588
591
  required: true
589
592
  type: string
593
+ - name: messageIds
594
+ description: 要合并转发的消息id列表
595
+ in: query
596
+ required: false
597
+ type: array
598
+ items:
599
+ type: string
600
+ collectionFormat: multi
590
601
  tags:
591
602
  - Puppet
592
603
  /conversations/{conversationId}/location:
@@ -1152,6 +1163,25 @@ paths:
1152
1163
  type: string
1153
1164
  tags:
1154
1165
  - Puppet
1166
+ /message/{id}/chat-history:
1167
+ get:
1168
+ operationId: Puppet_MessageChatHistory
1169
+ responses:
1170
+ '200':
1171
+ description: A successful response.
1172
+ schema:
1173
+ $ref: '#/definitions/puppetMessageChatHistoryResponse'
1174
+ default:
1175
+ description: An unexpected error response.
1176
+ schema:
1177
+ $ref: '#/definitions/rpcStatus'
1178
+ parameters:
1179
+ - name: id
1180
+ in: path
1181
+ required: true
1182
+ type: string
1183
+ tags:
1184
+ - Puppet
1155
1185
  /message/{id}/contact:
1156
1186
  get:
1157
1187
  operationId: Puppet_MessageContact
@@ -1314,7 +1344,10 @@ paths:
1314
1344
  $ref: '#/definitions/rpcStatus'
1315
1345
  parameters:
1316
1346
  - name: messageId
1317
- description: 要转发的消息id
1347
+ description: |-
1348
+ @deprecated: use message_ids instead.
1349
+
1350
+ 要转发的消息id
1318
1351
  in: path
1319
1352
  required: true
1320
1353
  type: string
@@ -1323,6 +1356,14 @@ paths:
1323
1356
  in: path
1324
1357
  required: true
1325
1358
  type: string
1359
+ - name: messageIds
1360
+ description: 要合并转发的消息id列表
1361
+ in: query
1362
+ required: false
1363
+ type: array
1364
+ items:
1365
+ type: string
1366
+ collectionFormat: multi
1326
1367
  tags:
1327
1368
  - Puppet
1328
1369
  /moment/coverage:
@@ -2523,6 +2564,7 @@ definitions:
2523
2564
  - CALL_STATUS_UNKNOWN
2524
2565
  - CALL_STATUS_CANCELED
2525
2566
  - CALL_STATUS_REJECTED
2567
+ - CALL_STATUS_MISSED
2526
2568
  - CALL_STATUS_ONGOING
2527
2569
  - CALL_STATUS_ENDED
2528
2570
  default: CALL_STATUS_UNKNOWN
@@ -2530,6 +2572,7 @@ definitions:
2530
2572
  - CALL_STATUS_UNKNOWN: 不明确
2531
2573
  - CALL_STATUS_CANCELED: 自己取消
2532
2574
  - CALL_STATUS_REJECTED: 对方拒接
2575
+ - CALL_STATUS_MISSED: 正在通话
2533
2576
  - CALL_STATUS_ONGOING: 正在通话
2534
2577
  - CALL_STATUS_ENDED: 已结束
2535
2578
  title: 类型枚举
@@ -2586,6 +2629,55 @@ definitions:
2586
2629
  title: 视频号直播专属
2587
2630
  objectNonceId:
2588
2631
  type: string
2632
+ puppetChatHistoryContent:
2633
+ type: object
2634
+ properties:
2635
+ type:
2636
+ $ref: '#/definitions/puppetChatHistoryContentType'
2637
+ text:
2638
+ type: string
2639
+ fileBox:
2640
+ type: string
2641
+ location:
2642
+ $ref: '#/definitions/puppetLocationPayload'
2643
+ urlLink:
2644
+ $ref: '#/definitions/puppetUrlLinkPayload'
2645
+ miniProgram:
2646
+ $ref: '#/definitions/puppetMiniProgramPayload'
2647
+ channel:
2648
+ $ref: '#/definitions/puppetChannelPayload'
2649
+ chatHistory:
2650
+ type: array
2651
+ items:
2652
+ type: object
2653
+ $ref: '#/definitions/puppetChatHistoryPayload'
2654
+ puppetChatHistoryContentType:
2655
+ type: string
2656
+ enum:
2657
+ - TEXT
2658
+ - FILE
2659
+ - LOCATION
2660
+ - URL
2661
+ - MINI_PROGRAM
2662
+ - CHANNEL
2663
+ - CHAT_HISTORY
2664
+ default: TEXT
2665
+ puppetChatHistoryPayload:
2666
+ type: object
2667
+ properties:
2668
+ type:
2669
+ type: integer
2670
+ format: int32
2671
+ avatar:
2672
+ type: string
2673
+ senderName:
2674
+ type: string
2675
+ corpName:
2676
+ type: string
2677
+ time:
2678
+ type: string
2679
+ message:
2680
+ $ref: '#/definitions/puppetChatHistoryContent'
2589
2681
  puppetContactAliasResponse:
2590
2682
  type: object
2591
2683
  properties:
@@ -3005,6 +3097,14 @@ definitions:
3005
3097
  properties:
3006
3098
  channel:
3007
3099
  $ref: '#/definitions/puppetChannelPayload'
3100
+ puppetMessageChatHistoryResponse:
3101
+ type: object
3102
+ properties:
3103
+ chatHistoryList:
3104
+ type: array
3105
+ items:
3106
+ type: object
3107
+ $ref: '#/definitions/puppetChatHistoryPayload'
3008
3108
  puppetMessageContactResponse:
3009
3109
  type: object
3010
3110
  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.66",
6
+ "version": "1.0.68",
7
7
  "contact": {
8
8
  "name": "Wechaty",
9
9
  "url": "https://github.com/wechaty/openapi",
@@ -867,10 +867,21 @@
867
867
  },
868
868
  {
869
869
  "name": "messageId",
870
- "description": "要转发的消息id",
870
+ "description": "@deprecated: use message_ids instead.\n\n要转发的消息id",
871
871
  "in": "path",
872
872
  "required": true,
873
873
  "type": "string"
874
+ },
875
+ {
876
+ "name": "messageIds",
877
+ "description": "要合并转发的消息id列表",
878
+ "in": "query",
879
+ "required": false,
880
+ "type": "array",
881
+ "items": {
882
+ "type": "string"
883
+ },
884
+ "collectionFormat": "multi"
874
885
  }
875
886
  ],
876
887
  "tags": [
@@ -1692,6 +1703,36 @@
1692
1703
  ]
1693
1704
  }
1694
1705
  },
1706
+ "/message/{id}/chat-history": {
1707
+ "get": {
1708
+ "operationId": "Puppet_MessageChatHistory",
1709
+ "responses": {
1710
+ "200": {
1711
+ "description": "A successful response.",
1712
+ "schema": {
1713
+ "$ref": "#/definitions/puppetMessageChatHistoryResponse"
1714
+ }
1715
+ },
1716
+ "default": {
1717
+ "description": "An unexpected error response.",
1718
+ "schema": {
1719
+ "$ref": "#/definitions/rpcStatus"
1720
+ }
1721
+ }
1722
+ },
1723
+ "parameters": [
1724
+ {
1725
+ "name": "id",
1726
+ "in": "path",
1727
+ "required": true,
1728
+ "type": "string"
1729
+ }
1730
+ ],
1731
+ "tags": [
1732
+ "Puppet"
1733
+ ]
1734
+ }
1735
+ },
1695
1736
  "/message/{id}/contact": {
1696
1737
  "get": {
1697
1738
  "operationId": "Puppet_MessageContact",
@@ -1940,7 +1981,7 @@
1940
1981
  "parameters": [
1941
1982
  {
1942
1983
  "name": "messageId",
1943
- "description": "要转发的消息id",
1984
+ "description": "@deprecated: use message_ids instead.\n\n要转发的消息id",
1944
1985
  "in": "path",
1945
1986
  "required": true,
1946
1987
  "type": "string"
@@ -1951,6 +1992,17 @@
1951
1992
  "in": "path",
1952
1993
  "required": true,
1953
1994
  "type": "string"
1995
+ },
1996
+ {
1997
+ "name": "messageIds",
1998
+ "description": "要合并转发的消息id列表",
1999
+ "in": "query",
2000
+ "required": false,
2001
+ "type": "array",
2002
+ "items": {
2003
+ "type": "string"
2004
+ },
2005
+ "collectionFormat": "multi"
1954
2006
  }
1955
2007
  ],
1956
2008
  "tags": [
@@ -3767,11 +3819,12 @@
3767
3819
  "CALL_STATUS_UNKNOWN",
3768
3820
  "CALL_STATUS_CANCELED",
3769
3821
  "CALL_STATUS_REJECTED",
3822
+ "CALL_STATUS_MISSED",
3770
3823
  "CALL_STATUS_ONGOING",
3771
3824
  "CALL_STATUS_ENDED"
3772
3825
  ],
3773
3826
  "default": "CALL_STATUS_UNKNOWN",
3774
- "description": "- CALL_STATUS_UNKNOWN: 不明确\n - CALL_STATUS_CANCELED: 自己取消\n - CALL_STATUS_REJECTED: 对方拒接\n - CALL_STATUS_ONGOING: 正在通话\n - CALL_STATUS_ENDED: 已结束",
3827
+ "description": "- CALL_STATUS_UNKNOWN: 不明确\n - CALL_STATUS_CANCELED: 自己取消\n - CALL_STATUS_REJECTED: 对方拒接\n - CALL_STATUS_MISSED: 正在通话\n - CALL_STATUS_ONGOING: 正在通话\n - CALL_STATUS_ENDED: 已结束",
3775
3828
  "title": "类型枚举"
3776
3829
  },
3777
3830
  "puppetCallType": {
@@ -3841,6 +3894,76 @@
3841
3894
  }
3842
3895
  }
3843
3896
  },
3897
+ "puppetChatHistoryContent": {
3898
+ "type": "object",
3899
+ "properties": {
3900
+ "type": {
3901
+ "$ref": "#/definitions/puppetChatHistoryContentType"
3902
+ },
3903
+ "text": {
3904
+ "type": "string"
3905
+ },
3906
+ "fileBox": {
3907
+ "type": "string"
3908
+ },
3909
+ "location": {
3910
+ "$ref": "#/definitions/puppetLocationPayload"
3911
+ },
3912
+ "urlLink": {
3913
+ "$ref": "#/definitions/puppetUrlLinkPayload"
3914
+ },
3915
+ "miniProgram": {
3916
+ "$ref": "#/definitions/puppetMiniProgramPayload"
3917
+ },
3918
+ "channel": {
3919
+ "$ref": "#/definitions/puppetChannelPayload"
3920
+ },
3921
+ "chatHistory": {
3922
+ "type": "array",
3923
+ "items": {
3924
+ "type": "object",
3925
+ "$ref": "#/definitions/puppetChatHistoryPayload"
3926
+ }
3927
+ }
3928
+ }
3929
+ },
3930
+ "puppetChatHistoryContentType": {
3931
+ "type": "string",
3932
+ "enum": [
3933
+ "TEXT",
3934
+ "FILE",
3935
+ "LOCATION",
3936
+ "URL",
3937
+ "MINI_PROGRAM",
3938
+ "CHANNEL",
3939
+ "CHAT_HISTORY"
3940
+ ],
3941
+ "default": "TEXT"
3942
+ },
3943
+ "puppetChatHistoryPayload": {
3944
+ "type": "object",
3945
+ "properties": {
3946
+ "type": {
3947
+ "type": "integer",
3948
+ "format": "int32"
3949
+ },
3950
+ "avatar": {
3951
+ "type": "string"
3952
+ },
3953
+ "senderName": {
3954
+ "type": "string"
3955
+ },
3956
+ "corpName": {
3957
+ "type": "string"
3958
+ },
3959
+ "time": {
3960
+ "type": "string"
3961
+ },
3962
+ "message": {
3963
+ "$ref": "#/definitions/puppetChatHistoryContent"
3964
+ }
3965
+ }
3966
+ },
3844
3967
  "puppetContactAliasResponse": {
3845
3968
  "type": "object",
3846
3969
  "properties": {
@@ -4345,6 +4468,18 @@
4345
4468
  }
4346
4469
  }
4347
4470
  },
4471
+ "puppetMessageChatHistoryResponse": {
4472
+ "type": "object",
4473
+ "properties": {
4474
+ "chatHistoryList": {
4475
+ "type": "array",
4476
+ "items": {
4477
+ "type": "object",
4478
+ "$ref": "#/definitions/puppetChatHistoryPayload"
4479
+ }
4480
+ }
4481
+ }
4482
+ },
4348
4483
  "puppetMessageContactResponse": {
4349
4484
  "type": "object",
4350
4485
  "properties": {
@@ -63,6 +63,7 @@ interface IPuppetService extends grpc.ServiceDefinition<grpc.UntypedServiceImple
63
63
  messageUrl: IPuppetService_IMessageUrl;
64
64
  messageChannel: IPuppetService_IMessageChannel;
65
65
  messageCallRecord: IPuppetService_IMessageCallRecord;
66
+ messageChatHistory: IPuppetService_IMessageChatHistory;
66
67
  messageRecall: IPuppetService_IMessageRecall;
67
68
  messageForward: IPuppetService_IMessageForward;
68
69
  messageLocation: IPuppetService_IMessageLocation;
@@ -480,6 +481,15 @@ interface IPuppetService_IMessageCallRecord extends grpc.MethodDefinition<wechat
480
481
  responseSerialize: grpc.serialize<wechaty_puppet_message_pb.MessageCallRecordResponse>;
481
482
  responseDeserialize: grpc.deserialize<wechaty_puppet_message_pb.MessageCallRecordResponse>;
482
483
  }
484
+ interface IPuppetService_IMessageChatHistory extends grpc.MethodDefinition<wechaty_puppet_message_pb.MessageChatHistoryRequest, wechaty_puppet_message_pb.MessageChatHistoryResponse> {
485
+ path: "/wechaty.Puppet/MessageChatHistory";
486
+ requestStream: false;
487
+ responseStream: false;
488
+ requestSerialize: grpc.serialize<wechaty_puppet_message_pb.MessageChatHistoryRequest>;
489
+ requestDeserialize: grpc.deserialize<wechaty_puppet_message_pb.MessageChatHistoryRequest>;
490
+ responseSerialize: grpc.serialize<wechaty_puppet_message_pb.MessageChatHistoryResponse>;
491
+ responseDeserialize: grpc.deserialize<wechaty_puppet_message_pb.MessageChatHistoryResponse>;
492
+ }
483
493
  interface IPuppetService_IMessageRecall extends grpc.MethodDefinition<wechaty_puppet_message_pb.MessageRecallRequest, wechaty_puppet_message_pb.MessageRecallResponse> {
484
494
  path: "/wechaty.Puppet/MessageRecall";
485
495
  requestStream: false;
@@ -1019,6 +1029,7 @@ export interface IPuppetServer extends grpc.UntypedServiceImplementation {
1019
1029
  messageUrl: grpc.handleUnaryCall<wechaty_puppet_message_pb.MessageUrlRequest, wechaty_puppet_message_pb.MessageUrlResponse>;
1020
1030
  messageChannel: grpc.handleUnaryCall<wechaty_puppet_message_pb.MessageChannelRequest, wechaty_puppet_message_pb.MessageChannelResponse>;
1021
1031
  messageCallRecord: grpc.handleUnaryCall<wechaty_puppet_message_pb.MessageCallRecordRequest, wechaty_puppet_message_pb.MessageCallRecordResponse>;
1032
+ messageChatHistory: grpc.handleUnaryCall<wechaty_puppet_message_pb.MessageChatHistoryRequest, wechaty_puppet_message_pb.MessageChatHistoryResponse>;
1022
1033
  messageRecall: grpc.handleUnaryCall<wechaty_puppet_message_pb.MessageRecallRequest, wechaty_puppet_message_pb.MessageRecallResponse>;
1023
1034
  messageForward: grpc.handleUnaryCall<wechaty_puppet_message_pb.MessageForwardRequest, wechaty_puppet_message_pb.MessageForwardResponse>;
1024
1035
  messageLocation: grpc.handleUnaryCall<wechaty_puppet_message_pb.MessageLocationRequest, wechaty_puppet_message_pb.MessageLocationResponse>;
@@ -1196,6 +1207,9 @@ export interface IPuppetClient {
1196
1207
  messageCallRecord(request: wechaty_puppet_message_pb.MessageCallRecordRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageCallRecordResponse) => void): grpc.ClientUnaryCall;
1197
1208
  messageCallRecord(request: wechaty_puppet_message_pb.MessageCallRecordRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageCallRecordResponse) => void): grpc.ClientUnaryCall;
1198
1209
  messageCallRecord(request: wechaty_puppet_message_pb.MessageCallRecordRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageCallRecordResponse) => void): grpc.ClientUnaryCall;
1210
+ messageChatHistory(request: wechaty_puppet_message_pb.MessageChatHistoryRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageChatHistoryResponse) => void): grpc.ClientUnaryCall;
1211
+ messageChatHistory(request: wechaty_puppet_message_pb.MessageChatHistoryRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageChatHistoryResponse) => void): grpc.ClientUnaryCall;
1212
+ messageChatHistory(request: wechaty_puppet_message_pb.MessageChatHistoryRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageChatHistoryResponse) => void): grpc.ClientUnaryCall;
1199
1213
  messageRecall(request: wechaty_puppet_message_pb.MessageRecallRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageRecallResponse) => void): grpc.ClientUnaryCall;
1200
1214
  messageRecall(request: wechaty_puppet_message_pb.MessageRecallRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageRecallResponse) => void): grpc.ClientUnaryCall;
1201
1215
  messageRecall(request: wechaty_puppet_message_pb.MessageRecallRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageRecallResponse) => void): grpc.ClientUnaryCall;
@@ -1484,6 +1498,9 @@ export class PuppetClient extends grpc.Client implements IPuppetClient {
1484
1498
  public messageCallRecord(request: wechaty_puppet_message_pb.MessageCallRecordRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageCallRecordResponse) => void): grpc.ClientUnaryCall;
1485
1499
  public messageCallRecord(request: wechaty_puppet_message_pb.MessageCallRecordRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageCallRecordResponse) => void): grpc.ClientUnaryCall;
1486
1500
  public messageCallRecord(request: wechaty_puppet_message_pb.MessageCallRecordRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageCallRecordResponse) => void): grpc.ClientUnaryCall;
1501
+ public messageChatHistory(request: wechaty_puppet_message_pb.MessageChatHistoryRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageChatHistoryResponse) => void): grpc.ClientUnaryCall;
1502
+ public messageChatHistory(request: wechaty_puppet_message_pb.MessageChatHistoryRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageChatHistoryResponse) => void): grpc.ClientUnaryCall;
1503
+ public messageChatHistory(request: wechaty_puppet_message_pb.MessageChatHistoryRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageChatHistoryResponse) => void): grpc.ClientUnaryCall;
1487
1504
  public messageRecall(request: wechaty_puppet_message_pb.MessageRecallRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageRecallResponse) => void): grpc.ClientUnaryCall;
1488
1505
  public messageRecall(request: wechaty_puppet_message_pb.MessageRecallRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageRecallResponse) => void): grpc.ClientUnaryCall;
1489
1506
  public messageRecall(request: wechaty_puppet_message_pb.MessageRecallRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_message_pb.MessageRecallResponse) => void): grpc.ClientUnaryCall;
@@ -735,6 +735,28 @@ function deserialize_wechaty_puppet_MessageChannelResponse(buffer_arg) {
735
735
  return wechaty_puppet_message_pb.MessageChannelResponse.deserializeBinary(new Uint8Array(buffer_arg));
736
736
  }
737
737
 
738
+ function serialize_wechaty_puppet_MessageChatHistoryRequest(arg) {
739
+ if (!(arg instanceof wechaty_puppet_message_pb.MessageChatHistoryRequest)) {
740
+ throw new Error('Expected argument of type wechaty.puppet.MessageChatHistoryRequest');
741
+ }
742
+ return Buffer.from(arg.serializeBinary());
743
+ }
744
+
745
+ function deserialize_wechaty_puppet_MessageChatHistoryRequest(buffer_arg) {
746
+ return wechaty_puppet_message_pb.MessageChatHistoryRequest.deserializeBinary(new Uint8Array(buffer_arg));
747
+ }
748
+
749
+ function serialize_wechaty_puppet_MessageChatHistoryResponse(arg) {
750
+ if (!(arg instanceof wechaty_puppet_message_pb.MessageChatHistoryResponse)) {
751
+ throw new Error('Expected argument of type wechaty.puppet.MessageChatHistoryResponse');
752
+ }
753
+ return Buffer.from(arg.serializeBinary());
754
+ }
755
+
756
+ function deserialize_wechaty_puppet_MessageChatHistoryResponse(buffer_arg) {
757
+ return wechaty_puppet_message_pb.MessageChatHistoryResponse.deserializeBinary(new Uint8Array(buffer_arg));
758
+ }
759
+
738
760
  function serialize_wechaty_puppet_MessageContactRequest(arg) {
739
761
  if (!(arg instanceof wechaty_puppet_message_pb.MessageContactRequest)) {
740
762
  throw new Error('Expected argument of type wechaty.puppet.MessageContactRequest');
@@ -2542,6 +2564,17 @@ messageFile: {
2542
2564
  responseSerialize: serialize_wechaty_puppet_MessageCallRecordResponse,
2543
2565
  responseDeserialize: deserialize_wechaty_puppet_MessageCallRecordResponse,
2544
2566
  },
2567
+ messageChatHistory: {
2568
+ path: '/wechaty.Puppet/MessageChatHistory',
2569
+ requestStream: false,
2570
+ responseStream: false,
2571
+ requestType: wechaty_puppet_message_pb.MessageChatHistoryRequest,
2572
+ responseType: wechaty_puppet_message_pb.MessageChatHistoryResponse,
2573
+ requestSerialize: serialize_wechaty_puppet_MessageChatHistoryRequest,
2574
+ requestDeserialize: deserialize_wechaty_puppet_MessageChatHistoryRequest,
2575
+ responseSerialize: serialize_wechaty_puppet_MessageChatHistoryResponse,
2576
+ responseDeserialize: deserialize_wechaty_puppet_MessageChatHistoryResponse,
2577
+ },
2545
2578
  messageRecall: {
2546
2579
  path: '/wechaty.Puppet/MessageRecall',
2547
2580
  requestStream: false,
@@ -378,6 +378,15 @@ type PuppetMessageCallRecord = {
378
378
  readonly responseType: typeof wechaty_puppet_message_pb.MessageCallRecordResponse;
379
379
  };
380
380
 
381
+ type PuppetMessageChatHistory = {
382
+ readonly methodName: string;
383
+ readonly service: typeof Puppet;
384
+ readonly requestStream: false;
385
+ readonly responseStream: false;
386
+ readonly requestType: typeof wechaty_puppet_message_pb.MessageChatHistoryRequest;
387
+ readonly responseType: typeof wechaty_puppet_message_pb.MessageChatHistoryResponse;
388
+ };
389
+
381
390
  type PuppetMessageRecall = {
382
391
  readonly methodName: string;
383
392
  readonly service: typeof Puppet;
@@ -915,6 +924,7 @@ export class Puppet {
915
924
  static readonly MessageUrl: PuppetMessageUrl;
916
925
  static readonly MessageChannel: PuppetMessageChannel;
917
926
  static readonly MessageCallRecord: PuppetMessageCallRecord;
927
+ static readonly MessageChatHistory: PuppetMessageChatHistory;
918
928
  static readonly MessageRecall: PuppetMessageRecall;
919
929
  static readonly MessageForward: PuppetMessageForward;
920
930
  static readonly MessageLocation: PuppetMessageLocation;
@@ -1356,6 +1366,15 @@ export class PuppetClient {
1356
1366
  requestMessage: wechaty_puppet_message_pb.MessageCallRecordRequest,
1357
1367
  callback: (error: ServiceError|null, responseMessage: wechaty_puppet_message_pb.MessageCallRecordResponse|null) => void
1358
1368
  ): UnaryResponse;
1369
+ messageChatHistory(
1370
+ requestMessage: wechaty_puppet_message_pb.MessageChatHistoryRequest,
1371
+ metadata: grpc.Metadata,
1372
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_message_pb.MessageChatHistoryResponse|null) => void
1373
+ ): UnaryResponse;
1374
+ messageChatHistory(
1375
+ requestMessage: wechaty_puppet_message_pb.MessageChatHistoryRequest,
1376
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_message_pb.MessageChatHistoryResponse|null) => void
1377
+ ): UnaryResponse;
1359
1378
  messageRecall(
1360
1379
  requestMessage: wechaty_puppet_message_pb.MessageRecallRequest,
1361
1380
  metadata: grpc.Metadata,
@@ -384,6 +384,15 @@ Puppet.MessageCallRecord = {
384
384
  responseType: wechaty_puppet_message_pb.MessageCallRecordResponse
385
385
  };
386
386
 
387
+ Puppet.MessageChatHistory = {
388
+ methodName: "MessageChatHistory",
389
+ service: Puppet,
390
+ requestStream: false,
391
+ responseStream: false,
392
+ requestType: wechaty_puppet_message_pb.MessageChatHistoryRequest,
393
+ responseType: wechaty_puppet_message_pb.MessageChatHistoryResponse
394
+ };
395
+
387
396
  Puppet.MessageRecall = {
388
397
  methodName: "MessageRecall",
389
398
  service: Puppet,
@@ -2134,6 +2143,37 @@ PuppetClient.prototype.messageCallRecord = function messageCallRecord(requestMes
2134
2143
  };
2135
2144
  };
2136
2145
 
2146
+ PuppetClient.prototype.messageChatHistory = function messageChatHistory(requestMessage, metadata, callback) {
2147
+ if (arguments.length === 2) {
2148
+ callback = arguments[1];
2149
+ }
2150
+ var client = grpc.unary(Puppet.MessageChatHistory, {
2151
+ request: requestMessage,
2152
+ host: this.serviceHost,
2153
+ metadata: metadata,
2154
+ transport: this.options.transport,
2155
+ debug: this.options.debug,
2156
+ onEnd: function (response) {
2157
+ if (callback) {
2158
+ if (response.status !== grpc.Code.OK) {
2159
+ var err = new Error(response.statusMessage);
2160
+ err.code = response.status;
2161
+ err.metadata = response.trailers;
2162
+ callback(err, null);
2163
+ } else {
2164
+ callback(null, response.message);
2165
+ }
2166
+ }
2167
+ }
2168
+ });
2169
+ return {
2170
+ cancel: function () {
2171
+ callback = null;
2172
+ client.close();
2173
+ }
2174
+ };
2175
+ };
2176
+
2137
2177
  PuppetClient.prototype.messageRecall = function messageRecall(requestMessage, metadata, callback) {
2138
2178
  if (arguments.length === 2) {
2139
2179
  callback = arguments[1];
@@ -15,8 +15,9 @@ enum CallStatus { // 类型枚举
15
15
  CALL_STATUS_UNKNOWN = 0; // 不明确
16
16
  CALL_STATUS_CANCELED = 1; // 自己取消
17
17
  CALL_STATUS_REJECTED = 2; // 对方拒接
18
- CALL_STATUS_ONGOING = 3; // 正在通话
19
- CALL_STATUS_ENDED = 4; // 已结束
18
+ CALL_STATUS_MISSED = 3; // 正在通话
19
+ CALL_STATUS_ONGOING = 4; // 正在通话
20
+ CALL_STATUS_ENDED = 5; // 已结束
20
21
  }
21
22
 
22
23
  message CallRecordPayload {
@@ -0,0 +1,42 @@
1
+ syntax = "proto3";
2
+ package wechaty.puppet;
3
+
4
+ option go_package = "github.com/wechaty/go-grpc/wechaty/puppet";
5
+ option java_package = "io.github.wechaty.grpc.puppet";
6
+ option csharp_namespace = "github.wechaty.grpc.puppet";
7
+
8
+ import "wechaty/puppet/location.proto";
9
+ import "wechaty/puppet/mini-program.proto";
10
+ import "wechaty/puppet/url-link.proto";
11
+ import "wechaty/puppet/channel.proto";
12
+
13
+ enum ChatHistoryContentType {
14
+ TEXT = 0;
15
+ FILE = 1;
16
+ LOCATION = 2;
17
+ URL = 3;
18
+ MINI_PROGRAM = 4;
19
+ CHANNEL = 5;
20
+ CHAT_HISTORY = 6;
21
+ }
22
+
23
+ message ChatHistoryContent {
24
+ ChatHistoryContentType type = 1;
25
+ string text = 2;
26
+ string file_box = 3;
27
+ LocationPayload location = 4;
28
+ UrlLinkPayload url_link = 5;
29
+ MiniProgramPayload mini_program = 6;
30
+ ChannelPayload channel = 7;
31
+ repeated ChatHistoryPayload chat_history = 8;
32
+ }
33
+
34
+
35
+ message ChatHistoryPayload {
36
+ int32 type = 1;
37
+ string avatar = 2;
38
+ string sender_name = 3;
39
+ string corp_name = 4;
40
+ string time = 5;
41
+ ChatHistoryContent message = 6;
42
+ }
@@ -21,6 +21,7 @@ import "wechaty/puppet/url-link.proto";
21
21
  import "wechaty/puppet/channel.proto";
22
22
  import "wechaty/puppet/post.proto";
23
23
  import "wechaty/puppet/call.proto";
24
+ import "wechaty/puppet/chat-history.proto";
24
25
 
25
26
 
26
27
  enum MessageType { // 消息类型
@@ -131,6 +132,13 @@ message MessageCallRecordResponse {
131
132
  CallRecordPayload call_record = 1;
132
133
  }
133
134
 
135
+ message MessageChatHistoryRequest {
136
+ string id = 1;
137
+ }
138
+ message MessageChatHistoryResponse {
139
+ repeated ChatHistoryPayload chat_history_list = 1;
140
+ }
141
+
134
142
 
135
143
  message MessageSendContactRequest {
136
144
  string conversation_id = 1;
@@ -221,8 +229,10 @@ message MessageRecallResponse {
221
229
  bool success = 1;
222
230
  }
223
231
  message MessageForwardRequest{
224
- string message_id = 1; // 要转发的消息id
232
+ // @deprecated: use message_ids instead.
233
+ string message_id = 1 [deprecated = true]; // 要转发的消息id
225
234
  string conversation_id = 2; // 对话id
235
+ repeated string message_ids = 3; // 要合并转发的消息id列表
226
236
  }
227
237
  message MessageForwardResponse {
228
238
  /**
@@ -363,6 +363,11 @@ service Puppet {
363
363
  get: "/message/{id}/call-record"
364
364
  };
365
365
  }
366
+ rpc MessageChatHistory (puppet.MessageChatHistoryRequest) returns (puppet.MessageChatHistoryResponse) {
367
+ option (google.api.http) = {
368
+ get: "/message/{id}/chat-history"
369
+ };
370
+ }
366
371
  rpc MessageRecall (puppet.MessageRecallRequest) returns (puppet.MessageRecallResponse) {
367
372
  option (google.api.http) = {
368
373
  put: "/message/{id}/recall"
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.packageJson = void 0;
4
4
  exports.packageJson = {
5
5
  "name": "@juzi/wechaty-grpc",
6
- "version": "1.0.66",
6
+ "version": "1.0.68",
7
7
  "description": "gRPC for Wechaty",
8
8
  "type": "module",
9
9
  "exports": {