@astromonacinema/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
@@ -34,6 +34,17 @@ export interface SendOtpResponse {
34
34
  ok: boolean;
35
35
  }
36
36
 
37
+ export interface VerifyOtpRequest {
38
+ identifier: string;
39
+ type: string;
40
+ code: string;
41
+ }
42
+
43
+ export interface VerifyOtpResponse {
44
+ accessToken: string;
45
+ refreshToken: string;
46
+ }
47
+
37
48
  export interface UserSession {
38
49
  id: string;
39
50
  /** временное значение */
@@ -83,15 +94,19 @@ wrappers[".google.protobuf.Struct"] = { fromObject: Struct.wrap, toObject: Struc
83
94
 
84
95
  export interface AuthServiceClient {
85
96
  sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
97
+
98
+ verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
86
99
  }
87
100
 
88
101
  export interface AuthServiceController {
89
102
  sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
103
+
104
+ verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
90
105
  }
91
106
 
92
107
  export function AuthServiceControllerMethods() {
93
108
  return function (constructor: Function) {
94
- const grpcMethods: string[] = ["sendOtp"];
109
+ const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
95
110
  for (const method of grpcMethods) {
96
111
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
97
112
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astromonacinema/contracts",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "license": "MIT",
5
5
  "description": "Protobuf contracts for microservices",
6
6
  "scripts": {
package/proto/auth.proto CHANGED
@@ -8,6 +8,7 @@ import "google/protobuf/any.proto";
8
8
 
9
9
  service AuthService {
10
10
  rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
11
+ rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
11
12
  }
12
13
 
13
14
  message SendOtpRequest {
@@ -18,6 +19,43 @@ message SendOtpRequest {
18
19
  message SendOtpResponse {
19
20
  bool ok = 1;
20
21
  }
22
+
23
+ message VerifyOtpRequest {
24
+ string identifier = 1;
25
+ string type = 2;
26
+ string code = 3;
27
+ }
28
+
29
+ message VerifyOtpResponse {
30
+ string access_token = 1;
31
+ string refresh_token = 2;
32
+ }
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
21
59
 
22
60
 
23
61
  /* Для пояснений типов */