@rstreamlabs/tunnels 3.2.1 → 3.4.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.mjs CHANGED
@@ -1,23 +1,54 @@
1
1
  import {
2
+ RstreamWebTTYResource,
3
+ attachWebTTYParticipantParamsSchema,
2
4
  clientFilterSchema,
3
5
  clientSchema,
6
+ createWebTTYControlRequestParamsSchema,
7
+ detachWebTTYParticipantParamsSchema,
4
8
  engineOpenApiDocument,
5
9
  engineOpenApiJson,
6
10
  eventSchema,
11
+ formatStreamAccessPath,
7
12
  formatTunnelHost,
8
13
  listClientsParamsSchema,
9
14
  listClientsResponseSchema,
10
15
  listTunnelsParamsSchema,
11
16
  listTunnelsResponseSchema,
17
+ listWebTTYControlRequestsParamsSchema,
18
+ listWebTTYKeyGrantDecryptMaterialParamsSchema,
19
+ listWebTTYSessionGroupsParamsSchema,
20
+ listWebTTYSessionsParamsSchema,
12
21
  projectLogEventsSchema,
22
+ readWebTTYSessionEventsParamsSchema,
23
+ resolveWebTTYControlRequestParamsSchema,
13
24
  streamEndpointSchema,
25
+ streamEntrySchema,
14
26
  streamSummaryEventSchema,
15
27
  streamSummarySchema,
16
28
  streamTLSInfoSchema,
29
+ streamWebTTYMetadataSchema,
17
30
  tunnelFilterSchema,
31
+ webTTYCapabilitiesSchema,
32
+ webTTYContextMetadataSchema,
33
+ webTTYControlRequestSchema,
34
+ webTTYCryptoMetadataSchema,
35
+ webTTYEncryptionModeSchema,
36
+ webTTYKeyGrantDecryptMaterialSchema,
37
+ webTTYKeyGrantSchema,
38
+ webTTYOriginSchema,
39
+ webTTYParticipantLiveSchema,
40
+ webTTYParticipantRoleSchema,
41
+ webTTYParticipantSchema,
42
+ webTTYRecordingModeSchema,
43
+ webTTYSessionEventSchema,
44
+ webTTYSessionGroupSchema,
45
+ webTTYSessionLiveSchema,
46
+ webTTYSessionModeSchema,
47
+ webTTYSessionSchema,
48
+ webTTYTransportSchema,
18
49
  webhookEventsSchema,
19
50
  wsEventsSchema
20
- } from "./chunk-VUAM3LRU.mjs";
51
+ } from "./chunk-6OUCIT5G.mjs";
21
52
 
22
53
  // src/auth-resource.ts
23
54
  import { createAuthTokenParamsSchema } from "@rstreamlabs/rstream/auth-token";
@@ -985,6 +1016,9 @@ var RstreamTunnelsClient = class {
985
1016
  get webhooks() {
986
1017
  return new RstreamWebhookResource();
987
1018
  }
1019
+ get webtty() {
1020
+ return new RstreamWebTTYResource(this);
1021
+ }
988
1022
  get turn() {
989
1023
  return new RstreamTURNResource(this);
990
1024
  }
@@ -1210,10 +1244,23 @@ var osFamilySchema = z2.enum([
1210
1244
  ]);
1211
1245
  var webttyCapabilitySchema = z2.enum(["exec", "fs"]);
1212
1246
  var webttyFSModeSchema = z2.enum(["read-write", "read-only"]);
1247
+ var webttyEncryptionPolicySchema = z2.enum([
1248
+ "disabled",
1249
+ "explicit_key",
1250
+ "workspace_managed"
1251
+ ]);
1213
1252
  var webttyServerSchema = z2.object({
1214
1253
  tunnel_id: z2.string(),
1254
+ tunnel_protocol: z2.enum(["http", "webtty"]),
1255
+ managed: z2.boolean(),
1215
1256
  host: z2.string(),
1216
1257
  token_auth: z2.boolean(),
1258
+ server_id: z2.string().optional(),
1259
+ server_name: z2.string().optional(),
1260
+ host_key_id: z2.string().optional(),
1261
+ e2e: z2.enum(["disabled", "required"]).optional(),
1262
+ client_proof: z2.enum(["none", "required"]).optional(),
1263
+ encryption_policy: webttyEncryptionPolicySchema.optional(),
1217
1264
  capabilities: z2.array(webttyCapabilitySchema).optional(),
1218
1265
  exec_path: z2.string().optional(),
1219
1266
  fs_path: z2.string().optional(),
@@ -1247,9 +1294,10 @@ function webTTYHasCapability(capabilities, capability) {
1247
1294
  function parser(tunnel) {
1248
1295
  if (tunnel.status !== "online") return null;
1249
1296
  if (tunnel.publish !== true) return null;
1250
- if (tunnel.protocol !== "http") return null;
1297
+ const managedProtocol = tunnel.protocol === "webtty";
1298
+ if (tunnel.protocol !== "http" && !managedProtocol) return null;
1251
1299
  const tunnelLabels = tunnel.labels ?? {};
1252
- if (tunnelLabels["application-protocol"] !== "rstream.webtty") {
1300
+ if (!managedProtocol && tunnelLabels["application-protocol"] !== "rstream.webtty") {
1253
1301
  return null;
1254
1302
  }
1255
1303
  const capabilities = webTTYCapabilitiesForLabels(tunnelLabels);
@@ -1262,8 +1310,16 @@ function parser(tunnel) {
1262
1310
  }
1263
1311
  const candidate = {
1264
1312
  tunnel_id: tunnel.id,
1313
+ tunnel_protocol: tunnel.protocol,
1314
+ managed: managedProtocol,
1265
1315
  host: formatTunnelHost(tunnel),
1266
1316
  token_auth: tunnel.token_auth === true,
1317
+ server_id: tunnelLabels["rstream.webtty.server_id"],
1318
+ server_name: tunnelLabels["rstream.webtty.server_name"],
1319
+ host_key_id: tunnelLabels["rstream.webtty.host_key_id"],
1320
+ e2e: tunnelLabels["rstream.webtty.e2e"],
1321
+ client_proof: tunnelLabels["rstream.webtty.client_proof"],
1322
+ encryption_policy: tunnelLabels["rstream.webtty.encryption_policy"],
1267
1323
  capabilities,
1268
1324
  exec_path: webTTYHasCapability(capabilities, "exec") ? tunnelLabels["rstream.webtty.exec.path"] ?? "/" : void 0,
1269
1325
  fs_path: webTTYHasCapability(capabilities, "fs") ? tunnelLabels["rstream.webtty.fs.path"] ?? "/fs" : void 0,
@@ -1295,6 +1351,7 @@ export {
1295
1351
  RstreamTunnelsClient,
1296
1352
  RstreamTunnelsResource,
1297
1353
  RstreamTunnelsResource as RstreamTunnelsRessource,
1354
+ RstreamWebTTYResource,
1298
1355
  RstreamWebhookResource,
1299
1356
  RstreamWebhookResource as RstreamWebhookRessource,
1300
1357
  RstreamTunnelsClient as Tunnels,
@@ -1304,6 +1361,7 @@ export {
1304
1361
  WEBHOOK_ID_HEADER,
1305
1362
  WEBHOOK_SIGNATURE_HEADER,
1306
1363
  Watch,
1364
+ attachWebTTYParticipantParamsSchema,
1307
1365
  buildWebhookHeaders,
1308
1366
  clientFilterSchema,
1309
1367
  clientSchema,
@@ -1312,30 +1370,59 @@ export {
1312
1370
  createAuthTokenFromClientCredentials,
1313
1371
  createPATTURNCredentials,
1314
1372
  createTURNCredentials,
1373
+ createWebTTYControlRequestParamsSchema,
1374
+ detachWebTTYParticipantParamsSchema,
1315
1375
  engineOpenApiDocument,
1316
1376
  engineOpenApiJson,
1317
1377
  eventSchema,
1378
+ formatStreamAccessPath,
1318
1379
  formatTunnelHost,
1319
1380
  generateWebhookSigningSecret,
1320
1381
  listClientsParamsSchema,
1321
1382
  listClientsResponseSchema,
1322
1383
  listTunnelsParamsSchema,
1323
1384
  listTunnelsResponseSchema,
1385
+ listWebTTYControlRequestsParamsSchema,
1386
+ listWebTTYKeyGrantDecryptMaterialParamsSchema,
1387
+ listWebTTYSessionGroupsParamsSchema,
1388
+ listWebTTYSessionsParamsSchema,
1324
1389
  normalizeEngineAddress,
1325
1390
  parseWebTTYServers,
1326
1391
  projectLogEventsSchema,
1392
+ readWebTTYSessionEventsParamsSchema,
1327
1393
  resolveControlPlaneCredentials,
1328
1394
  resolveManagedTunnelsProject,
1329
1395
  resolveTunnelsAPIURL,
1330
1396
  resolveTunnelsCredentials,
1331
1397
  resolveTunnelsEngine,
1398
+ resolveWebTTYControlRequestParamsSchema,
1332
1399
  signWebhookPayload,
1333
1400
  streamEndpointSchema,
1401
+ streamEntrySchema,
1334
1402
  streamSummaryEventSchema,
1335
1403
  streamSummarySchema,
1336
1404
  streamTLSInfoSchema,
1405
+ streamWebTTYMetadataSchema,
1337
1406
  tunnelFilterSchema,
1338
1407
  turnCredentialModeSchema,
1408
+ webTTYCapabilitiesSchema,
1409
+ webTTYContextMetadataSchema,
1410
+ webTTYControlRequestSchema,
1411
+ webTTYCryptoMetadataSchema,
1412
+ webTTYEncryptionModeSchema,
1413
+ webTTYKeyGrantDecryptMaterialSchema,
1414
+ webTTYKeyGrantSchema,
1415
+ webTTYOriginSchema,
1416
+ webTTYParticipantLiveSchema,
1417
+ webTTYParticipantRoleSchema,
1418
+ webTTYParticipantSchema,
1419
+ webTTYRecordingModeSchema,
1420
+ webTTYSessionEventSchema,
1421
+ webTTYSessionGroupSchema,
1422
+ webTTYSessionLiveSchema,
1423
+ webTTYSessionModeSchema,
1424
+ webTTYSessionSchema,
1425
+ webTTYTransportSchema,
1339
1426
  webhookEventsSchema,
1340
1427
  webttyServerSchema,
1341
1428
  wsEventsSchema
@@ -116,7 +116,10 @@ declare const engineOpenApiDocument: {
116
116
  "inspect-engine-state": string[];
117
117
  "expose-service-from-cli": string[];
118
118
  "connect-private-tunnel": string[];
119
- "operate-webtty": string[];
119
+ "run-tunnel-webtty": string[];
120
+ "join-managed-webtty": string[];
121
+ "control-managed-webtty": string[];
122
+ "read-managed-webtty-recordings": string[];
120
123
  };
121
124
  paths: {
122
125
  "/api/openapi.json": {
package/dist/openapi.d.ts CHANGED
@@ -116,7 +116,10 @@ declare const engineOpenApiDocument: {
116
116
  "inspect-engine-state": string[];
117
117
  "expose-service-from-cli": string[];
118
118
  "connect-private-tunnel": string[];
119
- "operate-webtty": string[];
119
+ "run-tunnel-webtty": string[];
120
+ "join-managed-webtty": string[];
121
+ "control-managed-webtty": string[];
122
+ "read-managed-webtty-recordings": string[];
120
123
  };
121
124
  paths: {
122
125
  "/api/openapi.json": {