@routr/simpledata 2.15.0 → 2.15.1

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.
@@ -23,12 +23,13 @@ exports.agentsLoader = agentsLoader;
23
23
  const common_1 = require("@routr/common");
24
24
  const find_1 = require("./find");
25
25
  function agentsLoader(config, list) {
26
+ var _a;
26
27
  if (config.kind !== common_1.CommonConnect.Kind.AGENT)
27
28
  throw new Error("invalid resource type `Agent`");
28
29
  const agent = common_1.CommonConnect.mapToAgent(config);
29
30
  agent.domain = (0, find_1.findByRef)(config.spec.domainRef, list);
30
31
  agent.credentials = (0, find_1.findByRef)(config.spec.credentialsRef, list);
31
- // maxContacts -1 means no limit
32
- agent.maxContacts = agent.maxContacts || -1;
32
+ // maxContacts -1 means no limit; 0 is a hard limit (no contacts)
33
+ agent.maxContacts = (_a = agent.maxContacts) !== null && _a !== void 0 ? _a : -1;
33
34
  return agent;
34
35
  }
@@ -25,6 +25,7 @@ const logger_1 = require("@fonoster/logger");
25
25
  const find_1 = require("./find");
26
26
  const logger = (0, logger_1.getLogger)({ service: "simpledata", filePath: __filename });
27
27
  function peersLoader(config, list) {
28
+ var _a;
28
29
  if (config.kind !== common_1.CommonConnect.Kind.PEER)
29
30
  throw new Error("invalid resource type `Peer`");
30
31
  const peer = common_1.CommonConnect.mapToPeer(config);
@@ -32,7 +33,7 @@ function peersLoader(config, list) {
32
33
  logger.warn("'backend:' prefix to be removed in upcoming updates. please use 'sip:' for compatibility.");
33
34
  }
34
35
  peer.credentials = (0, find_1.findByRef)(config.spec.credentialsRef, list);
35
- // maxContacts -1 means no limit
36
- peer.maxContacts = peer.maxContacts || -1;
36
+ // maxContacts -1 means no limit; 0 is a hard limit (no contacts)
37
+ peer.maxContacts = (_a = peer.maxContacts) !== null && _a !== void 0 ? _a : -1;
37
38
  return peer;
38
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routr/simpledata",
3
- "version": "2.15.0",
3
+ "version": "2.15.1",
4
4
  "description": "Files-based API Server for Routr Connect",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/routr#readme",
@@ -31,7 +31,7 @@
31
31
  "@opentelemetry/sdk-trace-node": "^1.0.4",
32
32
  "@opentelemetry/semantic-conventions": "^1.0.4",
33
33
  "@routr/common": "^2.15.0",
34
- "@routr/processor": "^2.15.0",
34
+ "@routr/processor": "^2.15.1",
35
35
  "google-protobuf": "^3.21.4",
36
36
  "jsonpath": "^1.1.1",
37
37
  "pb-util": "^1.0.3"
@@ -53,5 +53,5 @@
53
53
  "@types/google-protobuf": "^3.15.6",
54
54
  "@types/jsonpath": "^0.2.0"
55
55
  },
56
- "gitHead": "4cfe8529e9325b7a2f32aff615cf3db65c71cf29"
56
+ "gitHead": "2784f886cab933977feed3fe50edcaec0e6f7dac"
57
57
  }