@rstreamlabs/tunnels 3.10.2 → 4.0.1

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