@routr/common 2.0.31 → 2.1.7

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;
@@ -52,7 +52,7 @@ message Route {
52
52
  repeated string external_addrs = 11;
53
53
  // During route creation, an endpoint can request to add labels than can later be
54
54
  // used as selectors. For example, a Softphone can add a label `priority=1` to indicate
55
- // that it is the prefered endpoint for the given AOR.
55
+ // that it is the preferred endpoint for the given AOR.
56
56
  map<string, string> labels = 12;
57
57
  }
58
58
 
package/dist/service.js CHANGED
@@ -59,7 +59,7 @@ const loadOptions = {
59
59
  };
60
60
  // TODO: Get version from the proto or package
61
61
  const API_VERSION = "v2beta1";
62
- // We currenly don't have a way to obtain the proto type
62
+ // We currently don't have a way to obtain the proto type
63
63
  exports.PROCESSOR_OBJECT_PROTO = getObjectProto({
64
64
  name: "processor",
65
65
  version: API_VERSION,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routr/common",
3
- "version": "2.0.31",
3
+ "version": "2.1.7",
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": "bef1839e53701906f0739c8116639a1371f69173"
58
+ "gitHead": "d9c077986f631b93b28c13df87ad3f45bdd68499"
59
59
  }