@routr/edgeport 2.0.5-alpha.15 → 2.0.5-alpha.16

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.
@@ -2,30 +2,28 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.assertNoDuplicatedPort = exports.assertNoDuplicatedProto = exports.assertHasSecurityContext = exports.isSecureProto = void 0;
4
4
  // We need to have the spec.securityContext for all secure protocol
5
- const isSecureProto = (proto) => proto === 'wss' || proto === 'tls';
5
+ 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 => (0, 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
- throw new Error('found at least one secure protocol which requires setting the .spec.securityContext');
11
+ throw new Error("found at least one secure protocol which requires setting the .spec.securityContext");
12
12
  }
13
13
  };
14
14
  exports.assertHasSecurityContext = assertHasSecurityContext;
15
15
  // Only one entry per protocol is allowed
16
16
  const assertNoDuplicatedProto = (transports) => {
17
- if (transports.some(t1 => transports.filter(t2 => t1.protocol === t2.protocol).length > 1)) {
18
- throw new Error('found duplicated entries at .spec.transport');
17
+ if (transports.some((t1) => transports.filter((t2) => t1.protocol === t2.protocol).length > 1)) {
18
+ throw new Error("found duplicated entries at .spec.transport");
19
19
  }
20
20
  };
21
21
  exports.assertNoDuplicatedProto = assertNoDuplicatedProto;
22
22
  // The only protocol that can accept the same port twice are udp and tcp
23
23
  const assertNoDuplicatedPort = (transports) => {
24
- const duplicateCondition = (t1, t2) => (t1.port === t2.port &&
25
- t1.protocol !== 'udp' &&
26
- t1.protocol !== 'tcp');
27
- if (transports.some(t1 => transports.filter(t2 => duplicateCondition(t1, t2)).length > 1)) {
28
- throw new Error(`found the same port on more that one entry at .spec.transport`);
24
+ const duplicateCondition = (t1, t2) => t1.port === t2.port && t1.protocol !== "udp" && t1.protocol !== "tcp";
25
+ if (transports.some((t1) => transports.filter((t2) => duplicateCondition(t1, t2)).length > 1)) {
26
+ throw new Error("found the same port on more that one entry at .spec.transport");
29
27
  }
30
28
  };
31
29
  exports.assertNoDuplicatedPort = assertNoDuplicatedPort;
@@ -1,2 +1,2 @@
1
- export declare const readFile: (path: string) => any;
1
+ export declare const readFile: (path: string) => string;
2
2
  export declare const writeFile: (path: string, text: string) => void;
package/dist/config/fs.js CHANGED
@@ -1,18 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.writeFile = exports.readFile = void 0;
4
- const BufferedWriter = Java.type('java.io.BufferedWriter');
5
- const FileWriter = Java.type('java.io.FileWriter');
6
- const JFile = Java.type('java.io.File');
7
- const Files = Java.type('java.nio.file.Files');
8
- const Paths = Java.type('java.nio.file.Paths');
4
+ const BufferedWriter = Java.type("java.io.BufferedWriter");
5
+ const FileWriter = Java.type("java.io.FileWriter");
6
+ const JFile = Java.type("java.io.File");
7
+ const Files = Java.type("java.nio.file.Files");
8
+ const Paths = Java.type("java.nio.file.Paths");
9
9
  const readFile = (path) => {
10
- const lines = Files.readAllLines(Paths.get(path), Java.type('java.nio.charset.StandardCharsets').UTF_8);
10
+ const lines = Files.readAllLines(Paths.get(path), Java.type("java.nio.charset.StandardCharsets").UTF_8);
11
11
  const data = [];
12
12
  lines.forEach((line) => {
13
13
  data.push(line);
14
14
  });
15
- return data.join('\n').trim();
15
+ return data.join("\n").trim();
16
16
  };
17
17
  exports.readFile = readFile;
18
18
  const writeFile = (path, text) => {
@@ -1,5 +1,5 @@
1
- import * as J from 'fp-ts/Json';
2
- import * as E from 'fp-ts/Either';
1
+ import * as J from "fp-ts/Json";
2
+ import * as E from "fp-ts/Either";
3
3
  export declare const readFile: (path: string) => E.Either<Error, string>;
4
4
  export declare const validateConfig: (j: J.Json) => E.Either<Error, J.Json>;
5
5
  export declare const getConfig: <C>(path: string) => E.Either<Error, C>;
@@ -45,5 +45,5 @@ const validateConfig = (j) => E.tryCatch(() => {
45
45
  }, E.toError);
46
46
  exports.validateConfig = validateConfig;
47
47
  // Read a file and validate its content with Ajv
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));
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));
49
49
  exports.getConfig = getConfig;
@@ -60,6 +60,10 @@ export declare const schema: {
60
60
  };
61
61
  uniqueItems: boolean;
62
62
  };
63
+ unknownMethodAction: {
64
+ description: string;
65
+ enum: string[];
66
+ };
63
67
  transport: {
64
68
  description: string;
65
69
  type: string;
@@ -20,98 +20,102 @@ exports.schema = void 0;
20
20
  * limitations under the License.
21
21
  */
22
22
  exports.schema = {
23
- "$id": "https://json-schema.org/draft/2020-12/schema",
24
- "title": "EdgPort configuration",
25
- "description": "Configuration for an EdgePort instance",
26
- "type": "object",
27
- "properties": {
28
- "kind": {
29
- "description": "Resouce type",
30
- "type": "string"
23
+ $id: "https://json-schema.org/draft/2020-12/schema",
24
+ title: "EdgPort configuration",
25
+ description: "Configuration for an EdgePort instance",
26
+ type: "object",
27
+ properties: {
28
+ kind: {
29
+ description: "Resouce type",
30
+ type: "string"
31
31
  },
32
- "apiVersion": {
33
- "enum": ["v2draft1", "v2.0", "v2"]
32
+ apiVersion: {
33
+ enum: ["v2draft1", "v2.0", "v2"]
34
34
  },
35
- "metadata": {
36
- "description": "Resource metadata",
37
- "type": "object",
38
- "properties": {
39
- "ref": {
40
- "description": "EdgePort reference",
41
- "type": "string"
35
+ metadata: {
36
+ description: "Resource metadata",
37
+ type: "object",
38
+ properties: {
39
+ ref: {
40
+ description: "EdgePort reference",
41
+ type: "string"
42
42
  },
43
- "region": {
44
- "description": "Optional region where the EdgePort is operating",
45
- "type": "string"
43
+ region: {
44
+ description: "Optional region where the EdgePort is operating",
45
+ type: "string"
46
46
  }
47
47
  },
48
- "required": ["ref"]
48
+ required: ["ref"]
49
49
  },
50
- "spec": {
51
- "description": "Operation spec for the EdgePort",
52
- "type": "object",
53
- "properties": {
54
- "bindAddr": {
55
- "description": "Ipv4 interface to accept request on",
56
- "type": "string"
50
+ spec: {
51
+ description: "Operation spec for the EdgePort",
52
+ type: "object",
53
+ properties: {
54
+ bindAddr: {
55
+ description: "Ipv4 interface to accept request on",
56
+ type: "string"
57
57
  },
58
- "externalIps": {
59
- "description": "EdgePort external ip addresses.",
60
- "type": "array",
61
- "items": {
62
- "type": "string"
58
+ externalIps: {
59
+ description: "EdgePort external ip addresses.",
60
+ type: "array",
61
+ items: {
62
+ type: "string"
63
63
  },
64
- "uniqueItems": true,
65
- "minItems": 1,
64
+ uniqueItems: true,
65
+ minItems: 1
66
66
  },
67
- "localnets": {
68
- "description": "Networks considered to be in the same local network",
69
- "type": "array",
70
- "items": {
71
- "type": "string"
67
+ localnets: {
68
+ description: "Networks considered to be in the same local network",
69
+ type: "array",
70
+ items: {
71
+ type: "string"
72
72
  },
73
- "uniqueItems": true,
74
- "minItems": 1,
73
+ uniqueItems: true,
74
+ minItems: 1
75
75
  },
76
- "methods": {
77
- "description": "Acceptable SIP Methods",
78
- "type": "array",
79
- "items": {
80
- "type": "string"
76
+ methods: {
77
+ description: "Acceptable SIP Methods",
78
+ type: "array",
79
+ items: {
80
+ type: "string"
81
81
  },
82
- "uniqueItems": true
82
+ uniqueItems: true
83
83
  },
84
- "transport": {
85
- "description": "Acceptable Transport Protocols",
86
- "type": "array",
87
- "items": {
88
- "type": "object"
84
+ unknownMethodAction: {
85
+ description: "What to do if an incomming request type is not allowed",
86
+ enum: ["Discard", "Respond"]
87
+ },
88
+ transport: {
89
+ description: "Acceptable Transport Protocols",
90
+ type: "array",
91
+ items: {
92
+ type: "object"
89
93
  },
90
- "properties": {
91
- "protocol": {
92
- "type": "string"
94
+ properties: {
95
+ protocol: {
96
+ type: "string"
93
97
  },
94
- "bindAddr": {
95
- "type": "string"
98
+ bindAddr: {
99
+ type: "string"
96
100
  },
97
- "port": {
98
- "type": "integer"
101
+ port: {
102
+ type: "integer"
99
103
  }
100
104
  },
101
- "required": ["port", "protocol"]
105
+ required: ["port", "protocol"]
102
106
  },
103
- "processor": {
104
- "description": "Adjacent service for message routing",
105
- "type": "object",
106
- "properties": {
107
- "addr": {
108
- "type": "string"
107
+ processor: {
108
+ description: "Adjacent service for message routing",
109
+ type: "object",
110
+ properties: {
111
+ addr: {
112
+ type: "string"
109
113
  }
110
114
  }
111
115
  }
112
116
  },
113
- "required": ["methods", "transport", "processor"]
114
- },
117
+ required: ["methods", "transport", "processor"]
118
+ }
115
119
  },
116
- "required": ["kind", "metadata", "spec", "apiVersion"]
120
+ required: ["kind", "metadata", "spec", "apiVersion"]
117
121
  };
@@ -1,2 +1,9 @@
1
1
  import { EdgePortConfig, ListeningPoint, SipStack } from "./types";
2
+ /**
3
+ * Creates "listening" points for all the given transport.
4
+ *
5
+ * @param {SipStack} sipStack - SipStack to create LPs for
6
+ * @param {EdgePortConfig} config - Edgeport configuration
7
+ * @return {ListeningPoint[]}
8
+ */
2
9
  export default function createListeningPoints(sipStack: SipStack, config: EdgePortConfig): Array<ListeningPoint>;
@@ -1,8 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- // Creates LPs for all of the given transport and throws if upstream function fails
3
+ /**
4
+ * Creates "listening" points for all the given transport.
5
+ *
6
+ * @param {SipStack} sipStack - SipStack to create LPs for
7
+ * @param {EdgePortConfig} config - Edgeport configuration
8
+ * @return {ListeningPoint[]}
9
+ */
4
10
  function createListeningPoints(sipStack, config) {
5
11
  const listeningPoints = [];
12
+ // eslint-disable-next-line no-loops/no-loops
6
13
  for (const trans of config.spec.transport) {
7
14
  const proto = trans.protocol.toLowerCase();
8
15
  // If none was found we use the global bindAddr
@@ -1,2 +1,9 @@
1
- import { SipStack, ListeningPoint, SipProvider } from "./types";
1
+ import { ListeningPoint, SipProvider, SipStack } from "./types";
2
+ /**
3
+ * Creates a new SIP provider object.
4
+ *
5
+ * @param {SipStack} sipStack - SIP stack to use
6
+ * @param {Array<ListeningPoint>} listeningPoints - Listening points to use
7
+ * @return {SipProvider}
8
+ */
2
9
  export default function createSipProvider(sipStack: SipStack, listeningPoints: Array<ListeningPoint>): SipProvider;
@@ -1,9 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Creates a new SIP provider object.
5
+ *
6
+ * @param {SipStack} sipStack - SIP stack to use
7
+ * @param {Array<ListeningPoint>} listeningPoints - Listening points to use
8
+ * @return {SipProvider}
9
+ */
3
10
  function createSipProvider(sipStack, listeningPoints) {
4
- var _a;
5
11
  const sipProvider = sipStack.createSipProvider(listeningPoints[0]);
6
- (_a = listeningPoints === null || listeningPoints === void 0 ? void 0 : listeningPoints.filter(((lp, index) => index > 0))) === null || _a === void 0 ? void 0 : _a.forEach((lp) => sipProvider.addListeningPoint(lp));
12
+ // eslint-disable-next-line no-loops/no-loops
13
+ for (const lp1 of listeningPoints === null || listeningPoints === void 0 ? void 0 : listeningPoints.filter((lp, index) => index > 0)) {
14
+ sipProvider.addListeningPoint(lp1);
15
+ }
7
16
  return sipProvider;
8
17
  }
9
18
  exports.default = createSipProvider;
@@ -1,6 +1,8 @@
1
1
  import { SipStack } from "./types";
2
2
  /**
3
- * Takes a properties map and returns an instance of the
4
- * Java object SipStack
3
+ * Takes a properties map and returns an instance of the SipStack(Java object).
4
+ *
5
+ * @param {Map<string, string>} props - Properties map
6
+ * @return {SipStack}
5
7
  */
6
8
  export default function createSipStack(props: Map<string, string>): SipStack;
@@ -1,18 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const SipFactory = Java.type('javax.sip.SipFactory');
4
- const Properties = Java.type('java.util.Properties');
3
+ const SipFactory = Java.type("javax.sip.SipFactory");
4
+ const Properties = Java.type("java.util.Properties");
5
5
  /**
6
- * Takes a properties map and returns an instance of the
7
- * Java object SipStack
6
+ * Takes a properties map and returns an instance of the SipStack(Java object).
7
+ *
8
+ * @param {Map<string, string>} props - Properties map
9
+ * @return {SipStack}
8
10
  */
9
11
  function createSipStack(props) {
10
12
  const properties = new Properties();
13
+ // eslint-disable-next-line no-loops/no-loops
11
14
  for (const entry of props) {
12
15
  properties.setProperty(entry[0], entry[1]);
13
16
  }
14
17
  const sipFactory = SipFactory.getInstance();
15
- sipFactory.setPathName('gov.nist');
18
+ sipFactory.setPathName("gov.nist");
16
19
  return sipFactory.createSipStack(properties);
17
20
  }
18
21
  exports.default = createSipStack;
@@ -1,2 +1,7 @@
1
1
  import { EdgePortConfig } from "./types";
2
- export default function EdgePort(config: EdgePortConfig): void;
2
+ /**
3
+ * Starts a new Edgeport service.
4
+ *
5
+ * @param {EdgePortConfig} config - Edgeport configuration
6
+ */
7
+ export default function edgePort(config: EdgePortConfig): void;
package/dist/edgeport.js CHANGED
@@ -10,7 +10,12 @@ const create_sip_stack_1 = __importDefault(require("./create_sip_stack"));
10
10
  const server_properties_1 = __importDefault(require("./server_properties"));
11
11
  const GRPCSipListener = Java.type("io.routr.GRPCSipListener");
12
12
  const ArrayList = Java.type("java.util.ArrayList");
13
- function EdgePort(config) {
13
+ /**
14
+ * Starts a new Edgeport service.
15
+ *
16
+ * @param {EdgePortConfig} config - Edgeport configuration
17
+ */
18
+ function edgePort(config) {
14
19
  var _a, _b;
15
20
  (0, assertions_1.assertNoDuplicatedProto)(config.spec.transport);
16
21
  (0, assertions_1.assertNoDuplicatedPort)(config.spec.transport);
@@ -23,4 +28,4 @@ function EdgePort(config) {
23
28
  (_b = config.spec.localnets) === null || _b === void 0 ? void 0 : _b.forEach((net) => localnets.add(net));
24
29
  sipProvider.addSipListener(new GRPCSipListener(sipProvider, config, externalIps, localnets));
25
30
  }
26
- exports.default = EdgePort;
31
+ exports.default = edgePort;
package/dist/runner.js CHANGED
@@ -6,10 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  // require("./tracer").init("dispatcher")
7
7
  const edgeport_1 = __importDefault(require("./edgeport"));
8
8
  const get_config_1 = require("./config/get_config");
9
- const config = (0, get_config_1.getConfig)(System.getenv('CONFIG_PATH'));
10
- if (config._tag === 'Right') {
9
+ const config = (0, get_config_1.getConfig)(System.getenv("CONFIG_PATH"));
10
+ if (config._tag === "Right") {
11
11
  (0, edgeport_1.default)(config.right);
12
12
  }
13
13
  else {
14
- console.error(config.left);
14
+ // WARNING: Using @fonoster/logger causes conflict with Webpack.
15
+ // eslint-disable-next-line no-console
16
+ console.log(config.left);
15
17
  }
@@ -3,5 +3,8 @@ import { EdgePortConfig } from "./types";
3
3
  * Returns a Map object with the properties for the server's SipStack.
4
4
  * For more options see:
5
5
  * https://github.com/RestComm/jain-sip/blob/master/src/gov/nist/javax/sip/SipStackImpl.java
6
+ *
7
+ * @param {EdgePortConfig} config - Configuration object
8
+ * @return {Map<string, string>}
6
9
  */
7
10
  export default function getServerProperties(config: EdgePortConfig): Map<string, string>;
@@ -4,32 +4,35 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  * Returns a Map object with the properties for the server's SipStack.
5
5
  * For more options see:
6
6
  * https://github.com/RestComm/jain-sip/blob/master/src/gov/nist/javax/sip/SipStackImpl.java
7
+ *
8
+ * @param {EdgePortConfig} config - Configuration object
9
+ * @return {Map<string, string>}
7
10
  */
8
11
  function getServerProperties(config) {
9
12
  var _a, _b;
10
13
  const properties = new Map();
11
- properties.set('javax.sip.STACK_NAME', 'routr');
12
- properties.set('javax.sip.AUTOMATIC_DIALOG_SUPPORT', 'OFF');
13
- properties.set('gov.nist.javax.sip.MESSAGE_PROCESSOR_FACTORY', 'gov.nist.javax.sip.stack.NioMessageProcessorFactory');
14
- properties.set('gov.nist.javax.sip.PATCH_SIP_WEBSOCKETS_HEADERS', 'false');
15
- properties.set('gov.nist.javax.sip.CACHE_CLIENT_CONNECTIONS', 'true');
16
- properties.set('gov.nist.javax.sip.REENTRANT_LISTENER', 'false');
17
- properties.set('gov.nist.javax.sip.THREAD_POOL_SIZE', '16');
18
- properties.set('gov.nist.javax.sip.NIO_BLOCKING_MODE', 'NONBLOCKING');
14
+ properties.set("javax.sip.STACK_NAME", "routr");
15
+ properties.set("javax.sip.AUTOMATIC_DIALOG_SUPPORT", "OFF");
16
+ properties.set("gov.nist.javax.sip.MESSAGE_PROCESSOR_FACTORY", "gov.nist.javax.sip.stack.NioMessageProcessorFactory");
17
+ properties.set("gov.nist.javax.sip.PATCH_SIP_WEBSOCKETS_HEADERS", "false");
18
+ properties.set("gov.nist.javax.sip.CACHE_CLIENT_CONNECTIONS", "true");
19
+ properties.set("gov.nist.javax.sip.REENTRANT_LISTENER", "false");
20
+ properties.set("gov.nist.javax.sip.THREAD_POOL_SIZE", "16");
21
+ properties.set("gov.nist.javax.sip.NIO_BLOCKING_MODE", "NONBLOCKING");
19
22
  // Guard against denial of service attack.
20
- properties.set('gov.nist.javax.sip.MAX_MESSAGE_SIZE', '1048576');
21
- properties.set('gov.nist.javax.sip.LOG_MESSAGE_CONTENT', 'true');
23
+ properties.set("gov.nist.javax.sip.MAX_MESSAGE_SIZE", "1048576");
24
+ properties.set("gov.nist.javax.sip.LOG_MESSAGE_CONTENT", "true");
22
25
  // Default host
23
- properties.set('javax.sip.IP_ADDRESS', config.spec.bindAddr);
26
+ properties.set("javax.sip.IP_ADDRESS", config.spec.bindAddr);
24
27
  if (config.spec.securityContext) {
25
- properties.set('gov.nist.javax.sip.TLS_CLIENT_PROTOCOLS', (_a = config.spec.securityContext.client) === null || _a === void 0 ? void 0 : _a.protocols.join());
28
+ properties.set("gov.nist.javax.sip.TLS_CLIENT_PROTOCOLS", (_a = config.spec.securityContext.client) === null || _a === void 0 ? void 0 : _a.protocols.join());
26
29
  // This must be set to 'Disabled' when using WSS
27
- properties.set('gov.nist.javax.sip.TLS_CLIENT_AUTH_TYPE', (_b = config.spec.securityContext.client) === null || _b === void 0 ? void 0 : _b.authType);
28
- properties.set('javax.net.ssl.keyStore', config.spec.securityContext.keyStore);
29
- properties.set('javax.net.ssl.trustStore', config.spec.securityContext.trustStore);
30
- properties.set('javax.net.ssl.keyStorePassword', config.spec.securityContext.keyStorePassword);
31
- properties.set('javax.net.ssl.trustStorePassword', config.spec.securityContext.trustStorePassword);
32
- properties.set('javax.net.ssl.keyStoreType', config.spec.securityContext.keyStoreType);
30
+ properties.set("gov.nist.javax.sip.TLS_CLIENT_AUTH_TYPE", (_b = config.spec.securityContext.client) === null || _b === void 0 ? void 0 : _b.authType);
31
+ properties.set("javax.net.ssl.keyStore", config.spec.securityContext.keyStore);
32
+ properties.set("javax.net.ssl.trustStore", config.spec.securityContext.trustStore);
33
+ properties.set("javax.net.ssl.keyStorePassword", config.spec.securityContext.keyStorePassword);
34
+ properties.set("javax.net.ssl.trustStorePassword", config.spec.securityContext.trustStorePassword);
35
+ properties.set("javax.net.ssl.keyStoreType", config.spec.securityContext.keyStoreType);
33
36
  }
34
37
  return properties;
35
38
  }
package/dist/tracer.d.ts CHANGED
@@ -1 +1,7 @@
1
+ /**
2
+ * This function registers the instrumentations for the service.
3
+ *
4
+ * @param {string} serviceName - The name of the service.
5
+ * @return {Tracer} The tracer object.
6
+ */
1
7
  export declare function init(serviceName: string): import("@opentelemetry/api").Tracer;
package/dist/tracer.js CHANGED
@@ -30,20 +30,24 @@ const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
30
30
  const sdk_trace_base_1 = require("@opentelemetry/sdk-trace-base");
31
31
  const exporter_jaeger_1 = require("@opentelemetry/exporter-jaeger");
32
32
  const instrumentation_grpc_1 = require("@opentelemetry/instrumentation-grpc");
33
+ /**
34
+ * This function registers the instrumentations for the service.
35
+ *
36
+ * @param {string} serviceName - The name of the service.
37
+ * @return {Tracer} The tracer object.
38
+ */
33
39
  function init(serviceName) {
34
40
  const provider = new sdk_trace_node_1.NodeTracerProvider({
35
41
  resource: new resources_1.Resource({
36
- [semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME]: serviceName,
37
- }),
42
+ [semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME]: serviceName
43
+ })
38
44
  });
39
45
  const exporter = new exporter_jaeger_1.JaegerExporter();
40
46
  provider.addSpanProcessor(new sdk_trace_base_1.SimpleSpanProcessor(exporter));
41
47
  provider.register();
42
48
  (0, instrumentation_1.registerInstrumentations)({
43
- instrumentations: [
44
- new instrumentation_grpc_1.GrpcInstrumentation(),
45
- ],
49
+ instrumentations: [new instrumentation_grpc_1.GrpcInstrumentation()]
46
50
  });
47
- return api_1.default.trace.getTracer('routr-tracer');
51
+ return api_1.default.trace.getTracer("routr-tracer");
48
52
  }
49
53
  exports.init = init;
package/dist/types.d.ts CHANGED
@@ -29,13 +29,13 @@ export interface EdgePortConfig {
29
29
  export declare interface SipStack {
30
30
  createListeningPoint: (bindAddr: string, port: number, proto: string) => unknown;
31
31
  createSipProvider: (lp: ListeningPoint) => SipProvider;
32
- getClass: () => any;
32
+ getClass: any;
33
33
  }
34
34
  export declare interface ListeningPoint {
35
35
  }
36
+ export declare interface Java {
37
+ }
36
38
  export declare interface SipProvider {
37
39
  addListeningPoint: (lp: ListeningPoint) => void;
38
40
  addSipListener: (lp: unknown) => void;
39
41
  }
40
- export declare interface Java {
41
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routr/edgeport",
3
- "version": "2.0.5-alpha.15",
3
+ "version": "2.0.5-alpha.16",
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": "3e08aa86f1596252546134bff677d17d7dd54ced"
34
+ "gitHead": "b40323ac18cc3872b168bf4e8273f5bdb3f7510a"
35
35
  }