@juzi/wechaty-grpc 1.0.67 → 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 (59) 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/chat-history_grpc_pb.js +1 -0
  4. package/dist/cjs/out/wechaty/puppet/chat-history_pb.d.ts +121 -0
  5. package/dist/cjs/out/wechaty/puppet/chat-history_pb.js +839 -0
  6. package/dist/cjs/out/wechaty/puppet/chat-history_pb_service.d.ts +3 -0
  7. package/dist/cjs/out/wechaty/puppet/chat-history_pb_service.js +3 -0
  8. package/dist/cjs/out/wechaty/puppet/message_pb.d.ts +49 -0
  9. package/dist/cjs/out/wechaty/puppet/message_pb.js +394 -2
  10. package/dist/cjs/out/wechaty/puppet.openapi.yaml +101 -3
  11. package/dist/cjs/out/wechaty/puppet.swagger.json +137 -3
  12. package/dist/cjs/out/wechaty/puppet_grpc_pb.d.ts +17 -0
  13. package/dist/cjs/out/wechaty/puppet_grpc_pb.js +33 -0
  14. package/dist/cjs/out/wechaty/puppet_pb_service.d.ts +19 -0
  15. package/dist/cjs/out/wechaty/puppet_pb_service.js +40 -0
  16. package/dist/cjs/proto/wechaty/puppet/chat-history.proto +42 -0
  17. package/dist/cjs/proto/wechaty/puppet/message.proto +11 -1
  18. package/dist/cjs/proto/wechaty/puppet.proto +5 -0
  19. package/dist/cjs/src/package-json.js +1 -1
  20. package/dist/cjs/tests/puppet-server-impl.d.ts.map +1 -1
  21. package/dist/cjs/tests/puppet-server-impl.js +5 -0
  22. package/dist/cjs/tests/puppet-server-impl.js.map +1 -1
  23. package/dist/esm/commonjs/generated/puppet.cjs +1 -0
  24. package/dist/esm/commonjs/generated/puppet.cjs.d.ts +1 -0
  25. package/dist/esm/out/wechaty/puppet/chat-history_grpc_pb.js +1 -0
  26. package/dist/esm/out/wechaty/puppet/chat-history_pb.d.ts +121 -0
  27. package/dist/esm/out/wechaty/puppet/chat-history_pb.js +839 -0
  28. package/dist/esm/out/wechaty/puppet/chat-history_pb_service.d.ts +3 -0
  29. package/dist/esm/out/wechaty/puppet/chat-history_pb_service.js +3 -0
  30. package/dist/esm/out/wechaty/puppet/message_pb.d.ts +49 -0
  31. package/dist/esm/out/wechaty/puppet/message_pb.js +394 -2
  32. package/dist/esm/out/wechaty/puppet.openapi.yaml +101 -3
  33. package/dist/esm/out/wechaty/puppet.swagger.json +137 -3
  34. package/dist/esm/out/wechaty/puppet_grpc_pb.d.ts +17 -0
  35. package/dist/esm/out/wechaty/puppet_grpc_pb.js +33 -0
  36. package/dist/esm/out/wechaty/puppet_pb_service.d.ts +19 -0
  37. package/dist/esm/out/wechaty/puppet_pb_service.js +40 -0
  38. package/dist/esm/proto/wechaty/puppet/chat-history.proto +42 -0
  39. package/dist/esm/proto/wechaty/puppet/message.proto +11 -1
  40. package/dist/esm/proto/wechaty/puppet.proto +5 -0
  41. package/dist/esm/src/package-json.js +1 -1
  42. package/dist/esm/tests/puppet-server-impl.d.ts.map +1 -1
  43. package/dist/esm/tests/puppet-server-impl.js +5 -0
  44. package/dist/esm/tests/puppet-server-impl.js.map +1 -1
  45. package/out/wechaty/puppet/chat-history_grpc_pb.js +1 -0
  46. package/out/wechaty/puppet/chat-history_pb.d.ts +121 -0
  47. package/out/wechaty/puppet/chat-history_pb.js +839 -0
  48. package/out/wechaty/puppet/chat-history_pb_service.d.ts +3 -0
  49. package/out/wechaty/puppet/chat-history_pb_service.js +3 -0
  50. package/out/wechaty/puppet/message_pb.d.ts +49 -0
  51. package/out/wechaty/puppet/message_pb.js +394 -2
  52. package/out/wechaty/puppet.openapi.yaml +101 -3
  53. package/out/wechaty/puppet.swagger.json +137 -3
  54. package/out/wechaty/puppet_grpc_pb.d.ts +17 -0
  55. package/out/wechaty/puppet_grpc_pb.js +33 -0
  56. package/out/wechaty/puppet_pb_service.d.ts +19 -0
  57. package/out/wechaty/puppet_pb_service.js +40 -0
  58. package/package.json +1 -1
  59. package/src/package-json.ts +1 -1
@@ -0,0 +1,839 @@
1
+ // source: wechaty/puppet/chat-history.proto
2
+ /**
3
+ * @fileoverview
4
+ * @enhanceable
5
+ * @suppress {missingRequire} reports error on implicit type usages.
6
+ * @suppress {messageConventions} JS Compiler reports an error if a variable or
7
+ * field starts with 'MSG_' and isn't a translatable message.
8
+ * @public
9
+ */
10
+ // GENERATED CODE -- DO NOT EDIT!
11
+ /* eslint-disable */
12
+ // @ts-nocheck
13
+
14
+ var jspb = require('google-protobuf');
15
+ var goog = jspb;
16
+ var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
17
+
18
+ var wechaty_puppet_location_pb = require('../../wechaty/puppet/location_pb.js');
19
+ goog.object.extend(proto, wechaty_puppet_location_pb);
20
+ var wechaty_puppet_mini$program_pb = require('../../wechaty/puppet/mini-program_pb.js');
21
+ goog.object.extend(proto, wechaty_puppet_mini$program_pb);
22
+ var wechaty_puppet_url$link_pb = require('../../wechaty/puppet/url-link_pb.js');
23
+ goog.object.extend(proto, wechaty_puppet_url$link_pb);
24
+ var wechaty_puppet_channel_pb = require('../../wechaty/puppet/channel_pb.js');
25
+ goog.object.extend(proto, wechaty_puppet_channel_pb);
26
+ goog.exportSymbol('proto.wechaty.puppet.ChatHistoryContent', null, global);
27
+ goog.exportSymbol('proto.wechaty.puppet.ChatHistoryContentType', null, global);
28
+ goog.exportSymbol('proto.wechaty.puppet.ChatHistoryPayload', null, global);
29
+ /**
30
+ * Generated by JsPbCodeGenerator.
31
+ * @param {Array=} opt_data Optional initial data array, typically from a
32
+ * server response, or constructed directly in Javascript. The array is used
33
+ * in place and becomes part of the constructed object. It is not cloned.
34
+ * If no data is provided, the constructed object will be empty, but still
35
+ * valid.
36
+ * @extends {jspb.Message}
37
+ * @constructor
38
+ */
39
+ proto.wechaty.puppet.ChatHistoryContent = function(opt_data) {
40
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.wechaty.puppet.ChatHistoryContent.repeatedFields_, null);
41
+ };
42
+ goog.inherits(proto.wechaty.puppet.ChatHistoryContent, jspb.Message);
43
+ if (goog.DEBUG && !COMPILED) {
44
+ /**
45
+ * @public
46
+ * @override
47
+ */
48
+ proto.wechaty.puppet.ChatHistoryContent.displayName = 'proto.wechaty.puppet.ChatHistoryContent';
49
+ }
50
+ /**
51
+ * Generated by JsPbCodeGenerator.
52
+ * @param {Array=} opt_data Optional initial data array, typically from a
53
+ * server response, or constructed directly in Javascript. The array is used
54
+ * in place and becomes part of the constructed object. It is not cloned.
55
+ * If no data is provided, the constructed object will be empty, but still
56
+ * valid.
57
+ * @extends {jspb.Message}
58
+ * @constructor
59
+ */
60
+ proto.wechaty.puppet.ChatHistoryPayload = function(opt_data) {
61
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
62
+ };
63
+ goog.inherits(proto.wechaty.puppet.ChatHistoryPayload, jspb.Message);
64
+ if (goog.DEBUG && !COMPILED) {
65
+ /**
66
+ * @public
67
+ * @override
68
+ */
69
+ proto.wechaty.puppet.ChatHistoryPayload.displayName = 'proto.wechaty.puppet.ChatHistoryPayload';
70
+ }
71
+
72
+ /**
73
+ * List of repeated fields within this message type.
74
+ * @private {!Array<number>}
75
+ * @const
76
+ */
77
+ proto.wechaty.puppet.ChatHistoryContent.repeatedFields_ = [8];
78
+
79
+
80
+
81
+ if (jspb.Message.GENERATE_TO_OBJECT) {
82
+ /**
83
+ * Creates an object representation of this proto.
84
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
85
+ * Optional fields that are not set will be set to undefined.
86
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
87
+ * For the list of reserved names please see:
88
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
89
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
90
+ * JSPB instance for transitional soy proto support:
91
+ * http://goto/soy-param-migration
92
+ * @return {!Object}
93
+ */
94
+ proto.wechaty.puppet.ChatHistoryContent.prototype.toObject = function(opt_includeInstance) {
95
+ return proto.wechaty.puppet.ChatHistoryContent.toObject(opt_includeInstance, this);
96
+ };
97
+
98
+
99
+ /**
100
+ * Static version of the {@see toObject} method.
101
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
102
+ * the JSPB instance for transitional soy proto support:
103
+ * http://goto/soy-param-migration
104
+ * @param {!proto.wechaty.puppet.ChatHistoryContent} msg The msg instance to transform.
105
+ * @return {!Object}
106
+ * @suppress {unusedLocalVariables} f is only used for nested messages
107
+ */
108
+ proto.wechaty.puppet.ChatHistoryContent.toObject = function(includeInstance, msg) {
109
+ var f, obj = {
110
+ type: jspb.Message.getFieldWithDefault(msg, 1, 0),
111
+ text: jspb.Message.getFieldWithDefault(msg, 2, ""),
112
+ fileBox: jspb.Message.getFieldWithDefault(msg, 3, ""),
113
+ location: (f = msg.getLocation()) && wechaty_puppet_location_pb.LocationPayload.toObject(includeInstance, f),
114
+ urlLink: (f = msg.getUrlLink()) && wechaty_puppet_url$link_pb.UrlLinkPayload.toObject(includeInstance, f),
115
+ miniProgram: (f = msg.getMiniProgram()) && wechaty_puppet_mini$program_pb.MiniProgramPayload.toObject(includeInstance, f),
116
+ channel: (f = msg.getChannel()) && wechaty_puppet_channel_pb.ChannelPayload.toObject(includeInstance, f),
117
+ chatHistoryList: jspb.Message.toObjectList(msg.getChatHistoryList(),
118
+ proto.wechaty.puppet.ChatHistoryPayload.toObject, includeInstance)
119
+ };
120
+
121
+ if (includeInstance) {
122
+ obj.$jspbMessageInstance = msg;
123
+ }
124
+ return obj;
125
+ };
126
+ }
127
+
128
+
129
+ /**
130
+ * Deserializes binary data (in protobuf wire format).
131
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
132
+ * @return {!proto.wechaty.puppet.ChatHistoryContent}
133
+ */
134
+ proto.wechaty.puppet.ChatHistoryContent.deserializeBinary = function(bytes) {
135
+ var reader = new jspb.BinaryReader(bytes);
136
+ var msg = new proto.wechaty.puppet.ChatHistoryContent;
137
+ return proto.wechaty.puppet.ChatHistoryContent.deserializeBinaryFromReader(msg, reader);
138
+ };
139
+
140
+
141
+ /**
142
+ * Deserializes binary data (in protobuf wire format) from the
143
+ * given reader into the given message object.
144
+ * @param {!proto.wechaty.puppet.ChatHistoryContent} msg The message object to deserialize into.
145
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
146
+ * @return {!proto.wechaty.puppet.ChatHistoryContent}
147
+ */
148
+ proto.wechaty.puppet.ChatHistoryContent.deserializeBinaryFromReader = function(msg, reader) {
149
+ while (reader.nextField()) {
150
+ if (reader.isEndGroup()) {
151
+ break;
152
+ }
153
+ var field = reader.getFieldNumber();
154
+ switch (field) {
155
+ case 1:
156
+ var value = /** @type {!proto.wechaty.puppet.ChatHistoryContentType} */ (reader.readEnum());
157
+ msg.setType(value);
158
+ break;
159
+ case 2:
160
+ var value = /** @type {string} */ (reader.readString());
161
+ msg.setText(value);
162
+ break;
163
+ case 3:
164
+ var value = /** @type {string} */ (reader.readString());
165
+ msg.setFileBox(value);
166
+ break;
167
+ case 4:
168
+ var value = new wechaty_puppet_location_pb.LocationPayload;
169
+ reader.readMessage(value,wechaty_puppet_location_pb.LocationPayload.deserializeBinaryFromReader);
170
+ msg.setLocation(value);
171
+ break;
172
+ case 5:
173
+ var value = new wechaty_puppet_url$link_pb.UrlLinkPayload;
174
+ reader.readMessage(value,wechaty_puppet_url$link_pb.UrlLinkPayload.deserializeBinaryFromReader);
175
+ msg.setUrlLink(value);
176
+ break;
177
+ case 6:
178
+ var value = new wechaty_puppet_mini$program_pb.MiniProgramPayload;
179
+ reader.readMessage(value,wechaty_puppet_mini$program_pb.MiniProgramPayload.deserializeBinaryFromReader);
180
+ msg.setMiniProgram(value);
181
+ break;
182
+ case 7:
183
+ var value = new wechaty_puppet_channel_pb.ChannelPayload;
184
+ reader.readMessage(value,wechaty_puppet_channel_pb.ChannelPayload.deserializeBinaryFromReader);
185
+ msg.setChannel(value);
186
+ break;
187
+ case 8:
188
+ var value = new proto.wechaty.puppet.ChatHistoryPayload;
189
+ reader.readMessage(value,proto.wechaty.puppet.ChatHistoryPayload.deserializeBinaryFromReader);
190
+ msg.addChatHistory(value);
191
+ break;
192
+ default:
193
+ reader.skipField();
194
+ break;
195
+ }
196
+ }
197
+ return msg;
198
+ };
199
+
200
+
201
+ /**
202
+ * Serializes the message to binary data (in protobuf wire format).
203
+ * @return {!Uint8Array}
204
+ */
205
+ proto.wechaty.puppet.ChatHistoryContent.prototype.serializeBinary = function() {
206
+ var writer = new jspb.BinaryWriter();
207
+ proto.wechaty.puppet.ChatHistoryContent.serializeBinaryToWriter(this, writer);
208
+ return writer.getResultBuffer();
209
+ };
210
+
211
+
212
+ /**
213
+ * Serializes the given message to binary data (in protobuf wire
214
+ * format), writing to the given BinaryWriter.
215
+ * @param {!proto.wechaty.puppet.ChatHistoryContent} message
216
+ * @param {!jspb.BinaryWriter} writer
217
+ * @suppress {unusedLocalVariables} f is only used for nested messages
218
+ */
219
+ proto.wechaty.puppet.ChatHistoryContent.serializeBinaryToWriter = function(message, writer) {
220
+ var f = undefined;
221
+ f = message.getType();
222
+ if (f !== 0.0) {
223
+ writer.writeEnum(
224
+ 1,
225
+ f
226
+ );
227
+ }
228
+ f = message.getText();
229
+ if (f.length > 0) {
230
+ writer.writeString(
231
+ 2,
232
+ f
233
+ );
234
+ }
235
+ f = message.getFileBox();
236
+ if (f.length > 0) {
237
+ writer.writeString(
238
+ 3,
239
+ f
240
+ );
241
+ }
242
+ f = message.getLocation();
243
+ if (f != null) {
244
+ writer.writeMessage(
245
+ 4,
246
+ f,
247
+ wechaty_puppet_location_pb.LocationPayload.serializeBinaryToWriter
248
+ );
249
+ }
250
+ f = message.getUrlLink();
251
+ if (f != null) {
252
+ writer.writeMessage(
253
+ 5,
254
+ f,
255
+ wechaty_puppet_url$link_pb.UrlLinkPayload.serializeBinaryToWriter
256
+ );
257
+ }
258
+ f = message.getMiniProgram();
259
+ if (f != null) {
260
+ writer.writeMessage(
261
+ 6,
262
+ f,
263
+ wechaty_puppet_mini$program_pb.MiniProgramPayload.serializeBinaryToWriter
264
+ );
265
+ }
266
+ f = message.getChannel();
267
+ if (f != null) {
268
+ writer.writeMessage(
269
+ 7,
270
+ f,
271
+ wechaty_puppet_channel_pb.ChannelPayload.serializeBinaryToWriter
272
+ );
273
+ }
274
+ f = message.getChatHistoryList();
275
+ if (f.length > 0) {
276
+ writer.writeRepeatedMessage(
277
+ 8,
278
+ f,
279
+ proto.wechaty.puppet.ChatHistoryPayload.serializeBinaryToWriter
280
+ );
281
+ }
282
+ };
283
+
284
+
285
+ /**
286
+ * optional ChatHistoryContentType type = 1;
287
+ * @return {!proto.wechaty.puppet.ChatHistoryContentType}
288
+ */
289
+ proto.wechaty.puppet.ChatHistoryContent.prototype.getType = function() {
290
+ return /** @type {!proto.wechaty.puppet.ChatHistoryContentType} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
291
+ };
292
+
293
+
294
+ /**
295
+ * @param {!proto.wechaty.puppet.ChatHistoryContentType} value
296
+ * @return {!proto.wechaty.puppet.ChatHistoryContent} returns this
297
+ */
298
+ proto.wechaty.puppet.ChatHistoryContent.prototype.setType = function(value) {
299
+ return jspb.Message.setProto3EnumField(this, 1, value);
300
+ };
301
+
302
+
303
+ /**
304
+ * optional string text = 2;
305
+ * @return {string}
306
+ */
307
+ proto.wechaty.puppet.ChatHistoryContent.prototype.getText = function() {
308
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
309
+ };
310
+
311
+
312
+ /**
313
+ * @param {string} value
314
+ * @return {!proto.wechaty.puppet.ChatHistoryContent} returns this
315
+ */
316
+ proto.wechaty.puppet.ChatHistoryContent.prototype.setText = function(value) {
317
+ return jspb.Message.setProto3StringField(this, 2, value);
318
+ };
319
+
320
+
321
+ /**
322
+ * optional string file_box = 3;
323
+ * @return {string}
324
+ */
325
+ proto.wechaty.puppet.ChatHistoryContent.prototype.getFileBox = function() {
326
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
327
+ };
328
+
329
+
330
+ /**
331
+ * @param {string} value
332
+ * @return {!proto.wechaty.puppet.ChatHistoryContent} returns this
333
+ */
334
+ proto.wechaty.puppet.ChatHistoryContent.prototype.setFileBox = function(value) {
335
+ return jspb.Message.setProto3StringField(this, 3, value);
336
+ };
337
+
338
+
339
+ /**
340
+ * optional LocationPayload location = 4;
341
+ * @return {?proto.wechaty.puppet.LocationPayload}
342
+ */
343
+ proto.wechaty.puppet.ChatHistoryContent.prototype.getLocation = function() {
344
+ return /** @type{?proto.wechaty.puppet.LocationPayload} */ (
345
+ jspb.Message.getWrapperField(this, wechaty_puppet_location_pb.LocationPayload, 4));
346
+ };
347
+
348
+
349
+ /**
350
+ * @param {?proto.wechaty.puppet.LocationPayload|undefined} value
351
+ * @return {!proto.wechaty.puppet.ChatHistoryContent} returns this
352
+ */
353
+ proto.wechaty.puppet.ChatHistoryContent.prototype.setLocation = function(value) {
354
+ return jspb.Message.setWrapperField(this, 4, value);
355
+ };
356
+
357
+
358
+ /**
359
+ * Clears the message field making it undefined.
360
+ * @return {!proto.wechaty.puppet.ChatHistoryContent} returns this
361
+ */
362
+ proto.wechaty.puppet.ChatHistoryContent.prototype.clearLocation = function() {
363
+ return this.setLocation(undefined);
364
+ };
365
+
366
+
367
+ /**
368
+ * Returns whether this field is set.
369
+ * @return {boolean}
370
+ */
371
+ proto.wechaty.puppet.ChatHistoryContent.prototype.hasLocation = function() {
372
+ return jspb.Message.getField(this, 4) != null;
373
+ };
374
+
375
+
376
+ /**
377
+ * optional UrlLinkPayload url_link = 5;
378
+ * @return {?proto.wechaty.puppet.UrlLinkPayload}
379
+ */
380
+ proto.wechaty.puppet.ChatHistoryContent.prototype.getUrlLink = function() {
381
+ return /** @type{?proto.wechaty.puppet.UrlLinkPayload} */ (
382
+ jspb.Message.getWrapperField(this, wechaty_puppet_url$link_pb.UrlLinkPayload, 5));
383
+ };
384
+
385
+
386
+ /**
387
+ * @param {?proto.wechaty.puppet.UrlLinkPayload|undefined} value
388
+ * @return {!proto.wechaty.puppet.ChatHistoryContent} returns this
389
+ */
390
+ proto.wechaty.puppet.ChatHistoryContent.prototype.setUrlLink = function(value) {
391
+ return jspb.Message.setWrapperField(this, 5, value);
392
+ };
393
+
394
+
395
+ /**
396
+ * Clears the message field making it undefined.
397
+ * @return {!proto.wechaty.puppet.ChatHistoryContent} returns this
398
+ */
399
+ proto.wechaty.puppet.ChatHistoryContent.prototype.clearUrlLink = function() {
400
+ return this.setUrlLink(undefined);
401
+ };
402
+
403
+
404
+ /**
405
+ * Returns whether this field is set.
406
+ * @return {boolean}
407
+ */
408
+ proto.wechaty.puppet.ChatHistoryContent.prototype.hasUrlLink = function() {
409
+ return jspb.Message.getField(this, 5) != null;
410
+ };
411
+
412
+
413
+ /**
414
+ * optional MiniProgramPayload mini_program = 6;
415
+ * @return {?proto.wechaty.puppet.MiniProgramPayload}
416
+ */
417
+ proto.wechaty.puppet.ChatHistoryContent.prototype.getMiniProgram = function() {
418
+ return /** @type{?proto.wechaty.puppet.MiniProgramPayload} */ (
419
+ jspb.Message.getWrapperField(this, wechaty_puppet_mini$program_pb.MiniProgramPayload, 6));
420
+ };
421
+
422
+
423
+ /**
424
+ * @param {?proto.wechaty.puppet.MiniProgramPayload|undefined} value
425
+ * @return {!proto.wechaty.puppet.ChatHistoryContent} returns this
426
+ */
427
+ proto.wechaty.puppet.ChatHistoryContent.prototype.setMiniProgram = function(value) {
428
+ return jspb.Message.setWrapperField(this, 6, value);
429
+ };
430
+
431
+
432
+ /**
433
+ * Clears the message field making it undefined.
434
+ * @return {!proto.wechaty.puppet.ChatHistoryContent} returns this
435
+ */
436
+ proto.wechaty.puppet.ChatHistoryContent.prototype.clearMiniProgram = function() {
437
+ return this.setMiniProgram(undefined);
438
+ };
439
+
440
+
441
+ /**
442
+ * Returns whether this field is set.
443
+ * @return {boolean}
444
+ */
445
+ proto.wechaty.puppet.ChatHistoryContent.prototype.hasMiniProgram = function() {
446
+ return jspb.Message.getField(this, 6) != null;
447
+ };
448
+
449
+
450
+ /**
451
+ * optional ChannelPayload channel = 7;
452
+ * @return {?proto.wechaty.puppet.ChannelPayload}
453
+ */
454
+ proto.wechaty.puppet.ChatHistoryContent.prototype.getChannel = function() {
455
+ return /** @type{?proto.wechaty.puppet.ChannelPayload} */ (
456
+ jspb.Message.getWrapperField(this, wechaty_puppet_channel_pb.ChannelPayload, 7));
457
+ };
458
+
459
+
460
+ /**
461
+ * @param {?proto.wechaty.puppet.ChannelPayload|undefined} value
462
+ * @return {!proto.wechaty.puppet.ChatHistoryContent} returns this
463
+ */
464
+ proto.wechaty.puppet.ChatHistoryContent.prototype.setChannel = function(value) {
465
+ return jspb.Message.setWrapperField(this, 7, value);
466
+ };
467
+
468
+
469
+ /**
470
+ * Clears the message field making it undefined.
471
+ * @return {!proto.wechaty.puppet.ChatHistoryContent} returns this
472
+ */
473
+ proto.wechaty.puppet.ChatHistoryContent.prototype.clearChannel = function() {
474
+ return this.setChannel(undefined);
475
+ };
476
+
477
+
478
+ /**
479
+ * Returns whether this field is set.
480
+ * @return {boolean}
481
+ */
482
+ proto.wechaty.puppet.ChatHistoryContent.prototype.hasChannel = function() {
483
+ return jspb.Message.getField(this, 7) != null;
484
+ };
485
+
486
+
487
+ /**
488
+ * repeated ChatHistoryPayload chat_history = 8;
489
+ * @return {!Array<!proto.wechaty.puppet.ChatHistoryPayload>}
490
+ */
491
+ proto.wechaty.puppet.ChatHistoryContent.prototype.getChatHistoryList = function() {
492
+ return /** @type{!Array<!proto.wechaty.puppet.ChatHistoryPayload>} */ (
493
+ jspb.Message.getRepeatedWrapperField(this, proto.wechaty.puppet.ChatHistoryPayload, 8));
494
+ };
495
+
496
+
497
+ /**
498
+ * @param {!Array<!proto.wechaty.puppet.ChatHistoryPayload>} value
499
+ * @return {!proto.wechaty.puppet.ChatHistoryContent} returns this
500
+ */
501
+ proto.wechaty.puppet.ChatHistoryContent.prototype.setChatHistoryList = function(value) {
502
+ return jspb.Message.setRepeatedWrapperField(this, 8, value);
503
+ };
504
+
505
+
506
+ /**
507
+ * @param {!proto.wechaty.puppet.ChatHistoryPayload=} opt_value
508
+ * @param {number=} opt_index
509
+ * @return {!proto.wechaty.puppet.ChatHistoryPayload}
510
+ */
511
+ proto.wechaty.puppet.ChatHistoryContent.prototype.addChatHistory = function(opt_value, opt_index) {
512
+ return jspb.Message.addToRepeatedWrapperField(this, 8, opt_value, proto.wechaty.puppet.ChatHistoryPayload, opt_index);
513
+ };
514
+
515
+
516
+ /**
517
+ * Clears the list making it empty but non-null.
518
+ * @return {!proto.wechaty.puppet.ChatHistoryContent} returns this
519
+ */
520
+ proto.wechaty.puppet.ChatHistoryContent.prototype.clearChatHistoryList = function() {
521
+ return this.setChatHistoryList([]);
522
+ };
523
+
524
+
525
+
526
+
527
+
528
+ if (jspb.Message.GENERATE_TO_OBJECT) {
529
+ /**
530
+ * Creates an object representation of this proto.
531
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
532
+ * Optional fields that are not set will be set to undefined.
533
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
534
+ * For the list of reserved names please see:
535
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
536
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
537
+ * JSPB instance for transitional soy proto support:
538
+ * http://goto/soy-param-migration
539
+ * @return {!Object}
540
+ */
541
+ proto.wechaty.puppet.ChatHistoryPayload.prototype.toObject = function(opt_includeInstance) {
542
+ return proto.wechaty.puppet.ChatHistoryPayload.toObject(opt_includeInstance, this);
543
+ };
544
+
545
+
546
+ /**
547
+ * Static version of the {@see toObject} method.
548
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
549
+ * the JSPB instance for transitional soy proto support:
550
+ * http://goto/soy-param-migration
551
+ * @param {!proto.wechaty.puppet.ChatHistoryPayload} msg The msg instance to transform.
552
+ * @return {!Object}
553
+ * @suppress {unusedLocalVariables} f is only used for nested messages
554
+ */
555
+ proto.wechaty.puppet.ChatHistoryPayload.toObject = function(includeInstance, msg) {
556
+ var f, obj = {
557
+ type: jspb.Message.getFieldWithDefault(msg, 1, 0),
558
+ avatar: jspb.Message.getFieldWithDefault(msg, 2, ""),
559
+ senderName: jspb.Message.getFieldWithDefault(msg, 3, ""),
560
+ corpName: jspb.Message.getFieldWithDefault(msg, 4, ""),
561
+ time: jspb.Message.getFieldWithDefault(msg, 5, ""),
562
+ message: (f = msg.getMessage()) && proto.wechaty.puppet.ChatHistoryContent.toObject(includeInstance, f)
563
+ };
564
+
565
+ if (includeInstance) {
566
+ obj.$jspbMessageInstance = msg;
567
+ }
568
+ return obj;
569
+ };
570
+ }
571
+
572
+
573
+ /**
574
+ * Deserializes binary data (in protobuf wire format).
575
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
576
+ * @return {!proto.wechaty.puppet.ChatHistoryPayload}
577
+ */
578
+ proto.wechaty.puppet.ChatHistoryPayload.deserializeBinary = function(bytes) {
579
+ var reader = new jspb.BinaryReader(bytes);
580
+ var msg = new proto.wechaty.puppet.ChatHistoryPayload;
581
+ return proto.wechaty.puppet.ChatHistoryPayload.deserializeBinaryFromReader(msg, reader);
582
+ };
583
+
584
+
585
+ /**
586
+ * Deserializes binary data (in protobuf wire format) from the
587
+ * given reader into the given message object.
588
+ * @param {!proto.wechaty.puppet.ChatHistoryPayload} msg The message object to deserialize into.
589
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
590
+ * @return {!proto.wechaty.puppet.ChatHistoryPayload}
591
+ */
592
+ proto.wechaty.puppet.ChatHistoryPayload.deserializeBinaryFromReader = function(msg, reader) {
593
+ while (reader.nextField()) {
594
+ if (reader.isEndGroup()) {
595
+ break;
596
+ }
597
+ var field = reader.getFieldNumber();
598
+ switch (field) {
599
+ case 1:
600
+ var value = /** @type {number} */ (reader.readInt32());
601
+ msg.setType(value);
602
+ break;
603
+ case 2:
604
+ var value = /** @type {string} */ (reader.readString());
605
+ msg.setAvatar(value);
606
+ break;
607
+ case 3:
608
+ var value = /** @type {string} */ (reader.readString());
609
+ msg.setSenderName(value);
610
+ break;
611
+ case 4:
612
+ var value = /** @type {string} */ (reader.readString());
613
+ msg.setCorpName(value);
614
+ break;
615
+ case 5:
616
+ var value = /** @type {string} */ (reader.readString());
617
+ msg.setTime(value);
618
+ break;
619
+ case 6:
620
+ var value = new proto.wechaty.puppet.ChatHistoryContent;
621
+ reader.readMessage(value,proto.wechaty.puppet.ChatHistoryContent.deserializeBinaryFromReader);
622
+ msg.setMessage(value);
623
+ break;
624
+ default:
625
+ reader.skipField();
626
+ break;
627
+ }
628
+ }
629
+ return msg;
630
+ };
631
+
632
+
633
+ /**
634
+ * Serializes the message to binary data (in protobuf wire format).
635
+ * @return {!Uint8Array}
636
+ */
637
+ proto.wechaty.puppet.ChatHistoryPayload.prototype.serializeBinary = function() {
638
+ var writer = new jspb.BinaryWriter();
639
+ proto.wechaty.puppet.ChatHistoryPayload.serializeBinaryToWriter(this, writer);
640
+ return writer.getResultBuffer();
641
+ };
642
+
643
+
644
+ /**
645
+ * Serializes the given message to binary data (in protobuf wire
646
+ * format), writing to the given BinaryWriter.
647
+ * @param {!proto.wechaty.puppet.ChatHistoryPayload} message
648
+ * @param {!jspb.BinaryWriter} writer
649
+ * @suppress {unusedLocalVariables} f is only used for nested messages
650
+ */
651
+ proto.wechaty.puppet.ChatHistoryPayload.serializeBinaryToWriter = function(message, writer) {
652
+ var f = undefined;
653
+ f = message.getType();
654
+ if (f !== 0) {
655
+ writer.writeInt32(
656
+ 1,
657
+ f
658
+ );
659
+ }
660
+ f = message.getAvatar();
661
+ if (f.length > 0) {
662
+ writer.writeString(
663
+ 2,
664
+ f
665
+ );
666
+ }
667
+ f = message.getSenderName();
668
+ if (f.length > 0) {
669
+ writer.writeString(
670
+ 3,
671
+ f
672
+ );
673
+ }
674
+ f = message.getCorpName();
675
+ if (f.length > 0) {
676
+ writer.writeString(
677
+ 4,
678
+ f
679
+ );
680
+ }
681
+ f = message.getTime();
682
+ if (f.length > 0) {
683
+ writer.writeString(
684
+ 5,
685
+ f
686
+ );
687
+ }
688
+ f = message.getMessage();
689
+ if (f != null) {
690
+ writer.writeMessage(
691
+ 6,
692
+ f,
693
+ proto.wechaty.puppet.ChatHistoryContent.serializeBinaryToWriter
694
+ );
695
+ }
696
+ };
697
+
698
+
699
+ /**
700
+ * optional int32 type = 1;
701
+ * @return {number}
702
+ */
703
+ proto.wechaty.puppet.ChatHistoryPayload.prototype.getType = function() {
704
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
705
+ };
706
+
707
+
708
+ /**
709
+ * @param {number} value
710
+ * @return {!proto.wechaty.puppet.ChatHistoryPayload} returns this
711
+ */
712
+ proto.wechaty.puppet.ChatHistoryPayload.prototype.setType = function(value) {
713
+ return jspb.Message.setProto3IntField(this, 1, value);
714
+ };
715
+
716
+
717
+ /**
718
+ * optional string avatar = 2;
719
+ * @return {string}
720
+ */
721
+ proto.wechaty.puppet.ChatHistoryPayload.prototype.getAvatar = function() {
722
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
723
+ };
724
+
725
+
726
+ /**
727
+ * @param {string} value
728
+ * @return {!proto.wechaty.puppet.ChatHistoryPayload} returns this
729
+ */
730
+ proto.wechaty.puppet.ChatHistoryPayload.prototype.setAvatar = function(value) {
731
+ return jspb.Message.setProto3StringField(this, 2, value);
732
+ };
733
+
734
+
735
+ /**
736
+ * optional string sender_name = 3;
737
+ * @return {string}
738
+ */
739
+ proto.wechaty.puppet.ChatHistoryPayload.prototype.getSenderName = function() {
740
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
741
+ };
742
+
743
+
744
+ /**
745
+ * @param {string} value
746
+ * @return {!proto.wechaty.puppet.ChatHistoryPayload} returns this
747
+ */
748
+ proto.wechaty.puppet.ChatHistoryPayload.prototype.setSenderName = function(value) {
749
+ return jspb.Message.setProto3StringField(this, 3, value);
750
+ };
751
+
752
+
753
+ /**
754
+ * optional string corp_name = 4;
755
+ * @return {string}
756
+ */
757
+ proto.wechaty.puppet.ChatHistoryPayload.prototype.getCorpName = function() {
758
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
759
+ };
760
+
761
+
762
+ /**
763
+ * @param {string} value
764
+ * @return {!proto.wechaty.puppet.ChatHistoryPayload} returns this
765
+ */
766
+ proto.wechaty.puppet.ChatHistoryPayload.prototype.setCorpName = function(value) {
767
+ return jspb.Message.setProto3StringField(this, 4, value);
768
+ };
769
+
770
+
771
+ /**
772
+ * optional string time = 5;
773
+ * @return {string}
774
+ */
775
+ proto.wechaty.puppet.ChatHistoryPayload.prototype.getTime = function() {
776
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
777
+ };
778
+
779
+
780
+ /**
781
+ * @param {string} value
782
+ * @return {!proto.wechaty.puppet.ChatHistoryPayload} returns this
783
+ */
784
+ proto.wechaty.puppet.ChatHistoryPayload.prototype.setTime = function(value) {
785
+ return jspb.Message.setProto3StringField(this, 5, value);
786
+ };
787
+
788
+
789
+ /**
790
+ * optional ChatHistoryContent message = 6;
791
+ * @return {?proto.wechaty.puppet.ChatHistoryContent}
792
+ */
793
+ proto.wechaty.puppet.ChatHistoryPayload.prototype.getMessage = function() {
794
+ return /** @type{?proto.wechaty.puppet.ChatHistoryContent} */ (
795
+ jspb.Message.getWrapperField(this, proto.wechaty.puppet.ChatHistoryContent, 6));
796
+ };
797
+
798
+
799
+ /**
800
+ * @param {?proto.wechaty.puppet.ChatHistoryContent|undefined} value
801
+ * @return {!proto.wechaty.puppet.ChatHistoryPayload} returns this
802
+ */
803
+ proto.wechaty.puppet.ChatHistoryPayload.prototype.setMessage = function(value) {
804
+ return jspb.Message.setWrapperField(this, 6, value);
805
+ };
806
+
807
+
808
+ /**
809
+ * Clears the message field making it undefined.
810
+ * @return {!proto.wechaty.puppet.ChatHistoryPayload} returns this
811
+ */
812
+ proto.wechaty.puppet.ChatHistoryPayload.prototype.clearMessage = function() {
813
+ return this.setMessage(undefined);
814
+ };
815
+
816
+
817
+ /**
818
+ * Returns whether this field is set.
819
+ * @return {boolean}
820
+ */
821
+ proto.wechaty.puppet.ChatHistoryPayload.prototype.hasMessage = function() {
822
+ return jspb.Message.getField(this, 6) != null;
823
+ };
824
+
825
+
826
+ /**
827
+ * @enum {number}
828
+ */
829
+ proto.wechaty.puppet.ChatHistoryContentType = {
830
+ TEXT: 0,
831
+ FILE: 1,
832
+ LOCATION: 2,
833
+ URL: 3,
834
+ MINI_PROGRAM: 4,
835
+ CHANNEL: 5,
836
+ CHAT_HISTORY: 6
837
+ };
838
+
839
+ goog.object.extend(exports, proto.wechaty.puppet);