@sa2-movie-ticket/contracts 1.0.17 → 1.0.18

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.
package/gen/ts/users.ts CHANGED
@@ -34,6 +34,12 @@ export interface UserResponse {
34
34
  user: User | undefined;
35
35
  }
36
36
 
37
+ export interface PatchUserRequest {
38
+ userId: string;
39
+ name?: string | undefined;
40
+ avater?: string | undefined;
41
+ }
42
+
37
43
  export interface User {
38
44
  id: string;
39
45
  name?: string | undefined;
@@ -218,6 +224,102 @@ export const UserResponse: MessageFns<UserResponse> = {
218
224
  },
219
225
  };
220
226
 
227
+ function createBasePatchUserRequest(): PatchUserRequest {
228
+ return { userId: "", name: undefined, avater: undefined };
229
+ }
230
+
231
+ export const PatchUserRequest: MessageFns<PatchUserRequest> = {
232
+ encode(message: PatchUserRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
233
+ if (message.userId !== "") {
234
+ writer.uint32(10).string(message.userId);
235
+ }
236
+ if (message.name !== undefined) {
237
+ writer.uint32(18).string(message.name);
238
+ }
239
+ if (message.avater !== undefined) {
240
+ writer.uint32(26).string(message.avater);
241
+ }
242
+ return writer;
243
+ },
244
+
245
+ decode(input: BinaryReader | Uint8Array, length?: number): PatchUserRequest {
246
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
247
+ const end = length === undefined ? reader.len : reader.pos + length;
248
+ const message = createBasePatchUserRequest();
249
+ while (reader.pos < end) {
250
+ const tag = reader.uint32();
251
+ switch (tag >>> 3) {
252
+ case 1: {
253
+ if (tag !== 10) {
254
+ break;
255
+ }
256
+
257
+ message.userId = reader.string();
258
+ continue;
259
+ }
260
+ case 2: {
261
+ if (tag !== 18) {
262
+ break;
263
+ }
264
+
265
+ message.name = reader.string();
266
+ continue;
267
+ }
268
+ case 3: {
269
+ if (tag !== 26) {
270
+ break;
271
+ }
272
+
273
+ message.avater = reader.string();
274
+ continue;
275
+ }
276
+ }
277
+ if ((tag & 7) === 4 || tag === 0) {
278
+ break;
279
+ }
280
+ reader.skip(tag & 7);
281
+ }
282
+ return message;
283
+ },
284
+
285
+ fromJSON(object: any): PatchUserRequest {
286
+ return {
287
+ userId: isSet(object.userId)
288
+ ? globalThis.String(object.userId)
289
+ : isSet(object.user_id)
290
+ ? globalThis.String(object.user_id)
291
+ : "",
292
+ name: isSet(object.name) ? globalThis.String(object.name) : undefined,
293
+ avater: isSet(object.avater) ? globalThis.String(object.avater) : undefined,
294
+ };
295
+ },
296
+
297
+ toJSON(message: PatchUserRequest): unknown {
298
+ const obj: any = {};
299
+ if (message.userId !== "") {
300
+ obj.userId = message.userId;
301
+ }
302
+ if (message.name !== undefined) {
303
+ obj.name = message.name;
304
+ }
305
+ if (message.avater !== undefined) {
306
+ obj.avater = message.avater;
307
+ }
308
+ return obj;
309
+ },
310
+
311
+ create<I extends Exact<DeepPartial<PatchUserRequest>, I>>(base?: I): PatchUserRequest {
312
+ return PatchUserRequest.fromPartial(base ?? ({} as any));
313
+ },
314
+ fromPartial<I extends Exact<DeepPartial<PatchUserRequest>, I>>(object: I): PatchUserRequest {
315
+ const message = createBasePatchUserRequest();
316
+ message.userId = object.userId ?? "";
317
+ message.name = object.name ?? undefined;
318
+ message.avater = object.avater ?? undefined;
319
+ return message;
320
+ },
321
+ };
322
+
221
323
  function createBaseUser(): User {
222
324
  return {
223
325
  id: "",
@@ -410,11 +512,21 @@ export const UsersServiceService = {
410
512
  responseSerialize: (value: Empty): Buffer => Buffer.from(Empty.encode(value).finish()),
411
513
  responseDeserialize: (value: Buffer): Empty => Empty.decode(value),
412
514
  },
515
+ patchUser: {
516
+ path: "/users.v1.UsersService/PatchUser",
517
+ requestStream: false,
518
+ responseStream: false,
519
+ requestSerialize: (value: PatchUserRequest): Buffer => Buffer.from(PatchUserRequest.encode(value).finish()),
520
+ requestDeserialize: (value: Buffer): PatchUserRequest => PatchUserRequest.decode(value),
521
+ responseSerialize: (value: Empty): Buffer => Buffer.from(Empty.encode(value).finish()),
522
+ responseDeserialize: (value: Buffer): Empty => Empty.decode(value),
523
+ },
413
524
  } as const;
414
525
 
415
526
  export interface UsersServiceServer extends UntypedServiceImplementation {
416
527
  getUserById: handleUnaryCall<GetUserByIdRequest, UserResponse>;
417
528
  createUser: handleUnaryCall<CreateUserRequest, Empty>;
529
+ patchUser: handleUnaryCall<PatchUserRequest, Empty>;
418
530
  }
419
531
 
420
532
  export interface UsersServiceClient extends Client {
@@ -448,6 +560,21 @@ export interface UsersServiceClient extends Client {
448
560
  options: Partial<CallOptions>,
449
561
  callback: (error: ServiceError | null, response: Empty) => void,
450
562
  ): ClientUnaryCall;
563
+ patchUser(
564
+ request: PatchUserRequest,
565
+ callback: (error: ServiceError | null, response: Empty) => void,
566
+ ): ClientUnaryCall;
567
+ patchUser(
568
+ request: PatchUserRequest,
569
+ metadata: Metadata,
570
+ callback: (error: ServiceError | null, response: Empty) => void,
571
+ ): ClientUnaryCall;
572
+ patchUser(
573
+ request: PatchUserRequest,
574
+ metadata: Metadata,
575
+ options: Partial<CallOptions>,
576
+ callback: (error: ServiceError | null, response: Empty) => void,
577
+ ): ClientUnaryCall;
451
578
  }
452
579
 
453
580
  export const UsersServiceClient = makeGenericClientConstructor(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sa2-movie-ticket/contracts",
3
3
  "description": "Contracts for movie ticket microservices",
4
- "version": "1.0.17",
4
+ "version": "1.0.18",
5
5
  "license": "ISC",
6
6
  "type": "commonjs",
7
7
  "main": "dist/index.js",
package/proto/users.proto CHANGED
@@ -10,6 +10,7 @@ service UsersService {
10
10
  rpc GetUserById(GetUserByIdRequest) returns (UserResponse);
11
11
  rpc CreateUser(CreateUserRequest) returns (google.protobuf.Empty);
12
12
 
13
+ rpc PatchUser(PatchUserRequest) returns (google.protobuf.Empty);
13
14
  }
14
15
 
15
16
  message GetUserByIdRequest {
@@ -24,6 +25,12 @@ message UserResponse {
24
25
  User user = 1;
25
26
  }
26
27
 
28
+ message PatchUserRequest {
29
+ string user_id = 1;
30
+ optional string name = 2;
31
+ optional string avater = 3;
32
+ }
33
+
27
34
  message User {
28
35
  string id = 1;
29
36
  optional string name = 2;