@usteam/contracts 1.0.3 → 1.0.4

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
@@ -39,6 +39,15 @@ export interface VerifyOtpResponse {
39
39
  refreshToken: string;
40
40
  }
41
41
 
42
+ export interface RefreshRequest {
43
+ refreshToken: string;
44
+ }
45
+
46
+ export interface RefreshResponse {
47
+ accessToken: string;
48
+ refreshToken: string;
49
+ }
50
+
42
51
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
43
52
 
44
53
  /**
@@ -60,6 +69,13 @@ export interface AuthServiceClient {
60
69
  */
61
70
 
62
71
  verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
72
+
73
+ /**
74
+ * Refresh обновляет токен.
75
+ * отправляет токены.
76
+ */
77
+
78
+ refresh(request: RefreshRequest): Observable<RefreshResponse>;
63
79
  }
64
80
 
65
81
  /**
@@ -81,11 +97,18 @@ export interface AuthServiceController {
81
97
  */
82
98
 
83
99
  verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
100
+
101
+ /**
102
+ * Refresh обновляет токен.
103
+ * отправляет токены.
104
+ */
105
+
106
+ refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
84
107
  }
85
108
 
86
109
  export function AuthServiceControllerMethods() {
87
110
  return function (constructor: Function) {
88
- const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
111
+ const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh"];
89
112
  for (const method of grpcMethods) {
90
113
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
91
114
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usteam/contracts",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "scripts": {
package/proto/auth.proto CHANGED
@@ -11,6 +11,9 @@ service AuthService {
11
11
  // VerifyOtp веривицирует одноразовый пароль.
12
12
  // отправляет токены.
13
13
  rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
14
+ // Refresh обновляет токен.
15
+ // отправляет токены.
16
+ rpc Refresh (RefreshRequest) returns (RefreshResponse);
14
17
  }
15
18
 
16
19
  // Запрос на отправку OTP.
@@ -38,4 +41,13 @@ message VerifyOtpRequest {
38
41
  message VerifyOtpResponse {
39
42
  string access_token = 1;
40
43
  string refresh_token = 2;
44
+ }
45
+
46
+ message RefreshRequest {
47
+ string refresh_token = 1;
48
+ }
49
+
50
+ message RefreshResponse {
51
+ string access_token = 1;
52
+ string refresh_token = 2;
41
53
  }