@nexiolab/contracts 1.0.10 → 1.0.11

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
@@ -30,6 +30,15 @@ export interface VerifyOtpResponse {
30
30
  refreshToken: string;
31
31
  }
32
32
 
33
+ export interface RefreshRequest {
34
+ refreshToken: string;
35
+ }
36
+
37
+ export interface RefreshResponse {
38
+ accessToken: string;
39
+ refreshToken: string;
40
+ }
41
+
33
42
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
34
43
 
35
44
  /** AuthService provides authentication related operations */
@@ -42,6 +51,10 @@ export interface AuthServiceClient {
42
51
  /** Verifies otp code from user */
43
52
 
44
53
  verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
54
+
55
+ /** Refreshes access token */
56
+
57
+ refresh(request: RefreshRequest): Observable<RefreshResponse>;
45
58
  }
46
59
 
47
60
  /** AuthService provides authentication related operations */
@@ -54,11 +67,15 @@ export interface AuthServiceController {
54
67
  /** Verifies otp code from user */
55
68
 
56
69
  verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
70
+
71
+ /** Refreshes access token */
72
+
73
+ refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
57
74
  }
58
75
 
59
76
  export function AuthServiceControllerMethods() {
60
77
  return function (constructor: Function) {
61
- const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
78
+ const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh"];
62
79
  for (const method of grpcMethods) {
63
80
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
64
81
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexiolab/contracts",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
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
@@ -8,6 +8,8 @@ service AuthService {
8
8
  rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
9
9
  //Verifies otp code from user
10
10
  rpc VerifyOtp(VerifyOtpRequest) returns (VerifyOtpResponse);
11
+ //Refreshes access token
12
+ rpc Refresh(RefreshRequest) returns (RefreshResponse);
11
13
  }
12
14
 
13
15
  message SendOtpRequest {
@@ -28,5 +30,13 @@ message VerifyOtpRequest {
28
30
  message VerifyOtpResponse {
29
31
  string access_token = 1;
30
32
  string refresh_token = 2;
33
+ }
34
+
35
+ message RefreshRequest {
36
+ string refresh_token = 1;
37
+ }
31
38
 
39
+ message RefreshResponse {
40
+ string access_token = 1;
41
+ string refresh_token = 2;
32
42
  }