@rsdk/grpc.common 5.0.2-next.1 → 5.0.3-next.0
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [5.0.3-next.0](https://github.com/R-Vision/rsdk/compare/v5.0.2...v5.0.3-next.0) (2024-07-23)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* default GRPC-address ([4273784](https://github.com/R-Vision/rsdk/commit/427378463286fda531e57b682d54914aeb34191f))
|
|
11
|
+
* remove anti-localhost check from GrpcAddressParser ([3de405e](https://github.com/R-Vision/rsdk/commit/3de405e89462661534e5fd6710ab96701c5c679e))
|
|
12
|
+
|
|
13
|
+
## [5.0.2](https://github.com/R-Vision/rsdk/compare/v5.0.2-next.1...v5.0.2) (2024-07-19)
|
|
14
|
+
|
|
15
|
+
**Note:** Version bump only for package @rsdk/grpc.common
|
|
16
|
+
|
|
6
17
|
## [5.0.2-next.1](https://github.com/R-Vision/rsdk/compare/v5.0.2-next.0...v5.0.2-next.1) (2024-07-19)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @rsdk/grpc.common
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GrpcAddressParser = void 0;
|
|
4
4
|
const common_1 = require("@rsdk/common");
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* FIXME: Doesn't support IPv6
|
|
7
|
+
*/
|
|
8
|
+
const PATTERN = /^([\w.-_]+):(\d{4,5})$/;
|
|
6
9
|
class GrpcAddressParser {
|
|
7
10
|
type() {
|
|
8
11
|
return 'grpc_address';
|
|
@@ -12,10 +15,10 @@ class GrpcAddressParser {
|
|
|
12
15
|
}
|
|
13
16
|
parse(value) {
|
|
14
17
|
common_1.Assert.isString(value);
|
|
18
|
+
const [host, port] = value.split(':');
|
|
15
19
|
if (!PATTERN.test(value)) {
|
|
16
|
-
const [host, port] = value.split(':');
|
|
17
20
|
throw new Error((0, common_1.text) `
|
|
18
|
-
String ${value} is not a valid
|
|
21
|
+
String ${value} is not a valid gRPC address.
|
|
19
22
|
${host} is not a valid hostname(IP) or ${port} is not a valid port
|
|
20
23
|
`);
|
|
21
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grpc-address.parser.js","sourceRoot":"","sources":["../src/grpc-address.parser.ts"],"names":[],"mappings":";;;AAAA,yCAA4C;AAG5C,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"grpc-address.parser.js","sourceRoot":"","sources":["../src/grpc-address.parser.ts"],"names":[],"mappings":";;;AAAA,yCAA4C;AAG5C;;GAEG;AACH,MAAM,OAAO,GAAG,wBAAwB,CAAC;AAEzC,MAAa,iBAAiB;IAC5B,IAAI;QACF,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,WAAW;QACT,OAAO,yCAAyC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,KAAc;QAClB,eAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACvB,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEtC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,IAAA,aAAI,EAAA;iBACT,KAAK;UACZ,IAAI,mCAAmC,IAAI;OAC9C,CAAC,CAAC;QACL,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAtBD,8CAsBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdk/grpc.common",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.3-next.0",
|
|
4
4
|
"description": "Common grpc stuff",
|
|
5
5
|
"license": "Apache License 2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
"@rsdk/common": "*",
|
|
15
15
|
"@rsdk/core": "*"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "59c3a86e96c4c12daa6a74fd481d21cb76380c16"
|
|
18
18
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Assert, text } from '@rsdk/common';
|
|
2
2
|
import type { PropertyParser } from '@rsdk/core';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* FIXME: Doesn't support IPv6
|
|
6
|
+
*/
|
|
7
|
+
const PATTERN = /^([\w.-_]+):(\d{4,5})$/;
|
|
5
8
|
|
|
6
9
|
export class GrpcAddressParser implements PropertyParser<string> {
|
|
7
10
|
type(): string {
|
|
@@ -14,12 +17,11 @@ export class GrpcAddressParser implements PropertyParser<string> {
|
|
|
14
17
|
|
|
15
18
|
parse(value: unknown): string {
|
|
16
19
|
Assert.isString(value);
|
|
20
|
+
const [host, port] = value.split(':');
|
|
17
21
|
|
|
18
22
|
if (!PATTERN.test(value)) {
|
|
19
|
-
const [host, port] = value.split(':');
|
|
20
|
-
|
|
21
23
|
throw new Error(text`
|
|
22
|
-
String ${value} is not a valid
|
|
24
|
+
String ${value} is not a valid gRPC address.
|
|
23
25
|
${host} is not a valid hostname(IP) or ${port} is not a valid port
|
|
24
26
|
`);
|
|
25
27
|
}
|