@my-teacinema/contracts 1.0.5 → 1.0.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
@@ -19,19 +19,34 @@ export interface SendOtpResponse {
19
19
  ok: boolean;
20
20
  }
21
21
 
22
+ export interface VerifyRequest {
23
+ identifier: string;
24
+ type: string;
25
+ code: string;
26
+ }
27
+
28
+ export interface VerifyResponse {
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: VerifyRequest): Observable<VerifyResponse>;
26
39
  }
27
40
 
28
41
  export interface AuthServiceController {
29
42
  sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
43
+
44
+ verifyOtp(request: VerifyRequest): Promise<VerifyResponse> | Observable<VerifyResponse> | VerifyResponse;
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": "@my-teacinema/contracts",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "generated type script types",
5
5
  "scripts": {
6
6
  "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
@@ -13,8 +13,9 @@
13
13
  "access": "public"
14
14
  },
15
15
  "dependencies": {
16
+ "@my-teacinema/contracts": "^1.0.5",
16
17
  "@nestjs/microservices": "^11.1.23",
17
18
  "rxjs": "^7.8.2",
18
19
  "ts-proto": "^2.11.8"
19
20
  }
20
- }
21
+ }
package/proto/auth.proto CHANGED
@@ -5,6 +5,7 @@ package auth.v1;
5
5
 
6
6
  service AuthService {
7
7
  rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
8
+ rpc VerifyOtp (VerifyRequest) returns (VerifyResponse);
8
9
 
9
10
  }
10
11
 
@@ -15,4 +16,14 @@ message SendOtpRequest {
15
16
 
16
17
  message SendOtpResponse {
17
18
  bool ok = 1;
19
+ }
20
+
21
+ message VerifyRequest {
22
+ string identifier = 1;
23
+ string type = 2;
24
+ string code = 3;
25
+ }
26
+ message VerifyResponse {
27
+ string access_token = 1;
28
+ string refresh_token = 2;
18
29
  }