@readytomog/contracts 1.1.5 → 1.1.7
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 +70 -1
- package/package.json +1 -1
- package/proto/auth.proto +38 -1
package/gen/auth.ts
CHANGED
|
@@ -41,6 +41,39 @@ export interface RefreshAuthResponse {
|
|
|
41
41
|
refreshToken: string;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
export interface GenerateSecretResponse {
|
|
45
|
+
qrCode: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface VerifyTokenRequest {
|
|
49
|
+
token: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface VerifyTokenResponse {
|
|
53
|
+
verify: boolean;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface DisableTwoFactorResponse {
|
|
57
|
+
disable: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface SendOtpRequest {
|
|
61
|
+
identifier: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface SendOtpRespose {
|
|
65
|
+
ok: boolean;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface VerifyOtpRequest {
|
|
69
|
+
identifier: string;
|
|
70
|
+
otp: number;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface VerifyOtpResponse {
|
|
74
|
+
verify: boolean;
|
|
75
|
+
}
|
|
76
|
+
|
|
44
77
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
45
78
|
|
|
46
79
|
export interface AuthServiceClient {
|
|
@@ -51,6 +84,16 @@ export interface AuthServiceClient {
|
|
|
51
84
|
logout(request: Empty): Observable<LogoutResponse>;
|
|
52
85
|
|
|
53
86
|
refreshAuth(request: Empty): Observable<RefreshAuthResponse>;
|
|
87
|
+
|
|
88
|
+
generateSecret(request: Empty): Observable<GenerateSecretResponse>;
|
|
89
|
+
|
|
90
|
+
verifyToken(request: VerifyTokenRequest): Observable<VerifyTokenResponse>;
|
|
91
|
+
|
|
92
|
+
disableTwoFactor(request: Empty): Observable<DisableTwoFactorResponse>;
|
|
93
|
+
|
|
94
|
+
sendOtp(request: SendOtpRequest): Observable<SendOtpRespose>;
|
|
95
|
+
|
|
96
|
+
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
54
97
|
}
|
|
55
98
|
|
|
56
99
|
export interface AuthServiceController {
|
|
@@ -63,11 +106,37 @@ export interface AuthServiceController {
|
|
|
63
106
|
logout(request: Empty): Promise<LogoutResponse> | Observable<LogoutResponse> | LogoutResponse;
|
|
64
107
|
|
|
65
108
|
refreshAuth(request: Empty): Promise<RefreshAuthResponse> | Observable<RefreshAuthResponse> | RefreshAuthResponse;
|
|
109
|
+
|
|
110
|
+
generateSecret(
|
|
111
|
+
request: Empty,
|
|
112
|
+
): Promise<GenerateSecretResponse> | Observable<GenerateSecretResponse> | GenerateSecretResponse;
|
|
113
|
+
|
|
114
|
+
verifyToken(
|
|
115
|
+
request: VerifyTokenRequest,
|
|
116
|
+
): Promise<VerifyTokenResponse> | Observable<VerifyTokenResponse> | VerifyTokenResponse;
|
|
117
|
+
|
|
118
|
+
disableTwoFactor(
|
|
119
|
+
request: Empty,
|
|
120
|
+
): Promise<DisableTwoFactorResponse> | Observable<DisableTwoFactorResponse> | DisableTwoFactorResponse;
|
|
121
|
+
|
|
122
|
+
sendOtp(request: SendOtpRequest): Promise<SendOtpRespose> | Observable<SendOtpRespose> | SendOtpRespose;
|
|
123
|
+
|
|
124
|
+
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
66
125
|
}
|
|
67
126
|
|
|
68
127
|
export function AuthServiceControllerMethods() {
|
|
69
128
|
return function (constructor: Function) {
|
|
70
|
-
const grpcMethods: string[] = [
|
|
129
|
+
const grpcMethods: string[] = [
|
|
130
|
+
"login",
|
|
131
|
+
"registration",
|
|
132
|
+
"logout",
|
|
133
|
+
"refreshAuth",
|
|
134
|
+
"generateSecret",
|
|
135
|
+
"verifyToken",
|
|
136
|
+
"disableTwoFactor",
|
|
137
|
+
"sendOtp",
|
|
138
|
+
"verifyOtp",
|
|
139
|
+
];
|
|
71
140
|
for (const method of grpcMethods) {
|
|
72
141
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
73
142
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
|
@@ -9,6 +9,11 @@ service AuthService {
|
|
|
9
9
|
rpc Registration (RegistrationRequest) returns (RegistrationResponse);
|
|
10
10
|
rpc Logout (google.protobuf.Empty) returns (LogoutResponse);
|
|
11
11
|
rpc RefreshAuth (google.protobuf.Empty) returns (RefreshAuthResponse);
|
|
12
|
+
rpc GenerateSecret (google.protobuf.Empty) returns (GenerateSecretResponse);
|
|
13
|
+
rpc VerifyToken(VerifyTokenRequest) returns (VerifyTokenResponse);
|
|
14
|
+
rpc DisableTwoFactor(google.protobuf.Empty) returns (DisableTwoFactorResponse);
|
|
15
|
+
rpc SendOtp(SendOtpRequest) returns (SendOtpRespose);
|
|
16
|
+
rpc VerifyOtp(VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
12
17
|
};
|
|
13
18
|
|
|
14
19
|
message LoginRequest {
|
|
@@ -41,4 +46,36 @@ message LogoutResponse {
|
|
|
41
46
|
message RefreshAuthResponse {
|
|
42
47
|
string accessToken = 1;
|
|
43
48
|
string refreshToken = 2;
|
|
44
|
-
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
message GenerateSecretResponse {
|
|
52
|
+
string qrCode = 1;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
message VerifyTokenRequest {
|
|
56
|
+
string token = 1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
message VerifyTokenResponse {
|
|
60
|
+
bool verify = 1;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
message DisableTwoFactorResponse {
|
|
64
|
+
bool disable = 1;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
message SendOtpRequest {
|
|
68
|
+
string identifier = 1;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
message SendOtpRespose {
|
|
72
|
+
bool ok = 1;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
message VerifyOtpRequest {
|
|
76
|
+
string identifier = 1;
|
|
77
|
+
int32 otp = 2;
|
|
78
|
+
}
|
|
79
|
+
message VerifyOtpResponse {
|
|
80
|
+
bool verify = 1;
|
|
81
|
+
}
|