@juzi/wechaty-grpc 1.0.35 → 1.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/cjs/out/wechaty/puppet/contact_pb.d.ts +36 -0
  2. package/dist/cjs/out/wechaty/puppet/contact_pb.js +275 -0
  3. package/dist/cjs/out/wechaty/puppet.openapi.yaml +27 -1
  4. package/dist/cjs/out/wechaty/puppet.swagger.json +42 -1
  5. package/dist/cjs/out/wechaty/puppet_grpc_pb.d.ts +17 -0
  6. package/dist/cjs/out/wechaty/puppet_grpc_pb.js +33 -0
  7. package/dist/cjs/out/wechaty/puppet_pb_service.d.ts +19 -0
  8. package/dist/cjs/out/wechaty/puppet_pb_service.js +40 -0
  9. package/dist/cjs/proto/wechaty/puppet/contact.proto +6 -0
  10. package/dist/cjs/proto/wechaty/puppet.proto +6 -0
  11. package/dist/cjs/src/package-json.js +1 -1
  12. package/dist/cjs/tests/puppet-server-impl.d.ts.map +1 -1
  13. package/dist/cjs/tests/puppet-server-impl.js +5 -0
  14. package/dist/cjs/tests/puppet-server-impl.js.map +1 -1
  15. package/dist/esm/out/wechaty/puppet/contact_pb.d.ts +36 -0
  16. package/dist/esm/out/wechaty/puppet/contact_pb.js +275 -0
  17. package/dist/esm/out/wechaty/puppet.openapi.yaml +27 -1
  18. package/dist/esm/out/wechaty/puppet.swagger.json +42 -1
  19. package/dist/esm/out/wechaty/puppet_grpc_pb.d.ts +17 -0
  20. package/dist/esm/out/wechaty/puppet_grpc_pb.js +33 -0
  21. package/dist/esm/out/wechaty/puppet_pb_service.d.ts +19 -0
  22. package/dist/esm/out/wechaty/puppet_pb_service.js +40 -0
  23. package/dist/esm/proto/wechaty/puppet/contact.proto +6 -0
  24. package/dist/esm/proto/wechaty/puppet.proto +6 -0
  25. package/dist/esm/src/package-json.js +1 -1
  26. package/dist/esm/tests/puppet-server-impl.d.ts.map +1 -1
  27. package/dist/esm/tests/puppet-server-impl.js +5 -0
  28. package/dist/esm/tests/puppet-server-impl.js.map +1 -1
  29. package/out/wechaty/puppet/contact_pb.d.ts +36 -0
  30. package/out/wechaty/puppet/contact_pb.js +275 -0
  31. package/out/wechaty/puppet.openapi.yaml +27 -1
  32. package/out/wechaty/puppet.swagger.json +42 -1
  33. package/out/wechaty/puppet_grpc_pb.d.ts +17 -0
  34. package/out/wechaty/puppet_grpc_pb.js +33 -0
  35. package/out/wechaty/puppet_pb_service.d.ts +19 -0
  36. package/out/wechaty/puppet_pb_service.js +40 -0
  37. package/package.json +1 -1
  38. package/src/package-json.ts +1 -1
@@ -526,6 +526,42 @@ export namespace ContactDescriptionResponse {
526
526
  }
527
527
  }
528
528
 
529
+ export class ContactDeleteRequest extends jspb.Message {
530
+ getContactId(): string;
531
+ setContactId(value: string): void;
532
+
533
+ serializeBinary(): Uint8Array;
534
+ toObject(includeInstance?: boolean): ContactDeleteRequest.AsObject;
535
+ static toObject(includeInstance: boolean, msg: ContactDeleteRequest): ContactDeleteRequest.AsObject;
536
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
537
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
538
+ static serializeBinaryToWriter(message: ContactDeleteRequest, writer: jspb.BinaryWriter): void;
539
+ static deserializeBinary(bytes: Uint8Array): ContactDeleteRequest;
540
+ static deserializeBinaryFromReader(message: ContactDeleteRequest, reader: jspb.BinaryReader): ContactDeleteRequest;
541
+ }
542
+
543
+ export namespace ContactDeleteRequest {
544
+ export type AsObject = {
545
+ contactId: string,
546
+ }
547
+ }
548
+
549
+ export class ContactDeleteResponse extends jspb.Message {
550
+ serializeBinary(): Uint8Array;
551
+ toObject(includeInstance?: boolean): ContactDeleteResponse.AsObject;
552
+ static toObject(includeInstance: boolean, msg: ContactDeleteResponse): ContactDeleteResponse.AsObject;
553
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
554
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
555
+ static serializeBinaryToWriter(message: ContactDeleteResponse, writer: jspb.BinaryWriter): void;
556
+ static deserializeBinary(bytes: Uint8Array): ContactDeleteResponse;
557
+ static deserializeBinaryFromReader(message: ContactDeleteResponse, reader: jspb.BinaryReader): ContactDeleteResponse;
558
+ }
559
+
560
+ export namespace ContactDeleteResponse {
561
+ export type AsObject = {
562
+ }
563
+ }
564
+
529
565
  export interface ContactGenderMap {
530
566
  CONTACT_GENDER_UNSPECIFIED: 0;
531
567
  CONTACT_GENDER_MALE: 1;
@@ -23,6 +23,8 @@ goog.exportSymbol('proto.wechaty.puppet.ContactAvatarRequest', null, global);
23
23
  goog.exportSymbol('proto.wechaty.puppet.ContactAvatarResponse', null, global);
24
24
  goog.exportSymbol('proto.wechaty.puppet.ContactCorporationRemarkRequest', null, global);
25
25
  goog.exportSymbol('proto.wechaty.puppet.ContactCorporationRemarkResponse', null, global);
26
+ goog.exportSymbol('proto.wechaty.puppet.ContactDeleteRequest', null, global);
27
+ goog.exportSymbol('proto.wechaty.puppet.ContactDeleteResponse', null, global);
26
28
  goog.exportSymbol('proto.wechaty.puppet.ContactDescriptionRequest', null, global);
27
29
  goog.exportSymbol('proto.wechaty.puppet.ContactDescriptionResponse', null, global);
28
30
  goog.exportSymbol('proto.wechaty.puppet.ContactGender', null, global);
@@ -459,6 +461,48 @@ if (goog.DEBUG && !COMPILED) {
459
461
  */
460
462
  proto.wechaty.puppet.ContactDescriptionResponse.displayName = 'proto.wechaty.puppet.ContactDescriptionResponse';
461
463
  }
464
+ /**
465
+ * Generated by JsPbCodeGenerator.
466
+ * @param {Array=} opt_data Optional initial data array, typically from a
467
+ * server response, or constructed directly in Javascript. The array is used
468
+ * in place and becomes part of the constructed object. It is not cloned.
469
+ * If no data is provided, the constructed object will be empty, but still
470
+ * valid.
471
+ * @extends {jspb.Message}
472
+ * @constructor
473
+ */
474
+ proto.wechaty.puppet.ContactDeleteRequest = function(opt_data) {
475
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
476
+ };
477
+ goog.inherits(proto.wechaty.puppet.ContactDeleteRequest, jspb.Message);
478
+ if (goog.DEBUG && !COMPILED) {
479
+ /**
480
+ * @public
481
+ * @override
482
+ */
483
+ proto.wechaty.puppet.ContactDeleteRequest.displayName = 'proto.wechaty.puppet.ContactDeleteRequest';
484
+ }
485
+ /**
486
+ * Generated by JsPbCodeGenerator.
487
+ * @param {Array=} opt_data Optional initial data array, typically from a
488
+ * server response, or constructed directly in Javascript. The array is used
489
+ * in place and becomes part of the constructed object. It is not cloned.
490
+ * If no data is provided, the constructed object will be empty, but still
491
+ * valid.
492
+ * @extends {jspb.Message}
493
+ * @constructor
494
+ */
495
+ proto.wechaty.puppet.ContactDeleteResponse = function(opt_data) {
496
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
497
+ };
498
+ goog.inherits(proto.wechaty.puppet.ContactDeleteResponse, jspb.Message);
499
+ if (goog.DEBUG && !COMPILED) {
500
+ /**
501
+ * @public
502
+ * @override
503
+ */
504
+ proto.wechaty.puppet.ContactDeleteResponse.displayName = 'proto.wechaty.puppet.ContactDeleteResponse';
505
+ }
462
506
 
463
507
 
464
508
 
@@ -4070,6 +4114,237 @@ proto.wechaty.puppet.ContactDescriptionResponse.serializeBinaryToWriter = functi
4070
4114
  };
4071
4115
 
4072
4116
 
4117
+
4118
+
4119
+
4120
+ if (jspb.Message.GENERATE_TO_OBJECT) {
4121
+ /**
4122
+ * Creates an object representation of this proto.
4123
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
4124
+ * Optional fields that are not set will be set to undefined.
4125
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
4126
+ * For the list of reserved names please see:
4127
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
4128
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
4129
+ * JSPB instance for transitional soy proto support:
4130
+ * http://goto/soy-param-migration
4131
+ * @return {!Object}
4132
+ */
4133
+ proto.wechaty.puppet.ContactDeleteRequest.prototype.toObject = function(opt_includeInstance) {
4134
+ return proto.wechaty.puppet.ContactDeleteRequest.toObject(opt_includeInstance, this);
4135
+ };
4136
+
4137
+
4138
+ /**
4139
+ * Static version of the {@see toObject} method.
4140
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
4141
+ * the JSPB instance for transitional soy proto support:
4142
+ * http://goto/soy-param-migration
4143
+ * @param {!proto.wechaty.puppet.ContactDeleteRequest} msg The msg instance to transform.
4144
+ * @return {!Object}
4145
+ * @suppress {unusedLocalVariables} f is only used for nested messages
4146
+ */
4147
+ proto.wechaty.puppet.ContactDeleteRequest.toObject = function(includeInstance, msg) {
4148
+ var f, obj = {
4149
+ contactId: jspb.Message.getFieldWithDefault(msg, 1, "")
4150
+ };
4151
+
4152
+ if (includeInstance) {
4153
+ obj.$jspbMessageInstance = msg;
4154
+ }
4155
+ return obj;
4156
+ };
4157
+ }
4158
+
4159
+
4160
+ /**
4161
+ * Deserializes binary data (in protobuf wire format).
4162
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
4163
+ * @return {!proto.wechaty.puppet.ContactDeleteRequest}
4164
+ */
4165
+ proto.wechaty.puppet.ContactDeleteRequest.deserializeBinary = function(bytes) {
4166
+ var reader = new jspb.BinaryReader(bytes);
4167
+ var msg = new proto.wechaty.puppet.ContactDeleteRequest;
4168
+ return proto.wechaty.puppet.ContactDeleteRequest.deserializeBinaryFromReader(msg, reader);
4169
+ };
4170
+
4171
+
4172
+ /**
4173
+ * Deserializes binary data (in protobuf wire format) from the
4174
+ * given reader into the given message object.
4175
+ * @param {!proto.wechaty.puppet.ContactDeleteRequest} msg The message object to deserialize into.
4176
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
4177
+ * @return {!proto.wechaty.puppet.ContactDeleteRequest}
4178
+ */
4179
+ proto.wechaty.puppet.ContactDeleteRequest.deserializeBinaryFromReader = function(msg, reader) {
4180
+ while (reader.nextField()) {
4181
+ if (reader.isEndGroup()) {
4182
+ break;
4183
+ }
4184
+ var field = reader.getFieldNumber();
4185
+ switch (field) {
4186
+ case 1:
4187
+ var value = /** @type {string} */ (reader.readString());
4188
+ msg.setContactId(value);
4189
+ break;
4190
+ default:
4191
+ reader.skipField();
4192
+ break;
4193
+ }
4194
+ }
4195
+ return msg;
4196
+ };
4197
+
4198
+
4199
+ /**
4200
+ * Serializes the message to binary data (in protobuf wire format).
4201
+ * @return {!Uint8Array}
4202
+ */
4203
+ proto.wechaty.puppet.ContactDeleteRequest.prototype.serializeBinary = function() {
4204
+ var writer = new jspb.BinaryWriter();
4205
+ proto.wechaty.puppet.ContactDeleteRequest.serializeBinaryToWriter(this, writer);
4206
+ return writer.getResultBuffer();
4207
+ };
4208
+
4209
+
4210
+ /**
4211
+ * Serializes the given message to binary data (in protobuf wire
4212
+ * format), writing to the given BinaryWriter.
4213
+ * @param {!proto.wechaty.puppet.ContactDeleteRequest} message
4214
+ * @param {!jspb.BinaryWriter} writer
4215
+ * @suppress {unusedLocalVariables} f is only used for nested messages
4216
+ */
4217
+ proto.wechaty.puppet.ContactDeleteRequest.serializeBinaryToWriter = function(message, writer) {
4218
+ var f = undefined;
4219
+ f = message.getContactId();
4220
+ if (f.length > 0) {
4221
+ writer.writeString(
4222
+ 1,
4223
+ f
4224
+ );
4225
+ }
4226
+ };
4227
+
4228
+
4229
+ /**
4230
+ * optional string contact_id = 1;
4231
+ * @return {string}
4232
+ */
4233
+ proto.wechaty.puppet.ContactDeleteRequest.prototype.getContactId = function() {
4234
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
4235
+ };
4236
+
4237
+
4238
+ /**
4239
+ * @param {string} value
4240
+ * @return {!proto.wechaty.puppet.ContactDeleteRequest} returns this
4241
+ */
4242
+ proto.wechaty.puppet.ContactDeleteRequest.prototype.setContactId = function(value) {
4243
+ return jspb.Message.setProto3StringField(this, 1, value);
4244
+ };
4245
+
4246
+
4247
+
4248
+
4249
+
4250
+ if (jspb.Message.GENERATE_TO_OBJECT) {
4251
+ /**
4252
+ * Creates an object representation of this proto.
4253
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
4254
+ * Optional fields that are not set will be set to undefined.
4255
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
4256
+ * For the list of reserved names please see:
4257
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
4258
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
4259
+ * JSPB instance for transitional soy proto support:
4260
+ * http://goto/soy-param-migration
4261
+ * @return {!Object}
4262
+ */
4263
+ proto.wechaty.puppet.ContactDeleteResponse.prototype.toObject = function(opt_includeInstance) {
4264
+ return proto.wechaty.puppet.ContactDeleteResponse.toObject(opt_includeInstance, this);
4265
+ };
4266
+
4267
+
4268
+ /**
4269
+ * Static version of the {@see toObject} method.
4270
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
4271
+ * the JSPB instance for transitional soy proto support:
4272
+ * http://goto/soy-param-migration
4273
+ * @param {!proto.wechaty.puppet.ContactDeleteResponse} msg The msg instance to transform.
4274
+ * @return {!Object}
4275
+ * @suppress {unusedLocalVariables} f is only used for nested messages
4276
+ */
4277
+ proto.wechaty.puppet.ContactDeleteResponse.toObject = function(includeInstance, msg) {
4278
+ var f, obj = {
4279
+
4280
+ };
4281
+
4282
+ if (includeInstance) {
4283
+ obj.$jspbMessageInstance = msg;
4284
+ }
4285
+ return obj;
4286
+ };
4287
+ }
4288
+
4289
+
4290
+ /**
4291
+ * Deserializes binary data (in protobuf wire format).
4292
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
4293
+ * @return {!proto.wechaty.puppet.ContactDeleteResponse}
4294
+ */
4295
+ proto.wechaty.puppet.ContactDeleteResponse.deserializeBinary = function(bytes) {
4296
+ var reader = new jspb.BinaryReader(bytes);
4297
+ var msg = new proto.wechaty.puppet.ContactDeleteResponse;
4298
+ return proto.wechaty.puppet.ContactDeleteResponse.deserializeBinaryFromReader(msg, reader);
4299
+ };
4300
+
4301
+
4302
+ /**
4303
+ * Deserializes binary data (in protobuf wire format) from the
4304
+ * given reader into the given message object.
4305
+ * @param {!proto.wechaty.puppet.ContactDeleteResponse} msg The message object to deserialize into.
4306
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
4307
+ * @return {!proto.wechaty.puppet.ContactDeleteResponse}
4308
+ */
4309
+ proto.wechaty.puppet.ContactDeleteResponse.deserializeBinaryFromReader = function(msg, reader) {
4310
+ while (reader.nextField()) {
4311
+ if (reader.isEndGroup()) {
4312
+ break;
4313
+ }
4314
+ var field = reader.getFieldNumber();
4315
+ switch (field) {
4316
+ default:
4317
+ reader.skipField();
4318
+ break;
4319
+ }
4320
+ }
4321
+ return msg;
4322
+ };
4323
+
4324
+
4325
+ /**
4326
+ * Serializes the message to binary data (in protobuf wire format).
4327
+ * @return {!Uint8Array}
4328
+ */
4329
+ proto.wechaty.puppet.ContactDeleteResponse.prototype.serializeBinary = function() {
4330
+ var writer = new jspb.BinaryWriter();
4331
+ proto.wechaty.puppet.ContactDeleteResponse.serializeBinaryToWriter(this, writer);
4332
+ return writer.getResultBuffer();
4333
+ };
4334
+
4335
+
4336
+ /**
4337
+ * Serializes the given message to binary data (in protobuf wire
4338
+ * format), writing to the given BinaryWriter.
4339
+ * @param {!proto.wechaty.puppet.ContactDeleteResponse} message
4340
+ * @param {!jspb.BinaryWriter} writer
4341
+ * @suppress {unusedLocalVariables} f is only used for nested messages
4342
+ */
4343
+ proto.wechaty.puppet.ContactDeleteResponse.serializeBinaryToWriter = function(message, writer) {
4344
+ var f = undefined;
4345
+ };
4346
+
4347
+
4073
4348
  /**
4074
4349
  * @enum {number}
4075
4350
  */
@@ -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.35
12
+ version: 1.0.37
13
13
  contact:
14
14
  name: Wechaty
15
15
  url: 'https://github.com/wechaty/openapi'
@@ -128,6 +128,30 @@ paths:
128
128
  type: string
129
129
  tags:
130
130
  - Puppet
131
+ '/contacts/{contactId}/delete':
132
+ put:
133
+ operationId: Puppet_ContactDelete
134
+ responses:
135
+ '200':
136
+ description: A successful response.
137
+ schema:
138
+ $ref: '#/definitions/puppetContactDeleteResponse'
139
+ default:
140
+ description: An unexpected error response.
141
+ schema:
142
+ $ref: '#/definitions/rpcStatus'
143
+ parameters:
144
+ - name: contactId
145
+ in: path
146
+ required: true
147
+ type: string
148
+ - name: body
149
+ in: body
150
+ required: true
151
+ schema:
152
+ type: object
153
+ tags:
154
+ - Puppet
131
155
  '/contacts/{contactId}/description':
132
156
  put:
133
157
  operationId: Puppet_ContactDescription
@@ -2137,6 +2161,8 @@ definitions:
2137
2161
  type: string
2138
2162
  puppetContactCorporationRemarkResponse:
2139
2163
  type: object
2164
+ puppetContactDeleteResponse:
2165
+ type: object
2140
2166
  puppetContactDescriptionResponse:
2141
2167
  type: object
2142
2168
  puppetContactGender:
@@ -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.35",
6
+ "version": "1.0.37",
7
7
  "contact": {
8
8
  "name": "Wechaty",
9
9
  "url": "https://github.com/wechaty/openapi",
@@ -182,6 +182,44 @@
182
182
  ]
183
183
  }
184
184
  },
185
+ "/contacts/{contactId}/delete": {
186
+ "put": {
187
+ "operationId": "Puppet_ContactDelete",
188
+ "responses": {
189
+ "200": {
190
+ "description": "A successful response.",
191
+ "schema": {
192
+ "$ref": "#/definitions/puppetContactDeleteResponse"
193
+ }
194
+ },
195
+ "default": {
196
+ "description": "An unexpected error response.",
197
+ "schema": {
198
+ "$ref": "#/definitions/rpcStatus"
199
+ }
200
+ }
201
+ },
202
+ "parameters": [
203
+ {
204
+ "name": "contactId",
205
+ "in": "path",
206
+ "required": true,
207
+ "type": "string"
208
+ },
209
+ {
210
+ "name": "body",
211
+ "in": "body",
212
+ "required": true,
213
+ "schema": {
214
+ "type": "object"
215
+ }
216
+ }
217
+ ],
218
+ "tags": [
219
+ "Puppet"
220
+ ]
221
+ }
222
+ },
185
223
  "/contacts/{contactId}/description": {
186
224
  "put": {
187
225
  "operationId": "Puppet_ContactDescription",
@@ -3189,6 +3227,9 @@
3189
3227
  "puppetContactCorporationRemarkResponse": {
3190
3228
  "type": "object"
3191
3229
  },
3230
+ "puppetContactDeleteResponse": {
3231
+ "type": "object"
3232
+ },
3192
3233
  "puppetContactDescriptionResponse": {
3193
3234
  "type": "object"
3194
3235
  },
@@ -44,6 +44,7 @@ interface IPuppetService extends grpc.ServiceDefinition<grpc.UntypedServiceImple
44
44
  contactPhone: IPuppetService_IContactPhone;
45
45
  contactCorporationRemark: IPuppetService_IContactCorporationRemark;
46
46
  contactDescription: IPuppetService_IContactDescription;
47
+ contactDelete: IPuppetService_IContactDelete;
47
48
  contactList: IPuppetService_IContactList;
48
49
  friendshipPayload: IPuppetService_IFriendshipPayload;
49
50
  friendshipSearchPhone: IPuppetService_IFriendshipSearchPhone;
@@ -288,6 +289,15 @@ interface IPuppetService_IContactDescription extends grpc.MethodDefinition<wecha
288
289
  responseSerialize: grpc.serialize<wechaty_puppet_contact_pb.ContactDescriptionResponse>;
289
290
  responseDeserialize: grpc.deserialize<wechaty_puppet_contact_pb.ContactDescriptionResponse>;
290
291
  }
292
+ interface IPuppetService_IContactDelete extends grpc.MethodDefinition<wechaty_puppet_contact_pb.ContactDeleteRequest, wechaty_puppet_contact_pb.ContactDeleteResponse> {
293
+ path: "/wechaty.Puppet/ContactDelete";
294
+ requestStream: false;
295
+ responseStream: false;
296
+ requestSerialize: grpc.serialize<wechaty_puppet_contact_pb.ContactDeleteRequest>;
297
+ requestDeserialize: grpc.deserialize<wechaty_puppet_contact_pb.ContactDeleteRequest>;
298
+ responseSerialize: grpc.serialize<wechaty_puppet_contact_pb.ContactDeleteResponse>;
299
+ responseDeserialize: grpc.deserialize<wechaty_puppet_contact_pb.ContactDeleteResponse>;
300
+ }
291
301
  interface IPuppetService_IContactList extends grpc.MethodDefinition<wechaty_puppet_contact_pb.ContactListRequest, wechaty_puppet_contact_pb.ContactListResponse> {
292
302
  path: "/wechaty.Puppet/ContactList";
293
303
  requestStream: false;
@@ -870,6 +880,7 @@ export interface IPuppetServer extends grpc.UntypedServiceImplementation {
870
880
  contactPhone: grpc.handleUnaryCall<wechaty_puppet_contact_pb.ContactPhoneRequest, wechaty_puppet_contact_pb.ContactPhoneResponse>;
871
881
  contactCorporationRemark: grpc.handleUnaryCall<wechaty_puppet_contact_pb.ContactCorporationRemarkRequest, wechaty_puppet_contact_pb.ContactCorporationRemarkResponse>;
872
882
  contactDescription: grpc.handleUnaryCall<wechaty_puppet_contact_pb.ContactDescriptionRequest, wechaty_puppet_contact_pb.ContactDescriptionResponse>;
883
+ contactDelete: grpc.handleUnaryCall<wechaty_puppet_contact_pb.ContactDeleteRequest, wechaty_puppet_contact_pb.ContactDeleteResponse>;
873
884
  contactList: grpc.handleUnaryCall<wechaty_puppet_contact_pb.ContactListRequest, wechaty_puppet_contact_pb.ContactListResponse>;
874
885
  friendshipPayload: grpc.handleUnaryCall<wechaty_puppet_friendship_pb.FriendshipPayloadRequest, wechaty_puppet_friendship_pb.FriendshipPayloadResponse>;
875
886
  friendshipSearchPhone: grpc.handleUnaryCall<wechaty_puppet_friendship_pb.FriendshipSearchPhoneRequest, wechaty_puppet_friendship_pb.FriendshipSearchPhoneResponse>;
@@ -993,6 +1004,9 @@ export interface IPuppetClient {
993
1004
  contactDescription(request: wechaty_puppet_contact_pb.ContactDescriptionRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_contact_pb.ContactDescriptionResponse) => void): grpc.ClientUnaryCall;
994
1005
  contactDescription(request: wechaty_puppet_contact_pb.ContactDescriptionRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_contact_pb.ContactDescriptionResponse) => void): grpc.ClientUnaryCall;
995
1006
  contactDescription(request: wechaty_puppet_contact_pb.ContactDescriptionRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_contact_pb.ContactDescriptionResponse) => void): grpc.ClientUnaryCall;
1007
+ contactDelete(request: wechaty_puppet_contact_pb.ContactDeleteRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_contact_pb.ContactDeleteResponse) => void): grpc.ClientUnaryCall;
1008
+ contactDelete(request: wechaty_puppet_contact_pb.ContactDeleteRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_contact_pb.ContactDeleteResponse) => void): grpc.ClientUnaryCall;
1009
+ contactDelete(request: wechaty_puppet_contact_pb.ContactDeleteRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_contact_pb.ContactDeleteResponse) => void): grpc.ClientUnaryCall;
996
1010
  contactList(request: wechaty_puppet_contact_pb.ContactListRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_contact_pb.ContactListResponse) => void): grpc.ClientUnaryCall;
997
1011
  contactList(request: wechaty_puppet_contact_pb.ContactListRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_contact_pb.ContactListResponse) => void): grpc.ClientUnaryCall;
998
1012
  contactList(request: wechaty_puppet_contact_pb.ContactListRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_contact_pb.ContactListResponse) => void): grpc.ClientUnaryCall;
@@ -1241,6 +1255,9 @@ export class PuppetClient extends grpc.Client implements IPuppetClient {
1241
1255
  public contactDescription(request: wechaty_puppet_contact_pb.ContactDescriptionRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_contact_pb.ContactDescriptionResponse) => void): grpc.ClientUnaryCall;
1242
1256
  public contactDescription(request: wechaty_puppet_contact_pb.ContactDescriptionRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_contact_pb.ContactDescriptionResponse) => void): grpc.ClientUnaryCall;
1243
1257
  public contactDescription(request: wechaty_puppet_contact_pb.ContactDescriptionRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_contact_pb.ContactDescriptionResponse) => void): grpc.ClientUnaryCall;
1258
+ public contactDelete(request: wechaty_puppet_contact_pb.ContactDeleteRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_contact_pb.ContactDeleteResponse) => void): grpc.ClientUnaryCall;
1259
+ public contactDelete(request: wechaty_puppet_contact_pb.ContactDeleteRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_contact_pb.ContactDeleteResponse) => void): grpc.ClientUnaryCall;
1260
+ public contactDelete(request: wechaty_puppet_contact_pb.ContactDeleteRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_contact_pb.ContactDeleteResponse) => void): grpc.ClientUnaryCall;
1244
1261
  public contactList(request: wechaty_puppet_contact_pb.ContactListRequest, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_contact_pb.ContactListResponse) => void): grpc.ClientUnaryCall;
1245
1262
  public contactList(request: wechaty_puppet_contact_pb.ContactListRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_contact_pb.ContactListResponse) => void): grpc.ClientUnaryCall;
1246
1263
  public contactList(request: wechaty_puppet_contact_pb.ContactListRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: wechaty_puppet_contact_pb.ContactListResponse) => void): grpc.ClientUnaryCall;
@@ -98,6 +98,28 @@ function deserialize_wechaty_puppet_ContactCorporationRemarkResponse(buffer_arg)
98
98
  return wechaty_puppet_contact_pb.ContactCorporationRemarkResponse.deserializeBinary(new Uint8Array(buffer_arg));
99
99
  }
100
100
 
101
+ function serialize_wechaty_puppet_ContactDeleteRequest(arg) {
102
+ if (!(arg instanceof wechaty_puppet_contact_pb.ContactDeleteRequest)) {
103
+ throw new Error('Expected argument of type wechaty.puppet.ContactDeleteRequest');
104
+ }
105
+ return Buffer.from(arg.serializeBinary());
106
+ }
107
+
108
+ function deserialize_wechaty_puppet_ContactDeleteRequest(buffer_arg) {
109
+ return wechaty_puppet_contact_pb.ContactDeleteRequest.deserializeBinary(new Uint8Array(buffer_arg));
110
+ }
111
+
112
+ function serialize_wechaty_puppet_ContactDeleteResponse(arg) {
113
+ if (!(arg instanceof wechaty_puppet_contact_pb.ContactDeleteResponse)) {
114
+ throw new Error('Expected argument of type wechaty.puppet.ContactDeleteResponse');
115
+ }
116
+ return Buffer.from(arg.serializeBinary());
117
+ }
118
+
119
+ function deserialize_wechaty_puppet_ContactDeleteResponse(buffer_arg) {
120
+ return wechaty_puppet_contact_pb.ContactDeleteResponse.deserializeBinary(new Uint8Array(buffer_arg));
121
+ }
122
+
101
123
  function serialize_wechaty_puppet_ContactDescriptionRequest(arg) {
102
124
  if (!(arg instanceof wechaty_puppet_contact_pb.ContactDescriptionRequest)) {
103
125
  throw new Error('Expected argument of type wechaty.puppet.ContactDescriptionRequest');
@@ -2054,6 +2076,17 @@ contactPayload: {
2054
2076
  responseSerialize: serialize_wechaty_puppet_ContactDescriptionResponse,
2055
2077
  responseDeserialize: deserialize_wechaty_puppet_ContactDescriptionResponse,
2056
2078
  },
2079
+ contactDelete: {
2080
+ path: '/wechaty.Puppet/ContactDelete',
2081
+ requestStream: false,
2082
+ responseStream: false,
2083
+ requestType: wechaty_puppet_contact_pb.ContactDeleteRequest,
2084
+ responseType: wechaty_puppet_contact_pb.ContactDeleteResponse,
2085
+ requestSerialize: serialize_wechaty_puppet_ContactDeleteRequest,
2086
+ requestDeserialize: deserialize_wechaty_puppet_ContactDeleteRequest,
2087
+ responseSerialize: serialize_wechaty_puppet_ContactDeleteResponse,
2088
+ responseDeserialize: deserialize_wechaty_puppet_ContactDeleteResponse,
2089
+ },
2057
2090
  // *
2058
2091
  // Huan(202002): consider changing response to a stream in the future for better performance
2059
2092
  contactList: {
@@ -198,6 +198,15 @@ type PuppetContactDescription = {
198
198
  readonly responseType: typeof wechaty_puppet_contact_pb.ContactDescriptionResponse;
199
199
  };
200
200
 
201
+ type PuppetContactDelete = {
202
+ readonly methodName: string;
203
+ readonly service: typeof Puppet;
204
+ readonly requestStream: false;
205
+ readonly responseStream: false;
206
+ readonly requestType: typeof wechaty_puppet_contact_pb.ContactDeleteRequest;
207
+ readonly responseType: typeof wechaty_puppet_contact_pb.ContactDeleteResponse;
208
+ };
209
+
201
210
  type PuppetContactList = {
202
211
  readonly methodName: string;
203
212
  readonly service: typeof Puppet;
@@ -778,6 +787,7 @@ export class Puppet {
778
787
  static readonly ContactPhone: PuppetContactPhone;
779
788
  static readonly ContactCorporationRemark: PuppetContactCorporationRemark;
780
789
  static readonly ContactDescription: PuppetContactDescription;
790
+ static readonly ContactDelete: PuppetContactDelete;
781
791
  static readonly ContactList: PuppetContactList;
782
792
  static readonly FriendshipPayload: PuppetFriendshipPayload;
783
793
  static readonly FriendshipSearchPhone: PuppetFriendshipSearchPhone;
@@ -1022,6 +1032,15 @@ export class PuppetClient {
1022
1032
  requestMessage: wechaty_puppet_contact_pb.ContactDescriptionRequest,
1023
1033
  callback: (error: ServiceError|null, responseMessage: wechaty_puppet_contact_pb.ContactDescriptionResponse|null) => void
1024
1034
  ): UnaryResponse;
1035
+ contactDelete(
1036
+ requestMessage: wechaty_puppet_contact_pb.ContactDeleteRequest,
1037
+ metadata: grpc.Metadata,
1038
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_contact_pb.ContactDeleteResponse|null) => void
1039
+ ): UnaryResponse;
1040
+ contactDelete(
1041
+ requestMessage: wechaty_puppet_contact_pb.ContactDeleteRequest,
1042
+ callback: (error: ServiceError|null, responseMessage: wechaty_puppet_contact_pb.ContactDeleteResponse|null) => void
1043
+ ): UnaryResponse;
1025
1044
  contactList(
1026
1045
  requestMessage: wechaty_puppet_contact_pb.ContactListRequest,
1027
1046
  metadata: grpc.Metadata,
@@ -204,6 +204,15 @@ Puppet.ContactDescription = {
204
204
  responseType: wechaty_puppet_contact_pb.ContactDescriptionResponse
205
205
  };
206
206
 
207
+ Puppet.ContactDelete = {
208
+ methodName: "ContactDelete",
209
+ service: Puppet,
210
+ requestStream: false,
211
+ responseStream: false,
212
+ requestType: wechaty_puppet_contact_pb.ContactDeleteRequest,
213
+ responseType: wechaty_puppet_contact_pb.ContactDeleteResponse
214
+ };
215
+
207
216
  Puppet.ContactList = {
208
217
  methodName: "ContactList",
209
218
  service: Puppet,
@@ -1423,6 +1432,37 @@ PuppetClient.prototype.contactDescription = function contactDescription(requestM
1423
1432
  };
1424
1433
  };
1425
1434
 
1435
+ PuppetClient.prototype.contactDelete = function contactDelete(requestMessage, metadata, callback) {
1436
+ if (arguments.length === 2) {
1437
+ callback = arguments[1];
1438
+ }
1439
+ var client = grpc.unary(Puppet.ContactDelete, {
1440
+ request: requestMessage,
1441
+ host: this.serviceHost,
1442
+ metadata: metadata,
1443
+ transport: this.options.transport,
1444
+ debug: this.options.debug,
1445
+ onEnd: function (response) {
1446
+ if (callback) {
1447
+ if (response.status !== grpc.Code.OK) {
1448
+ var err = new Error(response.statusMessage);
1449
+ err.code = response.status;
1450
+ err.metadata = response.trailers;
1451
+ callback(err, null);
1452
+ } else {
1453
+ callback(null, response.message);
1454
+ }
1455
+ }
1456
+ }
1457
+ });
1458
+ return {
1459
+ cancel: function () {
1460
+ callback = null;
1461
+ client.close();
1462
+ }
1463
+ };
1464
+ };
1465
+
1426
1466
  PuppetClient.prototype.contactList = function contactList(requestMessage, metadata, callback) {
1427
1467
  if (arguments.length === 2) {
1428
1468
  callback = arguments[1];
@@ -123,3 +123,9 @@ message ContactDescriptionRequest {
123
123
  }
124
124
 
125
125
  message ContactDescriptionResponse {}
126
+
127
+ message ContactDeleteRequest {
128
+ string contact_id = 1;
129
+ }
130
+
131
+ message ContactDeleteResponse {}
@@ -225,6 +225,12 @@ service Puppet {
225
225
  body: "*"
226
226
  };
227
227
  }
228
+ rpc ContactDelete (puppet.ContactDeleteRequest) returns (puppet.ContactDeleteResponse) {
229
+ option (google.api.http) = {
230
+ put: "/contacts/{contact_id}/delete"
231
+ body: "*"
232
+ };
233
+ }
228
234
 
229
235
  /**
230
236
  * Huan(202002): consider changing response to a stream in the future for better performance
@@ -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.35",
6
+ "version": "1.0.37",
7
7
  "description": "gRPC for Wechaty",
8
8
  "type": "module",
9
9
  "exports": {