@requ1emz/contracts 1.0.38 → 1.0.39

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/user.ts CHANGED
@@ -26,6 +26,17 @@ export interface SendCreateUserRequest {
26
26
  passwordHash: string;
27
27
  }
28
28
 
29
+ export interface UpdateUserRequest {
30
+ id: string;
31
+ email?: string | undefined;
32
+ username?: string | undefined;
33
+ passwordHash?: string | undefined;
34
+ }
35
+
36
+ export interface UpdateUserResponse {
37
+ status: boolean;
38
+ }
39
+
29
40
  export interface SendCreateUserResponse {
30
41
  id: string;
31
42
  }
@@ -61,6 +72,8 @@ export interface UserServiceClient {
61
72
  getUser(request: SendGetUserRequest): Observable<SendGetUserResponse>;
62
73
 
63
74
  deleteUser(request: SendDeleteUserRequest): Observable<SendDeleteUserResponse>;
75
+
76
+ updateUser(request: UpdateUserRequest): Observable<UpdateUserResponse>;
64
77
  }
65
78
 
66
79
  export interface UserServiceController {
@@ -79,11 +92,15 @@ export interface UserServiceController {
79
92
  deleteUser(
80
93
  request: SendDeleteUserRequest,
81
94
  ): Promise<SendDeleteUserResponse> | Observable<SendDeleteUserResponse> | SendDeleteUserResponse;
95
+
96
+ updateUser(
97
+ request: UpdateUserRequest,
98
+ ): Promise<UpdateUserResponse> | Observable<UpdateUserResponse> | UpdateUserResponse;
82
99
  }
83
100
 
84
101
  export function UserServiceControllerMethods() {
85
102
  return function (constructor: Function) {
86
- const grpcMethods: string[] = ["checkUserExists", "createUser", "getUser", "deleteUser"];
103
+ const grpcMethods: string[] = ["checkUserExists", "createUser", "getUser", "deleteUser", "updateUser"];
87
104
  for (const method of grpcMethods) {
88
105
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
89
106
  GrpcMethod("UserService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@requ1emz/contracts",
3
- "version": "1.0.38",
3
+ "version": "1.0.39",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/user.proto CHANGED
@@ -7,6 +7,7 @@ service UserService {
7
7
  rpc CreateUser (SendCreateUserRequest) returns (SendCreateUserResponse);
8
8
  rpc GetUser (SendGetUserRequest) returns (SendGetUserResponse);
9
9
  rpc DeleteUser (SendDeleteUserRequest) returns (SendDeleteUserResponse);
10
+ rpc UpdateUser (UpdateUserRequest) returns (UpdateUserResponse);
10
11
  }
11
12
 
12
13
  message SendCheckUserExistsRequest {
@@ -25,6 +26,17 @@ message SendCreateUserRequest {
25
26
  string password_hash = 3;
26
27
  }
27
28
 
29
+ message UpdateUserRequest {
30
+ string id = 1;
31
+ optional string email = 2;
32
+ optional string username = 3;
33
+ optional string password_hash = 4;
34
+ }
35
+
36
+ message UpdateUserResponse {
37
+ bool status = 1;
38
+ }
39
+
28
40
  message SendCreateUserResponse {
29
41
  string id = 1;
30
42
  }