@routr/registry 2.0.8-alpha.4 → 2.0.8-alpha.5
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/config/get_config.js +3 -3
- package/dist/types.d.ts +2 -2
- package/dist/types.js +6 -6
- package/dist/utils.js +2 -2
- package/package.json +4 -4
|
@@ -62,13 +62,13 @@ const getConfig = (path) => {
|
|
|
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.
|
|
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.
|
|
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.
|
|
71
|
+
provider: types_1.CacheProvider.REDIS,
|
|
72
72
|
parameters: "host=localhost,port=6379"
|
|
73
73
|
};
|
|
74
74
|
}
|
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
|
|
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:
|
|
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.
|
|
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
|
|
7
|
-
(function (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
})(
|
|
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.js
CHANGED
|
@@ -50,7 +50,7 @@ exports.getUnregisteredTrunks = getUnregisteredTrunks;
|
|
|
50
50
|
function findTrunks(dataAPI) {
|
|
51
51
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52
52
|
return yield dataAPI.findBy({
|
|
53
|
-
kind: common_2.CommonConnect.
|
|
53
|
+
kind: common_2.CommonConnect.Kind.TRUNK,
|
|
54
54
|
criteria: common_2.CommonConnect.FindCriteria.FIND_TRUNKS_WITH_SEND_REGISTER,
|
|
55
55
|
parameters: {}
|
|
56
56
|
});
|
|
@@ -80,7 +80,7 @@ const configFromString = (params, allowedKeys) => {
|
|
|
80
80
|
};
|
|
81
81
|
exports.configFromString = configFromString;
|
|
82
82
|
const buildStore = (config) => {
|
|
83
|
-
if (config.cache.provider === types_1.
|
|
83
|
+
if (config.cache.provider === types_1.CacheProvider.REDIS) {
|
|
84
84
|
const allowedParameters = ["host", "port", "username", "password", "secure"];
|
|
85
85
|
return new redis_store_1.default((0, exports.configFromString)(config.cache.parameters, allowedParameters));
|
|
86
86
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@routr/registry",
|
|
3
|
-
"version": "2.0.8-alpha.
|
|
3
|
+
"version": "2.0.8-alpha.5",
|
|
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.8-alpha.
|
|
38
|
-
"@routr/processor": "^2.0.8-alpha.
|
|
37
|
+
"@routr/common": "^2.0.8-alpha.5",
|
|
38
|
+
"@routr/processor": "^2.0.8-alpha.5",
|
|
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": "
|
|
55
|
+
"gitHead": "215638b9d7b56b2db2c2f0bc1bada3b6accbde58"
|
|
56
56
|
}
|