@you-are-hired/contracts 1.0.1 → 1.0.3
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 +18 -1
- package/package.json +1 -1
- package/proto/auth.proto +13 -0
package/gen/auth.ts
CHANGED
|
@@ -19,19 +19,36 @@ export interface SendOTPPResponse {
|
|
|
19
19
|
ok: boolean;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
export interface VerifyOTPPRequest {
|
|
23
|
+
identifier: string;
|
|
24
|
+
type: string;
|
|
25
|
+
code: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface VerifyOTPPResponse {
|
|
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
36
|
sendOtp(request: SendOTPPRequest): Observable<SendOTPPResponse>;
|
|
37
|
+
|
|
38
|
+
verifyOtp(request: VerifyOTPPRequest): Observable<VerifyOTPPResponse>;
|
|
26
39
|
}
|
|
27
40
|
|
|
28
41
|
export interface AuthServiceController {
|
|
29
42
|
sendOtp(request: SendOTPPRequest): Promise<SendOTPPResponse> | Observable<SendOTPPResponse> | SendOTPPResponse;
|
|
43
|
+
|
|
44
|
+
verifyOtp(
|
|
45
|
+
request: VerifyOTPPRequest,
|
|
46
|
+
): Promise<VerifyOTPPResponse> | Observable<VerifyOTPPResponse> | VerifyOTPPResponse;
|
|
30
47
|
}
|
|
31
48
|
|
|
32
49
|
export function AuthServiceControllerMethods() {
|
|
33
50
|
return function (constructor: Function) {
|
|
34
|
-
const grpcMethods: string[] = ["sendOtp"];
|
|
51
|
+
const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
|
|
35
52
|
for (const method of grpcMethods) {
|
|
36
53
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
37
54
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
|
@@ -4,6 +4,7 @@ package auth.v1;
|
|
|
4
4
|
|
|
5
5
|
service AuthService {
|
|
6
6
|
rpc SendOTP(SendOTPPRequest) returns (SendOTPPResponse);
|
|
7
|
+
rpc VerifyOTP(VerifyOTPPRequest) returns (VerifyOTPPResponse);
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
message SendOTPPRequest {
|
|
@@ -14,3 +15,15 @@ message SendOTPPRequest {
|
|
|
14
15
|
message SendOTPPResponse {
|
|
15
16
|
bool ok = 1;
|
|
16
17
|
}
|
|
18
|
+
|
|
19
|
+
message VerifyOTPPRequest {
|
|
20
|
+
string identifier = 1;
|
|
21
|
+
string type = 2;
|
|
22
|
+
string code = 3;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message VerifyOTPPResponse {
|
|
26
|
+
string access_token = 1;
|
|
27
|
+
string refresh_token = 2;
|
|
28
|
+
}
|
|
29
|
+
|