@teacinema/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 CHANGED
@@ -19,19 +19,34 @@ 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
  export interface AuthServiceClient {
25
36
  sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
37
+
38
+ verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
26
39
  }
27
40
 
28
41
  export interface AuthServiceController {
29
42
  sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
43
+
44
+ verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
30
45
  }
31
46
 
32
47
  export function AuthServiceControllerMethods() {
33
48
  return function (constructor: Function) {
34
- const grpcMethods: string[] = ["sendOtp"];
49
+ const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
35
50
  for (const method of grpcMethods) {
36
51
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
37
52
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teacinema/contracts",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "scripts": {
6
6
  "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
package/proto/auth.proto CHANGED
@@ -4,6 +4,7 @@ package auth.v1;
4
4
 
5
5
  service AuthService {
6
6
  rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
7
+ rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
7
8
  }
8
9
 
9
10
  message SendOtpRequest {
@@ -13,4 +14,15 @@ message SendOtpRequest {
13
14
 
14
15
  message SendOtpResponse {
15
16
  bool ok = 1;
17
+ }
18
+
19
+ message VerifyOtpRequest {
20
+ string identifier = 1;
21
+ string type = 2;
22
+ string code = 3;
23
+ }
24
+
25
+ message VerifyOtpResponse {
26
+ string access_token = 1;
27
+ string refresh_token = 2;
16
28
  }