@rstreamlabs/tunnels 3.2.0 → 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/README.md +58 -4
- package/dist/chunk-6OUCIT5G.mjs +1330 -0
- package/dist/index.d.mts +2977 -131
- package/dist/index.d.ts +2977 -131
- package/dist/index.js +926 -171
- package/dist/index.mjs +165 -9
- package/dist/openapi.d.mts +4 -1
- package/dist/openapi.d.ts +4 -1
- package/dist/openapi.js +479 -58
- package/dist/openapi.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-VUAM3LRU.mjs +0 -710
package/dist/openapi.js
CHANGED
|
@@ -73,30 +73,44 @@ var listClientsParamsSchema = z.object({
|
|
|
73
73
|
});
|
|
74
74
|
var listClientsResponseSchema = z.array(clientSchema);
|
|
75
75
|
|
|
76
|
-
// src/
|
|
77
|
-
var import_tunnel = require("@rstreamlabs/rstream/tunnel");
|
|
76
|
+
// src/webtty-schemas.ts
|
|
78
77
|
var z2 = __toESM(require("zod"));
|
|
79
|
-
var
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
var
|
|
78
|
+
var webTTYTransportSchema = z2.enum([
|
|
79
|
+
"plain",
|
|
80
|
+
"websocket",
|
|
81
|
+
"webtransport"
|
|
82
|
+
]);
|
|
83
|
+
var webTTYRecordingModeSchema = z2.enum(["recorded", "private"]);
|
|
84
|
+
var webTTYEncryptionModeSchema = z2.enum(["managed", "e2e"]);
|
|
85
|
+
var webTTYSessionModeSchema = z2.enum([
|
|
86
|
+
"interactive",
|
|
87
|
+
"non-interactive"
|
|
88
|
+
]);
|
|
89
|
+
var webTTYOriginSchema = z2.enum([
|
|
90
|
+
"human",
|
|
91
|
+
"codex",
|
|
92
|
+
"api",
|
|
93
|
+
"automation",
|
|
94
|
+
"ci",
|
|
95
|
+
"scheduled-job"
|
|
96
|
+
]);
|
|
97
|
+
var webTTYParticipantRoleSchema = z2.enum(["controller", "spectator"]);
|
|
98
|
+
var webTTYInitiatorKindSchema = z2.enum([
|
|
99
|
+
"user",
|
|
100
|
+
"app",
|
|
101
|
+
"agent",
|
|
102
|
+
"service-account"
|
|
103
|
+
]);
|
|
104
|
+
var webTTYContextMetadataSchema = z2.object({
|
|
105
|
+
origin: webTTYOriginSchema.optional(),
|
|
106
|
+
origin_id: z2.string().optional(),
|
|
107
|
+
purpose: z2.string().optional(),
|
|
108
|
+
initiator_kind: webTTYInitiatorKindSchema.optional(),
|
|
109
|
+
agent_name: z2.string().optional(),
|
|
110
|
+
agent_version: z2.string().optional(),
|
|
111
|
+
request_id: z2.string().optional(),
|
|
112
|
+
labels: z2.record(z2.string(), z2.string()).optional()
|
|
113
|
+
}).passthrough();
|
|
100
114
|
|
|
101
115
|
// src/stream.ts
|
|
102
116
|
var z3 = __toESM(require("zod"));
|
|
@@ -148,6 +162,15 @@ var httpResponseStageSchema = z3.object({
|
|
|
148
162
|
protocol: httpProtocolSchema.optional(),
|
|
149
163
|
response: httpResponseSchema
|
|
150
164
|
});
|
|
165
|
+
var streamEntrySchema = z3.object({
|
|
166
|
+
kind: z3.enum([
|
|
167
|
+
"published_tunnel",
|
|
168
|
+
"private_rstream",
|
|
169
|
+
"proxy_egress",
|
|
170
|
+
"internal"
|
|
171
|
+
]),
|
|
172
|
+
transport: z3.enum(["rstream", "tls", "quic", "dtls", "http", "tcp"]).optional()
|
|
173
|
+
});
|
|
151
174
|
var tokenSourceSchema = z3.enum([
|
|
152
175
|
"authorization",
|
|
153
176
|
"query",
|
|
@@ -162,6 +185,10 @@ var firewallRuleSchema = z3.discriminatedUnion("kind", [
|
|
|
162
185
|
kind: z3.literal("rstream_auth"),
|
|
163
186
|
source: z3.literal("rstream_auth")
|
|
164
187
|
}),
|
|
188
|
+
z3.object({
|
|
189
|
+
kind: z3.literal("rstream"),
|
|
190
|
+
source: z3.literal("private_rstream").optional()
|
|
191
|
+
}),
|
|
165
192
|
z3.object({
|
|
166
193
|
kind: z3.literal("token"),
|
|
167
194
|
source: tokenSourceSchema.optional(),
|
|
@@ -282,6 +309,27 @@ var responseSchema = z3.discriminatedUnion("outcome", [
|
|
|
282
309
|
responseConnectedSchema,
|
|
283
310
|
responseFailedSchema
|
|
284
311
|
]);
|
|
312
|
+
var streamWebTTYMetadataSchema = z3.object({
|
|
313
|
+
server_id: nonEmptyStringSchema.optional(),
|
|
314
|
+
session_id: nonEmptyStringSchema.optional(),
|
|
315
|
+
session_group_id: nonEmptyStringSchema.optional(),
|
|
316
|
+
participant_id: nonEmptyStringSchema.optional(),
|
|
317
|
+
participant_role: webTTYParticipantRoleSchema.optional(),
|
|
318
|
+
controller: z3.boolean().optional(),
|
|
319
|
+
recording_mode: webTTYRecordingModeSchema.optional(),
|
|
320
|
+
encryption_mode: webTTYEncryptionModeSchema.optional(),
|
|
321
|
+
encryption_policy: z3.enum(["disabled", "explicit_key", "workspace_managed"]).optional(),
|
|
322
|
+
e2e: z3.boolean().optional(),
|
|
323
|
+
client_proof: z3.enum(["none", "required"]).optional(),
|
|
324
|
+
session_mode: webTTYSessionModeSchema.optional(),
|
|
325
|
+
downstream_transport: webTTYTransportSchema.optional(),
|
|
326
|
+
upstream_transport: webTTYTransportSchema.optional(),
|
|
327
|
+
origin: webTTYOriginSchema.optional(),
|
|
328
|
+
origin_id: z3.string().optional(),
|
|
329
|
+
initiator_kind: webTTYInitiatorKindSchema.optional(),
|
|
330
|
+
device_id: z3.string().optional(),
|
|
331
|
+
browser_id: z3.string().optional()
|
|
332
|
+
}).passthrough();
|
|
285
333
|
var streamSummarySchema = z3.object({
|
|
286
334
|
workspace_id: nonEmptyStringSchema.optional(),
|
|
287
335
|
project_id: nonEmptyStringSchema.optional(),
|
|
@@ -294,85 +342,421 @@ var streamSummarySchema = z3.object({
|
|
|
294
342
|
terminated_at: isoDateTimeSchema,
|
|
295
343
|
request: z3.object({
|
|
296
344
|
downstream: streamEndpointSchema,
|
|
345
|
+
entry: streamEntrySchema.optional(),
|
|
297
346
|
http: httpRequestStageSchema.optional()
|
|
298
347
|
}),
|
|
299
348
|
firewall: firewallSchema,
|
|
300
349
|
routing: routingSchema,
|
|
350
|
+
webtty: streamWebTTYMetadataSchema.optional(),
|
|
301
351
|
response: responseSchema
|
|
302
352
|
});
|
|
303
353
|
|
|
304
|
-
// src/
|
|
305
|
-
var import_tunnel2 = require("@rstreamlabs/rstream/tunnel");
|
|
354
|
+
// src/webtty-resource.ts
|
|
306
355
|
var z4 = __toESM(require("zod"));
|
|
307
356
|
var isoDateTimeSchema2 = z4.string().datetime({ offset: true });
|
|
308
|
-
var
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
var
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
357
|
+
var decimalCursorSchema = z4.string().regex(/^\d+$/);
|
|
358
|
+
var webTTYSequenceCursorInputSchema = z4.union([
|
|
359
|
+
decimalCursorSchema,
|
|
360
|
+
z4.number().int().nonnegative().safe().transform(String)
|
|
361
|
+
]);
|
|
362
|
+
var webTTYSessionStatusSchema = z4.enum([
|
|
363
|
+
"opening",
|
|
364
|
+
"active",
|
|
365
|
+
"closing",
|
|
366
|
+
"closed",
|
|
367
|
+
"errored"
|
|
368
|
+
]);
|
|
369
|
+
var webTTYControlRequestStatusSchema = z4.enum([
|
|
370
|
+
"pending",
|
|
371
|
+
"granted",
|
|
372
|
+
"refused",
|
|
373
|
+
"revoked",
|
|
374
|
+
"expired"
|
|
375
|
+
]);
|
|
376
|
+
var webTTYEventDirectionSchema = z4.enum([
|
|
377
|
+
"client_to_server",
|
|
378
|
+
"server_to_client",
|
|
379
|
+
"engine_internal"
|
|
380
|
+
]);
|
|
381
|
+
var webTTYStreamTypeSchema = z4.enum(["stdin", "stdout", "stderr"]);
|
|
382
|
+
var webTTYSessionEventTypeSchema = z4.enum([
|
|
383
|
+
"open",
|
|
384
|
+
"ack",
|
|
385
|
+
"data",
|
|
386
|
+
"resize",
|
|
387
|
+
"close",
|
|
388
|
+
"error",
|
|
389
|
+
"participant",
|
|
390
|
+
"control",
|
|
391
|
+
"recording_state"
|
|
392
|
+
]);
|
|
393
|
+
var jsonRecordSchema = z4.record(z4.string(), z4.unknown());
|
|
394
|
+
function rejectCryptoKeyEnvelopes(crypto, ctx, path) {
|
|
395
|
+
if (crypto === null || typeof crypto !== "object") {
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
if (Object.prototype.hasOwnProperty.call(crypto, "key_envelopes")) {
|
|
399
|
+
ctx.addIssue({
|
|
400
|
+
code: z4.ZodIssueCode.custom,
|
|
401
|
+
message: "key_envelopes are available only from the WebTTY decrypt-material endpoint.",
|
|
402
|
+
path: [...path, "key_envelopes"]
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
var webTTYCapabilitiesSchema = z4.object({
|
|
407
|
+
managed_protocol: z4.boolean(),
|
|
408
|
+
store_configured: z4.boolean(),
|
|
409
|
+
session_listing: z4.boolean(),
|
|
410
|
+
recording: z4.boolean(),
|
|
411
|
+
replay: z4.boolean(),
|
|
412
|
+
live_attach: z4.boolean(),
|
|
413
|
+
control_transfer: z4.boolean(),
|
|
414
|
+
e2e: z4.boolean(),
|
|
415
|
+
implemented_transports: z4.array(webTTYTransportSchema),
|
|
416
|
+
recording_modes: z4.array(webTTYRecordingModeSchema),
|
|
417
|
+
encryption_modes: z4.array(webTTYEncryptionModeSchema),
|
|
418
|
+
required_permissions: z4.record(z4.string(), z4.array(z4.string()))
|
|
419
|
+
});
|
|
420
|
+
var webTTYSessionLiveSchema = z4.object({
|
|
421
|
+
available: z4.boolean(),
|
|
422
|
+
attachable: z4.boolean(),
|
|
423
|
+
participant_count: z4.number().int().nonnegative(),
|
|
424
|
+
controller_participant_id: z4.string().optional(),
|
|
425
|
+
has_upstream: z4.boolean()
|
|
426
|
+
});
|
|
427
|
+
var webTTYParticipantLiveSchema = z4.object({
|
|
428
|
+
connected: z4.boolean(),
|
|
429
|
+
controller: z4.boolean()
|
|
430
|
+
});
|
|
431
|
+
var webTTYSessionSchema = z4.object({
|
|
432
|
+
id: z4.string(),
|
|
433
|
+
workspace_id: z4.string().optional(),
|
|
434
|
+
project_id: z4.string().optional(),
|
|
435
|
+
cluster_id: z4.string().optional(),
|
|
436
|
+
server_id: z4.string().optional(),
|
|
437
|
+
tunnel_id: z4.string(),
|
|
438
|
+
client_id: z4.string().optional(),
|
|
439
|
+
initiator_user_id: z4.string().optional(),
|
|
440
|
+
group_id: z4.string().optional(),
|
|
441
|
+
status: webTTYSessionStatusSchema,
|
|
442
|
+
session_mode: webTTYSessionModeSchema,
|
|
443
|
+
recording_mode: webTTYRecordingModeSchema,
|
|
444
|
+
encryption_mode: webTTYEncryptionModeSchema,
|
|
445
|
+
downstream_transport: webTTYTransportSchema.optional(),
|
|
446
|
+
upstream_transport: webTTYTransportSchema.optional(),
|
|
447
|
+
command_meta: z4.unknown().optional(),
|
|
448
|
+
context: webTTYContextMetadataSchema.optional(),
|
|
449
|
+
started_at: isoDateTimeSchema2,
|
|
450
|
+
ended_at: isoDateTimeSchema2.optional(),
|
|
451
|
+
exit_code: z4.number().int().optional(),
|
|
452
|
+
error_code: z4.string().optional(),
|
|
453
|
+
error_message: z4.string().optional(),
|
|
454
|
+
live: webTTYSessionLiveSchema.optional()
|
|
455
|
+
}).passthrough();
|
|
456
|
+
var webTTYSessionGroupSchema = z4.object({
|
|
457
|
+
id: z4.string(),
|
|
317
458
|
workspace_id: z4.string().optional(),
|
|
318
459
|
project_id: z4.string().optional(),
|
|
319
|
-
|
|
460
|
+
initiator_user_id: z4.string().optional(),
|
|
461
|
+
context: webTTYContextMetadataSchema.optional(),
|
|
462
|
+
created_at: isoDateTimeSchema2,
|
|
463
|
+
updated_at: isoDateTimeSchema2,
|
|
464
|
+
closed_at: isoDateTimeSchema2.optional()
|
|
465
|
+
}).passthrough();
|
|
466
|
+
var webTTYParticipantSchema = z4.object({
|
|
467
|
+
id: z4.string(),
|
|
468
|
+
session_id: z4.string(),
|
|
469
|
+
user_id: z4.string().optional(),
|
|
470
|
+
device_id: z4.string().optional(),
|
|
471
|
+
browser_id: z4.string().optional(),
|
|
472
|
+
role: webTTYParticipantRoleSchema,
|
|
473
|
+
attached_at: isoDateTimeSchema2,
|
|
474
|
+
detached_at: isoDateTimeSchema2.optional(),
|
|
475
|
+
controller: z4.boolean(),
|
|
476
|
+
grant_state: z4.string().optional(),
|
|
477
|
+
attach_grant: z4.string().optional(),
|
|
478
|
+
attach_grant_expires_at: isoDateTimeSchema2.optional(),
|
|
479
|
+
live: webTTYParticipantLiveSchema.optional()
|
|
480
|
+
}).passthrough();
|
|
481
|
+
var webTTYCryptoMetadataSchema = z4.object({
|
|
482
|
+
payload_suite: z4.string().optional(),
|
|
483
|
+
payload_key_id: z4.string().optional(),
|
|
484
|
+
nonce: z4.string().optional(),
|
|
485
|
+
key_envelope_suite: z4.string().optional(),
|
|
486
|
+
key_envelopes: z4.unknown().optional(),
|
|
487
|
+
key_context: z4.unknown().optional(),
|
|
488
|
+
key_context_raw: z4.string().optional()
|
|
489
|
+
}).passthrough();
|
|
490
|
+
var webTTYSessionEventSchema = z4.object({
|
|
491
|
+
id: z4.string(),
|
|
492
|
+
session_id: z4.string(),
|
|
493
|
+
seq: decimalCursorSchema,
|
|
494
|
+
created_at: isoDateTimeSchema2,
|
|
495
|
+
type: webTTYSessionEventTypeSchema,
|
|
496
|
+
direction: webTTYEventDirectionSchema.optional(),
|
|
497
|
+
stream_type: webTTYStreamTypeSchema.optional(),
|
|
498
|
+
participant_id: z4.string().optional(),
|
|
499
|
+
payload_length: z4.number().int().nonnegative().optional(),
|
|
500
|
+
payload_ciphertext: z4.string().optional(),
|
|
501
|
+
payload_plaintext: z4.string().optional(),
|
|
502
|
+
crypto: webTTYCryptoMetadataSchema.optional(),
|
|
503
|
+
prev_hash: z4.string().optional(),
|
|
504
|
+
hash: z4.string().optional(),
|
|
505
|
+
metadata: z4.unknown().optional()
|
|
506
|
+
}).passthrough().superRefine((value, ctx) => {
|
|
507
|
+
rejectCryptoKeyEnvelopes(value.crypto, ctx, ["crypto"]);
|
|
508
|
+
});
|
|
509
|
+
var webTTYKeyGrantBaseShape = {
|
|
510
|
+
id: z4.string(),
|
|
511
|
+
session_id: z4.string(),
|
|
512
|
+
recipient_id: z4.string(),
|
|
513
|
+
recipient_kind: z4.string(),
|
|
514
|
+
granted_by: z4.string().optional(),
|
|
515
|
+
crypto: webTTYCryptoMetadataSchema,
|
|
516
|
+
created_at: isoDateTimeSchema2,
|
|
517
|
+
revoked_at: isoDateTimeSchema2.optional()
|
|
518
|
+
};
|
|
519
|
+
var webTTYKeyGrantSchema = z4.object(webTTYKeyGrantBaseShape).passthrough().superRefine((value, ctx) => {
|
|
520
|
+
if (Object.prototype.hasOwnProperty.call(value, "wrapped_key")) {
|
|
521
|
+
ctx.addIssue({
|
|
522
|
+
code: z4.ZodIssueCode.custom,
|
|
523
|
+
message: "wrapped_key is available only from the WebTTY decrypt-material endpoint.",
|
|
524
|
+
path: ["wrapped_key"]
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
rejectCryptoKeyEnvelopes(value.crypto, ctx, ["crypto"]);
|
|
528
|
+
});
|
|
529
|
+
var webTTYKeyGrantDecryptMaterialSchema = z4.object({
|
|
530
|
+
...webTTYKeyGrantBaseShape,
|
|
531
|
+
wrapped_key: z4.string().optional()
|
|
532
|
+
}).passthrough();
|
|
533
|
+
var webTTYControlRequestSchema = z4.object({
|
|
534
|
+
id: z4.string(),
|
|
535
|
+
session_id: z4.string(),
|
|
536
|
+
requester_participant_id: z4.string(),
|
|
537
|
+
requester_user_id: z4.string().optional(),
|
|
538
|
+
approver_participant_id: z4.string().optional(),
|
|
539
|
+
approver_user_id: z4.string().optional(),
|
|
540
|
+
status: webTTYControlRequestStatusSchema,
|
|
541
|
+
reason: z4.string().optional(),
|
|
542
|
+
metadata: z4.unknown().optional(),
|
|
543
|
+
created_at: isoDateTimeSchema2,
|
|
544
|
+
updated_at: isoDateTimeSchema2,
|
|
545
|
+
resolved_at: isoDateTimeSchema2.optional(),
|
|
546
|
+
expires_at: isoDateTimeSchema2.optional()
|
|
547
|
+
}).passthrough();
|
|
548
|
+
var listWebTTYSessionsFiltersSchema = z4.object({
|
|
549
|
+
server_id: z4.string().optional(),
|
|
550
|
+
tunnel_id: z4.string().optional(),
|
|
551
|
+
user_id: z4.string().optional(),
|
|
552
|
+
group_id: z4.string().optional(),
|
|
553
|
+
origin: webTTYOriginSchema.optional(),
|
|
554
|
+
status: webTTYSessionStatusSchema.optional(),
|
|
555
|
+
started_from: isoDateTimeSchema2.optional(),
|
|
556
|
+
started_to: isoDateTimeSchema2.optional()
|
|
557
|
+
});
|
|
558
|
+
var listWebTTYSessionsParamsSchema = z4.object({
|
|
559
|
+
limit: z4.number().int().min(1).optional(),
|
|
560
|
+
filters: listWebTTYSessionsFiltersSchema.optional()
|
|
561
|
+
});
|
|
562
|
+
var listWebTTYSessionGroupsFiltersSchema = z4.object({
|
|
563
|
+
initiator_user_id: z4.string().optional(),
|
|
564
|
+
origin: webTTYOriginSchema.optional(),
|
|
565
|
+
created_from: isoDateTimeSchema2.optional(),
|
|
566
|
+
created_to: isoDateTimeSchema2.optional()
|
|
567
|
+
});
|
|
568
|
+
var listWebTTYSessionGroupsParamsSchema = z4.object({
|
|
569
|
+
limit: z4.number().int().min(1).optional(),
|
|
570
|
+
filters: listWebTTYSessionGroupsFiltersSchema.optional()
|
|
571
|
+
});
|
|
572
|
+
var readWebTTYSessionEventsParamsSchema = z4.object({
|
|
573
|
+
from_seq: webTTYSequenceCursorInputSchema.optional(),
|
|
574
|
+
limit: z4.number().int().min(1).optional()
|
|
575
|
+
});
|
|
576
|
+
var listWebTTYKeyGrantDecryptMaterialParamsSchema = z4.object({
|
|
577
|
+
recipient_id: z4.string().optional(),
|
|
578
|
+
recipient_kind: z4.string().optional()
|
|
579
|
+
});
|
|
580
|
+
var listWebTTYControlRequestsFiltersSchema = z4.object({
|
|
581
|
+
status: webTTYControlRequestStatusSchema.optional(),
|
|
582
|
+
requester_user_id: z4.string().optional()
|
|
583
|
+
});
|
|
584
|
+
var listWebTTYControlRequestsParamsSchema = z4.object({
|
|
585
|
+
limit: z4.number().int().min(1).optional(),
|
|
586
|
+
filters: listWebTTYControlRequestsFiltersSchema.optional()
|
|
587
|
+
});
|
|
588
|
+
var attachWebTTYParticipantParamsSchema = z4.object({
|
|
589
|
+
role: z4.literal("spectator").optional(),
|
|
590
|
+
device_id: z4.string().optional(),
|
|
591
|
+
browser_id: z4.string().optional(),
|
|
592
|
+
transport: webTTYTransportSchema.optional(),
|
|
593
|
+
grant_state: z4.string().optional(),
|
|
594
|
+
metadata: jsonRecordSchema.optional()
|
|
595
|
+
});
|
|
596
|
+
var detachWebTTYParticipantParamsSchema = z4.object({
|
|
597
|
+
reason: z4.string().optional(),
|
|
598
|
+
metadata: jsonRecordSchema.optional()
|
|
599
|
+
});
|
|
600
|
+
var createWebTTYControlRequestParamsSchema = z4.object({
|
|
601
|
+
participant_id: z4.string(),
|
|
602
|
+
reason: z4.string().optional(),
|
|
603
|
+
metadata: jsonRecordSchema.optional(),
|
|
604
|
+
expires_at: isoDateTimeSchema2.optional()
|
|
605
|
+
});
|
|
606
|
+
var resolveWebTTYControlRequestParamsSchema = z4.object({
|
|
607
|
+
action: z4.enum(["grant", "refuse", "revoke"]),
|
|
608
|
+
approver_participant_id: z4.string().optional(),
|
|
609
|
+
reason: z4.string().optional()
|
|
610
|
+
});
|
|
611
|
+
var webTTYSessionListSchema = z4.array(webTTYSessionSchema);
|
|
612
|
+
var webTTYSessionGroupListSchema = z4.array(webTTYSessionGroupSchema);
|
|
613
|
+
var webTTYParticipantListSchema = z4.array(webTTYParticipantSchema);
|
|
614
|
+
var webTTYSessionEventListSchema = z4.array(webTTYSessionEventSchema);
|
|
615
|
+
var webTTYKeyGrantListSchema = z4.array(webTTYKeyGrantSchema);
|
|
616
|
+
var webTTYKeyGrantDecryptMaterialListSchema = z4.array(
|
|
617
|
+
webTTYKeyGrantDecryptMaterialSchema
|
|
618
|
+
);
|
|
619
|
+
var webTTYControlRequestListSchema = z4.array(webTTYControlRequestSchema);
|
|
620
|
+
|
|
621
|
+
// src/event.ts
|
|
622
|
+
var import_tunnel = require("@rstreamlabs/rstream/tunnel");
|
|
623
|
+
var z5 = __toESM(require("zod"));
|
|
624
|
+
var isoDateTimeSchema3 = z5.string().datetime({ offset: true });
|
|
625
|
+
var initialStateSchema = z5.object({
|
|
626
|
+
snapshot_at: isoDateTimeSchema3,
|
|
627
|
+
clients: z5.array(clientSchema),
|
|
628
|
+
tunnels: z5.array(import_tunnel.tunnelSchema)
|
|
629
|
+
});
|
|
630
|
+
var eventBaseSchema = z5.object({
|
|
631
|
+
id: z5.string().optional(),
|
|
632
|
+
created_at: isoDateTimeSchema3.optional(),
|
|
633
|
+
user_id: z5.string().optional(),
|
|
634
|
+
workspace_id: z5.string().optional(),
|
|
635
|
+
project_id: z5.string().optional(),
|
|
636
|
+
cluster_id: z5.string().optional()
|
|
320
637
|
});
|
|
321
|
-
var withEventBase = (shape) =>
|
|
638
|
+
var withEventBase = (shape) => z5.object(shape).merge(eventBaseSchema).passthrough();
|
|
322
639
|
var stateInitialEventSchema = withEventBase({
|
|
323
|
-
type:
|
|
640
|
+
type: z5.literal("state.initial"),
|
|
324
641
|
object: initialStateSchema
|
|
325
642
|
});
|
|
326
643
|
var streamSummaryEventSchema = withEventBase({
|
|
327
|
-
type:
|
|
644
|
+
type: z5.literal("stream.summary"),
|
|
328
645
|
object: streamSummarySchema
|
|
329
646
|
});
|
|
330
647
|
var commonEventsSchema = [
|
|
331
648
|
withEventBase({
|
|
332
|
-
type:
|
|
649
|
+
type: z5.literal("client.created"),
|
|
333
650
|
object: clientSchema
|
|
334
651
|
}),
|
|
335
652
|
withEventBase({
|
|
336
|
-
type:
|
|
653
|
+
type: z5.literal("client.updated"),
|
|
337
654
|
object: clientSchema
|
|
338
655
|
}),
|
|
339
656
|
withEventBase({
|
|
340
|
-
type:
|
|
657
|
+
type: z5.literal("client.deleted"),
|
|
341
658
|
object: clientSchema
|
|
342
659
|
}),
|
|
343
660
|
withEventBase({
|
|
344
|
-
type:
|
|
345
|
-
object:
|
|
661
|
+
type: z5.literal("tunnel.created"),
|
|
662
|
+
object: import_tunnel.tunnelSchema
|
|
346
663
|
}),
|
|
347
664
|
withEventBase({
|
|
348
|
-
type:
|
|
349
|
-
object:
|
|
665
|
+
type: z5.literal("tunnel.updated"),
|
|
666
|
+
object: import_tunnel.tunnelSchema
|
|
350
667
|
}),
|
|
351
668
|
withEventBase({
|
|
352
|
-
type:
|
|
353
|
-
object:
|
|
669
|
+
type: z5.literal("tunnel.deleted"),
|
|
670
|
+
object: import_tunnel.tunnelSchema
|
|
671
|
+
})
|
|
672
|
+
];
|
|
673
|
+
var webTTYEventsSchema = [
|
|
674
|
+
withEventBase({
|
|
675
|
+
type: z5.literal("webtty.session.created"),
|
|
676
|
+
object: webTTYSessionSchema
|
|
677
|
+
}),
|
|
678
|
+
withEventBase({
|
|
679
|
+
type: z5.literal("webtty.session.updated"),
|
|
680
|
+
object: z5.union([webTTYSessionSchema, webTTYSessionGroupSchema])
|
|
681
|
+
}),
|
|
682
|
+
withEventBase({
|
|
683
|
+
type: z5.literal("webtty.session.ended"),
|
|
684
|
+
object: webTTYSessionSchema
|
|
685
|
+
}),
|
|
686
|
+
withEventBase({
|
|
687
|
+
type: z5.literal("webtty.participant.joined"),
|
|
688
|
+
object: webTTYParticipantSchema
|
|
689
|
+
}),
|
|
690
|
+
withEventBase({
|
|
691
|
+
type: z5.literal("webtty.participant.updated"),
|
|
692
|
+
object: webTTYParticipantSchema
|
|
693
|
+
}),
|
|
694
|
+
withEventBase({
|
|
695
|
+
type: z5.literal("webtty.participant.left"),
|
|
696
|
+
object: webTTYParticipantSchema
|
|
697
|
+
}),
|
|
698
|
+
withEventBase({
|
|
699
|
+
type: z5.literal("webtty.control.requested"),
|
|
700
|
+
object: webTTYControlRequestSchema
|
|
701
|
+
}),
|
|
702
|
+
withEventBase({
|
|
703
|
+
type: z5.literal("webtty.control.granted"),
|
|
704
|
+
object: webTTYControlRequestSchema
|
|
705
|
+
}),
|
|
706
|
+
withEventBase({
|
|
707
|
+
type: z5.literal("webtty.control.refused"),
|
|
708
|
+
object: webTTYControlRequestSchema
|
|
709
|
+
}),
|
|
710
|
+
withEventBase({
|
|
711
|
+
type: z5.literal("webtty.control.revoked"),
|
|
712
|
+
object: webTTYControlRequestSchema
|
|
354
713
|
})
|
|
355
714
|
];
|
|
356
715
|
var webhookDeliverableEventsSchema = [
|
|
357
716
|
commonEventsSchema[0],
|
|
358
717
|
commonEventsSchema[2],
|
|
359
718
|
commonEventsSchema[3],
|
|
360
|
-
commonEventsSchema[5]
|
|
719
|
+
commonEventsSchema[5],
|
|
720
|
+
...webTTYEventsSchema
|
|
361
721
|
];
|
|
362
|
-
var wsEventsSchema =
|
|
722
|
+
var wsEventsSchema = z5.union([
|
|
363
723
|
stateInitialEventSchema,
|
|
364
|
-
...commonEventsSchema
|
|
724
|
+
...commonEventsSchema,
|
|
725
|
+
...webTTYEventsSchema
|
|
365
726
|
]);
|
|
366
|
-
var webhookEventsSchema =
|
|
727
|
+
var webhookEventsSchema = z5.union(webhookDeliverableEventsSchema);
|
|
367
728
|
var projectLogEventsSchema = streamSummaryEventSchema;
|
|
368
|
-
var eventSchema =
|
|
729
|
+
var eventSchema = z5.union([
|
|
369
730
|
wsEventsSchema,
|
|
370
731
|
webhookEventsSchema,
|
|
371
732
|
projectLogEventsSchema
|
|
372
733
|
]);
|
|
373
734
|
|
|
735
|
+
// src/tunnel.ts
|
|
736
|
+
var import_tunnel2 = require("@rstreamlabs/rstream/tunnel");
|
|
737
|
+
var z6 = __toESM(require("zod"));
|
|
738
|
+
var tunnelFilterSchema = import_tunnel2.tunnelSchema.pick({
|
|
739
|
+
id: true,
|
|
740
|
+
name: true,
|
|
741
|
+
type: true,
|
|
742
|
+
status: true,
|
|
743
|
+
client_id: true,
|
|
744
|
+
user_id: true,
|
|
745
|
+
publish: true,
|
|
746
|
+
protocol: true,
|
|
747
|
+
hostname: true,
|
|
748
|
+
http_version: true,
|
|
749
|
+
labels: true
|
|
750
|
+
}).partial();
|
|
751
|
+
var listTunnelsParamsSchema = z6.object({
|
|
752
|
+
limit: z6.number().int().min(1).optional(),
|
|
753
|
+
filters: tunnelFilterSchema.optional()
|
|
754
|
+
});
|
|
755
|
+
var listTunnelsResponseSchema = z6.array(import_tunnel2.tunnelSchema);
|
|
756
|
+
|
|
374
757
|
// src/openapi.ts
|
|
375
|
-
var
|
|
758
|
+
var import_tunnel5 = require("@rstreamlabs/rstream/tunnel");
|
|
759
|
+
var z7 = __toESM(require("zod"));
|
|
376
760
|
var jsonContentType = "application/json";
|
|
377
761
|
var openApiContentType = "application/vnd.oai.openapi+json;version=3.1";
|
|
378
762
|
function isRecord(value) {
|
|
@@ -386,10 +770,10 @@ function dropSchemaKeyword(value) {
|
|
|
386
770
|
}
|
|
387
771
|
function jsonSchemaFor(schema) {
|
|
388
772
|
return dropSchemaKeyword(
|
|
389
|
-
|
|
773
|
+
z7.toJSONSchema(schema, {
|
|
390
774
|
unrepresentable: "any",
|
|
391
775
|
override: (ctx) => {
|
|
392
|
-
if (ctx.zodSchema instanceof
|
|
776
|
+
if (ctx.zodSchema instanceof z7.ZodDate) {
|
|
393
777
|
ctx.jsonSchema.type = "string";
|
|
394
778
|
ctx.jsonSchema.format = "date-time";
|
|
395
779
|
}
|
|
@@ -456,7 +840,7 @@ var readEngineStreamsRules = [
|
|
|
456
840
|
action: "read"
|
|
457
841
|
}
|
|
458
842
|
];
|
|
459
|
-
var watchParamsSchema =
|
|
843
|
+
var watchParamsSchema = z7.object({
|
|
460
844
|
clients: clientFilterSchema.optional(),
|
|
461
845
|
tunnels: tunnelFilterSchema.optional()
|
|
462
846
|
});
|
|
@@ -485,6 +869,40 @@ var enginePermissions = {
|
|
|
485
869
|
action: ["create", "delete"]
|
|
486
870
|
}
|
|
487
871
|
]
|
|
872
|
+
},
|
|
873
|
+
"webtty.sessions.read-only": {
|
|
874
|
+
name: "WebTTY Sessions: Read-Only",
|
|
875
|
+
description: "List managed WebTTY sessions, participants, replay state, and join as a spectator.",
|
|
876
|
+
rules: [
|
|
877
|
+
{
|
|
878
|
+
resource: "engine.webtty.sessions",
|
|
879
|
+
action: "read"
|
|
880
|
+
}
|
|
881
|
+
]
|
|
882
|
+
},
|
|
883
|
+
"webtty.sessions.read-write": {
|
|
884
|
+
name: "WebTTY Sessions: Read and Write",
|
|
885
|
+
description: "Create managed WebTTY sessions and coordinate control requests for active sessions.",
|
|
886
|
+
rules: [
|
|
887
|
+
{
|
|
888
|
+
resource: "engine.webtty.sessions",
|
|
889
|
+
action: ["read", "write"]
|
|
890
|
+
}
|
|
891
|
+
]
|
|
892
|
+
},
|
|
893
|
+
"webtty.logs.read-only": {
|
|
894
|
+
name: "WebTTY Session Logs: Read-Only",
|
|
895
|
+
description: "Read managed WebTTY session logs. End-to-end encrypted content still requires trusted local key material.",
|
|
896
|
+
rules: [
|
|
897
|
+
{
|
|
898
|
+
resource: "engine.webtty.sessions",
|
|
899
|
+
action: "read"
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
resource: "engine.webtty.logs",
|
|
903
|
+
action: "read"
|
|
904
|
+
}
|
|
905
|
+
]
|
|
488
906
|
}
|
|
489
907
|
};
|
|
490
908
|
var engineOpenApiDocument = {
|
|
@@ -604,11 +1022,14 @@ var engineOpenApiDocument = {
|
|
|
604
1022
|
"tunnels.resources.read-only",
|
|
605
1023
|
"tunnels.streams.create-delete"
|
|
606
1024
|
],
|
|
607
|
-
"
|
|
1025
|
+
"run-tunnel-webtty": [
|
|
608
1026
|
"tunnels.resources.read-only",
|
|
609
1027
|
"tunnels.tunnels.create-delete",
|
|
610
1028
|
"tunnels.streams.create-delete"
|
|
611
|
-
]
|
|
1029
|
+
],
|
|
1030
|
+
"join-managed-webtty": ["webtty.sessions.read-only"],
|
|
1031
|
+
"control-managed-webtty": ["webtty.sessions.read-write"],
|
|
1032
|
+
"read-managed-webtty-recordings": ["webtty.logs.read-only"]
|
|
612
1033
|
},
|
|
613
1034
|
paths: {
|
|
614
1035
|
"/api/openapi.json": {
|
package/dist/openapi.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rstreamlabs/tunnels",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.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": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"typescript-config": "*"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@rstreamlabs/rstream": "3.
|
|
50
|
+
"@rstreamlabs/rstream": "3.3.0",
|
|
51
51
|
"@types/jsonwebtoken": "^9.0.10",
|
|
52
52
|
"jsonwebtoken": "^9.0.3",
|
|
53
53
|
"zod": "^4.3.6"
|