@testcinemaorg/contracts 1.1.2 → 1.1.3

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