@xwing-dev/shared 1.0.4 → 1.0.5
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/package.json
CHANGED
|
@@ -10,7 +10,7 @@ import { Observable } from "rxjs";
|
|
|
10
10
|
|
|
11
11
|
export const protobufPackage = "auth.v1";
|
|
12
12
|
|
|
13
|
-
export interface
|
|
13
|
+
export interface SendOtpRequestDto {
|
|
14
14
|
identifier: string;
|
|
15
15
|
type: string;
|
|
16
16
|
}
|
|
@@ -19,19 +19,38 @@ export interface SendOtpResponseDto {
|
|
|
19
19
|
message: string;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
export interface VerifyOtpRequestDto {
|
|
23
|
+
identifier: string;
|
|
24
|
+
type: string;
|
|
25
|
+
code: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface VerifyOtpResponseDto {
|
|
29
|
+
accessToken: string;
|
|
30
|
+
refreshToken: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
22
33
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
23
34
|
|
|
24
35
|
export interface AuthServiceClient {
|
|
25
|
-
sendOtp(request:
|
|
36
|
+
sendOtp(request: SendOtpRequestDto): Observable<SendOtpResponseDto>;
|
|
37
|
+
|
|
38
|
+
verifyOtp(request: VerifyOtpRequestDto): Observable<VerifyOtpResponseDto>;
|
|
26
39
|
}
|
|
27
40
|
|
|
28
41
|
export interface AuthServiceController {
|
|
29
|
-
sendOtp(
|
|
42
|
+
sendOtp(
|
|
43
|
+
request: SendOtpRequestDto,
|
|
44
|
+
): Promise<SendOtpResponseDto> | Observable<SendOtpResponseDto> | SendOtpResponseDto;
|
|
45
|
+
|
|
46
|
+
verifyOtp(
|
|
47
|
+
request: VerifyOtpRequestDto,
|
|
48
|
+
): Promise<VerifyOtpResponseDto> | Observable<VerifyOtpResponseDto> | VerifyOtpResponseDto;
|
|
30
49
|
}
|
|
31
50
|
|
|
32
51
|
export function AuthServiceControllerMethods() {
|
|
33
52
|
return function (constructor: Function) {
|
|
34
|
-
const grpcMethods: string[] = ["sendOtp"];
|
|
53
|
+
const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
|
|
35
54
|
for (const method of grpcMethods) {
|
|
36
55
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
37
56
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
@@ -3,14 +3,26 @@ syntax = "proto3";
|
|
|
3
3
|
package auth.v1;
|
|
4
4
|
|
|
5
5
|
service AuthService {
|
|
6
|
-
rpc SendOtp(
|
|
6
|
+
rpc SendOtp(SendOtpRequestDto) returns (SendOtpResponseDto);
|
|
7
|
+
rpc VerifyOtp(VerifyOtpRequestDto) returns (VerifyOtpResponseDto);
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
message
|
|
10
|
+
message SendOtpRequestDto {
|
|
10
11
|
string identifier = 1;
|
|
11
12
|
string type = 2;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
message SendOtpResponseDto {
|
|
15
16
|
string message = 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message VerifyOtpRequestDto {
|
|
20
|
+
string identifier = 1;
|
|
21
|
+
string type = 2;
|
|
22
|
+
string code = 3;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message VerifyOtpResponseDto {
|
|
26
|
+
string access_token = 1;
|
|
27
|
+
string refresh_token = 2;
|
|
16
28
|
}
|