@temporalio/common 1.11.2 → 1.11.3
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/lib/internal-non-workflow/parse-host-uri.d.ts +5 -4
- package/lib/internal-non-workflow/parse-host-uri.js +8 -7
- package/lib/internal-non-workflow/parse-host-uri.js.map +1 -1
- package/lib/internal-non-workflow/tls-config.d.ts +2 -2
- package/lib/internal-non-workflow/tls-config.js.map +1 -1
- package/package.json +3 -3
- package/src/internal-non-workflow/parse-host-uri.ts +6 -5
- package/src/internal-non-workflow/tls-config.ts +2 -2
|
@@ -32,14 +32,15 @@ export declare function joinProtoHostPort(components: ProtoHostPort): string;
|
|
|
32
32
|
* Parse the address for the gRPC endpoint of a Temporal server.
|
|
33
33
|
*
|
|
34
34
|
* - The URI may only contain a hostname and a port.
|
|
35
|
-
* - Port is optional; it
|
|
35
|
+
* - Port is optional; if not specified, set it to `defaultPort`.
|
|
36
36
|
*
|
|
37
|
-
* Examples of valid URIs:
|
|
37
|
+
* Examples of valid URIs (assuming `defaultPort` is 7233):
|
|
38
38
|
*
|
|
39
39
|
* ```
|
|
40
|
-
* 127.0.0.1
|
|
40
|
+
* 127.0.0.1 => { host: '127.0.0.1', port: 7233 }
|
|
41
|
+
* 192.168.0.1:7233 => { host: '192.168.0.1', port: 7233 }
|
|
41
42
|
* my.temporal.service.com:7233 => { host: 'my.temporal.service.com', port: 7233 }
|
|
42
43
|
* [::ffff:192.0.2.128]:8080 => { host: '[::ffff:192.0.2.128]', port: 8080 }
|
|
43
44
|
* ```
|
|
44
45
|
*/
|
|
45
|
-
export declare function
|
|
46
|
+
export declare function normalizeGrpcEndpointAddress(uri: string, defaultPort: number): string;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* simply using `split(':')` breaks on IPv6 addresses. Hence these helpers.
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.normalizeGrpcEndpointAddress = exports.joinProtoHostPort = exports.splitProtoHostPort = void 0;
|
|
13
13
|
/**
|
|
14
14
|
* Scheme. Requires but doesn't capture the ':' or '://' separator that follows.
|
|
15
15
|
* e.g. `http:` will be captured as 'http'.
|
|
@@ -70,23 +70,24 @@ exports.joinProtoHostPort = joinProtoHostPort;
|
|
|
70
70
|
* Parse the address for the gRPC endpoint of a Temporal server.
|
|
71
71
|
*
|
|
72
72
|
* - The URI may only contain a hostname and a port.
|
|
73
|
-
* - Port is optional; it
|
|
73
|
+
* - Port is optional; if not specified, set it to `defaultPort`.
|
|
74
74
|
*
|
|
75
|
-
* Examples of valid URIs:
|
|
75
|
+
* Examples of valid URIs (assuming `defaultPort` is 7233):
|
|
76
76
|
*
|
|
77
77
|
* ```
|
|
78
|
-
* 127.0.0.1
|
|
78
|
+
* 127.0.0.1 => { host: '127.0.0.1', port: 7233 }
|
|
79
|
+
* 192.168.0.1:7233 => { host: '192.168.0.1', port: 7233 }
|
|
79
80
|
* my.temporal.service.com:7233 => { host: 'my.temporal.service.com', port: 7233 }
|
|
80
81
|
* [::ffff:192.0.2.128]:8080 => { host: '[::ffff:192.0.2.128]', port: 8080 }
|
|
81
82
|
* ```
|
|
82
83
|
*/
|
|
83
|
-
function
|
|
84
|
+
function normalizeGrpcEndpointAddress(uri, defaultPort) {
|
|
84
85
|
const splitted = splitProtoHostPort(uri);
|
|
85
86
|
if (!splitted || splitted.scheme !== undefined) {
|
|
86
87
|
throw new TypeError(`Invalid address for Temporal gRPC endpoint: expected URI of the form 'hostname' or 'hostname:port'; got '${uri}'`);
|
|
87
88
|
}
|
|
88
|
-
splitted.port ??=
|
|
89
|
+
splitted.port ??= defaultPort;
|
|
89
90
|
return joinProtoHostPort(splitted);
|
|
90
91
|
}
|
|
91
|
-
exports.
|
|
92
|
+
exports.normalizeGrpcEndpointAddress = normalizeGrpcEndpointAddress;
|
|
92
93
|
//# sourceMappingURL=parse-host-uri.js.map
|
|
@@ -1 +1 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|
|
@@ -27,8 +27,8 @@ export interface TLSConfig {
|
|
|
27
27
|
* Pass a falsy value to use a non-encrypted connection or `true` or `{}` to
|
|
28
28
|
* connect with TLS without any customization.
|
|
29
29
|
*/
|
|
30
|
-
export type TLSConfigOption = TLSConfig | boolean | null;
|
|
30
|
+
export type TLSConfigOption = TLSConfig | boolean | undefined | null;
|
|
31
31
|
/**
|
|
32
32
|
* Normalize {@link TLSConfigOption} by turning false and null to undefined and true to and empty object
|
|
33
33
|
*/
|
|
34
|
-
export declare function normalizeTlsConfig(tls
|
|
34
|
+
export declare function normalizeTlsConfig(tls: TLSConfigOption): TLSConfig | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tls-config.js","sourceRoot":"","sources":["../../src/internal-non-workflow/tls-config.ts"],"names":[],"mappings":";;;AA+BA;;GAEG;AACH,SAAgB,kBAAkB,CAAC,
|
|
1
|
+
{"version":3,"file":"tls-config.js","sourceRoot":"","sources":["../../src/internal-non-workflow/tls-config.ts"],"names":[],"mappings":";;;AA+BA;;GAEG;AACH,SAAgB,kBAAkB,CAAC,GAAoB;IACrD,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3F,CAAC;AAFD,gDAEC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temporalio/common",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.3",
|
|
4
4
|
"description": "Common library for code that's used across the Client, Worker, and/or Workflow",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"author": "Temporal Technologies Inc. <sdk@temporal.io>",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@temporalio/proto": "1.11.
|
|
15
|
+
"@temporalio/proto": "1.11.3",
|
|
16
16
|
"long": "^5.2.3",
|
|
17
17
|
"ms": "^3.0.0-canary.1",
|
|
18
18
|
"proto3-json-serializer": "^2.0.0"
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"src",
|
|
37
37
|
"lib"
|
|
38
38
|
],
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "4c90f9d844710abf7e085662373aac226ec09017"
|
|
40
40
|
}
|
|
@@ -80,23 +80,24 @@ export function joinProtoHostPort(components: ProtoHostPort): string {
|
|
|
80
80
|
* Parse the address for the gRPC endpoint of a Temporal server.
|
|
81
81
|
*
|
|
82
82
|
* - The URI may only contain a hostname and a port.
|
|
83
|
-
* - Port is optional; it
|
|
83
|
+
* - Port is optional; if not specified, set it to `defaultPort`.
|
|
84
84
|
*
|
|
85
|
-
* Examples of valid URIs:
|
|
85
|
+
* Examples of valid URIs (assuming `defaultPort` is 7233):
|
|
86
86
|
*
|
|
87
87
|
* ```
|
|
88
|
-
* 127.0.0.1
|
|
88
|
+
* 127.0.0.1 => { host: '127.0.0.1', port: 7233 }
|
|
89
|
+
* 192.168.0.1:7233 => { host: '192.168.0.1', port: 7233 }
|
|
89
90
|
* my.temporal.service.com:7233 => { host: 'my.temporal.service.com', port: 7233 }
|
|
90
91
|
* [::ffff:192.0.2.128]:8080 => { host: '[::ffff:192.0.2.128]', port: 8080 }
|
|
91
92
|
* ```
|
|
92
93
|
*/
|
|
93
|
-
export function
|
|
94
|
+
export function normalizeGrpcEndpointAddress(uri: string, defaultPort: number): string {
|
|
94
95
|
const splitted = splitProtoHostPort(uri);
|
|
95
96
|
if (!splitted || splitted.scheme !== undefined) {
|
|
96
97
|
throw new TypeError(
|
|
97
98
|
`Invalid address for Temporal gRPC endpoint: expected URI of the form 'hostname' or 'hostname:port'; got '${uri}'`
|
|
98
99
|
);
|
|
99
100
|
}
|
|
100
|
-
splitted.port ??=
|
|
101
|
+
splitted.port ??= defaultPort;
|
|
101
102
|
return joinProtoHostPort(splitted);
|
|
102
103
|
}
|
|
@@ -27,11 +27,11 @@ export interface TLSConfig {
|
|
|
27
27
|
* Pass a falsy value to use a non-encrypted connection or `true` or `{}` to
|
|
28
28
|
* connect with TLS without any customization.
|
|
29
29
|
*/
|
|
30
|
-
export type TLSConfigOption = TLSConfig | boolean | null;
|
|
30
|
+
export type TLSConfigOption = TLSConfig | boolean | undefined | null;
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Normalize {@link TLSConfigOption} by turning false and null to undefined and true to and empty object
|
|
34
34
|
*/
|
|
35
|
-
export function normalizeTlsConfig(tls
|
|
35
|
+
export function normalizeTlsConfig(tls: TLSConfigOption): TLSConfig | undefined {
|
|
36
36
|
return typeof tls === 'object' ? (tls === null ? undefined : tls) : tls ? {} : undefined;
|
|
37
37
|
}
|