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