@fullactivities/contracts 1.0.3 → 1.0.5

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/dist/paths.js CHANGED
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PROTO_PATHS = void 0;
4
4
  const node_path_1 = require("node:path");
5
5
  exports.PROTO_PATHS = {
6
- AUTH: (0, node_path_1.join)(__dirname, '../../proto/auth.proto'),
6
+ AUTH: (0, node_path_1.join)(__dirname, '../proto/auth.proto'),
7
7
  };
package/gen/auth.ts CHANGED
@@ -30,23 +30,38 @@ export interface VerifyOtpResponse {
30
30
  refreshToken: string;
31
31
  }
32
32
 
33
+ export interface RefreshTokenRequest {
34
+ refreshToken: string;
35
+ }
36
+
37
+ export interface RefreshTokenResponse {
38
+ accessToken: string;
39
+ refreshToken: string;
40
+ }
41
+
33
42
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
34
43
 
35
44
  export interface AuthServiceClient {
36
45
  sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
37
46
 
38
47
  verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
48
+
49
+ refreshToken(request: RefreshTokenRequest): Observable<RefreshTokenResponse>;
39
50
  }
40
51
 
41
52
  export interface AuthServiceController {
42
53
  sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
43
54
 
44
55
  verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
56
+
57
+ refreshToken(
58
+ request: RefreshTokenRequest,
59
+ ): Promise<RefreshTokenResponse> | Observable<RefreshTokenResponse> | RefreshTokenResponse;
45
60
  }
46
61
 
47
62
  export function AuthServiceControllerMethods() {
48
63
  return function (constructor: Function) {
49
- const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
64
+ const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refreshToken"];
50
65
  for (const method of grpcMethods) {
51
66
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
52
67
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullactivities/contracts",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Protobuf contracts for Full Activities microservices",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/auth.proto CHANGED
@@ -5,6 +5,7 @@ package auth.v1;
5
5
  service AuthService {
6
6
  rpc SendOtp(SendOtpRequest) returns (SendOtpResponse);
7
7
  rpc VerifyOtp(VerifyOtpRequest) returns (VerifyOtpResponse);
8
+ rpc RefreshToken(RefreshTokenRequest) returns (RefreshTokenResponse);
8
9
  }
9
10
 
10
11
  message SendOtpRequest {
@@ -27,3 +28,12 @@ message VerifyOtpResponse {
27
28
  string refresh_token = 2;
28
29
  }
29
30
 
31
+ message RefreshTokenRequest {
32
+ string refresh_token = 1;
33
+ }
34
+
35
+ message RefreshTokenResponse {
36
+ string access_token = 1;
37
+ string refresh_token = 2;
38
+ }
39
+