@routr/common 2.0.8-alpha.30 → 2.0.8-alpha.31
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/auth.js +1 -1
- package/dist/connect/api/client.js +1 -1
- package/dist/connect/client.js +1 -1
- package/dist/connect/connect_error.js +1 -1
- package/dist/connect/index.js +1 -1
- package/dist/connect/protos/acl.proto +1 -1
- package/dist/connect/protos/agents.proto +1 -1
- package/dist/connect/protos/credentials.proto +1 -1
- package/dist/connect/protos/domains.proto +1 -1
- package/dist/connect/protos/numbers.proto +1 -1
- package/dist/connect/protos/peers.proto +1 -1
- package/dist/connect/protos/trunks.proto +1 -1
- package/dist/connect/schemas/acl.js +1 -1
- package/dist/connect/schemas/agent.js +1 -1
- package/dist/connect/schemas/crendentials.js +1 -1
- package/dist/connect/schemas/domain.js +1 -1
- package/dist/connect/schemas/index.js +1 -1
- package/dist/connect/schemas/number.js +1 -1
- package/dist/connect/schemas/peer.js +1 -1
- package/dist/connect/schemas/trunk.js +1 -1
- package/dist/connect/schemas/validators.js +1 -1
- package/dist/errors.js +1 -1
- package/dist/healthcheck.d.ts +1 -0
- package/dist/healthcheck.js +24 -0
- package/dist/helper.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -2
- package/dist/ip_utils.js +1 -1
- package/dist/protos/common.proto +1 -1
- package/dist/protos/location.proto +1 -1
- package/dist/protos/processor.proto +1 -1
- package/dist/protos/requester.proto +1 -1
- package/dist/protos/sipmessage.proto +1 -1
- package/dist/requester/grpc_client.js +1 -1
- package/dist/requester/index.js +1 -1
- package/dist/service.js +25 -3
- package/dist/tracer.js +1 -1
- package/package.json +6 -4
package/dist/assertions.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.assertEnvsAreSet = void 0;
|
|
4
4
|
/*
|
|
5
|
-
* Copyright (C)
|
|
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
|
package/dist/auth.js
CHANGED
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createForbideenResponse = exports.createServerInternalErrorResponse = exports.createUnauthorizedResponseWithoutChallenge = exports.createUnauthorizedResponse = exports.getCredentials = exports.calculateAuthResponse = exports.buildAuthChallenge = exports.generateNonce = void 0;
|
|
7
7
|
/*
|
|
8
|
-
* Copyright (C)
|
|
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
|
|
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.serviceAPI = exports.apiClient = void 0;
|
|
27
27
|
/*
|
|
28
|
-
* Copyright (C)
|
|
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
|
package/dist/connect/client.js
CHANGED
|
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.createConnectService = exports.createConnectClient = void 0;
|
|
27
27
|
/*
|
|
28
|
-
* Copyright (C)
|
|
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
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertToErrorResponse = exports.CodeToResponseTypeMap = void 0;
|
|
4
4
|
/*
|
|
5
|
-
* Copyright (C)
|
|
5
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
6
6
|
* http://github.com/fonoster
|
|
7
7
|
*
|
|
8
8
|
* This file is part of Routr.
|
package/dist/connect/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
/*
|
|
18
|
-
* Copyright (C)
|
|
18
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
19
19
|
* http://github.com/fonoster
|
|
20
20
|
*
|
|
21
21
|
* This file is part of Routr.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
/*
|
|
4
|
-
* Copyright (C)
|
|
4
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
5
5
|
* http://github.com/fonoster
|
|
6
6
|
*
|
|
7
7
|
* This file is part of Routr.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
/*
|
|
4
|
-
* Copyright (C)
|
|
4
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
5
5
|
* http://github.com/fonoster
|
|
6
6
|
*
|
|
7
7
|
* This file is part of Routr.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
/*
|
|
4
|
-
* Copyright (C)
|
|
4
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
5
5
|
* http://github.com/fonoster
|
|
6
6
|
*
|
|
7
7
|
* This file is part of Routr.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
/*
|
|
4
|
-
* Copyright (C)
|
|
4
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
5
5
|
* http://github.com/fonoster
|
|
6
6
|
*
|
|
7
7
|
* This file is part of Routr.
|
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
/*
|
|
18
|
-
* Copyright (C)
|
|
18
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
19
19
|
* http://github.com/fonoster
|
|
20
20
|
*
|
|
21
21
|
* This file is part of Routr.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
/*
|
|
4
|
-
* Copyright (C)
|
|
4
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
5
5
|
* http://github.com/fonoster
|
|
6
6
|
*
|
|
7
7
|
* This file is part of Routr.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
/*
|
|
4
|
-
* Copyright (C)
|
|
4
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
5
5
|
* http://github.com/fonoster
|
|
6
6
|
*
|
|
7
7
|
* This file is part of Routr.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
/*
|
|
4
|
-
* Copyright (C)
|
|
4
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
5
5
|
* http://github.com/fonoster
|
|
6
6
|
*
|
|
7
7
|
* This file is part of Routr.
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.schemaValidators = void 0;
|
|
7
7
|
/*
|
|
8
|
-
* Copyright (C)
|
|
8
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
9
9
|
* http://github.com/fonoster
|
|
10
10
|
*
|
|
11
11
|
* This file is part of Routr.
|
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.BadRequestError = exports.ResourceNotFoundError = exports.UnimplementedError = exports.ServiceUnavailableError = exports.ServiceDefinitionNotFoundError = void 0;
|
|
27
27
|
/*
|
|
28
|
-
* Copyright (C)
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const check: (address: string) => Promise<void>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.check = 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 grpc_health_check_1 = require("@fonoster/grpc-health-check");
|
|
23
|
+
const check = (address) => (0, grpc_health_check_1.checker)("", address);
|
|
24
|
+
exports.check = check;
|
package/dist/helper.js
CHANGED
|
@@ -28,7 +28,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.toPascaleCase = exports.readConfigFile = exports.getListeningPoint = exports.deepCopy = void 0;
|
|
30
30
|
/*
|
|
31
|
-
* Copyright (C)
|
|
31
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
32
32
|
* http://github.com/fonoster/routr
|
|
33
33
|
*
|
|
34
34
|
* This file is part of Routr
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -23,9 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Environment = exports.ConnectSchemas = exports.CommonErrors = exports.CommonTypes = exports.CommonRequester = exports.CommonConnect = exports.Assertions = exports.Tracer = exports.IpUtils = exports.Helper = exports.Redis = exports.Auth = exports.LOCATION_OBJECT_PROTO = exports.PROCESSOR_OBJECT_PROTO = exports.Method = exports.Transport = exports.getObjectProto = exports.createService = void 0;
|
|
26
|
+
exports.HealthCheck = exports.Environment = exports.ConnectSchemas = exports.CommonErrors = exports.CommonTypes = exports.CommonRequester = exports.CommonConnect = exports.Assertions = exports.Tracer = exports.IpUtils = exports.Helper = exports.Redis = exports.Auth = exports.LOCATION_OBJECT_PROTO = exports.PROCESSOR_OBJECT_PROTO = exports.Method = exports.Transport = exports.getObjectProto = exports.createService = void 0;
|
|
27
27
|
/*
|
|
28
|
-
* Copyright (C)
|
|
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
|
|
@@ -62,3 +62,4 @@ exports.CommonTypes = __importStar(require("./types"));
|
|
|
62
62
|
exports.CommonErrors = __importStar(require("./errors"));
|
|
63
63
|
exports.ConnectSchemas = __importStar(require("./connect/schemas"));
|
|
64
64
|
exports.Environment = __importStar(require("./envs"));
|
|
65
|
+
exports.HealthCheck = __importStar(require("./healthcheck"));
|
package/dist/ip_utils.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getLocalnetIp = exports.isLocalnet = exports.addressCount = exports.hasIp = exports.formatNet = void 0;
|
|
4
4
|
/*
|
|
5
|
-
* Copyright (C)
|
|
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
|
package/dist/protos/common.proto
CHANGED
|
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.REQUESTER_PROTO = void 0;
|
|
27
27
|
/*
|
|
28
|
-
* Copyright (C)
|
|
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
|
package/dist/requester/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
/*
|
|
18
|
-
* Copyright (C)
|
|
18
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
19
19
|
* http://github.com/fonoster
|
|
20
20
|
*
|
|
21
21
|
* This file is part of Routr.
|
package/dist/service.js
CHANGED
|
@@ -24,10 +24,31 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.getObjectProto = exports.LOCATION_OBJECT_PROTO = exports.PROCESSOR_OBJECT_PROTO = void 0;
|
|
27
|
-
|
|
27
|
+
/*
|
|
28
|
+
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
29
|
+
* http://github.com/fonoster/routr
|
|
30
|
+
*
|
|
31
|
+
* This file is part of Routr
|
|
32
|
+
*
|
|
33
|
+
* Licensed under the MIT License (the "License")
|
|
34
|
+
* you may not use this file except in compliance with
|
|
35
|
+
* the License. You may obtain a copy of the License at
|
|
36
|
+
*
|
|
37
|
+
* https://opensource.org/licenses/MIT
|
|
38
|
+
*
|
|
39
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
40
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
41
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
42
|
+
* See the License for the specific language governing permissions and
|
|
43
|
+
* limitations under the License.
|
|
44
|
+
*/
|
|
28
45
|
const grpc = __importStar(require("@grpc/grpc-js"));
|
|
29
46
|
const protoLoader = __importStar(require("@grpc/proto-loader"));
|
|
47
|
+
const errors_1 = require("./errors");
|
|
30
48
|
const logger_1 = require("@fonoster/logger");
|
|
49
|
+
const grpc_health_check_1 = require("@fonoster/grpc-health-check");
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
51
|
+
const interceptor = require("grpc-interceptors");
|
|
31
52
|
const logger = (0, logger_1.getLogger)({ service: "common", filePath: __filename });
|
|
32
53
|
const loadOptions = {
|
|
33
54
|
keepCase: false,
|
|
@@ -76,11 +97,12 @@ function createService(serviceInfo) {
|
|
|
76
97
|
name: serviceInfo.name,
|
|
77
98
|
bindAddr: serviceInfo.bindAddr
|
|
78
99
|
});
|
|
79
|
-
|
|
100
|
+
withHealthChecks.start();
|
|
80
101
|
};
|
|
81
102
|
const credentials = grpc.ServerCredentials.createInsecure();
|
|
82
103
|
const server = new grpc.Server();
|
|
83
104
|
server.addService(serviceInfo.service, serviceInfo.handlers);
|
|
84
|
-
|
|
105
|
+
const withHealthChecks = interceptor.serverProxy((0, grpc_health_check_1.useHealth)(server));
|
|
106
|
+
withHealthChecks.bindAsync(serviceInfo.bindAddr, credentials, cb);
|
|
85
107
|
}
|
|
86
108
|
exports.default = createService;
|
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)
|
|
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@routr/common",
|
|
3
|
-
"version": "2.0.8-alpha.
|
|
3
|
+
"version": "2.0.8-alpha.31",
|
|
4
4
|
"description": "Common package",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/routr#readme",
|
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
"postbuild": "cp -a src/protos dist/protos && cp -a src/connect/protos dist/connect/protos"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@fonoster/
|
|
16
|
+
"@fonoster/grpc-health-check": "^3.1.2",
|
|
17
|
+
"@fonoster/logger": "0.3.20",
|
|
17
18
|
"@grpc/grpc-js": "^1.8.4",
|
|
18
|
-
"@grpc/proto-loader": "^0.
|
|
19
|
+
"@grpc/proto-loader": "^0.7.2",
|
|
19
20
|
"@opentelemetry/api": "^1.0.4",
|
|
20
21
|
"@opentelemetry/exporter-jaeger": "^1.0.4",
|
|
21
22
|
"@opentelemetry/instrumentation": "^0.27.0",
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
"@opentelemetry/semantic-conventions": "^1.0.4",
|
|
27
28
|
"ajv": "^6.12.6",
|
|
28
29
|
"fp-ts": "^2.11.8",
|
|
30
|
+
"grpc-interceptors": "github:fonoster/node-grpc-interceptors",
|
|
29
31
|
"ip-utils": "^2.4.0",
|
|
30
32
|
"js-yaml": "^4.1.0",
|
|
31
33
|
"pb-util": "^1.0.3",
|
|
@@ -53,5 +55,5 @@
|
|
|
53
55
|
"devDependencies": {
|
|
54
56
|
"@types/js-yaml": "^4.0.5"
|
|
55
57
|
},
|
|
56
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "6bca271d5a0b7163353a16af6b5195d264b3530f"
|
|
57
59
|
}
|