@taskora-uni/contracts 2.0.0 → 2.1.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.ts +39 -1
- package/package.json +1 -1
- package/proto/auth.proto +25 -0
package/generated/auth.ts
CHANGED
|
@@ -29,12 +29,39 @@ export interface RefreshTokensResponse {
|
|
|
29
29
|
refreshToken: string;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
export interface StartRegistrationRequest {
|
|
33
|
+
email: string;
|
|
34
|
+
password: string;
|
|
35
|
+
token: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface StartRegistrationResponse {
|
|
39
|
+
id: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ConfirmRegistrationOtpRequest {
|
|
43
|
+
id: string;
|
|
44
|
+
code: string;
|
|
45
|
+
token: string;
|
|
46
|
+
firstName: string;
|
|
47
|
+
lastName: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface ConfirmRegistrationOtpResponse {
|
|
51
|
+
accessToken: string;
|
|
52
|
+
refreshToken: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
32
55
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
33
56
|
|
|
34
57
|
export interface AuthServiceClient {
|
|
35
58
|
login(request: LoginRequest): Observable<LoginResponse>;
|
|
36
59
|
|
|
37
60
|
refreshTokens(request: RefreshTokensRequest): Observable<RefreshTokensResponse>;
|
|
61
|
+
|
|
62
|
+
startRegistration(request: StartRegistrationRequest): Observable<StartRegistrationResponse>;
|
|
63
|
+
|
|
64
|
+
confirmRegistrationOtp(request: ConfirmRegistrationOtpRequest): Observable<ConfirmRegistrationOtpResponse>;
|
|
38
65
|
}
|
|
39
66
|
|
|
40
67
|
export interface AuthServiceController {
|
|
@@ -43,11 +70,22 @@ export interface AuthServiceController {
|
|
|
43
70
|
refreshTokens(
|
|
44
71
|
request: RefreshTokensRequest,
|
|
45
72
|
): Promise<RefreshTokensResponse> | Observable<RefreshTokensResponse> | RefreshTokensResponse;
|
|
73
|
+
|
|
74
|
+
startRegistration(
|
|
75
|
+
request: StartRegistrationRequest,
|
|
76
|
+
): Promise<StartRegistrationResponse> | Observable<StartRegistrationResponse> | StartRegistrationResponse;
|
|
77
|
+
|
|
78
|
+
confirmRegistrationOtp(
|
|
79
|
+
request: ConfirmRegistrationOtpRequest,
|
|
80
|
+
):
|
|
81
|
+
| Promise<ConfirmRegistrationOtpResponse>
|
|
82
|
+
| Observable<ConfirmRegistrationOtpResponse>
|
|
83
|
+
| ConfirmRegistrationOtpResponse;
|
|
46
84
|
}
|
|
47
85
|
|
|
48
86
|
export function AuthServiceControllerMethods() {
|
|
49
87
|
return function (constructor: Function) {
|
|
50
|
-
const grpcMethods: string[] = ["login", "refreshTokens"];
|
|
88
|
+
const grpcMethods: string[] = ["login", "refreshTokens", "startRegistration", "confirmRegistrationOtp"];
|
|
51
89
|
for (const method of grpcMethods) {
|
|
52
90
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
53
91
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
|
@@ -5,6 +5,8 @@ package auth.v1;
|
|
|
5
5
|
service AuthService {
|
|
6
6
|
rpc Login(LoginRequest) returns (LoginResponse);
|
|
7
7
|
rpc RefreshTokens(RefreshTokensRequest) returns (RefreshTokensResponse);
|
|
8
|
+
rpc StartRegistration(StartRegistrationRequest) returns (StartRegistrationResponse);
|
|
9
|
+
rpc ConfirmRegistrationOtp(ConfirmRegistrationOtpRequest) returns (ConfirmRegistrationOtpResponse);
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
message LoginRequest {
|
|
@@ -25,3 +27,26 @@ message RefreshTokensResponse {
|
|
|
25
27
|
string access_token = 1;
|
|
26
28
|
string refresh_token = 2;
|
|
27
29
|
}
|
|
30
|
+
|
|
31
|
+
message StartRegistrationRequest {
|
|
32
|
+
string email = 1;
|
|
33
|
+
string password = 2;
|
|
34
|
+
string token = 3;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message StartRegistrationResponse {
|
|
38
|
+
string id = 1;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
message ConfirmRegistrationOtpRequest {
|
|
42
|
+
string id = 1;
|
|
43
|
+
string code = 2;
|
|
44
|
+
string token = 3;
|
|
45
|
+
string first_name = 4;
|
|
46
|
+
string last_name = 5;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
message ConfirmRegistrationOtpResponse {
|
|
50
|
+
string access_token = 1;
|
|
51
|
+
string refresh_token = 2;
|
|
52
|
+
}
|