@ihorcinema/contracts 1.0.0 → 1.0.1
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 +16 -1
- package/package.json +1 -1
- package/proto/auth.proto +12 -0
package/gen/auth.ts
CHANGED
|
@@ -19,6 +19,17 @@ export interface SendOtpResponse {
|
|
|
19
19
|
ok: boolean;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
export interface VerifyOtpRequest {
|
|
23
|
+
identifier: string;
|
|
24
|
+
type: string;
|
|
25
|
+
code: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface VerifyOtpResponse {
|
|
29
|
+
accessToken: string;
|
|
30
|
+
refreshToken: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
22
33
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
23
34
|
|
|
24
35
|
/** AuthService provides authentication-related RPC methods. */
|
|
@@ -27,6 +38,8 @@ export interface AuthServiceClient {
|
|
|
27
38
|
/** SendOtp sends an OTP to the specified identifier. */
|
|
28
39
|
|
|
29
40
|
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
41
|
+
|
|
42
|
+
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
30
43
|
}
|
|
31
44
|
|
|
32
45
|
/** AuthService provides authentication-related RPC methods. */
|
|
@@ -35,11 +48,13 @@ export interface AuthServiceController {
|
|
|
35
48
|
/** SendOtp sends an OTP to the specified identifier. */
|
|
36
49
|
|
|
37
50
|
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
51
|
+
|
|
52
|
+
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
38
53
|
}
|
|
39
54
|
|
|
40
55
|
export function AuthServiceControllerMethods() {
|
|
41
56
|
return function (constructor: Function) {
|
|
42
|
-
const grpcMethods: string[] = ["sendOtp"];
|
|
57
|
+
const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
|
|
43
58
|
for (const method of grpcMethods) {
|
|
44
59
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
45
60
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
|
@@ -6,6 +6,7 @@ package auth.v1;
|
|
|
6
6
|
service AuthService {
|
|
7
7
|
// SendOtp sends an OTP to the specified identifier.
|
|
8
8
|
rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
|
|
9
|
+
rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
message SendOtpRequest {
|
|
@@ -15,4 +16,15 @@ message SendOtpRequest {
|
|
|
15
16
|
|
|
16
17
|
message SendOtpResponse {
|
|
17
18
|
bool ok = 1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
message VerifyOtpRequest {
|
|
22
|
+
string identifier = 1;
|
|
23
|
+
string type = 2;
|
|
24
|
+
string code = 3;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
message VerifyOtpResponse {
|
|
28
|
+
string access_token = 1;
|
|
29
|
+
string refresh_token = 2;
|
|
18
30
|
}
|