@requ1emz/contracts 1.0.37 → 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/auth.ts +3 -5
- package/gen/user.ts +18 -1
- package/package.json +1 -1
- package/proto/auth.proto +3 -5
- package/proto/user.proto +12 -0
package/gen/auth.ts
CHANGED
|
@@ -34,14 +34,12 @@ export interface UpdateUserRequest {
|
|
|
34
34
|
id: string;
|
|
35
35
|
email?: string | undefined;
|
|
36
36
|
username?: string | undefined;
|
|
37
|
-
|
|
37
|
+
currentPassword?: string | undefined;
|
|
38
|
+
newPassword?: string | undefined;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
export interface UpdateUserResponse {
|
|
41
|
-
|
|
42
|
-
email: string;
|
|
43
|
-
username: string;
|
|
44
|
-
passwordHash: string;
|
|
42
|
+
status: boolean;
|
|
45
43
|
}
|
|
46
44
|
|
|
47
45
|
export interface RefreshRequest {
|
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
package/proto/auth.proto
CHANGED
|
@@ -33,14 +33,12 @@ message UpdateUserRequest {
|
|
|
33
33
|
string id = 1;
|
|
34
34
|
optional string email = 2;
|
|
35
35
|
optional string username = 3;
|
|
36
|
-
optional string
|
|
36
|
+
optional string current_password = 4;
|
|
37
|
+
optional string new_password = 5;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
message UpdateUserResponse {
|
|
40
|
-
|
|
41
|
-
string email = 2;
|
|
42
|
-
string username = 3;
|
|
43
|
-
string password_hash =4;
|
|
41
|
+
bool status = 1;
|
|
44
42
|
}
|
|
45
43
|
|
|
46
44
|
message RefreshRequest {
|
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
|
}
|