@routr/processor 2.0.8-alpha.33 → 2.0.8-alpha.36

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/helper.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { MessageRequest, Route, Transport, NetInterface } from "@routr/common";
1
+ import { MessageRequest, Transport, NetInterface } from "@routr/common";
2
2
  export declare const isTypeResponse: (request: MessageRequest) => boolean;
3
3
  export declare const isTypeRequest: (request: MessageRequest) => boolean;
4
4
  export declare const getEdgeInterface: (nets: {
@@ -7,14 +7,6 @@ export declare const getEdgeInterface: (nets: {
7
7
  localnets: string[];
8
8
  externalAddrs: string[];
9
9
  }) => NetInterface;
10
- /**
11
- * A request traversing a second EdgePort would have updated the requestUri.
12
- * Therefore, we are able to re-construct the Route from the request.
13
- *
14
- * @param {MessageRequest} request - the request
15
- * @return {Route} the route
16
- */
17
- export declare function createRouteFromLastMessage(request: MessageRequest): Route;
18
10
  export declare const hasSDP: (request: MessageRequest) => boolean;
19
11
  export declare const isOk: (request: MessageRequest) => boolean;
20
12
  export declare const isRinging: (request: MessageRequest) => boolean;
package/dist/helper.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isBye = exports.isOkOrRingingWithSDP = exports.isInviteOrAckWithSDP = exports.isWebRTC = exports.isRinging = exports.isOk = exports.hasSDP = exports.createRouteFromLastMessage = exports.getEdgeInterface = exports.isTypeRequest = exports.isTypeResponse = void 0;
3
+ exports.isBye = exports.isOkOrRingingWithSDP = exports.isInviteOrAckWithSDP = exports.isWebRTC = exports.isRinging = exports.isOk = exports.hasSDP = exports.getEdgeInterface = exports.isTypeRequest = exports.isTypeResponse = void 0;
4
4
  /*
5
5
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/routr
@@ -21,7 +21,6 @@ exports.isBye = exports.isOkOrRingingWithSDP = exports.isInviteOrAckWithSDP = ex
21
21
  */
22
22
  const common_1 = require("@routr/common");
23
23
  const common_2 = require("@routr/common");
24
- const index_1 = require("./index");
25
24
  const isTypeResponse = (request) => request.message.messageType === common_1.CommonTypes.MessageType.RESPONSE;
26
25
  exports.isTypeResponse = isTypeResponse;
27
26
  const isTypeRequest = (request) => !(0, exports.isTypeResponse)(request);
@@ -44,34 +43,6 @@ const getEdgeInterface = (nets) => {
44
43
  };
45
44
  };
46
45
  exports.getEdgeInterface = getEdgeInterface;
47
- /**
48
- * A request traversing a second EdgePort would have updated the requestUri.
49
- * Therefore, we are able to re-construct the Route from the request.
50
- *
51
- * @param {MessageRequest} request - the request
52
- * @return {Route} the route
53
- */
54
- function createRouteFromLastMessage(request) {
55
- var _a;
56
- const uri = request.message.requestUri;
57
- const sessionCount = index_1.Extensions.getHeaderValue(request, common_1.CommonTypes.ExtraHeader.SESSION_COUNT)
58
- ? parseInt(index_1.Extensions.getHeaderValue(request, common_1.CommonTypes.ExtraHeader.SESSION_COUNT))
59
- : -1;
60
- return {
61
- edgePortRef: request.edgePortRef,
62
- user: uri.user,
63
- host: uri.host,
64
- port: uri.port,
65
- transport: (_a = uri.transportParam) === null || _a === void 0 ? void 0 : _a.toUpperCase(),
66
- registeredOn: Date.now(),
67
- sessionCount,
68
- expires: index_1.Target.getTargetExpires(request),
69
- listeningPoints: request.listeningPoints,
70
- localnets: request.localnets,
71
- externalAddrs: request.externalAddrs
72
- };
73
- }
74
- exports.createRouteFromLastMessage = createRouteFromLastMessage;
75
46
  const hasSDP = (request) => { var _a; return ((_a = request.message.body) === null || _a === void 0 ? void 0 : _a.length) > 0; };
76
47
  exports.hasSDP = hasSDP;
77
48
  const isOk = (request) => request.message.responseType === common_1.CommonTypes.ResponseType.OK;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routr/processor",
3
- "version": "2.0.8-alpha.33",
3
+ "version": "2.0.8-alpha.36",
4
4
  "description": "Processor server and API",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/routr#readme",
@@ -44,5 +44,5 @@
44
44
  "bugs": {
45
45
  "url": "https://github.com/fonoster/routr/issues"
46
46
  },
47
- "gitHead": "ba083087c734dcc29b190bacd12b41c480d11563"
47
+ "gitHead": "88b5c909892c32a5663ee3fee30910df2ecaf2aa"
48
48
  }