@requ1emz/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 path_1 = require("path");
5
+ exports.PROTO_PATHS = {
6
+ AUTH: (0, path_1.join)(__dirname, "../../proto/auth.proto"),
7
+ };
package/gen/auth.ts CHANGED
@@ -26,7 +26,16 @@ export interface SendLoginRequest {
26
26
  }
27
27
 
28
28
  export interface SendLoginResponse {
29
- accesToken: string;
29
+ accessToken: string;
30
+ refreshToken: string;
31
+ }
32
+
33
+ export interface RefreshRequest {
34
+ refreshToken: string;
35
+ }
36
+
37
+ export interface RefreshResponse {
38
+ accessToken: string;
30
39
  refreshToken: string;
31
40
  }
32
41
 
@@ -36,6 +45,8 @@ export interface AuthServiceClient {
36
45
  register(request: SendRegistrationRequest): Observable<SendRegistationResponse>;
37
46
 
38
47
  login(request: SendLoginRequest): Observable<SendLoginResponse>;
48
+
49
+ refresh(request: RefreshRequest): Observable<RefreshResponse>;
39
50
  }
40
51
 
41
52
  export interface AuthServiceController {
@@ -44,11 +55,13 @@ export interface AuthServiceController {
44
55
  ): Promise<SendRegistationResponse> | Observable<SendRegistationResponse> | SendRegistationResponse;
45
56
 
46
57
  login(request: SendLoginRequest): Promise<SendLoginResponse> | Observable<SendLoginResponse> | SendLoginResponse;
58
+
59
+ refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
47
60
  }
48
61
 
49
62
  export function AuthServiceControllerMethods() {
50
63
  return function (constructor: Function) {
51
- const grpcMethods: string[] = ["register", "login"];
64
+ const grpcMethods: string[] = ["register", "login", "refresh"];
52
65
  for (const method of grpcMethods) {
53
66
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
54
67
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@requ1emz/contracts",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -9,6 +9,7 @@
9
9
  "generate": "protoc -I ./proto/ ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
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 Register (SendRegistrationRequest) returns (SendRegistationResponse );
7
7
  rpc Login (SendLoginRequest) returns (SendLoginResponse);
8
+ rpc Refresh (RefreshRequest) returns (RefreshResponse);
8
9
  }
9
10
 
10
11
  message SendRegistrationRequest {
@@ -23,6 +24,15 @@ message SendLoginRequest {
23
24
  }
24
25
 
25
26
  message SendLoginResponse {
26
- string acces_token = 1;
27
+ string access_token = 1;
28
+ string refresh_token = 2;
29
+ }
30
+
31
+ message RefreshRequest {
32
+ string refresh_token = 1;
33
+ }
34
+
35
+ message RefreshResponse {
36
+ string access_token = 1;
27
37
  string refresh_token = 2;
28
38
  }