@wdtest007/contracts 1.0.12 → 1.0.13

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/users.ts CHANGED
@@ -34,12 +34,23 @@ export interface CreateUserResponse {
34
34
  ok: boolean;
35
35
  }
36
36
 
37
+ export interface PatchUserRequest {
38
+ userId: string;
39
+ name?: string | undefined;
40
+ }
41
+
42
+ export interface PatchUserResponse {
43
+ ok: boolean;
44
+ }
45
+
37
46
  export const USERS_V1_PACKAGE_NAME = "users.v1";
38
47
 
39
48
  export interface UsersServiceClient {
40
49
  getMe(request: GetMeRequest): Observable<GetMeResponse>;
41
50
 
42
51
  createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
52
+
53
+ patchUser(request: PatchUserRequest): Observable<PatchUserResponse>;
43
54
  }
44
55
 
45
56
  export interface UsersServiceController {
@@ -48,11 +59,13 @@ export interface UsersServiceController {
48
59
  createUser(
49
60
  request: CreateUserRequest,
50
61
  ): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
62
+
63
+ patchUser(request: PatchUserRequest): Promise<PatchUserResponse> | Observable<PatchUserResponse> | PatchUserResponse;
51
64
  }
52
65
 
53
66
  export function UsersServiceControllerMethods() {
54
67
  return function (constructor: Function) {
55
- const grpcMethods: string[] = ["getMe", "createUser"];
68
+ const grpcMethods: string[] = ["getMe", "createUser", "patchUser"];
56
69
  for (const method of grpcMethods) {
57
70
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
58
71
  GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdtest007/contracts",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Protobuf definition and generated TS types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",
package/proto/users.proto CHANGED
@@ -3,29 +3,42 @@ syntax = "proto3";
3
3
  package users.v1;
4
4
 
5
5
  service UsersService {
6
- rpc GetMe(GetMeRequest) returns (GetMeResponse);
7
- rpc CreateUser(CreateUserRequest) returns (CreateUserResponse);
6
+ rpc GetMe(GetMeRequest) returns (GetMeResponse);
7
+ rpc CreateUser(CreateUserRequest) returns (CreateUserResponse);
8
+ rpc PatchUser(PatchUserRequest) returns (PatchUserResponse);
8
9
  }
9
10
 
10
11
  message GetMeRequest {
11
- string id = 1;
12
+ string id = 1;
12
13
  }
14
+
13
15
  message GetMeResponse {
14
- User user = 1;
16
+ User user = 1;
15
17
 
16
18
  }
17
19
 
18
20
  message User {
19
- string id = 1;
20
- optional string name = 2;
21
- optional string phone = 3;
22
- optional string email = 4;
23
- optional string avatar = 5;
21
+ string id = 1;
22
+ optional string name = 2;
23
+ optional string phone = 3;
24
+ optional string email = 4;
25
+ optional string avatar = 5;
24
26
  }
25
27
 
26
28
  message CreateUserRequest{
27
- string id =1;
29
+ string id = 1;
28
30
  }
31
+
29
32
  message CreateUserResponse{
30
- bool ok =1;
33
+ bool ok = 1;
34
+ }
35
+
36
+ message PatchUserRequest{
37
+ string user_id = 1;
38
+
39
+ optional string name = 2;
40
+ }
41
+
42
+ message PatchUserResponse{
43
+ bool ok = 1;
31
44
  }