@rstreamlabs/tunnels 3.10.2 → 4.0.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/dist/openapi.js CHANGED
@@ -37,25 +37,10 @@ module.exports = __toCommonJS(openapi_exports);
37
37
 
38
38
  // src/client.ts
39
39
  var z = __toESM(require("zod"));
40
- var clientSchema = z.object({
41
- id: z.string(),
42
- status: z.enum(["online", "offline"]),
43
- user_id: z.string().optional(),
44
- workspace_id: z.string().optional(),
45
- project_id: z.string().optional(),
46
- cluster_id: z.string().optional(),
47
- plan: z.string().optional(),
48
- provider: z.string().optional(),
49
- region: z.string().optional(),
50
- agent: z.string().optional(),
51
- channel: z.string().optional(),
52
- version: z.string().optional(),
53
- os: z.string().optional(),
54
- arch: z.string().optional(),
55
- protocol_version: z.string().optional(),
56
- labels: z.record(z.string(), z.string()).optional()
57
- });
58
- var clientFilterSchema = clientSchema.pick({
40
+ var import_client = require("@rstreamlabs/rstream/client");
41
+ var import_client2 = require("@rstreamlabs/rstream/client");
42
+ var listedClientSchema = import_client.clientSchema.partial();
43
+ var clientFilterSchema = import_client.clientSchema.pick({
59
44
  id: true,
60
45
  status: true,
61
46
  user_id: true,
@@ -71,22 +56,45 @@ var listClientsParamsSchema = z.object({
71
56
  limit: z.number().int().min(1).optional(),
72
57
  filters: clientFilterSchema.optional()
73
58
  });
74
- var listClientsResponseSchema = z.array(clientSchema);
59
+ var listClientsResponseSchema = z.array(listedClientSchema);
75
60
 
76
- // src/webtty-schemas.ts
61
+ // src/tunnel.ts
62
+ var import_tunnel = require("@rstreamlabs/rstream/tunnel");
77
63
  var z2 = __toESM(require("zod"));
78
- var webTTYTransportSchema = z2.enum([
64
+ var tunnelFilterSchema = import_tunnel.tunnelSchema.pick({
65
+ id: true,
66
+ name: true,
67
+ type: true,
68
+ status: true,
69
+ client_id: true,
70
+ user_id: true,
71
+ publish: true,
72
+ protocol: true,
73
+ hostname: true,
74
+ http_version: true,
75
+ labels: true
76
+ }).partial();
77
+ var listTunnelsParamsSchema = z2.object({
78
+ limit: z2.number().int().min(1).optional(),
79
+ filters: tunnelFilterSchema.optional()
80
+ });
81
+ var listedTunnelSchema = import_tunnel.tunnelSchema.partial();
82
+ var listTunnelsResponseSchema = z2.array(listedTunnelSchema);
83
+
84
+ // src/webtty-schemas.ts
85
+ var z3 = __toESM(require("zod"));
86
+ var webTTYTransportSchema = z3.enum([
79
87
  "plain",
80
88
  "websocket",
81
89
  "webtransport"
82
90
  ]);
83
- var webTTYRecordingModeSchema = z2.enum(["recorded", "private"]);
84
- var webTTYEncryptionModeSchema = z2.enum(["managed", "e2e"]);
85
- var webTTYSessionModeSchema = z2.enum([
91
+ var webTTYRecordingModeSchema = z3.enum(["recorded", "private"]);
92
+ var webTTYEncryptionModeSchema = z3.enum(["managed", "e2e"]);
93
+ var webTTYSessionModeSchema = z3.enum([
86
94
  "interactive",
87
95
  "non-interactive"
88
96
  ]);
89
- var webTTYOriginSchema = z2.enum([
97
+ var webTTYOriginSchema = z3.enum([
90
98
  "human",
91
99
  "codex",
92
100
  "api",
@@ -94,259 +102,260 @@ var webTTYOriginSchema = z2.enum([
94
102
  "ci",
95
103
  "scheduled-job"
96
104
  ]);
97
- var webTTYParticipantRoleSchema = z2.enum(["controller", "spectator"]);
98
- var webTTYInitiatorKindSchema = z2.enum([
105
+ var webTTYParticipantRoleSchema = z3.enum(["controller", "spectator"]);
106
+ var webTTYInitiatorKindSchema = z3.enum([
99
107
  "user",
100
108
  "app",
101
109
  "agent",
102
110
  "service-account"
103
111
  ]);
104
- var webTTYContextMetadataSchema = z2.object({
112
+ var webTTYContextMetadataSchema = z3.object({
105
113
  origin: webTTYOriginSchema.optional(),
106
- origin_id: z2.string().optional(),
107
- purpose: z2.string().optional(),
114
+ origin_id: z3.string().optional(),
115
+ purpose: z3.string().optional(),
108
116
  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()
117
+ agent_name: z3.string().optional(),
118
+ agent_version: z3.string().optional(),
119
+ request_id: z3.string().optional(),
120
+ labels: z3.record(z3.string(), z3.string()).optional(),
121
+ execution_deadline: z3.string().datetime({ offset: true }).optional()
113
122
  }).passthrough();
114
123
 
115
124
  // src/stream.ts
116
- var z3 = __toESM(require("zod"));
117
- var nonEmptyStringSchema = z3.string().min(1);
118
- var isoDateTimeSchema = z3.string().datetime({ offset: true });
119
- var ipAddressSchema = z3.string();
120
- var intNonNegSchema = z3.number().int().nonnegative();
121
- var numNonNegSchema = z3.number().nonnegative();
122
- var geolocationSchema = z3.object({
123
- country: z3.string().optional(),
124
- region: z3.string().optional()
125
+ var z4 = __toESM(require("zod"));
126
+ var nonEmptyStringSchema = z4.string().min(1);
127
+ var isoDateTimeSchema = z4.string().datetime({ offset: true });
128
+ var ipAddressSchema = z4.string();
129
+ var intNonNegSchema = z4.number().int().nonnegative();
130
+ var numNonNegSchema = z4.number().nonnegative();
131
+ var geolocationSchema = z4.object({
132
+ country: z4.string().optional(),
133
+ region: z4.string().optional()
125
134
  });
126
- var streamTLSInfoSchema = z3.object({
127
- version: z3.string().min(1).optional(),
128
- cipher: z3.string().min(1).optional(),
129
- protocol: z3.string().min(1).optional(),
130
- curve: z3.string().min(1).optional(),
131
- ech: z3.boolean().optional()
135
+ var streamTLSInfoSchema = z4.object({
136
+ version: z4.string().min(1).optional(),
137
+ cipher: z4.string().min(1).optional(),
138
+ protocol: z4.string().min(1).optional(),
139
+ curve: z4.string().min(1).optional(),
140
+ ech: z4.boolean().optional()
132
141
  });
133
- var streamEndpointSchema = z3.object({
142
+ var streamEndpointSchema = z4.object({
134
143
  ip: ipAddressSchema.optional(),
135
144
  geolocation: geolocationSchema.optional(),
136
145
  tls: streamTLSInfoSchema.optional()
137
146
  });
138
- var httpHeadersSchema = z3.record(
139
- z3.string(),
140
- z3.union([z3.string(), z3.array(z3.string())])
147
+ var httpHeadersSchema = z4.record(
148
+ z4.string(),
149
+ z4.union([z4.string(), z4.array(z4.string())])
141
150
  );
142
- var httpProtocolSchema = z3.enum(["http/1.1", "h2", "h2c", "h3"]);
143
- var httpRequestSchema = z3.object({
151
+ var httpProtocolSchema = z4.enum(["http/1.1", "h2", "h2c", "h3"]);
152
+ var httpRequestSchema = z4.object({
144
153
  method: nonEmptyStringSchema,
145
- scheme: z3.string().min(1).optional(),
154
+ scheme: z4.string().min(1).optional(),
146
155
  host: nonEmptyStringSchema.optional(),
147
156
  path: nonEmptyStringSchema.optional(),
148
- query: z3.string().optional(),
157
+ query: z4.string().optional(),
149
158
  url: nonEmptyStringSchema.optional(),
150
159
  headers: httpHeadersSchema.optional(),
151
- userAgent: z3.string().optional()
160
+ userAgent: z4.string().optional()
152
161
  });
153
- var httpResponseSchema = z3.object({
154
- status: z3.number().int().min(100).max(999),
162
+ var httpResponseSchema = z4.object({
163
+ status: z4.number().int().min(100).max(999),
155
164
  headers: httpHeadersSchema.optional()
156
165
  });
157
- var httpRequestStageSchema = z3.object({
166
+ var httpRequestStageSchema = z4.object({
158
167
  protocol: httpProtocolSchema.optional(),
159
168
  request: httpRequestSchema
160
169
  });
161
- var httpResponseStageSchema = z3.object({
170
+ var httpResponseStageSchema = z4.object({
162
171
  protocol: httpProtocolSchema.optional(),
163
172
  response: httpResponseSchema
164
173
  });
165
- var streamEntrySchema = z3.object({
166
- kind: z3.enum([
174
+ var streamEntrySchema = z4.object({
175
+ kind: z4.enum([
167
176
  "published_tunnel",
168
177
  "private_rstream",
169
178
  "proxy_egress",
170
179
  "internal"
171
180
  ]),
172
- transport: z3.enum(["rstream", "tls", "quic", "dtls", "http", "tcp"]).optional()
181
+ transport: z4.enum(["rstream", "tls", "quic", "dtls", "http", "tcp"]).optional()
173
182
  });
174
- var tokenSourceSchema = z3.enum([
183
+ var tokenSourceSchema = z4.enum([
175
184
  "authorization",
176
185
  "query",
177
186
  "client",
178
187
  "unknown"
179
188
  ]);
180
- var tokenTypeSchema = z3.enum(["auth", "pat", "app", "unknown"]);
181
- var firewallRuleSchema = z3.discriminatedUnion("kind", [
182
- z3.object({ kind: z3.literal("none") }),
183
- z3.object({ kind: z3.literal("mtls") }),
184
- z3.object({
185
- kind: z3.literal("rstream_auth"),
186
- source: z3.literal("rstream_auth")
189
+ var tokenTypeSchema = z4.enum(["auth", "pat", "app", "unknown"]);
190
+ var firewallRuleSchema = z4.discriminatedUnion("kind", [
191
+ z4.object({ kind: z4.literal("none") }),
192
+ z4.object({ kind: z4.literal("mtls") }),
193
+ z4.object({
194
+ kind: z4.literal("rstream_auth"),
195
+ source: z4.literal("rstream_auth")
187
196
  }),
188
- z3.object({
189
- kind: z3.literal("rstream"),
190
- source: z3.literal("private_rstream").optional()
197
+ z4.object({
198
+ kind: z4.literal("rstream"),
199
+ source: z4.literal("private_rstream").optional()
191
200
  }),
192
- z3.object({
193
- kind: z3.literal("token"),
201
+ z4.object({
202
+ kind: z4.literal("token"),
194
203
  source: tokenSourceSchema.optional(),
195
204
  tokenType: tokenTypeSchema.optional()
196
205
  })
197
206
  ]);
198
- var unauthorizedSourceSchema = z3.object({
207
+ var unauthorizedSourceSchema = z4.object({
199
208
  source: tokenSourceSchema
200
209
  });
201
- var unauthorizedReasonSchema = (shape) => z3.object(shape).merge(unauthorizedSourceSchema);
202
- var unauthorizedSchema = z3.discriminatedUnion("reason", [
210
+ var unauthorizedReasonSchema = (shape) => z4.object(shape).merge(unauthorizedSourceSchema);
211
+ var unauthorizedSchema = z4.discriminatedUnion("reason", [
203
212
  unauthorizedReasonSchema({
204
- reason: z3.literal("missing_token")
213
+ reason: z4.literal("missing_token")
205
214
  }),
206
215
  unauthorizedReasonSchema({
207
- reason: z3.literal("invalid_token")
216
+ reason: z4.literal("invalid_token")
208
217
  }),
209
218
  unauthorizedReasonSchema({
210
- reason: z3.literal("expired_token")
219
+ reason: z4.literal("expired_token")
211
220
  }),
212
221
  unauthorizedReasonSchema({
213
- reason: z3.literal("invalid_secret")
222
+ reason: z4.literal("invalid_secret")
214
223
  }),
215
224
  unauthorizedReasonSchema({
216
- reason: z3.literal("user_mismatch")
225
+ reason: z4.literal("user_mismatch")
217
226
  }),
218
227
  unauthorizedReasonSchema({
219
- reason: z3.literal("insufficient_scope")
228
+ reason: z4.literal("insufficient_scope")
220
229
  }),
221
230
  unauthorizedReasonSchema({
222
- reason: z3.literal("policy_denied"),
223
- policy: z3.enum(["ip", "geo", "mtls", "challenge", "other"]),
224
- value: z3.string().optional()
231
+ reason: z4.literal("policy_denied"),
232
+ policy: z4.enum(["ip", "geo", "mtls", "challenge", "other"]),
233
+ value: z4.string().optional()
225
234
  })
226
235
  ]);
227
- var failureSchema = z3.discriminatedUnion("kind", [
228
- z3.object({
229
- kind: z3.literal("timeout"),
236
+ var failureSchema = z4.discriminatedUnion("kind", [
237
+ z4.object({
238
+ kind: z4.literal("timeout"),
230
239
  timeoutMs: intNonNegSchema.optional(),
231
- message: z3.string().optional()
240
+ message: z4.string().optional()
232
241
  }),
233
- z3.object({
234
- kind: z3.literal("unauthorized"),
242
+ z4.object({
243
+ kind: z4.literal("unauthorized"),
235
244
  why: unauthorizedSchema,
236
- message: z3.string().optional()
245
+ message: z4.string().optional()
237
246
  }),
238
- z3.object({
239
- kind: z3.literal("not_found"),
240
- resource: z3.enum(["tunnel", "client", "route"]),
241
- message: z3.string().optional()
247
+ z4.object({
248
+ kind: z4.literal("not_found"),
249
+ resource: z4.enum(["tunnel", "client", "route"]),
250
+ message: z4.string().optional()
242
251
  }),
243
- z3.object({
244
- kind: z3.literal("refused"),
245
- reason: z3.enum(["capacity", "policy", "unsupported", "other"]),
246
- message: z3.string().optional()
252
+ z4.object({
253
+ kind: z4.literal("refused"),
254
+ reason: z4.enum(["capacity", "policy", "unsupported", "other"]),
255
+ message: z4.string().optional()
247
256
  }),
248
- z3.object({ kind: z3.literal("io"), message: z3.string().optional() }),
249
- z3.object({ kind: z3.literal("internal"), message: z3.string().optional() })
257
+ z4.object({ kind: z4.literal("io"), message: z4.string().optional() }),
258
+ z4.object({ kind: z4.literal("internal"), message: z4.string().optional() })
250
259
  ]);
251
- var firewallSchema = z3.discriminatedUnion("decision", [
252
- z3.object({ decision: z3.literal("allowed"), rule: firewallRuleSchema }),
253
- z3.object({
254
- decision: z3.literal("denied"),
260
+ var firewallSchema = z4.discriminatedUnion("decision", [
261
+ z4.object({ decision: z4.literal("allowed"), rule: firewallRuleSchema }),
262
+ z4.object({
263
+ decision: z4.literal("denied"),
255
264
  rule: firewallRuleSchema,
256
265
  failure: failureSchema
257
266
  })
258
267
  ]);
259
- var routedTunnelSchema = z3.object({
268
+ var routedTunnelSchema = z4.object({
260
269
  tunnelId: nonEmptyStringSchema.optional(),
261
- tunnelName: z3.string().optional(),
262
- hostname: z3.string().optional(),
263
- protocol: z3.string().optional(),
264
- published: z3.boolean().optional(),
265
- type: z3.string().optional(),
266
- tlsMode: z3.string().optional(),
267
- httpVersion: z3.string().optional(),
268
- httpUseTls: z3.boolean().optional(),
269
- upstreamTls: z3.boolean().optional(),
270
- tokenAuth: z3.boolean().optional(),
271
- mtls_auth: z3.boolean().optional()
270
+ tunnelName: z4.string().optional(),
271
+ hostname: z4.string().optional(),
272
+ protocol: z4.string().optional(),
273
+ published: z4.boolean().optional(),
274
+ type: z4.string().optional(),
275
+ tlsMode: z4.string().optional(),
276
+ httpVersion: z4.string().optional(),
277
+ httpUseTls: z4.boolean().optional(),
278
+ upstreamTls: z4.boolean().optional(),
279
+ tokenAuth: z4.boolean().optional(),
280
+ mtls_auth: z4.boolean().optional()
272
281
  });
273
- var routingNodeSchema = z3.object({
282
+ var routingNodeSchema = z4.object({
274
283
  engineId: nonEmptyStringSchema,
275
284
  region: nonEmptyStringSchema,
276
285
  generation: nonEmptyStringSchema.optional()
277
286
  });
278
- var routingPathSchema = z3.object({
279
- mode: z3.enum(["direct", "cross_region"]),
280
- crossRegionRoutingAllowed: z3.boolean(),
287
+ var routingPathSchema = z4.object({
288
+ mode: z4.enum(["direct", "cross_region"]),
289
+ crossRegionRoutingAllowed: z4.boolean(),
281
290
  ingress: routingNodeSchema,
282
291
  owner: routingNodeSchema,
283
292
  anchor: routingNodeSchema
284
293
  });
285
- var routingSchema = z3.discriminatedUnion("decision", [
286
- z3.object({
287
- decision: z3.literal("routed"),
294
+ var routingSchema = z4.discriminatedUnion("decision", [
295
+ z4.object({
296
+ decision: z4.literal("routed"),
288
297
  tunnel: routedTunnelSchema,
289
298
  path: routingPathSchema.optional()
290
299
  }),
291
- z3.object({ decision: z3.literal("not_routed"), failure: failureSchema })
300
+ z4.object({ decision: z4.literal("not_routed"), failure: failureSchema })
292
301
  ]);
293
- var streamConnectedMetricsSchema = z3.object({
302
+ var streamConnectedMetricsSchema = z4.object({
294
303
  establish_ms: numNonNegSchema,
295
304
  duration_ms: numNonNegSchema,
296
305
  upstream_bytes: intNonNegSchema,
297
306
  downstream_bytes: intNonNegSchema
298
307
  });
299
- var streamFailedMetricsSchema = z3.object({
308
+ var streamFailedMetricsSchema = z4.object({
300
309
  time_to_fail_ms: numNonNegSchema.optional(),
301
310
  establish_ms: numNonNegSchema.optional()
302
311
  });
303
- var terminationSchema = z3.object({
304
- by: z3.enum(["downstream", "upstream", "server", "unknown"]),
305
- reason: z3.enum(["closed", "reset", "timeout", "error", "unknown"]),
306
- message: z3.string().optional()
312
+ var terminationSchema = z4.object({
313
+ by: z4.enum(["downstream", "upstream", "server", "unknown"]),
314
+ reason: z4.enum(["closed", "reset", "timeout", "error", "unknown"]),
315
+ message: z4.string().optional()
307
316
  });
308
- var responseConnectedSchema = z3.object({
309
- outcome: z3.literal("connected"),
317
+ var responseConnectedSchema = z4.object({
318
+ outcome: z4.literal("connected"),
310
319
  established_at: isoDateTimeSchema,
311
320
  upstream: streamEndpointSchema.optional(),
312
321
  metrics: streamConnectedMetricsSchema,
313
322
  termination: terminationSchema.optional(),
314
323
  http: httpResponseStageSchema.optional()
315
324
  });
316
- var responseFailedSchema = z3.object({
317
- outcome: z3.literal("failed"),
325
+ var responseFailedSchema = z4.object({
326
+ outcome: z4.literal("failed"),
318
327
  failure: failureSchema,
319
328
  upstream: streamEndpointSchema.optional(),
320
329
  metrics: streamFailedMetricsSchema.optional(),
321
330
  termination: terminationSchema.optional(),
322
331
  http: httpResponseStageSchema.optional()
323
332
  });
324
- var responseSchema = z3.discriminatedUnion("outcome", [
333
+ var responseSchema = z4.discriminatedUnion("outcome", [
325
334
  responseConnectedSchema,
326
335
  responseFailedSchema
327
336
  ]);
328
- var streamWebTTYMetadataSchema = z3.object({
337
+ var streamWebTTYMetadataSchema = z4.object({
329
338
  server_id: nonEmptyStringSchema.optional(),
330
339
  session_id: nonEmptyStringSchema.optional(),
331
340
  session_group_id: nonEmptyStringSchema.optional(),
332
341
  participant_id: nonEmptyStringSchema.optional(),
333
342
  participant_role: webTTYParticipantRoleSchema.optional(),
334
- controller: z3.boolean().optional(),
343
+ controller: z4.boolean().optional(),
335
344
  recording_mode: webTTYRecordingModeSchema.optional(),
336
345
  encryption_mode: webTTYEncryptionModeSchema.optional(),
337
- encryption_policy: z3.enum(["disabled", "explicit_key", "workspace_managed"]).optional(),
338
- e2e: z3.boolean().optional(),
339
- client_proof: z3.enum(["none", "required"]).optional(),
346
+ encryption_policy: z4.enum(["disabled", "explicit_key", "workspace_managed"]).optional(),
347
+ e2e: z4.boolean().optional(),
348
+ client_proof: z4.enum(["none", "required"]).optional(),
340
349
  session_mode: webTTYSessionModeSchema.optional(),
341
350
  downstream_transport: webTTYTransportSchema.optional(),
342
351
  upstream_transport: webTTYTransportSchema.optional(),
343
352
  origin: webTTYOriginSchema.optional(),
344
- origin_id: z3.string().optional(),
353
+ origin_id: z4.string().optional(),
345
354
  initiator_kind: webTTYInitiatorKindSchema.optional(),
346
- device_id: z3.string().optional(),
347
- browser_id: z3.string().optional()
355
+ device_id: z4.string().optional(),
356
+ browser_id: z4.string().optional()
348
357
  }).passthrough();
349
- var streamSummarySchema = z3.object({
358
+ var streamSummarySchema = z4.object({
350
359
  workspace_id: nonEmptyStringSchema.optional(),
351
360
  project_id: nonEmptyStringSchema.optional(),
352
361
  cluster_id: nonEmptyStringSchema.optional(),
@@ -356,7 +365,7 @@ var streamSummarySchema = z3.object({
356
365
  stream_id: nonEmptyStringSchema,
357
366
  created_at: isoDateTimeSchema,
358
367
  terminated_at: isoDateTimeSchema,
359
- request: z3.object({
368
+ request: z4.object({
360
369
  downstream: streamEndpointSchema,
361
370
  entry: streamEntrySchema.optional(),
362
371
  http: httpRequestStageSchema.optional()
@@ -368,34 +377,34 @@ var streamSummarySchema = z3.object({
368
377
  });
369
378
 
370
379
  // src/webtty-resource.ts
371
- var z4 = __toESM(require("zod"));
372
- var isoDateTimeSchema2 = z4.string().datetime({ offset: true });
373
- var decimalCursorSchema = z4.string().regex(/^\d+$/);
374
- var webTTYSequenceCursorInputSchema = z4.union([
380
+ var z5 = __toESM(require("zod"));
381
+ var isoDateTimeSchema2 = z5.string().datetime({ offset: true });
382
+ var decimalCursorSchema = z5.string().regex(/^\d+$/);
383
+ var webTTYSequenceCursorInputSchema = z5.union([
375
384
  decimalCursorSchema,
376
- z4.number().int().nonnegative().safe().transform(String)
385
+ z5.number().int().nonnegative().safe().transform(String)
377
386
  ]);
378
- var webTTYSessionStatusSchema = z4.enum([
387
+ var webTTYSessionStatusSchema = z5.enum([
379
388
  "opening",
380
389
  "active",
381
390
  "closing",
382
391
  "closed",
383
392
  "errored"
384
393
  ]);
385
- var webTTYControlRequestStatusSchema = z4.enum([
394
+ var webTTYControlRequestStatusSchema = z5.enum([
386
395
  "pending",
387
396
  "granted",
388
397
  "refused",
389
398
  "revoked",
390
399
  "expired"
391
400
  ]);
392
- var webTTYEventDirectionSchema = z4.enum([
401
+ var webTTYEventDirectionSchema = z5.enum([
393
402
  "client_to_server",
394
403
  "server_to_client",
395
404
  "engine_internal"
396
405
  ]);
397
- var webTTYStreamTypeSchema = z4.enum(["stdin", "stdout", "stderr"]);
398
- var webTTYSessionEventTypeSchema = z4.enum([
406
+ var webTTYStreamTypeSchema = z5.enum(["stdin", "stdout", "stderr"]);
407
+ var webTTYSessionEventTypeSchema = z5.enum([
399
408
  "open",
400
409
  "ack",
401
410
  "data",
@@ -406,372 +415,379 @@ var webTTYSessionEventTypeSchema = z4.enum([
406
415
  "control",
407
416
  "recording_state"
408
417
  ]);
409
- var jsonRecordSchema = z4.record(z4.string(), z4.unknown());
418
+ var jsonRecordSchema = z5.record(z5.string(), z5.unknown());
410
419
  function rejectCryptoKeyEnvelopes(crypto, ctx, path) {
411
420
  if (crypto === null || typeof crypto !== "object") {
412
421
  return;
413
422
  }
414
423
  if (Object.prototype.hasOwnProperty.call(crypto, "key_envelopes")) {
415
424
  ctx.addIssue({
416
- code: z4.ZodIssueCode.custom,
425
+ code: z5.ZodIssueCode.custom,
417
426
  message: "key_envelopes are available only from the WebTTY decrypt-material endpoint.",
418
427
  path: [...path, "key_envelopes"]
419
428
  });
420
429
  }
421
430
  }
422
- var webTTYCapabilitiesSchema = z4.object({
423
- managed_protocol: z4.boolean(),
424
- store_configured: z4.boolean(),
425
- session_listing: z4.boolean(),
426
- recording: z4.boolean(),
427
- replay: z4.boolean(),
428
- live_attach: z4.boolean(),
429
- control_transfer: z4.boolean(),
430
- e2e: z4.boolean(),
431
- implemented_transports: z4.array(webTTYTransportSchema),
432
- recording_modes: z4.array(webTTYRecordingModeSchema),
433
- encryption_modes: z4.array(webTTYEncryptionModeSchema),
434
- required_permissions: z4.record(z4.string(), z4.array(z4.string()))
431
+ var webTTYCapabilitiesSchema = z5.object({
432
+ managed_protocol: z5.boolean(),
433
+ store_configured: z5.boolean(),
434
+ session_listing: z5.boolean(),
435
+ recording: z5.boolean(),
436
+ replay: z5.boolean(),
437
+ live_attach: z5.boolean(),
438
+ control_transfer: z5.boolean(),
439
+ detached_execution: z5.boolean().default(false),
440
+ explicit_termination: z5.boolean().default(false),
441
+ execution_transports: z5.array(webTTYTransportSchema).default([]),
442
+ max_execution_seconds: z5.number().int().positive().optional(),
443
+ e2e: z5.boolean(),
444
+ implemented_transports: z5.array(webTTYTransportSchema),
445
+ recording_modes: z5.array(webTTYRecordingModeSchema),
446
+ encryption_modes: z5.array(webTTYEncryptionModeSchema),
447
+ required_permissions: z5.record(z5.string(), z5.array(z5.string()))
435
448
  });
436
- var webTTYSessionLiveSchema = z4.object({
437
- available: z4.boolean(),
438
- attachable: z4.boolean(),
439
- participant_count: z4.number().int().nonnegative(),
440
- controller_participant_id: z4.string().optional(),
441
- has_upstream: z4.boolean()
449
+ var webTTYSessionLiveSchema = z5.object({
450
+ available: z5.boolean(),
451
+ attachable: z5.boolean(),
452
+ participant_count: z5.number().int().nonnegative(),
453
+ controller_participant_id: z5.string().optional(),
454
+ has_upstream: z5.boolean()
442
455
  });
443
- var webTTYParticipantLiveSchema = z4.object({
444
- connected: z4.boolean(),
445
- controller: z4.boolean()
456
+ var webTTYParticipantLiveSchema = z5.object({
457
+ connected: z5.boolean(),
458
+ controller: z5.boolean()
446
459
  });
447
- var webTTYSessionSchema = z4.object({
448
- id: z4.string(),
449
- workspace_id: z4.string().optional(),
450
- project_id: z4.string().optional(),
451
- cluster_id: z4.string().optional(),
452
- server_id: z4.string().optional(),
453
- tunnel_id: z4.string(),
454
- client_id: z4.string().optional(),
455
- initiator_user_id: z4.string().optional(),
456
- group_id: z4.string().optional(),
460
+ var webTTYSessionSchema = z5.object({
461
+ id: z5.string(),
462
+ workspace_id: z5.string().optional(),
463
+ project_id: z5.string().optional(),
464
+ cluster_id: z5.string().optional(),
465
+ server_id: z5.string().optional(),
466
+ tunnel_id: z5.string(),
467
+ client_id: z5.string().optional(),
468
+ initiator_user_id: z5.string().optional(),
469
+ group_id: z5.string().optional(),
457
470
  status: webTTYSessionStatusSchema,
458
471
  session_mode: webTTYSessionModeSchema,
459
472
  recording_mode: webTTYRecordingModeSchema,
460
473
  encryption_mode: webTTYEncryptionModeSchema,
461
474
  downstream_transport: webTTYTransportSchema.optional(),
462
475
  upstream_transport: webTTYTransportSchema.optional(),
463
- command_meta: z4.unknown().optional(),
476
+ command_meta: z5.unknown().optional(),
464
477
  context: webTTYContextMetadataSchema.optional(),
465
478
  started_at: isoDateTimeSchema2,
466
479
  ended_at: isoDateTimeSchema2.optional(),
467
- exit_code: z4.number().int().optional(),
468
- error_code: z4.string().optional(),
469
- error_message: z4.string().optional(),
480
+ exit_code: z5.number().int().optional(),
481
+ error_code: z5.string().optional(),
482
+ error_message: z5.string().optional(),
470
483
  live: webTTYSessionLiveSchema.optional()
471
484
  }).passthrough();
472
- var webTTYSessionGroupSchema = z4.object({
473
- id: z4.string(),
474
- workspace_id: z4.string().optional(),
475
- project_id: z4.string().optional(),
476
- initiator_user_id: z4.string().optional(),
485
+ var webTTYSessionGroupSchema = z5.object({
486
+ id: z5.string(),
487
+ workspace_id: z5.string().optional(),
488
+ project_id: z5.string().optional(),
489
+ initiator_user_id: z5.string().optional(),
477
490
  context: webTTYContextMetadataSchema.optional(),
478
491
  created_at: isoDateTimeSchema2,
479
492
  updated_at: isoDateTimeSchema2,
480
493
  closed_at: isoDateTimeSchema2.optional()
481
494
  }).passthrough();
482
- var webTTYParticipantSchema = z4.object({
483
- id: z4.string(),
484
- session_id: z4.string(),
485
- user_id: z4.string().optional(),
486
- device_id: z4.string().optional(),
487
- browser_id: z4.string().optional(),
495
+ var webTTYParticipantSchema = z5.object({
496
+ id: z5.string(),
497
+ session_id: z5.string(),
498
+ user_id: z5.string().optional(),
499
+ device_id: z5.string().optional(),
500
+ browser_id: z5.string().optional(),
488
501
  role: webTTYParticipantRoleSchema,
489
502
  attached_at: isoDateTimeSchema2,
490
503
  detached_at: isoDateTimeSchema2.optional(),
491
- controller: z4.boolean(),
492
- grant_state: z4.string().optional(),
493
- attach_grant: z4.string().optional(),
504
+ controller: z5.boolean(),
505
+ grant_state: z5.string().optional(),
506
+ attach_grant: z5.string().optional(),
494
507
  attach_grant_expires_at: isoDateTimeSchema2.optional(),
495
508
  live: webTTYParticipantLiveSchema.optional()
496
509
  }).passthrough();
497
- var webTTYCryptoMetadataSchema = z4.object({
498
- payload_suite: z4.string().optional(),
499
- payload_key_id: z4.string().optional(),
500
- nonce: z4.string().optional(),
501
- key_envelope_suite: z4.string().optional(),
502
- key_envelopes: z4.unknown().optional(),
503
- key_context: z4.unknown().optional(),
504
- key_context_raw: z4.string().optional()
510
+ var webTTYCryptoMetadataSchema = z5.object({
511
+ payload_suite: z5.string().optional(),
512
+ payload_key_id: z5.string().optional(),
513
+ nonce: z5.string().optional(),
514
+ key_envelope_suite: z5.string().optional(),
515
+ key_envelopes: z5.unknown().optional(),
516
+ key_context: z5.unknown().optional(),
517
+ key_context_raw: z5.string().optional()
505
518
  }).passthrough();
506
- var webTTYSessionEventSchema = z4.object({
507
- id: z4.string(),
508
- session_id: z4.string(),
519
+ var webTTYSessionEventSchema = z5.object({
520
+ id: z5.string(),
521
+ session_id: z5.string(),
509
522
  seq: decimalCursorSchema,
510
523
  created_at: isoDateTimeSchema2,
511
524
  type: webTTYSessionEventTypeSchema,
512
525
  direction: webTTYEventDirectionSchema.optional(),
513
526
  stream_type: webTTYStreamTypeSchema.optional(),
514
- participant_id: z4.string().optional(),
515
- payload_length: z4.number().int().nonnegative().optional(),
516
- payload_ciphertext: z4.string().optional(),
517
- payload_plaintext: z4.string().optional(),
527
+ participant_id: z5.string().optional(),
528
+ payload_length: z5.number().int().nonnegative().optional(),
529
+ payload_ciphertext: z5.string().optional(),
530
+ payload_plaintext: z5.string().optional(),
518
531
  crypto: webTTYCryptoMetadataSchema.optional(),
519
- prev_hash: z4.string().optional(),
520
- hash: z4.string().optional(),
521
- metadata: z4.unknown().optional()
532
+ prev_hash: z5.string().optional(),
533
+ hash: z5.string().optional(),
534
+ metadata: z5.unknown().optional()
522
535
  }).passthrough().superRefine((value, ctx) => {
523
536
  rejectCryptoKeyEnvelopes(value.crypto, ctx, ["crypto"]);
524
537
  });
525
538
  var webTTYKeyGrantBaseShape = {
526
- id: z4.string(),
527
- session_id: z4.string(),
528
- recipient_id: z4.string(),
529
- recipient_kind: z4.string(),
530
- granted_by: z4.string().optional(),
539
+ id: z5.string(),
540
+ session_id: z5.string(),
541
+ recipient_id: z5.string(),
542
+ recipient_kind: z5.string(),
543
+ granted_by: z5.string().optional(),
531
544
  crypto: webTTYCryptoMetadataSchema,
532
545
  created_at: isoDateTimeSchema2,
533
546
  revoked_at: isoDateTimeSchema2.optional()
534
547
  };
535
- var webTTYKeyGrantSchema = z4.object(webTTYKeyGrantBaseShape).passthrough().superRefine((value, ctx) => {
548
+ var webTTYKeyGrantSchema = z5.object(webTTYKeyGrantBaseShape).passthrough().superRefine((value, ctx) => {
536
549
  if (Object.prototype.hasOwnProperty.call(value, "wrapped_key")) {
537
550
  ctx.addIssue({
538
- code: z4.ZodIssueCode.custom,
551
+ code: z5.ZodIssueCode.custom,
539
552
  message: "wrapped_key is available only from the WebTTY decrypt-material endpoint.",
540
553
  path: ["wrapped_key"]
541
554
  });
542
555
  }
543
556
  rejectCryptoKeyEnvelopes(value.crypto, ctx, ["crypto"]);
544
557
  });
545
- var webTTYKeyGrantDecryptMaterialSchema = z4.object({
558
+ var webTTYKeyGrantDecryptMaterialSchema = z5.object({
546
559
  ...webTTYKeyGrantBaseShape,
547
- wrapped_key: z4.string().optional()
560
+ wrapped_key: z5.string().optional()
548
561
  }).passthrough();
549
- var webTTYControlRequestSchema = z4.object({
550
- id: z4.string(),
551
- session_id: z4.string(),
552
- requester_participant_id: z4.string(),
553
- requester_user_id: z4.string().optional(),
554
- approver_participant_id: z4.string().optional(),
555
- approver_user_id: z4.string().optional(),
562
+ var webTTYControlRequestSchema = z5.object({
563
+ id: z5.string(),
564
+ session_id: z5.string(),
565
+ requester_participant_id: z5.string(),
566
+ requester_user_id: z5.string().optional(),
567
+ approver_participant_id: z5.string().optional(),
568
+ approver_user_id: z5.string().optional(),
556
569
  status: webTTYControlRequestStatusSchema,
557
- reason: z4.string().optional(),
558
- metadata: z4.unknown().optional(),
570
+ reason: z5.string().optional(),
571
+ metadata: z5.unknown().optional(),
559
572
  created_at: isoDateTimeSchema2,
560
573
  updated_at: isoDateTimeSchema2,
561
574
  resolved_at: isoDateTimeSchema2.optional(),
562
575
  expires_at: isoDateTimeSchema2.optional()
563
576
  }).passthrough();
564
- var listWebTTYSessionsFiltersSchema = z4.object({
565
- server_id: z4.string().optional(),
566
- tunnel_id: z4.string().optional(),
567
- user_id: z4.string().optional(),
568
- group_id: z4.string().optional(),
577
+ var listWebTTYSessionsFiltersSchema = z5.object({
578
+ server_id: z5.string().optional(),
579
+ tunnel_id: z5.string().optional(),
580
+ user_id: z5.string().optional(),
581
+ group_id: z5.string().optional(),
569
582
  origin: webTTYOriginSchema.optional(),
570
583
  status: webTTYSessionStatusSchema.optional(),
571
584
  started_from: isoDateTimeSchema2.optional(),
572
585
  started_to: isoDateTimeSchema2.optional()
573
586
  });
574
- var listWebTTYSessionsParamsSchema = z4.object({
575
- limit: z4.number().int().min(1).optional(),
587
+ var listWebTTYSessionsParamsSchema = z5.object({
588
+ limit: z5.number().int().min(1).optional(),
576
589
  filters: listWebTTYSessionsFiltersSchema.optional()
577
590
  });
578
- var listWebTTYSessionGroupsFiltersSchema = z4.object({
579
- initiator_user_id: z4.string().optional(),
591
+ var listWebTTYSessionGroupsFiltersSchema = z5.object({
592
+ initiator_user_id: z5.string().optional(),
580
593
  origin: webTTYOriginSchema.optional(),
581
594
  created_from: isoDateTimeSchema2.optional(),
582
595
  created_to: isoDateTimeSchema2.optional()
583
596
  });
584
- var listWebTTYSessionGroupsParamsSchema = z4.object({
585
- limit: z4.number().int().min(1).optional(),
597
+ var listWebTTYSessionGroupsParamsSchema = z5.object({
598
+ limit: z5.number().int().min(1).optional(),
586
599
  filters: listWebTTYSessionGroupsFiltersSchema.optional()
587
600
  });
588
- var readWebTTYSessionEventsParamsSchema = z4.object({
601
+ var readWebTTYSessionEventsParamsSchema = z5.object({
589
602
  from_seq: webTTYSequenceCursorInputSchema.optional(),
590
- limit: z4.number().int().min(1).optional()
603
+ limit: z5.number().int().min(1).optional()
591
604
  });
592
- var listWebTTYKeyGrantDecryptMaterialParamsSchema = z4.object({
593
- recipient_id: z4.string().optional(),
594
- recipient_kind: z4.string().optional()
605
+ var listWebTTYKeyGrantDecryptMaterialParamsSchema = z5.object({
606
+ recipient_id: z5.string().optional(),
607
+ recipient_kind: z5.string().optional()
595
608
  });
596
- var listWebTTYControlRequestsFiltersSchema = z4.object({
609
+ var listWebTTYControlRequestsFiltersSchema = z5.object({
597
610
  status: webTTYControlRequestStatusSchema.optional(),
598
- requester_user_id: z4.string().optional()
611
+ requester_user_id: z5.string().optional()
599
612
  });
600
- var listWebTTYControlRequestsParamsSchema = z4.object({
601
- limit: z4.number().int().min(1).optional(),
613
+ var listWebTTYControlRequestsParamsSchema = z5.object({
614
+ limit: z5.number().int().min(1).optional(),
602
615
  filters: listWebTTYControlRequestsFiltersSchema.optional()
603
616
  });
604
- var attachWebTTYParticipantParamsSchema = z4.object({
605
- role: z4.literal("spectator").optional(),
606
- device_id: z4.string().optional(),
607
- browser_id: z4.string().optional(),
617
+ var attachWebTTYParticipantParamsSchema = z5.object({
618
+ role: z5.literal("spectator").optional(),
619
+ device_id: z5.string().optional(),
620
+ browser_id: z5.string().optional(),
608
621
  transport: webTTYTransportSchema.optional(),
609
- grant_state: z4.string().optional(),
622
+ grant_state: z5.string().optional(),
610
623
  metadata: jsonRecordSchema.optional()
611
624
  });
612
- var detachWebTTYParticipantParamsSchema = z4.object({
613
- reason: z4.string().optional(),
625
+ var detachWebTTYParticipantParamsSchema = z5.object({
626
+ reason: z5.string().optional(),
614
627
  metadata: jsonRecordSchema.optional()
615
628
  });
616
- var createWebTTYControlRequestParamsSchema = z4.object({
617
- participant_id: z4.string(),
618
- reason: z4.string().optional(),
629
+ var createWebTTYControlRequestParamsSchema = z5.object({
630
+ participant_id: z5.string(),
631
+ reason: z5.string().optional(),
619
632
  metadata: jsonRecordSchema.optional(),
620
633
  expires_at: isoDateTimeSchema2.optional()
621
634
  });
622
- var resolveWebTTYControlRequestParamsSchema = z4.object({
623
- action: z4.enum(["grant", "refuse", "revoke"]),
624
- approver_participant_id: z4.string().optional(),
625
- reason: z4.string().optional()
635
+ var resolveWebTTYControlRequestParamsSchema = z5.object({
636
+ action: z5.enum(["grant", "refuse", "revoke"]),
637
+ approver_participant_id: z5.string().optional(),
638
+ reason: z5.string().optional()
626
639
  });
627
- var webTTYSessionListSchema = z4.array(webTTYSessionSchema);
628
- var webTTYSessionGroupListSchema = z4.array(webTTYSessionGroupSchema);
629
- var webTTYParticipantListSchema = z4.array(webTTYParticipantSchema);
630
- var webTTYSessionEventListSchema = z4.array(webTTYSessionEventSchema);
631
- var webTTYKeyGrantListSchema = z4.array(webTTYKeyGrantSchema);
632
- var webTTYKeyGrantDecryptMaterialListSchema = z4.array(
640
+ var webTTYSessionListSchema = z5.array(webTTYSessionSchema);
641
+ var webTTYSessionGroupListSchema = z5.array(webTTYSessionGroupSchema);
642
+ var webTTYParticipantListSchema = z5.array(webTTYParticipantSchema);
643
+ var webTTYSessionEventListSchema = z5.array(webTTYSessionEventSchema);
644
+ var webTTYKeyGrantListSchema = z5.array(webTTYKeyGrantSchema);
645
+ var webTTYKeyGrantDecryptMaterialListSchema = z5.array(
633
646
  webTTYKeyGrantDecryptMaterialSchema
634
647
  );
635
- var webTTYControlRequestListSchema = z4.array(webTTYControlRequestSchema);
648
+ var webTTYControlRequestListSchema = z5.array(webTTYControlRequestSchema);
636
649
 
637
650
  // src/event.ts
638
- var import_tunnel = require("@rstreamlabs/rstream/tunnel");
639
- var z5 = __toESM(require("zod"));
640
- var isoDateTimeSchema3 = z5.string().datetime({ offset: true });
641
- var initialStateSchema = z5.object({
651
+ var import_tunnel3 = require("@rstreamlabs/rstream/tunnel");
652
+ var z6 = __toESM(require("zod"));
653
+ var isoDateTimeSchema3 = z6.string().datetime({ offset: true });
654
+ var initialStateSchema = z6.object({
642
655
  snapshot_at: isoDateTimeSchema3,
643
- clients: z5.array(clientSchema),
644
- tunnels: z5.array(import_tunnel.tunnelSchema)
656
+ clients: z6.array(listedClientSchema),
657
+ tunnels: z6.array(listedTunnelSchema)
645
658
  });
646
- var eventBaseSchema = z5.object({
647
- id: z5.string().optional(),
659
+ var eventBaseSchema = z6.object({
660
+ id: z6.string().optional(),
648
661
  created_at: isoDateTimeSchema3.optional(),
649
- user_id: z5.string().optional(),
650
- workspace_id: z5.string().optional(),
651
- project_id: z5.string().optional(),
652
- cluster_id: z5.string().optional()
662
+ user_id: z6.string().optional(),
663
+ workspace_id: z6.string().optional(),
664
+ project_id: z6.string().optional(),
665
+ cluster_id: z6.string().optional()
653
666
  });
654
- var withEventBase = (shape) => z5.object(shape).merge(eventBaseSchema).passthrough();
667
+ var withEventBase = (shape) => z6.object(shape).merge(eventBaseSchema).passthrough();
655
668
  var stateInitialEventSchema = withEventBase({
656
- type: z5.literal("state.initial"),
669
+ type: z6.literal("state.initial"),
657
670
  object: initialStateSchema
658
671
  });
659
672
  var streamSummaryEventSchema = withEventBase({
660
- type: z5.literal("stream.summary"),
673
+ type: z6.literal("stream.summary"),
661
674
  object: streamSummarySchema
662
675
  });
676
+ var fullInventoryEventsSchema = [
677
+ withEventBase({
678
+ type: z6.literal("client.created"),
679
+ object: import_client2.clientSchema
680
+ }),
681
+ withEventBase({
682
+ type: z6.literal("client.updated"),
683
+ object: import_client2.clientSchema
684
+ }),
685
+ withEventBase({
686
+ type: z6.literal("client.deleted"),
687
+ object: import_client2.clientSchema
688
+ }),
689
+ withEventBase({
690
+ type: z6.literal("tunnel.created"),
691
+ object: import_tunnel3.tunnelSchema
692
+ }),
693
+ withEventBase({
694
+ type: z6.literal("tunnel.updated"),
695
+ object: import_tunnel3.tunnelSchema
696
+ }),
697
+ withEventBase({
698
+ type: z6.literal("tunnel.deleted"),
699
+ object: import_tunnel3.tunnelSchema
700
+ })
701
+ ];
663
702
  var commonEventsSchema = [
664
703
  withEventBase({
665
- type: z5.literal("client.created"),
666
- object: clientSchema
704
+ type: z6.literal("client.created"),
705
+ object: listedClientSchema
667
706
  }),
668
707
  withEventBase({
669
- type: z5.literal("client.updated"),
670
- object: clientSchema
708
+ type: z6.literal("client.updated"),
709
+ object: listedClientSchema
671
710
  }),
672
711
  withEventBase({
673
- type: z5.literal("client.deleted"),
674
- object: clientSchema
712
+ type: z6.literal("client.deleted"),
713
+ object: listedClientSchema
675
714
  }),
676
715
  withEventBase({
677
- type: z5.literal("tunnel.created"),
678
- object: import_tunnel.tunnelSchema
716
+ type: z6.literal("tunnel.created"),
717
+ object: listedTunnelSchema
679
718
  }),
680
719
  withEventBase({
681
- type: z5.literal("tunnel.updated"),
682
- object: import_tunnel.tunnelSchema
720
+ type: z6.literal("tunnel.updated"),
721
+ object: listedTunnelSchema
683
722
  }),
684
723
  withEventBase({
685
- type: z5.literal("tunnel.deleted"),
686
- object: import_tunnel.tunnelSchema
724
+ type: z6.literal("tunnel.deleted"),
725
+ object: listedTunnelSchema
687
726
  })
688
727
  ];
689
728
  var webTTYEventsSchema = [
690
729
  withEventBase({
691
- type: z5.literal("webtty.session.created"),
730
+ type: z6.literal("webtty.session.created"),
692
731
  object: webTTYSessionSchema
693
732
  }),
694
733
  withEventBase({
695
- type: z5.literal("webtty.session.updated"),
696
- object: z5.union([webTTYSessionSchema, webTTYSessionGroupSchema])
734
+ type: z6.literal("webtty.session.updated"),
735
+ object: z6.union([webTTYSessionSchema, webTTYSessionGroupSchema])
697
736
  }),
698
737
  withEventBase({
699
- type: z5.literal("webtty.session.ended"),
738
+ type: z6.literal("webtty.session.ended"),
700
739
  object: webTTYSessionSchema
701
740
  }),
702
741
  withEventBase({
703
- type: z5.literal("webtty.participant.joined"),
742
+ type: z6.literal("webtty.participant.joined"),
704
743
  object: webTTYParticipantSchema
705
744
  }),
706
745
  withEventBase({
707
- type: z5.literal("webtty.participant.updated"),
746
+ type: z6.literal("webtty.participant.updated"),
708
747
  object: webTTYParticipantSchema
709
748
  }),
710
749
  withEventBase({
711
- type: z5.literal("webtty.participant.left"),
750
+ type: z6.literal("webtty.participant.left"),
712
751
  object: webTTYParticipantSchema
713
752
  }),
714
753
  withEventBase({
715
- type: z5.literal("webtty.control.requested"),
754
+ type: z6.literal("webtty.control.requested"),
716
755
  object: webTTYControlRequestSchema
717
756
  }),
718
757
  withEventBase({
719
- type: z5.literal("webtty.control.granted"),
758
+ type: z6.literal("webtty.control.granted"),
720
759
  object: webTTYControlRequestSchema
721
760
  }),
722
761
  withEventBase({
723
- type: z5.literal("webtty.control.refused"),
762
+ type: z6.literal("webtty.control.refused"),
724
763
  object: webTTYControlRequestSchema
725
764
  }),
726
765
  withEventBase({
727
- type: z5.literal("webtty.control.revoked"),
766
+ type: z6.literal("webtty.control.revoked"),
728
767
  object: webTTYControlRequestSchema
729
768
  })
730
769
  ];
731
770
  var webhookDeliverableEventsSchema = [
732
- commonEventsSchema[0],
733
- commonEventsSchema[2],
734
- commonEventsSchema[3],
735
- commonEventsSchema[5],
771
+ fullInventoryEventsSchema[0],
772
+ fullInventoryEventsSchema[2],
773
+ fullInventoryEventsSchema[3],
774
+ fullInventoryEventsSchema[5],
736
775
  ...webTTYEventsSchema
737
776
  ];
738
- var wsEventsSchema = z5.union([
777
+ var wsEventsSchema = z6.union([
739
778
  stateInitialEventSchema,
740
779
  ...commonEventsSchema,
741
780
  ...webTTYEventsSchema
742
781
  ]);
743
- var webhookEventsSchema = z5.union(webhookDeliverableEventsSchema);
782
+ var webhookEventsSchema = z6.union(webhookDeliverableEventsSchema);
744
783
  var projectLogEventsSchema = streamSummaryEventSchema;
745
- var eventSchema = z5.union([
784
+ var eventSchema = z6.union([
746
785
  wsEventsSchema,
747
786
  webhookEventsSchema,
748
787
  projectLogEventsSchema
749
788
  ]);
750
789
 
751
- // src/tunnel.ts
752
- var import_tunnel2 = require("@rstreamlabs/rstream/tunnel");
753
- var z6 = __toESM(require("zod"));
754
- var tunnelFilterSchema = import_tunnel2.tunnelSchema.pick({
755
- id: true,
756
- name: true,
757
- type: true,
758
- status: true,
759
- client_id: true,
760
- user_id: true,
761
- publish: true,
762
- protocol: true,
763
- hostname: true,
764
- http_version: true,
765
- labels: true
766
- }).partial();
767
- var listTunnelsParamsSchema = z6.object({
768
- limit: z6.number().int().min(1).optional(),
769
- filters: tunnelFilterSchema.optional()
770
- });
771
- var listTunnelsResponseSchema = z6.array(import_tunnel2.tunnelSchema);
772
-
773
790
  // src/openapi.ts
774
- var import_tunnel5 = require("@rstreamlabs/rstream/tunnel");
775
791
  var z7 = __toESM(require("zod"));
776
792
  var jsonContentType = "application/json";
777
793
  var openApiContentType = "application/vnd.oai.openapi+json;version=3.1";
@@ -850,12 +866,6 @@ var readEngineStateRule = {
850
866
  action: "read"
851
867
  };
852
868
  var readEngineStateRules = [readEngineStateRule];
853
- var readEngineStreamsRules = [
854
- {
855
- resource: "engine.streams",
856
- action: "read"
857
- }
858
- ];
859
869
  var watchParamsSchema = z7.object({
860
870
  clients: clientFilterSchema.optional(),
861
871
  tunnels: tunnelFilterSchema.optional()
@@ -1085,11 +1095,11 @@ var engineOpenApiDocument = {
1085
1095
  }
1086
1096
  }
1087
1097
  },
1088
- Client: jsonSchemaFor(clientSchema),
1098
+ Client: jsonSchemaFor(listedClientSchema),
1089
1099
  Event: jsonSchemaFor(wsEventsSchema),
1090
1100
  ListClientsParams: jsonSchemaFor(listClientsParamsSchema),
1091
1101
  ListTunnelsParams: jsonSchemaFor(listTunnelsParamsSchema),
1092
- TunnelListItem: jsonSchemaFor(import_tunnel5.tunnelSchema),
1102
+ TunnelListItem: jsonSchemaFor(listedTunnelSchema),
1093
1103
  WatchParams: jsonSchemaFor(watchParamsSchema)
1094
1104
  }
1095
1105
  },
@@ -1270,19 +1280,20 @@ var engineOpenApiDocument = {
1270
1280
  get: {
1271
1281
  tags: ["Runtime inventory"],
1272
1282
  summary: "List visible engine clients.",
1283
+ "x-rstream-token-scope": "resources.tunnels.scopes.clients.list",
1273
1284
  operationId: "list_engine_clients",
1274
1285
  parameters: [{ $ref: "#/components/parameters/ListClientsParams" }],
1275
1286
  security: [{ bearerAuth: [] }, { mutualTLS: [] }],
1276
1287
  responses: {
1277
1288
  "200": jsonArrayResponse(
1278
- "Visible clients.",
1289
+ "Visible clients. Fine-grained list scopes may filter objects and project fields.",
1279
1290
  "#/components/schemas/Client"
1280
1291
  ),
1281
1292
  "400": { $ref: "#/components/responses/BadRequest" },
1282
1293
  "401": { $ref: "#/components/responses/Unauthorized" },
1283
1294
  "403": { $ref: "#/components/responses/Forbidden" }
1284
1295
  },
1285
- "x-rstream-required-rules": readEngineStreamsRules
1296
+ "x-rstream-required-rules": readEngineStateRules
1286
1297
  }
1287
1298
  },
1288
1299
  "/api/tunnels": {
@@ -1302,7 +1313,7 @@ var engineOpenApiDocument = {
1302
1313
  "403": { $ref: "#/components/responses/Forbidden" }
1303
1314
  },
1304
1315
  "x-rstream-required-rules": readEngineStateRules,
1305
- "x-rstream-token-metadata-scope": "metadata.scopes.tunnels.list"
1316
+ "x-rstream-token-scope": "resources.tunnels.scopes.tunnels.list"
1306
1317
  }
1307
1318
  },
1308
1319
  "/api/sse": {