@requ1emz/contracts 1.0.35 → 1.0.37

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/auth.ts CHANGED
@@ -30,6 +30,20 @@ export interface SendLoginResponse {
30
30
  refreshToken: string;
31
31
  }
32
32
 
33
+ export interface UpdateUserRequest {
34
+ id: string;
35
+ email?: string | undefined;
36
+ username?: string | undefined;
37
+ passwordHash?: string | undefined;
38
+ }
39
+
40
+ export interface UpdateUserResponse {
41
+ id: string;
42
+ email: string;
43
+ username: string;
44
+ passwordHash: string;
45
+ }
46
+
33
47
  export interface RefreshRequest {
34
48
  refreshToken: string;
35
49
  }
@@ -47,6 +61,8 @@ export interface AuthServiceClient {
47
61
  login(request: SendLoginRequest): Observable<SendLoginResponse>;
48
62
 
49
63
  refresh(request: RefreshRequest): Observable<RefreshResponse>;
64
+
65
+ updateUser(request: UpdateUserRequest): Observable<UpdateUserResponse>;
50
66
  }
51
67
 
52
68
  export interface AuthServiceController {
@@ -57,11 +73,15 @@ export interface AuthServiceController {
57
73
  login(request: SendLoginRequest): Promise<SendLoginResponse> | Observable<SendLoginResponse> | SendLoginResponse;
58
74
 
59
75
  refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
76
+
77
+ updateUser(
78
+ request: UpdateUserRequest,
79
+ ): Promise<UpdateUserResponse> | Observable<UpdateUserResponse> | UpdateUserResponse;
60
80
  }
61
81
 
62
82
  export function AuthServiceControllerMethods() {
63
83
  return function (constructor: Function) {
64
- const grpcMethods: string[] = ["register", "login", "refresh"];
84
+ const grpcMethods: string[] = ["register", "login", "refresh", "updateUser"];
65
85
  for (const method of grpcMethods) {
66
86
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
67
87
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/gen/user.ts CHANGED
@@ -43,20 +43,6 @@ export interface SendGetUserResponse {
43
43
  passwordHash: string;
44
44
  }
45
45
 
46
- export interface SendUpdateUserRequest {
47
- id: string;
48
- email: string;
49
- username: string;
50
- password: string;
51
- }
52
-
53
- export interface SendUpdateUserResponse {
54
- id: string;
55
- email: string;
56
- username: string;
57
- passwordHash: string;
58
- }
59
-
60
46
  export interface SendDeleteUserRequest {
61
47
  id: string;
62
48
  }
@@ -74,8 +60,6 @@ export interface UserServiceClient {
74
60
 
75
61
  getUser(request: SendGetUserRequest): Observable<SendGetUserResponse>;
76
62
 
77
- updateUser(request: SendUpdateUserRequest): Observable<SendUpdateUserResponse>;
78
-
79
63
  deleteUser(request: SendDeleteUserRequest): Observable<SendDeleteUserResponse>;
80
64
  }
81
65
 
@@ -92,10 +76,6 @@ export interface UserServiceController {
92
76
  request: SendGetUserRequest,
93
77
  ): Promise<SendGetUserResponse> | Observable<SendGetUserResponse> | SendGetUserResponse;
94
78
 
95
- updateUser(
96
- request: SendUpdateUserRequest,
97
- ): Promise<SendUpdateUserResponse> | Observable<SendUpdateUserResponse> | SendUpdateUserResponse;
98
-
99
79
  deleteUser(
100
80
  request: SendDeleteUserRequest,
101
81
  ): Promise<SendDeleteUserResponse> | Observable<SendDeleteUserResponse> | SendDeleteUserResponse;
@@ -103,7 +83,7 @@ export interface UserServiceController {
103
83
 
104
84
  export function UserServiceControllerMethods() {
105
85
  return function (constructor: Function) {
106
- const grpcMethods: string[] = ["checkUserExists", "createUser", "getUser", "updateUser", "deleteUser"];
86
+ const grpcMethods: string[] = ["checkUserExists", "createUser", "getUser", "deleteUser"];
107
87
  for (const method of grpcMethods) {
108
88
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
109
89
  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.35",
3
+ "version": "1.0.37",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/auth.proto CHANGED
@@ -6,6 +6,7 @@ service AuthService {
6
6
  rpc Register (SendRegistrationRequest) returns (SendRegistationResponse );
7
7
  rpc Login (SendLoginRequest) returns (SendLoginResponse);
8
8
  rpc Refresh (RefreshRequest) returns (RefreshResponse);
9
+ rpc UpdateUser (UpdateUserRequest) returns (UpdateUserResponse);
9
10
  }
10
11
 
11
12
  message SendRegistrationRequest {
@@ -28,6 +29,20 @@ message SendLoginResponse {
28
29
  string refresh_token = 2;
29
30
  }
30
31
 
32
+ message UpdateUserRequest {
33
+ string id = 1;
34
+ optional string email = 2;
35
+ optional string username = 3;
36
+ optional string password_hash = 4;
37
+ }
38
+
39
+ message UpdateUserResponse {
40
+ string id = 1;
41
+ string email = 2;
42
+ string username = 3;
43
+ string password_hash =4;
44
+ }
45
+
31
46
  message RefreshRequest {
32
47
  string refresh_token = 1;
33
48
  }
package/proto/user.proto CHANGED
@@ -6,7 +6,6 @@ service UserService {
6
6
  rpc CheckUserExists (SendCheckUserExistsRequest) returns (SendCheckUserExistsResponse);
7
7
  rpc CreateUser (SendCreateUserRequest) returns (SendCreateUserResponse);
8
8
  rpc GetUser (SendGetUserRequest) returns (SendGetUserResponse);
9
- rpc UpdateUser (SendUpdateUserRequest) returns (SendUpdateUserResponse);
10
9
  rpc DeleteUser (SendDeleteUserRequest) returns (SendDeleteUserResponse);
11
10
  }
12
11
 
@@ -45,20 +44,6 @@ message SendGetUserResponse {
45
44
  string password_hash = 4;
46
45
  }
47
46
 
48
- message SendUpdateUserRequest {
49
- string id = 1;
50
- string email = 2;
51
- string username = 3;
52
- string password = 4;
53
- }
54
-
55
- message SendUpdateUserResponse {
56
- string id = 1;
57
- string email = 2;
58
- string username = 3;
59
- string password_hash =4;
60
- }
61
-
62
47
  message SendDeleteUserRequest {
63
48
  string id = 1;
64
49
  }