@routr/connect 2.0.8-alpha.20 → 2.0.8-alpha.23
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/handlers.d.ts +1 -1
- package/dist/handlers.js +3 -1
- package/package.json +5 -5
package/dist/handlers.d.ts
CHANGED
@@ -3,4 +3,4 @@ import { ILocationService } from "@routr/location";
|
|
3
3
|
import { CommonConnect as CC } from "@routr/common";
|
4
4
|
export declare const handleRegister: (apiClient: CC.APIClient, location: ILocationService) => (request: MessageRequest, res: Response) => Promise<void>;
|
5
5
|
export declare const handleRegistry: (req: MessageRequest, res: Response) => void;
|
6
|
-
export declare const handleRequest: (location: ILocationService, apiClient?: CC.APIClient) => (
|
6
|
+
export declare const handleRequest: (location: ILocationService, apiClient?: CC.APIClient) => (request: MessageRequest, res: Response) => Promise<void>;
|
package/dist/handlers.js
CHANGED
@@ -35,6 +35,7 @@ const function_1 = require("fp-ts/function");
|
|
35
35
|
const router_1 = require("./router");
|
36
36
|
const common_1 = require("@routr/common");
|
37
37
|
const utils_1 = require("./utils");
|
38
|
+
const enforceE164 = processor_1.Alterations.enforceE164(common_1.Environment.ENFORCE_E164, common_1.Environment.ENFORCE_E164_WITH_MOBILE_PREFIX);
|
38
39
|
const handleRegister = (apiClient, location) => {
|
39
40
|
return (request, res) => __awaiter(void 0, void 0, void 0, function* () {
|
40
41
|
// Calculate and return challenge
|
@@ -75,8 +76,9 @@ const handleRegistry = (req, res) => {
|
|
75
76
|
};
|
76
77
|
exports.handleRegistry = handleRegistry;
|
77
78
|
// TODO: If request has X-Connect-Token then validate the JWT value and continue
|
78
|
-
const handleRequest = (location, apiClient) => (
|
79
|
+
const handleRequest = (location, apiClient) => (request, res) => __awaiter(void 0, void 0, void 0, function* () {
|
79
80
|
try {
|
81
|
+
const req = common_1.Environment.ENFORCE_E164 ? enforceE164(request) : request;
|
80
82
|
const route = processor_1.Extensions.getHeaderValue(req, common_1.CommonTypes.ExtraHeader.EDGEPORT_REF)
|
81
83
|
? processor_1.Helper.createRouteFromLastMessage(req)
|
82
84
|
: yield (0, router_1.router)(location, apiClient)(req);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@routr/connect",
|
3
|
-
"version": "2.0.8-alpha.
|
3
|
+
"version": "2.0.8-alpha.23",
|
4
4
|
"description": "Default processor",
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
6
6
|
"homepage": "https://github.com/fonoster/routr#readme",
|
@@ -28,9 +28,9 @@
|
|
28
28
|
"@opentelemetry/sdk-trace-base": "^1.0.4",
|
29
29
|
"@opentelemetry/sdk-trace-node": "^1.0.4",
|
30
30
|
"@opentelemetry/semantic-conventions": "^1.0.4",
|
31
|
-
"@routr/common": "^2.0.8-alpha.
|
32
|
-
"@routr/location": "^2.0.8-alpha.
|
33
|
-
"@routr/processor": "^2.0.8-alpha.
|
31
|
+
"@routr/common": "^2.0.8-alpha.23",
|
32
|
+
"@routr/location": "^2.0.8-alpha.23",
|
33
|
+
"@routr/processor": "^2.0.8-alpha.23"
|
34
34
|
},
|
35
35
|
"files": [
|
36
36
|
"dist"
|
@@ -45,5 +45,5 @@
|
|
45
45
|
"bugs": {
|
46
46
|
"url": "https://github.com/fonoster/routr/issues"
|
47
47
|
},
|
48
|
-
"gitHead": "
|
48
|
+
"gitHead": "1347b753f0dbdd3bdf423f2691867aa250b768af"
|
49
49
|
}
|