@routr/dispatcher 2.0.8-alpha.9 → 2.0.10

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.
@@ -1,3 +1,3 @@
1
- import { MessageDispatcherConfig } from "../types";
2
1
  import * as E from "fp-ts/Either";
2
+ import { MessageDispatcherConfig } from "../types";
3
3
  export declare const getConfig: (path: string) => E.Either<Error, MessageDispatcherConfig>;
@@ -27,14 +27,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.getConfig = void 0;
30
- const fs_1 = __importDefault(require("fs"));
30
+ /*
31
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
32
+ * http://github.com/fonoster/routr
33
+ *
34
+ * This file is part of Routr
35
+ *
36
+ * Licensed under the MIT License (the "License");
37
+ * you may not use this file except in compliance with
38
+ * the License. You may obtain a copy of the License at
39
+ *
40
+ * https://opensource.org/licenses/MIT
41
+ *
42
+ * Unless required by applicable law or agreed to in writing, software
43
+ * distributed under the License is distributed on an "AS IS" BASIS,
44
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
45
+ * See the License for the specific language governing permissions and
46
+ * limitations under the License.
47
+ */
48
+ const E = __importStar(require("fp-ts/Either"));
31
49
  const schema_1 = require("./schema");
50
+ const common_1 = require("@routr/common");
32
51
  const ajv_1 = __importDefault(require("ajv"));
33
- const E = __importStar(require("fp-ts/Either"));
34
52
  const ajv = new ajv_1.default();
35
53
  const validate = ajv.compile(schema_1.schema);
36
54
  const getConfig = (path) => {
37
- const c = JSON.parse(fs_1.default.readFileSync(path, "utf8"));
55
+ const c = common_1.Helper.readConfigFile(path);
38
56
  if (!validate(Object.assign({}, c))) {
39
57
  return E.left(new Error(JSON.stringify(validate.errors[0].message)));
40
58
  }
@@ -12,16 +12,9 @@ export declare const schema: {
12
12
  description: string;
13
13
  type: string;
14
14
  };
15
- metadata: {
15
+ ref: {
16
16
  description: string;
17
17
  type: string;
18
- properties: {
19
- ref: {
20
- description: string;
21
- type: string;
22
- };
23
- };
24
- required: string[];
25
18
  };
26
19
  spec: {
27
20
  description: string;
@@ -44,6 +37,9 @@ export declare const schema: {
44
37
  addr: {
45
38
  type: string;
46
39
  };
40
+ postProcessor: {
41
+ type: string;
42
+ };
47
43
  };
48
44
  required: string[];
49
45
  };
@@ -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
@@ -33,16 +33,9 @@ exports.schema = {
33
33
  description: "Resource version",
34
34
  type: "string"
35
35
  },
36
- metadata: {
37
- description: "Resource metadata",
38
- type: "object",
39
- properties: {
40
- ref: {
41
- description: "EdgePort reference",
42
- type: "string"
43
- }
44
- },
45
- required: ["ref"]
36
+ ref: {
37
+ description: "EdgePort reference",
38
+ type: "string"
46
39
  },
47
40
  spec: {
48
41
  description: "Operations spec for EdgePort",
@@ -64,6 +57,9 @@ exports.schema = {
64
57
  },
65
58
  addr: {
66
59
  type: "string"
60
+ },
61
+ postProcessor: {
62
+ type: "boolean"
67
63
  }
68
64
  },
69
65
  required: ["ref", "addr"]
@@ -96,5 +92,5 @@ exports.schema = {
96
92
  }
97
93
  }
98
94
  },
99
- required: ["kind", "metadata", "spec", "apiVersion"]
95
+ required: ["kind", "ref", "spec", "apiVersion"]
100
96
  };
package/dist/envs.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare const CONFIG_PATH: string;
package/dist/envs.js ADDED
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ 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;
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.MiddlewareUnavailableError = exports.ProcessorUnavailableError = exports.NotMatchingProcessorFound = 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
@@ -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) && (config === null || config === void 0 ? void 0 : config.matchFunc(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 === null || request === void 0 ? void 0 : request.ref);
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;
@@ -0,0 +1,4 @@
1
+ import { MessageDispatcherConfig } from "./types";
2
+ import messageDispatcher from "./service";
3
+ export { getConfig } from "./config/get_config";
4
+ export { MessageDispatcherConfig, messageDispatcher };
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
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.messageDispatcher = exports.getConfig = void 0;
7
+ const service_1 = __importDefault(require("./service"));
8
+ exports.messageDispatcher = service_1.default;
9
+ var get_config_1 = require("./config/get_config");
10
+ Object.defineProperty(exports, "getConfig", { enumerable: true, get: function () { return get_config_1.getConfig; } });
@@ -10,4 +10,4 @@ import { CommonTypes as CT } from "@routr/common";
10
10
  export default function processor(params: {
11
11
  processors: ProcessorConfig[];
12
12
  middlewares?: CT.MiddlewareConfig[];
13
- }): (call: RunProcessorParams, callback: any) => void;
13
+ }): (call: RunProcessorParams, callback: any) => Promise<void>;
package/dist/processor.js CHANGED
@@ -1,10 +1,19 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
13
  };
5
14
  Object.defineProperty(exports, "__esModule", { value: true });
6
15
  /*
7
- * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
16
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
8
17
  * http://github.com/fonoster/routr
9
18
  *
10
19
  * This file is part of Routr
@@ -23,10 +32,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
32
  */
24
33
  const connections_1 = __importDefault(require("./connections"));
25
34
  const run_processor_1 = require("./run_processor");
26
- const common_1 = require("@routr/common");
35
+ const processor_1 = require("@routr/processor");
27
36
  const run_middlewares_1 = require("./run_middlewares");
28
- const logger_1 = require("@fonoster/logger");
29
- const logger = (0, logger_1.getLogger)({ service: "dispatcher", filePath: __filename });
37
+ const isErrorResponse = (request) => processor_1.Helper.isTypeResponse(request) && !processor_1.Helper.isOk(request) && !processor_1.Helper.isRinging(request);
30
38
  /**
31
39
  * Creates a new instance of Processor.
32
40
  *
@@ -39,32 +47,45 @@ function processor(params) {
39
47
  const middConns = (0, connections_1.default)(middlewares);
40
48
  // Upstream request and callback
41
49
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
42
- return (call, callback) => {
50
+ return (call, callback) => __awaiter(this, void 0, void 0, function* () {
43
51
  const { request } = call;
44
- // Messages type reponse will not be sent to middleware chain
45
- if (request.message.messageType === common_1.CommonTypes.MessageType.RESPONSE) {
46
- return (0, run_processor_1.runProcessor)({
47
- callback,
52
+ try {
53
+ if (isErrorResponse(request)) {
54
+ callback(null, yield (0, run_processor_1.runProcessor)({
55
+ request,
56
+ processors,
57
+ connections: procConns
58
+ }));
59
+ return;
60
+ }
61
+ const preProcessorRequest = yield (0, run_middlewares_1.runMiddlewares)({
48
62
  request,
49
- processors,
50
- connections: procConns
63
+ middlewares,
64
+ connections: middConns,
65
+ runPostProcessorMiddlewares: false
51
66
  });
52
- }
53
- (0, run_middlewares_1.runMiddlewares)({ callback, request, middlewares, connections: middConns })
54
- .then((req) => {
55
- // Since the chain was broken we need to skip the processor and return the updated request
56
- if (req.message.messageType === common_1.CommonTypes.MessageType.RESPONSE) {
57
- logger.silly("skipped processsing request", { ref: req.ref });
58
- return callback(null, req);
67
+ if (isErrorResponse(request)) {
68
+ return callback(null, preProcessorRequest);
59
69
  }
60
- (0, run_processor_1.runProcessor)({
61
- callback,
62
- request: req,
70
+ const processedRequest = yield (0, run_processor_1.runProcessor)({
71
+ request: preProcessorRequest,
63
72
  processors,
64
73
  connections: procConns
65
74
  });
66
- })
67
- .catch(callback);
68
- };
75
+ if (isErrorResponse(request)) {
76
+ return callback(null, processedRequest);
77
+ }
78
+ const postProcessorRequest = yield (0, run_middlewares_1.runMiddlewares)({
79
+ request: processedRequest,
80
+ middlewares,
81
+ connections: middConns,
82
+ runPostProcessorMiddlewares: true
83
+ });
84
+ return callback(null, postProcessorRequest);
85
+ }
86
+ catch (err) {
87
+ return callback(err, null);
88
+ }
89
+ });
69
90
  }
70
91
  exports.default = processor;
@@ -34,7 +34,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
35
  exports.runMiddlewares = void 0;
36
36
  /*
37
- * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
37
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
38
38
  * http://github.com/fonoster/routr
39
39
  *
40
40
  * This file is part of Routr
@@ -71,17 +71,21 @@ function processMessage(middlewareRef, conn, request) {
71
71
  // eslint-disable-next-line require-jsdoc
72
72
  function runMiddlewares(params) {
73
73
  return __awaiter(this, void 0, void 0, function* () {
74
- const { connections, request, middlewares = [] } = params;
74
+ const { connections, request, middlewares = [], runPostProcessorMiddlewares } = params;
75
75
  const req = Object.assign({}, request);
76
76
  // eslint-disable-next-line no-async-promise-executor
77
77
  return new Promise((resolve, rejects) => __awaiter(this, void 0, void 0, function* () {
78
78
  // eslint-disable-next-line no-loops/no-loops
79
79
  for (const midd of middlewares) {
80
- logger.silly("sending request to middleware", {
80
+ logger.verbose("sending request to middleware", {
81
81
  ref: request.ref,
82
82
  middlewareRef: midd.ref,
83
- addr: midd.addr
83
+ addr: midd.addr,
84
+ postProcessor: midd.postProcessor,
85
+ runPostProcessorMiddlewares
84
86
  });
87
+ if (runPostProcessorMiddlewares !== midd.postProcessor)
88
+ continue;
85
89
  // Get the next middleware
86
90
  const conn = connections.get(midd.ref);
87
91
  // Send message and re-insert response for next middleware
@@ -89,7 +93,7 @@ function runMiddlewares(params) {
89
93
  req.message = (yield processMessage(midd.ref, conn, req))
90
94
  .message;
91
95
  if (req.message.messageType === common_1.CommonTypes.MessageType.RESPONSE) {
92
- logger.silly("found messageType to be responseType and broke the chain", {
96
+ logger.verbose("found messageType to be responseType and broke the chain", {
93
97
  ref: request.ref,
94
98
  middlewareRef: midd.ref,
95
99
  addr: midd.addr
@@ -98,7 +102,7 @@ function runMiddlewares(params) {
98
102
  }
99
103
  }
100
104
  catch (e) {
101
- rejects(e);
105
+ return rejects(e);
102
106
  }
103
107
  }
104
108
  resolve(req);
@@ -1,8 +1,9 @@
1
1
  import { RunProcessorParams } from "./types";
2
+ import { MessageRequest } from "@routr/common";
2
3
  /**
3
4
  * Runs the processor.
4
5
  *
5
6
  * @param {RunProcessorParams} params - The parameters for the run processor
6
- * @return {Promise<any>}
7
+ * @return {Promise<MessageRequest>}
7
8
  */
8
- export declare function runProcessor(params: RunProcessorParams): void;
9
+ export declare function runProcessor(params: RunProcessorParams): Promise<MessageRequest>;
@@ -22,13 +22,22 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
25
34
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
35
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
36
  };
28
37
  Object.defineProperty(exports, "__esModule", { value: true });
29
38
  exports.runProcessor = void 0;
30
39
  /*
31
- * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
40
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
32
41
  * http://github.com/fonoster/routr
33
42
  *
34
43
  * This file is part of Routr
@@ -45,42 +54,39 @@ exports.runProcessor = void 0;
45
54
  * See the License for the specific language governing permissions and
46
55
  * limitations under the License.
47
56
  */
57
+ const grpc = __importStar(require("@grpc/grpc-js"));
58
+ const api_1 = __importDefault(require("@opentelemetry/api"));
48
59
  const errors_1 = require("./errors");
49
60
  const find_processor_1 = require("./find_processor");
50
- const api_1 = __importDefault(require("@opentelemetry/api"));
51
- const grpc = __importStar(require("@grpc/grpc-js"));
52
61
  const logger_1 = require("@fonoster/logger");
53
62
  const logger = (0, logger_1.getLogger)({ service: "dispatcher", filePath: __filename });
54
63
  /**
55
64
  * Runs the processor.
56
65
  *
57
66
  * @param {RunProcessorParams} params - The parameters for the run processor
58
- * @return {Promise<any>}
67
+ * @return {Promise<MessageRequest>}
59
68
  */
60
69
  function runProcessor(params) {
61
- const currentSpan = api_1.default.trace.getSpan(api_1.default.context.active());
62
- // display traceid in the terminal
63
- logger.silly(`traceid: ${currentSpan === null || currentSpan === void 0 ? void 0 : currentSpan.spanContext().traceId}`);
64
- const tracer = api_1.default.trace.getTracer("routr-tracer");
65
- const span = tracer.startSpan("server.js:sayHello()", { kind: 1 });
66
- span.addEvent("invoking sayHello() to...");
67
- const { callback, connections, processors, request } = params;
68
- const matchResult = (0, find_processor_1.findProcessor)(processors)(request);
69
- if ("code" in matchResult) {
70
- return callback(matchResult);
71
- }
72
- logger.silly("forwarding request to processor", {
73
- processorRef: matchResult.ref
74
- });
75
- const conn = connections.get(matchResult.ref);
76
- // Connects to downstream processor
77
- conn.processMessage(request, (err, response) => {
78
- if ((err === null || err === void 0 ? void 0 : err.code) === grpc.status.UNAVAILABLE) {
79
- // We augment the error to indicate which processor failed
80
- callback(new errors_1.ProcessorUnavailableError(matchResult.ref));
81
- return;
82
- }
83
- callback(err, response);
70
+ return __awaiter(this, void 0, void 0, function* () {
71
+ const currentSpan = api_1.default.trace.getSpan(api_1.default.context.active());
72
+ // Display traceid in the terminal
73
+ logger.verbose(`traceid: ${currentSpan === null || currentSpan === void 0 ? void 0 : currentSpan.spanContext().traceId}`);
74
+ const { connections, processors, request } = params;
75
+ return new Promise((resolve, reject) => {
76
+ const matchResult = (0, find_processor_1.findProcessor)(processors)(request);
77
+ if ("code" in matchResult) {
78
+ return reject(matchResult);
79
+ }
80
+ const conn = connections.get(matchResult.ref);
81
+ logger.verbose("forwarding request to processor", { ref: matchResult.ref });
82
+ conn.processMessage(request, (err, result) => {
83
+ if ((err === null || err === void 0 ? void 0 : err.code) === grpc.status.UNAVAILABLE) {
84
+ // We augment the error to indicate which processor failed
85
+ return reject(new errors_1.ProcessorUnavailableError(matchResult.ref));
86
+ }
87
+ resolve(Object.assign(Object.assign({}, request), result));
88
+ });
89
+ });
84
90
  });
85
91
  }
86
92
  exports.runProcessor = runProcessor;
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
@@ -24,11 +24,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
24
24
  */
25
25
  const service_1 = __importDefault(require("./service"));
26
26
  const get_config_1 = require("./config/get_config");
27
- const common_1 = require("@routr/common");
28
27
  const logger_1 = require("@fonoster/logger");
28
+ const envs_1 = require("./envs");
29
29
  const logger = (0, logger_1.getLogger)({ service: "dispatcher", filePath: __filename });
30
- common_1.Assertions.assertEnvsAreSet(["CONFIG_PATH"]);
31
- const result = (0, get_config_1.getConfig)(process.env.CONFIG_PATH);
30
+ const result = (0, get_config_1.getConfig)(envs_1.CONFIG_PATH);
32
31
  if (result._tag === "Right") {
33
32
  (0, service_1.default)(result.right);
34
33
  }
package/dist/service.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  /*
4
- * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
4
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
5
5
  * http://github.com/fonoster/routr
6
6
  *
7
7
  * This file is part of Routr
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
@@ -14,14 +14,13 @@ export type CallbackErrors = NotMatchingProcessorFound | ProcessorUnavailableErr
14
14
  } | null;
15
15
  export type ProcessorCallback = (err: CallbackErrors, reponse?: MessageRequest) => void;
16
16
  export interface RunProcessorParams {
17
- callback: CT.GrpcCallback;
18
17
  connections: Map<string, ProcessorGPRCConnection>;
19
18
  processors: ProcessorConfig[];
20
19
  request: MessageRequest;
21
20
  }
22
21
  export interface RunMiddlewaresParams {
23
- callback: CT.GrpcCallback;
24
22
  connections: Map<string, ProcessorGPRCConnection>;
25
23
  middlewares: CT.MiddlewareConfig[];
26
24
  request: MessageRequest;
25
+ runPostProcessorMiddlewares: boolean;
27
26
  }
package/dist/util.js CHANGED
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getServiceInfo = 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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@routr/dispatcher",
3
- "version": "2.0.8-alpha.9",
3
+ "version": "2.0.10",
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",
7
7
  "license": "MIT",
8
- "main": "dist/dispatcher",
9
- "types": "dist/dispatcher",
8
+ "main": "dist/index",
9
+ "types": "dist/index",
10
10
  "scripts": {
11
11
  "prebuild": "rimraf ./dist tsconfig.tsbuildinfo",
12
12
  "build": "tsc -b tsconfig.json"
@@ -25,8 +25,8 @@
25
25
  "access": "public"
26
26
  },
27
27
  "dependencies": {
28
- "@fonoster/logger": "0.3.18",
29
- "@grpc/grpc-js": "^1.5.9",
28
+ "@fonoster/logger": "0.3.20",
29
+ "@grpc/grpc-js": "^1.8.4",
30
30
  "@opentelemetry/api": "^1.0.4",
31
31
  "@opentelemetry/exporter-jaeger": "^1.0.4",
32
32
  "@opentelemetry/instrumentation": "^0.27.0",
@@ -35,7 +35,8 @@
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.9",
38
+ "@routr/common": "^2.0.9",
39
+ "@routr/processor": "^2.0.9",
39
40
  "ajv": "^6.12.6",
40
41
  "fp-ts": "^2.11.8"
41
42
  },
@@ -46,5 +47,5 @@
46
47
  "bugs": {
47
48
  "url": "https://github.com/fonoster/routr/issues"
48
49
  },
49
- "gitHead": "9ebb361db74fad2b3891fc9add683ddfde2efdff"
50
+ "gitHead": "2886cad085d6beecea03b33b0b4241e9ea00f38e"
50
51
  }