@slack-clone-org/contracts 1.0.3 → 1.0.6

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/generated/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
  /** VerifyOtp verifies the provided one-time password. */
43
52
 
44
53
  verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
54
+
55
+ /** Refresh 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
  /** VerifyOtp verifies the provided one-time password. */
55
68
 
56
69
  verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
70
+
71
+ /** Refresh 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": "@slack-clone-org/contracts",
3
- "version": "1.0.3",
3
+ "version": "1.0.6",
4
4
  "description": "Shared gRPC contracts and TypeScript definitions for Slack Clone microservices",
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
  // VerifyOtp verifies the provided one-time password.
10
10
  rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
11
+ // Refresh token
12
+ rpc Refresh (RefreshRequest) returns (RefreshResponse);
11
13
  }
12
14
 
13
15
  message SendOtpRequest {
@@ -28,4 +30,13 @@ message VerifyOtpRequest {
28
30
  message VerifyOtpResponse {
29
31
  string access_token = 1;
30
32
  string refresh_token = 2;
31
- }
33
+ }
34
+
35
+ message RefreshRequest {
36
+ string refresh_token = 1;
37
+ }
38
+
39
+ message RefreshResponse {
40
+ string access_token = 1;
41
+ string refresh_token = 2;
42
+ }