@cinema_learn/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.
@@ -0,0 +1 @@
1
+ export * from './proto';
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./proto"), exports);
@@ -0,0 +1 @@
1
+ export * from "./paths";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./paths"), exports);
@@ -0,0 +1,3 @@
1
+ export declare const PROTO_PATHS: {
2
+ readonly AUTH: string;
3
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PROTO_PATHS = void 0;
4
+ const node_path_1 = require("node:path");
5
+ exports.PROTO_PATHS = {
6
+ AUTH: (0, node_path_1.join)(__dirname, "../../proto/auth.proto"),
7
+ };
package/gen/auth.ts CHANGED
@@ -32,23 +32,38 @@ export interface VerifyOtpResponse {
32
32
  refreshToken: string;
33
33
  }
34
34
 
35
+ export interface RefreshTokenRequest {
36
+ refreshToken: string;
37
+ }
38
+
39
+ export interface RefreshTokenResponse {
40
+ accessToken: string;
41
+ refreshToken: string;
42
+ }
43
+
35
44
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
36
45
 
37
46
  export interface AuthServiceClient {
38
47
  sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
39
48
 
40
49
  verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
50
+
51
+ refreshToken(request: RefreshTokenRequest): Observable<RefreshTokenResponse>;
41
52
  }
42
53
 
43
54
  export interface AuthServiceController {
44
55
  sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
45
56
 
46
57
  verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
58
+
59
+ refreshToken(
60
+ request: RefreshTokenRequest,
61
+ ): Promise<RefreshTokenResponse> | Observable<RefreshTokenResponse> | RefreshTokenResponse;
47
62
  }
48
63
 
49
64
  export function AuthServiceControllerMethods() {
50
65
  return function (constructor: Function) {
51
- const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
66
+ const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refreshToken"];
52
67
  for (const method of grpcMethods) {
53
68
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
54
69
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinema_learn/contracts",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "scripts": {
@@ -9,7 +9,8 @@
9
9
  },
10
10
  "files": [
11
11
  "proto",
12
- "gen"
12
+ "gen",
13
+ "dist"
13
14
  ],
14
15
  "description": "Protocol contracts for Cinema Learn microservices",
15
16
  "dependencies": {
package/proto/auth.proto CHANGED
@@ -7,6 +7,8 @@ service AuthService {
7
7
 
8
8
  rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
9
9
 
10
+ rpc RefreshToken (RefreshTokenRequest) returns (RefreshTokenResponse);
11
+
10
12
  }
11
13
 
12
14
  message SendOtpRequest {
@@ -28,3 +30,12 @@ message VerifyOtpResponse {
28
30
  string access_token = 1;
29
31
  string refresh_token = 2;
30
32
  }
33
+
34
+ message RefreshTokenRequest {
35
+ string refresh_token = 1;
36
+ }
37
+
38
+ message RefreshTokenResponse {
39
+ string access_token = 1;
40
+ string refresh_token = 2;
41
+ }