@routr/edgeport 2.0.5-alpha.12 → 2.0.5-alpha.15
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/assertions.js +1 -1
- package/dist/config/get_config.js +6 -2
- package/dist/edgeport.js +5 -5
- package/dist/runner.js +3 -2
- package/dist/tracer.d.ts +1 -0
- package/dist/tracer.js +49 -0
- package/package.json +2 -2
package/dist/assertions.js
CHANGED
|
@@ -6,7 +6,7 @@ const isSecureProto = (proto) => proto === 'wss' || proto === 'tls';
|
|
|
6
6
|
exports.isSecureProto = isSecureProto;
|
|
7
7
|
// We need to have the spec.securityContext for all secure protocol
|
|
8
8
|
const assertHasSecurityContext = (config) => {
|
|
9
|
-
const hasSecureProto = config.spec.transport.some(t1 => exports.isSecureProto(t1.protocol));
|
|
9
|
+
const hasSecureProto = config.spec.transport.some(t1 => (0, exports.isSecureProto)(t1.protocol));
|
|
10
10
|
if (hasSecureProto && !config.spec.securityContext) {
|
|
11
11
|
throw new Error('found at least one secure protocol which requires setting the .spec.securityContext');
|
|
12
12
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -41,5 +45,5 @@ const validateConfig = (j) => E.tryCatch(() => {
|
|
|
41
45
|
}, E.toError);
|
|
42
46
|
exports.validateConfig = validateConfig;
|
|
43
47
|
// Read a file and validate its content with Ajv
|
|
44
|
-
const getConfig = (path) => function_1.pipe(path, exports.readFile, E.chain(value => function_1.pipe(E.tryCatch(() => JSON.parse(value), E.toError), E.chain(exports.validateConfig))), E.map((v) => v));
|
|
48
|
+
const getConfig = (path) => (0, function_1.pipe)(path, exports.readFile, E.chain(value => (0, function_1.pipe)(E.tryCatch(() => JSON.parse(value), E.toError), E.chain(exports.validateConfig))), E.map((v) => v));
|
|
45
49
|
exports.getConfig = getConfig;
|
package/dist/edgeport.js
CHANGED
|
@@ -12,11 +12,11 @@ const GRPCSipListener = Java.type("io.routr.GRPCSipListener");
|
|
|
12
12
|
const ArrayList = Java.type("java.util.ArrayList");
|
|
13
13
|
function EdgePort(config) {
|
|
14
14
|
var _a, _b;
|
|
15
|
-
assertions_1.assertNoDuplicatedProto(config.spec.transport);
|
|
16
|
-
assertions_1.assertNoDuplicatedPort(config.spec.transport);
|
|
17
|
-
assertions_1.assertHasSecurityContext(config);
|
|
18
|
-
const sipStack = create_sip_stack_1.default(server_properties_1.default(config));
|
|
19
|
-
const sipProvider = create_sip_provider_1.default(sipStack, create_listening_points_1.default(sipStack, config));
|
|
15
|
+
(0, assertions_1.assertNoDuplicatedProto)(config.spec.transport);
|
|
16
|
+
(0, assertions_1.assertNoDuplicatedPort)(config.spec.transport);
|
|
17
|
+
(0, assertions_1.assertHasSecurityContext)(config);
|
|
18
|
+
const sipStack = (0, create_sip_stack_1.default)((0, server_properties_1.default)(config));
|
|
19
|
+
const sipProvider = (0, create_sip_provider_1.default)(sipStack, (0, create_listening_points_1.default)(sipStack, config));
|
|
20
20
|
const externalIps = new ArrayList();
|
|
21
21
|
const localnets = new ArrayList();
|
|
22
22
|
(_a = config.spec.externalIps) === null || _a === void 0 ? void 0 : _a.forEach((addr) => externalIps.add(addr));
|
package/dist/runner.js
CHANGED
|
@@ -3,11 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
// require("./tracer").init("dispatcher")
|
|
6
7
|
const edgeport_1 = __importDefault(require("./edgeport"));
|
|
7
8
|
const get_config_1 = require("./config/get_config");
|
|
8
|
-
const config = get_config_1.getConfig(System.getenv('CONFIG_PATH'));
|
|
9
|
+
const config = (0, get_config_1.getConfig)(System.getenv('CONFIG_PATH'));
|
|
9
10
|
if (config._tag === 'Right') {
|
|
10
|
-
edgeport_1.default(config.right);
|
|
11
|
+
(0, edgeport_1.default)(config.right);
|
|
11
12
|
}
|
|
12
13
|
else {
|
|
13
14
|
console.error(config.left);
|
package/dist/tracer.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function init(serviceName: string): import("@opentelemetry/api").Tracer;
|
package/dist/tracer.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.init = void 0;
|
|
7
|
+
/*
|
|
8
|
+
* Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
|
|
9
|
+
* http://github.com/fonoster/routr
|
|
10
|
+
*
|
|
11
|
+
* This file is part of Routr
|
|
12
|
+
*
|
|
13
|
+
* Licensed under the MIT License (the "License")
|
|
14
|
+
* you may not use this file except in compliance with
|
|
15
|
+
* the License. You may obtain a copy of the License at
|
|
16
|
+
*
|
|
17
|
+
* https://opensource.org/licenses/MIT
|
|
18
|
+
*
|
|
19
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
20
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
+
* See the License for the specific language governing permissions and
|
|
23
|
+
* limitations under the License.
|
|
24
|
+
*/
|
|
25
|
+
const api_1 = __importDefault(require("@opentelemetry/api"));
|
|
26
|
+
const instrumentation_1 = require("@opentelemetry/instrumentation");
|
|
27
|
+
const sdk_trace_node_1 = require("@opentelemetry/sdk-trace-node");
|
|
28
|
+
const resources_1 = require("@opentelemetry/resources");
|
|
29
|
+
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
|
|
30
|
+
const sdk_trace_base_1 = require("@opentelemetry/sdk-trace-base");
|
|
31
|
+
const exporter_jaeger_1 = require("@opentelemetry/exporter-jaeger");
|
|
32
|
+
const instrumentation_grpc_1 = require("@opentelemetry/instrumentation-grpc");
|
|
33
|
+
function init(serviceName) {
|
|
34
|
+
const provider = new sdk_trace_node_1.NodeTracerProvider({
|
|
35
|
+
resource: new resources_1.Resource({
|
|
36
|
+
[semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME]: serviceName,
|
|
37
|
+
}),
|
|
38
|
+
});
|
|
39
|
+
const exporter = new exporter_jaeger_1.JaegerExporter();
|
|
40
|
+
provider.addSpanProcessor(new sdk_trace_base_1.SimpleSpanProcessor(exporter));
|
|
41
|
+
provider.register();
|
|
42
|
+
(0, instrumentation_1.registerInstrumentations)({
|
|
43
|
+
instrumentations: [
|
|
44
|
+
new instrumentation_grpc_1.GrpcInstrumentation(),
|
|
45
|
+
],
|
|
46
|
+
});
|
|
47
|
+
return api_1.default.trace.getTracer('routr-tracer');
|
|
48
|
+
}
|
|
49
|
+
exports.init = init;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@routr/edgeport",
|
|
3
|
-
"version": "2.0.5-alpha.
|
|
3
|
+
"version": "2.0.5-alpha.15",
|
|
4
4
|
"description": "SIP endpoint at the edge of the network",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/routr#readme",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"fp-ts": "^2.11.8"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "3e08aa86f1596252546134bff677d17d7dd54ced"
|
|
35
35
|
}
|