@routr/registry 2.0.6-alpha.1 → 2.0.7-alpha.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.
package/dist/errors.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as grpc from "@grpc/grpc-js";
2
- export declare type InvalidConfiguration = InvalidSchemaConfiguration;
2
+ export type InvalidConfiguration = InvalidSchemaConfiguration;
3
3
  /**
4
4
  * Error thrown when the Registry service finds a bad configuration.
5
5
  */
@@ -49,23 +49,30 @@ class RedisStore {
49
49
  }
50
50
  /** @inheritdoc */
51
51
  list() {
52
- var e_1, _a;
52
+ var _a, e_1, _b, _c;
53
53
  return __awaiter(this, void 0, void 0, function* () {
54
54
  const entries = [];
55
55
  try {
56
56
  // eslint-disable-next-line no-loops/no-loops
57
- for (var _b = __asyncValues(yield this.client.scanIterator({
57
+ for (var _d = true, _e = __asyncValues(yield this.client.scanIterator({
58
58
  CURSOR: 0,
59
59
  MATCH: `${KEY_PREFIX}:*`
60
- })), _c; _c = yield _b.next(), !_c.done;) {
61
- const k = _c.value;
62
- entries.push(JSON.parse(yield this.client.get(k)));
60
+ })), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
61
+ _c = _f.value;
62
+ _d = false;
63
+ try {
64
+ const k = _c;
65
+ entries.push(JSON.parse(yield this.client.get(k)));
66
+ }
67
+ finally {
68
+ _d = true;
69
+ }
63
70
  }
64
71
  }
65
72
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
66
73
  finally {
67
74
  try {
68
- if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
75
+ if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
69
76
  }
70
77
  finally { if (e_1) throw e_1.error; }
71
78
  }
package/dist/service.js CHANGED
@@ -66,7 +66,7 @@ function registryService(config) {
66
66
  // Create a list of trunks in the Store
67
67
  const trunksInStore = (yield store.list()).map((r) => r.trunkRef);
68
68
  const registryInvocations = resources
69
- .filter((resources) => !trunksInStore.includes(resources.metadata.ref))
69
+ .filter((resources) => !trunksInStore.includes(resources.ref))
70
70
  .map((resource) => __awaiter(this, void 0, void 0, function* () {
71
71
  const registrationRequestInput = (0, utils_1.registrationRequestInputFromTrunk)(yield (0, utils_1.convertResourceToTrunk)(dataAPI, resource), config);
72
72
  const request = (0, request_1.default)(registrationRequestInput);
package/dist/utils.js CHANGED
@@ -98,7 +98,7 @@ const convertResourceToTrunk = (dataAPI, resource) => __awaiter(void 0, void 0,
98
98
  const cred = yield dataAPI.get((_c = trunkSpec.outbound) === null || _c === void 0 ? void 0 : _c.credentialsRef);
99
99
  const usernameAndPassword = cred === null || cred === void 0 ? void 0 : cred.spec.credentials;
100
100
  return {
101
- ref: resource.metadata.ref,
101
+ ref: resource.ref,
102
102
  name: resource.metadata.name,
103
103
  region: metadata.region,
104
104
  host: uri.host,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routr/registry",
3
- "version": "2.0.6-alpha.1",
3
+ "version": "2.0.7-alpha.0",
4
4
  "description": "Sends trunks registrations and maintains their bindings",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/routr#readme",
@@ -34,8 +34,8 @@
34
34
  "@opentelemetry/sdk-trace-base": "^1.0.4",
35
35
  "@opentelemetry/sdk-trace-node": "^1.0.4",
36
36
  "@opentelemetry/semantic-conventions": "^1.0.4",
37
- "@routr/common": "^2.0.6-alpha.1",
38
- "@routr/processor": "^2.0.6-alpha.1",
37
+ "@routr/common": "^2.0.7-alpha.0",
38
+ "@routr/processor": "^2.0.7-alpha.0",
39
39
  "ajv": "^6.12.6",
40
40
  "fp-ts": "^2.11.8",
41
41
  "pb-util": "^1.0.3",
@@ -52,5 +52,5 @@
52
52
  "devDependencies": {
53
53
  "@types/uniqid": "^5.3.2"
54
54
  },
55
- "gitHead": "389513636bbac9ab7ffbe14f1b8ecdb5bb93bad4"
55
+ "gitHead": "1c08d04c570d1fa156729a8f61e43c3c51b68f96"
56
56
  }