@rstreamlabs/tunnels 3.4.0 → 3.6.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/dist/index.d.mts +247 -240
- package/dist/index.d.ts +247 -240
- package/dist/index.js +22 -3
- package/dist/index.mjs +22 -3
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -165,7 +165,7 @@ function createAuthTokenFromClientCredentials(credentials, params, options) {
|
|
|
165
165
|
metadata: {
|
|
166
166
|
engine: options?.engine
|
|
167
167
|
},
|
|
168
|
-
permissions: null,
|
|
168
|
+
permissions: tokenParams.permissions ?? null,
|
|
169
169
|
resources: normalizeAuthTokenResources(tokenParams, options)
|
|
170
170
|
};
|
|
171
171
|
const { token } = (0, import_rstream.createClientCredentialsToken)(credentials, {
|
|
@@ -2597,6 +2597,13 @@ var webttyEncryptionPolicySchema = z9.enum([
|
|
|
2597
2597
|
]);
|
|
2598
2598
|
var webttyServerSchema = z9.object({
|
|
2599
2599
|
tunnel_id: z9.string(),
|
|
2600
|
+
tunnel_name: z9.string().optional(),
|
|
2601
|
+
target: z9.string().optional(),
|
|
2602
|
+
rstream_url: z9.string().optional(),
|
|
2603
|
+
status: z9.string().optional(),
|
|
2604
|
+
publish: z9.boolean().optional(),
|
|
2605
|
+
workspace_id: z9.string().optional(),
|
|
2606
|
+
project_id: z9.string().optional(),
|
|
2600
2607
|
tunnel_protocol: z9.enum(["http", "webtty"]),
|
|
2601
2608
|
managed: z9.boolean(),
|
|
2602
2609
|
host: z9.string(),
|
|
@@ -2654,14 +2661,26 @@ function parser(tunnel) {
|
|
|
2654
2661
|
if (labelKey.length === 0) continue;
|
|
2655
2662
|
labels[labelKey] = value;
|
|
2656
2663
|
}
|
|
2664
|
+
const name = (tunnel.name ?? "").trim();
|
|
2665
|
+
const serverId = (tunnelLabels["rstream.webtty.server_id"] ?? "").trim();
|
|
2666
|
+
const serverName = (tunnelLabels["rstream.webtty.server_name"] ?? "").trim();
|
|
2667
|
+
const target = serverName || name || tunnel.id;
|
|
2668
|
+
const rstreamTarget = serverId || name || tunnel.id;
|
|
2657
2669
|
const candidate = {
|
|
2658
2670
|
tunnel_id: tunnel.id,
|
|
2671
|
+
tunnel_name: name || void 0,
|
|
2672
|
+
target,
|
|
2673
|
+
rstream_url: `rstrm://${rstreamTarget}`,
|
|
2674
|
+
status: tunnel.status,
|
|
2675
|
+
publish: tunnel.publish === true,
|
|
2676
|
+
workspace_id: tunnel.workspace_id,
|
|
2677
|
+
project_id: tunnel.project_id,
|
|
2659
2678
|
tunnel_protocol: tunnel.protocol,
|
|
2660
2679
|
managed: managedProtocol,
|
|
2661
2680
|
host: formatTunnelHost(tunnel),
|
|
2662
2681
|
token_auth: tunnel.token_auth === true,
|
|
2663
|
-
server_id:
|
|
2664
|
-
server_name:
|
|
2682
|
+
server_id: serverId || void 0,
|
|
2683
|
+
server_name: serverName || void 0,
|
|
2665
2684
|
host_key_id: tunnelLabels["rstream.webtty.host_key_id"],
|
|
2666
2685
|
e2e: tunnelLabels["rstream.webtty.e2e"],
|
|
2667
2686
|
client_proof: tunnelLabels["rstream.webtty.client_proof"],
|
package/dist/index.mjs
CHANGED
|
@@ -98,7 +98,7 @@ function createAuthTokenFromClientCredentials(credentials, params, options) {
|
|
|
98
98
|
metadata: {
|
|
99
99
|
engine: options?.engine
|
|
100
100
|
},
|
|
101
|
-
permissions: null,
|
|
101
|
+
permissions: tokenParams.permissions ?? null,
|
|
102
102
|
resources: normalizeAuthTokenResources(tokenParams, options)
|
|
103
103
|
};
|
|
104
104
|
const { token } = createClientCredentialsToken(credentials, {
|
|
@@ -1251,6 +1251,13 @@ var webttyEncryptionPolicySchema = z2.enum([
|
|
|
1251
1251
|
]);
|
|
1252
1252
|
var webttyServerSchema = z2.object({
|
|
1253
1253
|
tunnel_id: z2.string(),
|
|
1254
|
+
tunnel_name: z2.string().optional(),
|
|
1255
|
+
target: z2.string().optional(),
|
|
1256
|
+
rstream_url: z2.string().optional(),
|
|
1257
|
+
status: z2.string().optional(),
|
|
1258
|
+
publish: z2.boolean().optional(),
|
|
1259
|
+
workspace_id: z2.string().optional(),
|
|
1260
|
+
project_id: z2.string().optional(),
|
|
1254
1261
|
tunnel_protocol: z2.enum(["http", "webtty"]),
|
|
1255
1262
|
managed: z2.boolean(),
|
|
1256
1263
|
host: z2.string(),
|
|
@@ -1308,14 +1315,26 @@ function parser(tunnel) {
|
|
|
1308
1315
|
if (labelKey.length === 0) continue;
|
|
1309
1316
|
labels[labelKey] = value;
|
|
1310
1317
|
}
|
|
1318
|
+
const name = (tunnel.name ?? "").trim();
|
|
1319
|
+
const serverId = (tunnelLabels["rstream.webtty.server_id"] ?? "").trim();
|
|
1320
|
+
const serverName = (tunnelLabels["rstream.webtty.server_name"] ?? "").trim();
|
|
1321
|
+
const target = serverName || name || tunnel.id;
|
|
1322
|
+
const rstreamTarget = serverId || name || tunnel.id;
|
|
1311
1323
|
const candidate = {
|
|
1312
1324
|
tunnel_id: tunnel.id,
|
|
1325
|
+
tunnel_name: name || void 0,
|
|
1326
|
+
target,
|
|
1327
|
+
rstream_url: `rstrm://${rstreamTarget}`,
|
|
1328
|
+
status: tunnel.status,
|
|
1329
|
+
publish: tunnel.publish === true,
|
|
1330
|
+
workspace_id: tunnel.workspace_id,
|
|
1331
|
+
project_id: tunnel.project_id,
|
|
1313
1332
|
tunnel_protocol: tunnel.protocol,
|
|
1314
1333
|
managed: managedProtocol,
|
|
1315
1334
|
host: formatTunnelHost(tunnel),
|
|
1316
1335
|
token_auth: tunnel.token_auth === true,
|
|
1317
|
-
server_id:
|
|
1318
|
-
server_name:
|
|
1336
|
+
server_id: serverId || void 0,
|
|
1337
|
+
server_name: serverName || void 0,
|
|
1319
1338
|
host_key_id: tunnelLabels["rstream.webtty.host_key_id"],
|
|
1320
1339
|
e2e: tunnelLabels["rstream.webtty.e2e"],
|
|
1321
1340
|
client_proof: tunnelLabels["rstream.webtty.client_proof"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rstreamlabs/tunnels",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "JS/TS SDK for the rstream Engine API and tunnel runtime APIs.",
|
|
5
5
|
"author": "@uartnet <hello@rstream.io>",
|
|
6
6
|
"repository": {
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"type-check": "tsc --noEmit"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@turbo/gen": "^2.
|
|
42
|
-
"@types/node": "^
|
|
41
|
+
"@turbo/gen": "^2.10.0",
|
|
42
|
+
"@types/node": "^26",
|
|
43
43
|
"eslint": "9.39.4",
|
|
44
44
|
"eslint-config": "*",
|
|
45
45
|
"tsup": "^8.5.1",
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
"typescript-config": "*"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@rstreamlabs/rstream": "3.
|
|
50
|
+
"@rstreamlabs/rstream": "3.4.0",
|
|
51
51
|
"@types/jsonwebtoken": "^9.0.10",
|
|
52
52
|
"jsonwebtoken": "^9.0.3",
|
|
53
|
-
"zod": "^4.3
|
|
53
|
+
"zod": "^4.4.3"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|