@vsniksnet/contracts 1.0.4 → 1.0.5

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
@@ -21,7 +21,7 @@ export interface CreateUserResponse {
21
21
  }
22
22
 
23
23
  export interface GetUserRequest {
24
- id: string;
24
+ userId: string;
25
25
  }
26
26
 
27
27
  export interface GetUserResponse {
@@ -39,6 +39,16 @@ export interface ListUsersResponse {
39
39
  total: number;
40
40
  }
41
41
 
42
+ export interface UpdateEmailRequest {
43
+ email: string;
44
+ userId: string;
45
+ }
46
+
47
+ export interface UpdateEmailResponse {
48
+ success: boolean;
49
+ email: string;
50
+ }
51
+
42
52
  export interface User {
43
53
  id: string;
44
54
  email: string;
@@ -62,6 +72,10 @@ export interface UsersServiceClient {
62
72
  /** List users */
63
73
 
64
74
  listUsers(request: ListUsersRequest): Observable<ListUsersResponse>;
75
+
76
+ /** Update email */
77
+
78
+ updateEmail(request: UpdateEmailRequest): Observable<UpdateEmailResponse>;
65
79
  }
66
80
 
67
81
  /** Users service */
@@ -80,11 +94,17 @@ export interface UsersServiceController {
80
94
  /** List users */
81
95
 
82
96
  listUsers(request: ListUsersRequest): Promise<ListUsersResponse> | Observable<ListUsersResponse> | ListUsersResponse;
97
+
98
+ /** Update email */
99
+
100
+ updateEmail(
101
+ request: UpdateEmailRequest,
102
+ ): Promise<UpdateEmailResponse> | Observable<UpdateEmailResponse> | UpdateEmailResponse;
83
103
  }
84
104
 
85
105
  export function UsersServiceControllerMethods() {
86
106
  return function (constructor: Function) {
87
- const grpcMethods: string[] = ["createUser", "getUser", "listUsers"];
107
+ const grpcMethods: string[] = ["createUser", "getUser", "listUsers", "updateEmail"];
88
108
  for (const method of grpcMethods) {
89
109
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
90
110
  GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vsniksnet/contracts",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Protobuf definitions and generated typescript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/users.proto CHANGED
@@ -4,12 +4,14 @@ package users.v1;
4
4
 
5
5
  /** Users service */
6
6
  service UsersService {
7
- /** Create user */
7
+ /* Create user */
8
8
  rpc CreateUser (CreateUserRequest) returns (CreateUserResponse);
9
- /** Get one user by id */
9
+ /* Get one user by id */
10
10
  rpc GetUser (GetUserRequest) returns (GetUserResponse);
11
- /** List users */
11
+ /* List users */
12
12
  rpc ListUsers (ListUsersRequest) returns (ListUsersResponse);
13
+ /* Update email */
14
+ rpc UpdateEmail (UpdateEmailRequest) returns (UpdateEmailResponse);
13
15
  }
14
16
 
15
17
  message CreateUserRequest {
@@ -23,7 +25,7 @@ message CreateUserResponse {
23
25
  }
24
26
 
25
27
  message GetUserRequest {
26
- string id = 1;
28
+ string user_id = 1;
27
29
  }
28
30
 
29
31
  message GetUserResponse {
@@ -41,6 +43,16 @@ message ListUsersResponse {
41
43
  int32 total = 2;
42
44
  }
43
45
 
46
+ message UpdateEmailRequest {
47
+ string email = 1;
48
+ string user_id = 2;
49
+ }
50
+
51
+ message UpdateEmailResponse {
52
+ bool success = 1;
53
+ string email = 2;
54
+ }
55
+
44
56
  message User {
45
57
  string id = 1;
46
58
  string email = 2;