@routr/dispatcher 2.0.8-alpha.1 → 2.0.8-alpha.11
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.
|
@@ -38,7 +38,7 @@ const getConfig = (path) => {
|
|
|
38
38
|
if (!validate(Object.assign({}, c))) {
|
|
39
39
|
return E.left(new Error(JSON.stringify(validate.errors[0].message)));
|
|
40
40
|
}
|
|
41
|
-
//
|
|
41
|
+
// Convert funcMatch to actual functions
|
|
42
42
|
const processors = c.spec.processors.map((p) => {
|
|
43
43
|
const { ref, addr, methods, matchFunc } = p;
|
|
44
44
|
return { ref, addr, methods, matchFunc: eval(`(${matchFunc})`) };
|
package/dist/find_processor.js
CHANGED
|
@@ -5,10 +5,10 @@ const errors_1 = require("./errors");
|
|
|
5
5
|
const hasMethod = (config, request) => config.methods.includes(request.method);
|
|
6
6
|
exports.hasMethod = hasMethod;
|
|
7
7
|
// TODO: We need a way to test the matching function
|
|
8
|
-
const filter = (request, config) => (0, exports.hasMethod)(config, request) &&
|
|
8
|
+
const filter = (request, config) => (0, exports.hasMethod)(config, request) && config.matchFunc(request);
|
|
9
9
|
exports.filter = filter;
|
|
10
10
|
const findProcessor = (list) => (request) => {
|
|
11
11
|
var _a;
|
|
12
|
-
return (_a = list.find((config) => (0, exports.filter)(request, config))) !== null && _a !== void 0 ? _a : new errors_1.NotMatchingProcessorFound(request
|
|
12
|
+
return (_a = list.find((config) => (0, exports.filter)(request, config))) !== null && _a !== void 0 ? _a : new errors_1.NotMatchingProcessorFound(request.ref);
|
|
13
13
|
};
|
|
14
14
|
exports.findProcessor = findProcessor;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@routr/dispatcher",
|
|
3
|
-
"version": "2.0.8-alpha.
|
|
3
|
+
"version": "2.0.8-alpha.11",
|
|
4
4
|
"description": "Receives SIP messages and forwards them to the corresponding Message Processor",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/routr#readme",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@opentelemetry/sdk-trace-base": "^1.0.4",
|
|
36
36
|
"@opentelemetry/sdk-trace-node": "^1.0.4",
|
|
37
37
|
"@opentelemetry/semantic-conventions": "^1.0.4",
|
|
38
|
-
"@routr/common": "^2.0.8-alpha.
|
|
38
|
+
"@routr/common": "^2.0.8-alpha.11",
|
|
39
39
|
"ajv": "^6.12.6",
|
|
40
40
|
"fp-ts": "^2.11.8"
|
|
41
41
|
},
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"bugs": {
|
|
47
47
|
"url": "https://github.com/fonoster/routr/issues"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "627659ac51d0814a3106bcaac31a15c581a5809f"
|
|
50
50
|
}
|