@routr/common 2.0.20 → 2.1.0

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.
@@ -4,3 +4,8 @@
4
4
  * @param {string[]} variables environment variables to check
5
5
  */
6
6
  export declare function assertEnvsAreSet(variables: string[]): void;
7
+ /**
8
+ * Function that asserts that the given file exists.
9
+ * @param {string} file file to check
10
+ */
11
+ export declare function assertFileExist(file: string): void;
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.assertEnvsAreSet = void 0;
6
+ exports.assertFileExist = exports.assertEnvsAreSet = void 0;
4
7
  /*
5
8
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
6
9
  * http://github.com/fonoster/routr
@@ -20,6 +23,7 @@ exports.assertEnvsAreSet = void 0;
20
23
  * limitations under the License.
21
24
  */
22
25
  const logger_1 = require("@fonoster/logger");
26
+ const fs_1 = __importDefault(require("fs"));
23
27
  const logger = (0, logger_1.getLogger)({ service: "common", filePath: __filename });
24
28
  /**
25
29
  * Function that asserts that the given environment variable is set.
@@ -35,3 +39,14 @@ function assertEnvsAreSet(variables) {
35
39
  });
36
40
  }
37
41
  exports.assertEnvsAreSet = assertEnvsAreSet;
42
+ /**
43
+ * Function that asserts that the given file exists.
44
+ * @param {string} file file to check
45
+ */
46
+ function assertFileExist(file) {
47
+ if (!fs_1.default.existsSync(file)) {
48
+ logger.error(`the file ${file} does not exist`);
49
+ process.exit(1);
50
+ }
51
+ }
52
+ exports.assertFileExist = assertFileExist;
@@ -40,6 +40,8 @@ message Route {
40
40
  string user = 1;
41
41
  string host = 2;
42
42
  string port = 3;
43
+ string advertised_host = 13;
44
+ string advertised_port = 14;
43
45
  fonoster.routr.common.v2beta1.Transport transport = 4;
44
46
  int64 registered_on = 5;
45
47
  int32 expires = 6;
package/dist/types.d.ts CHANGED
@@ -125,6 +125,8 @@ export interface Route {
125
125
  user: string;
126
126
  host: string;
127
127
  port: number;
128
+ advertisedHost: string;
129
+ advertisedPort: number;
128
130
  transport: Transport;
129
131
  registeredOn?: number;
130
132
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routr/common",
3
- "version": "2.0.20",
3
+ "version": "2.1.0",
4
4
  "description": "Common package",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/routr#readme",
@@ -55,5 +55,5 @@
55
55
  "devDependencies": {
56
56
  "@types/js-yaml": "^4.0.5"
57
57
  },
58
- "gitHead": "4e577fb7c461a6093bcaa33451872fb86c873e6e"
58
+ "gitHead": "0e75c7950157dcb7701082655259a87da322c29d"
59
59
  }