@aaanton/contracts 1.0.1 → 1.0.2
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
|
@@ -21,6 +21,17 @@ export interface SendOtpResponse {
|
|
|
21
21
|
status: boolean;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
export interface VerifyOtpRequest {
|
|
25
|
+
identifier: string;
|
|
26
|
+
type: string;
|
|
27
|
+
code: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface VerifyOtpResponse {
|
|
31
|
+
accessToken: string;
|
|
32
|
+
refreshToken: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
24
35
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
25
36
|
|
|
26
37
|
/** Auth service handles authentication */
|
|
@@ -29,6 +40,8 @@ export interface AuthServiceClient {
|
|
|
29
40
|
/** Sends one time password */
|
|
30
41
|
|
|
31
42
|
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
43
|
+
|
|
44
|
+
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
32
45
|
}
|
|
33
46
|
|
|
34
47
|
/** Auth service handles authentication */
|
|
@@ -37,11 +50,13 @@ export interface AuthServiceController {
|
|
|
37
50
|
/** Sends one time password */
|
|
38
51
|
|
|
39
52
|
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
53
|
+
|
|
54
|
+
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
40
55
|
}
|
|
41
56
|
|
|
42
57
|
export function AuthServiceControllerMethods() {
|
|
43
58
|
return function (constructor: Function) {
|
|
44
|
-
const grpcMethods: string[] = ["sendOtp"];
|
|
59
|
+
const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
|
|
45
60
|
for (const method of grpcMethods) {
|
|
46
61
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
47
62
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
|
@@ -6,6 +6,8 @@ package auth.v1;
|
|
|
6
6
|
service AuthService {
|
|
7
7
|
// Sends one time password
|
|
8
8
|
rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
|
|
9
|
+
|
|
10
|
+
rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
// Request to SendOtp
|
|
@@ -17,4 +19,14 @@ message SendOtpRequest {
|
|
|
17
19
|
// Response for SendOtp
|
|
18
20
|
message SendOtpResponse {
|
|
19
21
|
bool status = 1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
message VerifyOtpRequest {
|
|
25
|
+
string identifier = 1;
|
|
26
|
+
string type = 2;
|
|
27
|
+
string code = 3;
|
|
28
|
+
}
|
|
29
|
+
message VerifyOtpResponse {
|
|
30
|
+
string access_token = 1;
|
|
31
|
+
string refresh_token = 2;
|
|
20
32
|
}
|