@ticket_for_cinema/contracts 1.0.2 → 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.
@@ -0,0 +1 @@
1
+ export * from "./proto";
@@ -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_PATH: {
2
+ readonly AUTH: string;
3
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PROTO_PATH = void 0;
4
+ const path_1 = require("path");
5
+ exports.PROTO_PATH = {
6
+ AUTH: (0, path_1.join)(__dirname, "../../proto/auth.proto"),
7
+ };
package/gen/auth.ts CHANGED
@@ -34,23 +34,38 @@ export interface VerifyOtpResponse {
34
34
  refreshToken: string;
35
35
  }
36
36
 
37
+ export interface RefreshTokensRequest {
38
+ refreshToken: string;
39
+ }
40
+
41
+ export interface RefreshTokensResponse {
42
+ accessToken: string;
43
+ refreshToken: string;
44
+ }
45
+
37
46
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
38
47
 
39
48
  export interface AuthServiceClient {
40
49
  sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
41
50
 
42
51
  verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
52
+
53
+ refreshTokens(request: RefreshTokensRequest): Observable<RefreshTokensResponse>;
43
54
  }
44
55
 
45
56
  export interface AuthServiceController {
46
57
  sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
47
58
 
48
59
  verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
60
+
61
+ refreshTokens(
62
+ request: RefreshTokensRequest,
63
+ ): Promise<RefreshTokensResponse> | Observable<RefreshTokensResponse> | RefreshTokensResponse;
49
64
  }
50
65
 
51
66
  export function AuthServiceControllerMethods() {
52
67
  return function (constructor: Function) {
53
- const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
68
+ const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refreshTokens"];
54
69
  for (const method of grpcMethods) {
55
70
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
56
71
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ticket_for_cinema/contracts",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Contracts for microservices",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -9,6 +9,7 @@
9
9
  "build": "tsc -p tsconfig.build.json"
10
10
  },
11
11
  "files": [
12
+ "dist",
12
13
  "proto",
13
14
  "gen"
14
15
  ],
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 RefreshTokens (RefreshTokensRequest) returns (RefreshTokensResponse);
8
9
  }
9
10
 
10
11
  message SendOtpRequest {
@@ -26,5 +27,14 @@ message VerifyOtpRequest {
26
27
  message VerifyOtpResponse {
27
28
  string access_token = 1;
28
29
  string refresh_token = 2;
29
-
30
- }
30
+ }
31
+
32
+ message RefreshTokensRequest {
33
+ string refresh_token = 1;
34
+ }
35
+
36
+ message RefreshTokensResponse {
37
+ string access_token = 1;
38
+ string refresh_token = 2;
39
+ }
40
+