@requ1emz/contracts 1.0.36 → 1.0.38
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 +19 -1
- package/gen/user.ts +1 -21
- package/package.json +1 -1
- package/proto/auth.proto +13 -0
- package/proto/user.proto +0 -15
package/gen/auth.ts
CHANGED
|
@@ -30,6 +30,18 @@ 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
|
+
currentPassword?: string | undefined;
|
|
38
|
+
newPassword?: string | undefined;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface UpdateUserResponse {
|
|
42
|
+
status: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
33
45
|
export interface RefreshRequest {
|
|
34
46
|
refreshToken: string;
|
|
35
47
|
}
|
|
@@ -47,6 +59,8 @@ export interface AuthServiceClient {
|
|
|
47
59
|
login(request: SendLoginRequest): Observable<SendLoginResponse>;
|
|
48
60
|
|
|
49
61
|
refresh(request: RefreshRequest): Observable<RefreshResponse>;
|
|
62
|
+
|
|
63
|
+
updateUser(request: UpdateUserRequest): Observable<UpdateUserResponse>;
|
|
50
64
|
}
|
|
51
65
|
|
|
52
66
|
export interface AuthServiceController {
|
|
@@ -57,11 +71,15 @@ export interface AuthServiceController {
|
|
|
57
71
|
login(request: SendLoginRequest): Promise<SendLoginResponse> | Observable<SendLoginResponse> | SendLoginResponse;
|
|
58
72
|
|
|
59
73
|
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
74
|
+
|
|
75
|
+
updateUser(
|
|
76
|
+
request: UpdateUserRequest,
|
|
77
|
+
): Promise<UpdateUserResponse> | Observable<UpdateUserResponse> | UpdateUserResponse;
|
|
60
78
|
}
|
|
61
79
|
|
|
62
80
|
export function AuthServiceControllerMethods() {
|
|
63
81
|
return function (constructor: Function) {
|
|
64
|
-
const grpcMethods: string[] = ["register", "login", "refresh"];
|
|
82
|
+
const grpcMethods: string[] = ["register", "login", "refresh", "updateUser"];
|
|
65
83
|
for (const method of grpcMethods) {
|
|
66
84
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
67
85
|
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 | undefined;
|
|
49
|
-
username?: string | undefined;
|
|
50
|
-
passwordHash?: string | undefined;
|
|
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", "
|
|
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
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,18 @@ 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 current_password = 4;
|
|
37
|
+
optional string new_password = 5;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
message UpdateUserResponse {
|
|
41
|
+
bool status = 1;
|
|
42
|
+
}
|
|
43
|
+
|
|
31
44
|
message RefreshRequest {
|
|
32
45
|
string refresh_token = 1;
|
|
33
46
|
}
|
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
|
-
optional string email = 2;
|
|
51
|
-
optional string username = 3;
|
|
52
|
-
optional string password_hash = 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
|
}
|