@routr/registry 2.0.8-alpha.4 → 2.0.8-alpha.41

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.
@@ -28,7 +28,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.getConfig = void 0;
30
30
  /*
31
- * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
31
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
32
32
  * http://github.com/fonoster/routr
33
33
  *
34
34
  * This file is part of Routr
@@ -46,29 +46,29 @@ exports.getConfig = void 0;
46
46
  * limitations under the License.
47
47
  */
48
48
  const types_1 = require("../types");
49
- const fs_1 = __importDefault(require("fs"));
50
49
  const schema_1 = require("./schema");
51
50
  const ajv_1 = __importDefault(require("ajv"));
52
51
  const E = __importStar(require("fp-ts/Either"));
53
52
  const errors_1 = require("../errors");
53
+ const common_1 = require("@routr/common");
54
54
  const ajv = new ajv_1.default();
55
55
  const validate = ajv.compile(schema_1.schema);
56
56
  const getConfig = (path) => {
57
57
  var _a, _b, _c;
58
- const c = JSON.parse(fs_1.default.readFileSync(path, "utf8"));
58
+ const c = common_1.Helper.readConfigFile(path);
59
59
  if (!validate(Object.assign({}, c))) {
60
60
  return E.left(new errors_1.InvalidSchemaConfiguration(JSON.stringify(validate.errors[0].message)));
61
61
  }
62
62
  const config = c.spec;
63
63
  if (!((_a = config === null || config === void 0 ? void 0 : config.cache) === null || _a === void 0 ? void 0 : _a.provider)) {
64
64
  config.cache = {
65
- provider: types_1.CACHE_PROVIDER.MEMORY
65
+ provider: types_1.CacheProvider.MEMORY
66
66
  };
67
67
  }
68
- if (((_b = config === null || config === void 0 ? void 0 : config.cache) === null || _b === void 0 ? void 0 : _b.provider) === types_1.CACHE_PROVIDER.REDIS &&
68
+ if (((_b = config === null || config === void 0 ? void 0 : config.cache) === null || _b === void 0 ? void 0 : _b.provider) === types_1.CacheProvider.REDIS &&
69
69
  !((_c = config === null || config === void 0 ? void 0 : config.cache) === null || _c === void 0 ? void 0 : _c.parameters)) {
70
70
  config.cache = {
71
- provider: types_1.CACHE_PROVIDER.REDIS,
71
+ provider: types_1.CacheProvider.REDIS,
72
72
  parameters: "host=localhost,port=6379"
73
73
  };
74
74
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.schema = void 0;
4
4
  /*
5
- * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
5
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/routr
7
7
  *
8
8
  * This file is part of Routr
package/dist/envs.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare const CONFIG_PATH: string;
2
+ export declare const ENABLE_HEALTHCHECKS: boolean;
package/dist/envs.js ADDED
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ENABLE_HEALTHCHECKS = exports.CONFIG_PATH = void 0;
4
+ /*
5
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
6
+ * http://github.com/fonoster
7
+ *
8
+ * This file is part of Routr.
9
+ *
10
+ * Licensed under the MIT License (the "License");
11
+ * you may not use this file except in compliance with
12
+ * the License. You may obtain a copy of the License at
13
+ *
14
+ * https://opensource.org/licenses/MIT
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ */
22
+ const common_1 = require("@routr/common");
23
+ common_1.Assertions.assertEnvsAreSet(["CONFIG_PATH"]);
24
+ exports.CONFIG_PATH = process.env.CONFIG_PATH;
25
+ exports.ENABLE_HEALTHCHECKS = process.env.ENABLE_HEALTHCHECKS !== "false";
package/dist/errors.js CHANGED
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.InvalidSchemaConfiguration = void 0;
27
27
  /*
28
- * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
28
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
29
29
  * http://github.com/fonoster/routr
30
30
  *
31
31
  * This file is part of Routr
package/dist/request.js CHANGED
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getPortFromAddress = exports.getHostFromAddress = void 0;
7
7
  /*
8
- * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
8
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
9
9
  * http://github.com/fonoster/routr
10
10
  *
11
11
  * This file is part of Routr
@@ -135,6 +135,8 @@ function createRegistrationRequest(params) {
135
135
  methodParam: common_1.Method.REGISTER,
136
136
  secure: params.secure
137
137
  },
138
+ via: [],
139
+ recordRoute: [],
138
140
  messageType: common_1.CommonTypes.MessageType.REQUEST
139
141
  }
140
142
  };
package/dist/runner.js CHANGED
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  /*
8
- * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
8
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
9
9
  * http://github.com/fonoster/routr
10
10
  *
11
11
  * This file is part of Routr
@@ -26,14 +26,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  require("./tracer").init("dispatcher");
27
27
  const service_1 = __importDefault(require("./service"));
28
28
  const get_config_1 = require("./config/get_config");
29
- const common_1 = require("@routr/common");
30
29
  const logger_1 = require("@fonoster/logger");
30
+ const envs_1 = require("./envs");
31
+ const express_1 = __importDefault(require("express"));
32
+ const app = (0, express_1.default)();
33
+ const healthPort = 8080;
31
34
  const logger = (0, logger_1.getLogger)({ service: "registry", filePath: __filename });
32
- common_1.Assertions.assertEnvsAreSet(["CONFIG_PATH"]);
33
- const config = (0, get_config_1.getConfig)(process.env.CONFIG_PATH);
35
+ const config = (0, get_config_1.getConfig)(envs_1.CONFIG_PATH);
34
36
  if (config._tag === "Right") {
35
37
  (0, service_1.default)(config.right);
36
38
  }
37
39
  else {
38
40
  logger.error(config.left);
39
41
  }
42
+ if (envs_1.ENABLE_HEALTHCHECKS) {
43
+ app.get("/healthz", (_, res) => {
44
+ res.send("OK");
45
+ });
46
+ app.listen(healthPort, () => {
47
+ logger.info(`health check endpoint listening on port ${healthPort}`);
48
+ });
49
+ }
package/dist/sender.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { ServiceUnavailableError } from "@routr/common";
1
+ import { CommonErrors as CE } from "@routr/common";
2
2
  import { RegistrationRequest, SendMessageResponse } from "./types";
3
- export declare const sendRegisterMessage: (requesterAddr: string) => (request: RegistrationRequest) => Promise<ServiceUnavailableError | SendMessageResponse>;
3
+ export declare const sendRegisterMessage: (requesterAddr: string) => (request: RegistrationRequest) => Promise<CE.ServiceUnavailableError | SendMessageResponse>;
package/dist/sender.js CHANGED
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.sendRegisterMessage = void 0;
27
27
  /*
28
- * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
28
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
29
29
  * http://github.com/fonoster/routr
30
30
  *
31
31
  * This file is part of Routr
@@ -44,14 +44,13 @@ exports.sendRegisterMessage = void 0;
44
44
  */
45
45
  const grpc = __importStar(require("@grpc/grpc-js"));
46
46
  const common_1 = require("@routr/common");
47
- const common_2 = require("@routr/common");
48
47
  const sendRegisterMessage = (requesterAddr) => {
49
48
  return (request) => {
50
- const client = new common_2.CommonRequester.REQUESTER_PROTO.v2draft1.Requester(requesterAddr, grpc.credentials.createInsecure());
49
+ const client = new common_1.CommonRequester.REQUESTER_PROTO.v2draft1.Requester(requesterAddr, grpc.credentials.createInsecure());
51
50
  return new Promise((resolve, reject) => {
52
51
  client.sendMessage(request, (err, response) => {
53
52
  if ((err === null || err === void 0 ? void 0 : err.code) === 14) {
54
- return reject(new common_1.ServiceUnavailableError(requesterAddr));
53
+ return reject(new common_1.CommonErrors.ServiceUnavailableError(requesterAddr));
55
54
  }
56
55
  else if (err) {
57
56
  return reject(err);
package/dist/service.js CHANGED
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  /*
16
- * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
16
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
17
17
  * http://github.com/fonoster/routr
18
18
  *
19
19
  * This file is part of Routr
@@ -36,7 +36,6 @@ const types_1 = require("./types");
36
36
  const utils_1 = require("./utils");
37
37
  const common_1 = require("@routr/common");
38
38
  const logger_1 = require("@fonoster/logger");
39
- const common_2 = require("@routr/common");
40
39
  const logger = (0, logger_1.getLogger)({ service: "registry", filePath: __filename });
41
40
  const DEFAULT_REGISTRATION_INTERVAL = 60;
42
41
  // TODO:
@@ -49,15 +48,15 @@ const DEFAULT_REGISTRATION_INTERVAL = 60;
49
48
  function registryService(config) {
50
49
  var _a;
51
50
  logger.info("starting registry service");
52
- const registerInterval = (_a = config.registerInterval) !== null && _a !== void 0 ? _a : DEFAULT_REGISTRATION_INTERVAL;
53
51
  const store = (0, utils_1.buildStore)(config);
52
+ const dataAPI = common_1.CommonConnect.apiClient({ apiAddr: config.apiAddr });
53
+ const registerInterval = (_a = config.registerInterval) !== null && _a !== void 0 ? _a : DEFAULT_REGISTRATION_INTERVAL;
54
54
  // Creates internval to send registration request every X seconds
55
55
  setInterval(() => __awaiter(this, void 0, void 0, function* () {
56
56
  logger.verbose("starting registration process");
57
- let resources = [];
58
- const dataAPI = common_1.CommonConnect.dataAPI(config.apiAddr);
57
+ let trunks = [];
59
58
  try {
60
- resources = yield (0, utils_1.findTrunks)(dataAPI);
59
+ trunks = yield (0, utils_1.findTrunks)(dataAPI);
61
60
  }
62
61
  catch (err) {
63
62
  logger.error("failed to retrieve trunks from API", err);
@@ -65,10 +64,10 @@ function registryService(config) {
65
64
  }
66
65
  // Create a list of trunks in the Store
67
66
  const trunksInStore = (yield store.list()).map((r) => r.trunkRef);
68
- const registryInvocations = resources
69
- .filter((resources) => !trunksInStore.includes(resources.ref))
70
- .map((resource) => __awaiter(this, void 0, void 0, function* () {
71
- const registrationRequestInput = (0, utils_1.registrationRequestInputFromTrunk)(yield (0, utils_1.convertResourceToTrunk)(dataAPI, resource), config);
67
+ const registryInvocations = trunks
68
+ .filter((trunk) => !trunksInStore.includes(trunk.ref))
69
+ .map((trunk) => __awaiter(this, void 0, void 0, function* () {
70
+ const registrationRequestInput = (0, utils_1.registrationRequestInputFromTrunk)(trunk, config);
72
71
  const request = (0, request_1.default)(registrationRequestInput);
73
72
  return (0, sender_1.sendRegisterMessage)(config.requesterAddr)(request);
74
73
  }));
@@ -80,7 +79,7 @@ function registryService(config) {
80
79
  logger.error("request rejected", result.reason);
81
80
  return;
82
81
  }
83
- if (result.value instanceof common_2.ServiceUnavailableError) {
82
+ if (result.value instanceof common_1.CommonErrors.ServiceUnavailableError) {
84
83
  logger.error("service unavailable", result.value);
85
84
  return;
86
85
  }
@@ -88,7 +87,7 @@ function registryService(config) {
88
87
  // Makes sure we send register before the last register expires
89
88
  const retentionTime = ((_e = (_c = (_b = message.contact) === null || _b === void 0 ? void 0 : _b.expires) !== null && _c !== void 0 ? _c : (_d = message.expires) === null || _d === void 0 ? void 0 : _d.expires) !== null && _e !== void 0 ? _e : types_1.DEFAULT_EXPIRES) - registerInterval;
90
89
  // TODO: Refactor to use ResponseType instead of string
91
- const status = message.responseType.toString() == "OK"
90
+ const status = message.responseType == common_1.CommonTypes.ResponseType.OK
92
91
  ? types_1.RegistrationEntryStatus.REGISTERED
93
92
  : types_1.RegistrationEntryStatus.QUARANTINE;
94
93
  // Storing trunk in registry with status and retention time
package/dist/tracer.js CHANGED
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.init = void 0;
7
7
  /*
8
- * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
8
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
9
9
  * http://github.com/fonoster/routr
10
10
  *
11
11
  * This file is part of Routr
package/dist/types.d.ts CHANGED
@@ -2,7 +2,7 @@ import { Method, Transport } from "@routr/common";
2
2
  import { SIPMessage } from "@routr/common/src/types";
3
3
  export declare const DEFAULT_MAX_FORWARDS = 70;
4
4
  export declare const DEFAULT_EXPIRES = 600;
5
- export declare enum CACHE_PROVIDER {
5
+ export declare enum CacheProvider {
6
6
  MEMORY = "memory",
7
7
  REDIS = "redis"
8
8
  }
@@ -21,7 +21,7 @@ export interface RegistryConfig {
21
21
  registerInterval: number;
22
22
  methods: Method[];
23
23
  cache?: {
24
- provider: CACHE_PROVIDER;
24
+ provider: CacheProvider;
25
25
  parameters?: string;
26
26
  };
27
27
  }
package/dist/types.js CHANGED
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RegistrationEntryStatus = exports.CACHE_PROVIDER = exports.DEFAULT_EXPIRES = exports.DEFAULT_MAX_FORWARDS = void 0;
3
+ exports.RegistrationEntryStatus = exports.CacheProvider = exports.DEFAULT_EXPIRES = exports.DEFAULT_MAX_FORWARDS = void 0;
4
4
  exports.DEFAULT_MAX_FORWARDS = 70;
5
5
  exports.DEFAULT_EXPIRES = 600;
6
- var CACHE_PROVIDER;
7
- (function (CACHE_PROVIDER) {
8
- CACHE_PROVIDER["MEMORY"] = "memory";
9
- CACHE_PROVIDER["REDIS"] = "redis";
10
- })(CACHE_PROVIDER = exports.CACHE_PROVIDER || (exports.CACHE_PROVIDER = {}));
6
+ var CacheProvider;
7
+ (function (CacheProvider) {
8
+ CacheProvider["MEMORY"] = "memory";
9
+ CacheProvider["REDIS"] = "redis";
10
+ })(CacheProvider = exports.CacheProvider || (exports.CacheProvider = {}));
11
11
  var RegistrationEntryStatus;
12
12
  (function (RegistrationEntryStatus) {
13
13
  RegistrationEntryStatus["REGISTERED"] = "registered";
package/dist/utils.d.ts CHANGED
@@ -1,20 +1,18 @@
1
- import { Transport } from "@routr/common";
2
1
  import { CommonConnect as CC } from "@routr/common";
3
2
  import MemoryStore from "./memory_store";
4
3
  import RedisStore from "./redis_store";
5
4
  import { IRegistryStore, RegistryConfig, Trunk } from "./types";
6
5
  export declare function getUnregisteredTrunks(store: IRegistryStore): (trunks: Trunk[]) => Promise<Trunk[]>;
7
- export declare function findTrunks(dataAPI: CC.DataAPI): Promise<CC.Resource[]>;
6
+ export declare function findTrunks(apiClient: CC.APIClient): Promise<CC.Trunk[]>;
8
7
  export declare const configFromString: (params: string, allowedKeys: string[]) => Record<string, string | boolean>;
9
8
  export declare const buildStore: (config: RegistryConfig) => MemoryStore | RedisStore;
10
- export declare const convertResourceToTrunk: (dataAPI: CC.DataAPI, resource: CC.Resource) => Promise<Trunk>;
11
- export declare const registrationRequestInputFromTrunk: (trunk: Trunk, config: RegistryConfig) => {
9
+ export declare const registrationRequestInputFromTrunk: (trunk: CC.Trunk, config: RegistryConfig) => {
12
10
  trunkRef: string;
13
11
  user: string;
14
12
  targetDomain: string;
15
13
  targetAddress: string;
16
14
  proxyAddress: string;
17
- transport: Transport;
15
+ transport: import("@routr/common").Transport;
18
16
  auth: {
19
17
  username: string;
20
18
  secret: string;
package/dist/utils.js CHANGED
@@ -12,27 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.registrationRequestInputFromTrunk = exports.convertResourceToTrunk = exports.buildStore = exports.configFromString = exports.findTrunks = exports.getUnregisteredTrunks = void 0;
16
- /*
17
- * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
18
- * http://github.com/fonoster
19
- *
20
- * This file is part of Routr.
21
- *
22
- * Licensed under the MIT License (the "License");
23
- * you may not use this file except in compliance with
24
- * the License. You may obtain a copy of the License at
25
- *
26
- * https://opensource.org/licenses/MIT
27
- *
28
- * Unless required by applicable law or agreed to in writing, software
29
- * distributed under the License is distributed on an "AS IS" BASIS,
30
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31
- * See the License for the specific language governing permissions and
32
- * limitations under the License.
33
- */
34
- const common_1 = require("@routr/common");
35
- const common_2 = require("@routr/common");
15
+ exports.registrationRequestInputFromTrunk = exports.buildStore = exports.configFromString = exports.findTrunks = exports.getUnregisteredTrunks = void 0;
36
16
  const memory_store_1 = __importDefault(require("./memory_store"));
37
17
  const redis_store_1 = __importDefault(require("./redis_store"));
38
18
  const types_1 = require("./types");
@@ -47,13 +27,12 @@ function getUnregisteredTrunks(store) {
47
27
  }
48
28
  exports.getUnregisteredTrunks = getUnregisteredTrunks;
49
29
  // eslint-disable-next-line require-jsdoc
50
- function findTrunks(dataAPI) {
30
+ function findTrunks(apiClient) {
51
31
  return __awaiter(this, void 0, void 0, function* () {
52
- return yield dataAPI.findBy({
53
- kind: common_2.CommonConnect.KIND.TRUNK,
54
- criteria: common_2.CommonConnect.FindCriteria.FIND_TRUNKS_WITH_SEND_REGISTER,
55
- parameters: {}
56
- });
32
+ return (yield apiClient.trunks.findBy({
33
+ fieldName: "sendRegister",
34
+ fieldValue: "true"
35
+ })).items;
57
36
  });
58
37
  }
59
38
  exports.findTrunks = findTrunks;
@@ -80,7 +59,7 @@ const configFromString = (params, allowedKeys) => {
80
59
  };
81
60
  exports.configFromString = configFromString;
82
61
  const buildStore = (config) => {
83
- if (config.cache.provider === types_1.CACHE_PROVIDER.REDIS) {
62
+ if (config.cache.provider === types_1.CacheProvider.REDIS) {
84
63
  const allowedParameters = ["host", "port", "username", "password", "secure"];
85
64
  return new redis_store_1.default((0, exports.configFromString)(config.cache.parameters, allowedParameters));
86
65
  }
@@ -89,39 +68,21 @@ const buildStore = (config) => {
89
68
  }
90
69
  };
91
70
  exports.buildStore = buildStore;
92
- const convertResourceToTrunk = (dataAPI, resource) => __awaiter(void 0, void 0, void 0, function* () {
93
- var _a, _b, _c, _d, _e, _f;
94
- const metadata = resource.metadata;
95
- const trunkSpec = resource.spec;
96
- const uri = (_b = (_a = trunkSpec.outbound) === null || _a === void 0 ? void 0 : _a.uris[0]) === null || _b === void 0 ? void 0 : _b.uri;
97
- // WARNING: Perhaps we should bring this on a single API call
98
- const cred = yield dataAPI.get((_c = trunkSpec.outbound) === null || _c === void 0 ? void 0 : _c.credentialsRef);
99
- const usernameAndPassword = cred === null || cred === void 0 ? void 0 : cred.spec.credentials;
100
- return {
101
- ref: resource.ref,
102
- name: resource.metadata.name,
103
- region: metadata.region,
104
- host: uri.host,
105
- port: (_d = uri.port) !== null && _d !== void 0 ? _d : 5060,
106
- user: uri.user,
107
- credentials: {
108
- username: usernameAndPassword === null || usernameAndPassword === void 0 ? void 0 : usernameAndPassword.username,
109
- secret: usernameAndPassword === null || usernameAndPassword === void 0 ? void 0 : usernameAndPassword.password
110
- },
111
- transport: (_f = (_e = uri.transport) === null || _e === void 0 ? void 0 : _e.toLowerCase()) !== null && _f !== void 0 ? _f : common_1.Transport.UDP
112
- };
113
- });
114
- exports.convertResourceToTrunk = convertResourceToTrunk;
115
71
  const registrationRequestInputFromTrunk = (trunk, config) => {
72
+ var _a, _b;
73
+ const uri = trunk.uris[0];
116
74
  return {
117
75
  trunkRef: trunk.ref,
118
- user: trunk.user,
119
- targetDomain: trunk.host,
120
- targetAddress: `${trunk.host}:${trunk.port}`,
76
+ user: uri.user,
77
+ targetDomain: uri.host,
78
+ targetAddress: `${uri.host}:${uri.port}`,
121
79
  // TODO: Find closest edgeport instead of [0]
122
80
  proxyAddress: config.edgePorts[0].address,
123
- transport: trunk.transport,
124
- auth: trunk.credentials,
81
+ transport: uri.transport,
82
+ auth: {
83
+ username: (_a = trunk.outboundCredentials) === null || _a === void 0 ? void 0 : _a.username,
84
+ secret: (_b = trunk.outboundCredentials) === null || _b === void 0 ? void 0 : _b.password
85
+ },
125
86
  methods: config.methods
126
87
  };
127
88
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routr/registry",
3
- "version": "2.0.8-alpha.4",
3
+ "version": "2.0.8-alpha.41",
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",
@@ -12,7 +12,8 @@
12
12
  "build": "tsc -b tsconfig.json"
13
13
  },
14
14
  "bin": {
15
- "run_registry": "dist/runner.js"
15
+ "run_registry": "dist/runner.js",
16
+ "healthcheck_registry": "dist/healthcheck.js"
16
17
  },
17
18
  "directories": {
18
19
  "src": "src",
@@ -25,7 +26,7 @@
25
26
  "access": "public"
26
27
  },
27
28
  "dependencies": {
28
- "@grpc/grpc-js": "^1.5.9",
29
+ "@grpc/grpc-js": "^1.8.4",
29
30
  "@opentelemetry/api": "^1.0.4",
30
31
  "@opentelemetry/exporter-jaeger": "^1.0.4",
31
32
  "@opentelemetry/instrumentation": "^0.27.0",
@@ -34,9 +35,10 @@
34
35
  "@opentelemetry/sdk-trace-base": "^1.0.4",
35
36
  "@opentelemetry/sdk-trace-node": "^1.0.4",
36
37
  "@opentelemetry/semantic-conventions": "^1.0.4",
37
- "@routr/common": "^2.0.8-alpha.4",
38
- "@routr/processor": "^2.0.8-alpha.4",
38
+ "@routr/common": "^2.0.8-alpha.41",
39
+ "@routr/processor": "^2.0.8-alpha.41",
39
40
  "ajv": "^6.12.6",
41
+ "express": "^4.18.2",
40
42
  "fp-ts": "^2.11.8",
41
43
  "pb-util": "^1.0.3",
42
44
  "redis": "^4.0.4",
@@ -50,7 +52,8 @@
50
52
  "url": "https://github.com/fonoster/routr/issues"
51
53
  },
52
54
  "devDependencies": {
55
+ "@types/express": "^4.17.17",
53
56
  "@types/uniqid": "^5.3.2"
54
57
  },
55
- "gitHead": "320abeb05175976ddfca265096a2ea63004607f4"
58
+ "gitHead": "52f44320b57824dfea40f48b02b44b9a8e6bdda3"
56
59
  }