@readytomog/contracts 1.1.6 → 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 CHANGED
@@ -57,6 +57,23 @@ export interface DisableTwoFactorResponse {
57
57
  disable: boolean;
58
58
  }
59
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
+
60
77
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
61
78
 
62
79
  export interface AuthServiceClient {
@@ -73,6 +90,10 @@ export interface AuthServiceClient {
73
90
  verifyToken(request: VerifyTokenRequest): Observable<VerifyTokenResponse>;
74
91
 
75
92
  disableTwoFactor(request: Empty): Observable<DisableTwoFactorResponse>;
93
+
94
+ sendOtp(request: SendOtpRequest): Observable<SendOtpRespose>;
95
+
96
+ verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
76
97
  }
77
98
 
78
99
  export interface AuthServiceController {
@@ -97,6 +118,10 @@ export interface AuthServiceController {
97
118
  disableTwoFactor(
98
119
  request: Empty,
99
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;
100
125
  }
101
126
 
102
127
  export function AuthServiceControllerMethods() {
@@ -109,6 +134,8 @@ export function AuthServiceControllerMethods() {
109
134
  "generateSecret",
110
135
  "verifyToken",
111
136
  "disableTwoFactor",
137
+ "sendOtp",
138
+ "verifyOtp",
112
139
  ];
113
140
  for (const method of grpcMethods) {
114
141
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@readytomog/contracts",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "Protobuf definitions and generated Typescript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/auth.proto CHANGED
@@ -10,8 +10,10 @@ service AuthService {
10
10
  rpc Logout (google.protobuf.Empty) returns (LogoutResponse);
11
11
  rpc RefreshAuth (google.protobuf.Empty) returns (RefreshAuthResponse);
12
12
  rpc GenerateSecret (google.protobuf.Empty) returns (GenerateSecretResponse);
13
- rpc VerifyToken(VerifyTokenRequest) returns(VerifyTokenResponse);
14
- rpc DisableTwoFactor(google.protobuf.Empty) returns(DisableTwoFactorResponse);
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);
15
17
  };
16
18
 
17
19
  message LoginRequest {
@@ -60,4 +62,20 @@ message VerifyTokenResponse {
60
62
 
61
63
  message DisableTwoFactorResponse {
62
64
  bool disable = 1;
63
- }
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
+ }