@sync-chat/contracts 1.1.3 → 1.2.0
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/generated/auth/auth.ts +27 -6
- package/package.json +1 -1
- package/proto/auth/auth.proto +27 -12
package/generated/auth/auth.ts
CHANGED
|
@@ -11,19 +11,32 @@ import { Observable } from "rxjs";
|
|
|
11
11
|
export const protobufPackage = "auth.v1";
|
|
12
12
|
|
|
13
13
|
export interface RegisterRequest {
|
|
14
|
+
userName: string;
|
|
15
|
+
email: string;
|
|
16
|
+
password: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface LoginRequest {
|
|
14
20
|
email: string;
|
|
15
21
|
password: string;
|
|
16
|
-
|
|
17
|
-
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface RefreshRequest {
|
|
25
|
+
refreshToken: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface LogoutRequest {
|
|
29
|
+
refreshToken: string;
|
|
18
30
|
}
|
|
19
31
|
|
|
20
32
|
export interface AuthResponse {
|
|
21
33
|
message: string;
|
|
34
|
+
accessToken: string;
|
|
35
|
+
refreshToken: string;
|
|
22
36
|
}
|
|
23
37
|
|
|
24
|
-
export interface
|
|
25
|
-
|
|
26
|
-
password: string;
|
|
38
|
+
export interface LogoutResponse {
|
|
39
|
+
message: string;
|
|
27
40
|
}
|
|
28
41
|
|
|
29
42
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
@@ -32,17 +45,25 @@ export interface AuthServiceClient {
|
|
|
32
45
|
register(request: RegisterRequest): Observable<AuthResponse>;
|
|
33
46
|
|
|
34
47
|
login(request: LoginRequest): Observable<AuthResponse>;
|
|
48
|
+
|
|
49
|
+
refresh(request: RefreshRequest): Observable<AuthResponse>;
|
|
50
|
+
|
|
51
|
+
logout(request: LogoutRequest): Observable<LogoutResponse>;
|
|
35
52
|
}
|
|
36
53
|
|
|
37
54
|
export interface AuthServiceController {
|
|
38
55
|
register(request: RegisterRequest): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
|
|
39
56
|
|
|
40
57
|
login(request: LoginRequest): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
|
|
58
|
+
|
|
59
|
+
refresh(request: RefreshRequest): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
|
|
60
|
+
|
|
61
|
+
logout(request: LogoutRequest): Promise<LogoutResponse> | Observable<LogoutResponse> | LogoutResponse;
|
|
41
62
|
}
|
|
42
63
|
|
|
43
64
|
export function AuthServiceControllerMethods() {
|
|
44
65
|
return function (constructor: Function) {
|
|
45
|
-
const grpcMethods: string[] = ["register", "login"];
|
|
66
|
+
const grpcMethods: string[] = ["register", "login", "refresh", "logout"];
|
|
46
67
|
for (const method of grpcMethods) {
|
|
47
68
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
48
69
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/auth/auth.proto
CHANGED
|
@@ -1,24 +1,39 @@
|
|
|
1
1
|
syntax = "proto3";
|
|
2
|
+
|
|
2
3
|
package auth.v1;
|
|
3
4
|
|
|
4
5
|
service AuthService {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
rpc Register (RegisterRequest) returns (AuthResponse);
|
|
7
|
+
rpc Login (LoginRequest) returns (AuthResponse);
|
|
8
|
+
rpc Refresh (RefreshRequest) returns (AuthResponse);
|
|
9
|
+
rpc Logout (LogoutRequest) returns (LogoutResponse);
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
message RegisterRequest {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
string userDesc = 4;
|
|
13
|
+
string user_name = 1;
|
|
14
|
+
string email = 2;
|
|
15
|
+
string password = 3;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
message
|
|
18
|
-
|
|
18
|
+
message LoginRequest {
|
|
19
|
+
string email = 1;
|
|
20
|
+
string password = 2;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
message
|
|
22
|
-
|
|
23
|
-
string password = 2;
|
|
23
|
+
message RefreshRequest {
|
|
24
|
+
string refresh_token = 1;
|
|
24
25
|
}
|
|
26
|
+
|
|
27
|
+
message LogoutRequest {
|
|
28
|
+
string refresh_token = 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
message AuthResponse {
|
|
32
|
+
string message = 1;
|
|
33
|
+
string access_token = 2;
|
|
34
|
+
string refresh_token = 3;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message LogoutResponse {
|
|
38
|
+
string message = 1;
|
|
39
|
+
}
|