@voice-chat/contracts 1.0.9 → 1.0.11
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 +17 -1
- package/package.json +1 -1
- package/proto/auth.proto +11 -0
package/gen/auth.ts
CHANGED
|
@@ -10,6 +10,16 @@ import { Observable } from "rxjs";
|
|
|
10
10
|
|
|
11
11
|
export const protobufPackage = "auth.v1";
|
|
12
12
|
|
|
13
|
+
export interface VerifyTokenRequest {
|
|
14
|
+
token: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface VerifyTokenResponse {
|
|
18
|
+
isValid: boolean;
|
|
19
|
+
userId: string;
|
|
20
|
+
username: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
13
23
|
export interface LoginRequest {
|
|
14
24
|
email: string;
|
|
15
25
|
password: string;
|
|
@@ -36,6 +46,8 @@ export interface AuthServiceClient {
|
|
|
36
46
|
login(request: LoginRequest): Observable<LoginResponse>;
|
|
37
47
|
|
|
38
48
|
registration(request: RegistrationRequest): Observable<RegistrationResponse>;
|
|
49
|
+
|
|
50
|
+
verifyToken(request: VerifyTokenRequest): Observable<VerifyTokenResponse>;
|
|
39
51
|
}
|
|
40
52
|
|
|
41
53
|
export interface AuthServiceController {
|
|
@@ -44,11 +56,15 @@ export interface AuthServiceController {
|
|
|
44
56
|
registration(
|
|
45
57
|
request: RegistrationRequest,
|
|
46
58
|
): Promise<RegistrationResponse> | Observable<RegistrationResponse> | RegistrationResponse;
|
|
59
|
+
|
|
60
|
+
verifyToken(
|
|
61
|
+
request: VerifyTokenRequest,
|
|
62
|
+
): Promise<VerifyTokenResponse> | Observable<VerifyTokenResponse> | VerifyTokenResponse;
|
|
47
63
|
}
|
|
48
64
|
|
|
49
65
|
export function AuthServiceControllerMethods() {
|
|
50
66
|
return function (constructor: Function) {
|
|
51
|
-
const grpcMethods: string[] = ["login", "registration"];
|
|
67
|
+
const grpcMethods: string[] = ["login", "registration", "verifyToken"];
|
|
52
68
|
for (const method of grpcMethods) {
|
|
53
69
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
54
70
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
|
@@ -5,6 +5,17 @@ package auth.v1;
|
|
|
5
5
|
service AuthService {
|
|
6
6
|
rpc Login(LoginRequest) returns (LoginResponse);
|
|
7
7
|
rpc Registration(RegistrationRequest) returns (RegistrationResponse);
|
|
8
|
+
rpc VerifyToken(VerifyTokenRequest) returns (VerifyTokenResponse);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
message VerifyTokenRequest {
|
|
12
|
+
string token = 1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message VerifyTokenResponse {
|
|
16
|
+
bool is_valid = 1;
|
|
17
|
+
string user_id = 2;
|
|
18
|
+
string username = 3;
|
|
8
19
|
}
|
|
9
20
|
|
|
10
21
|
message LoginRequest {
|