@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/README.md +24 -1
- package/dist/{chunk-DQN5T7CI.mjs → chunk-PRIEMDZT.mjs} +396 -383
- package/dist/index.d.mts +700 -591
- package/dist/index.d.ts +700 -591
- package/dist/index.js +419 -404
- package/dist/index.mjs +26 -22
- package/dist/openapi.d.mts +2 -1
- package/dist/openapi.d.ts +2 -1
- package/dist/openapi.js +382 -371
- package/dist/openapi.mjs +1 -1
- package/package.json +3 -3
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
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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(
|
|
59
|
+
var listClientsResponseSchema = z.array(listedClientSchema);
|
|
75
60
|
|
|
76
|
-
// src/
|
|
61
|
+
// src/tunnel.ts
|
|
62
|
+
var import_tunnel = require("@rstreamlabs/rstream/tunnel");
|
|
77
63
|
var z2 = __toESM(require("zod"));
|
|
78
|
-
var
|
|
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 =
|
|
84
|
-
var webTTYEncryptionModeSchema =
|
|
85
|
-
var webTTYSessionModeSchema =
|
|
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 =
|
|
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 =
|
|
98
|
-
var webTTYInitiatorKindSchema =
|
|
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 =
|
|
112
|
+
var webTTYContextMetadataSchema = z3.object({
|
|
105
113
|
origin: webTTYOriginSchema.optional(),
|
|
106
|
-
origin_id:
|
|
107
|
-
purpose:
|
|
114
|
+
origin_id: z3.string().optional(),
|
|
115
|
+
purpose: z3.string().optional(),
|
|
108
116
|
initiator_kind: webTTYInitiatorKindSchema.optional(),
|
|
109
|
-
agent_name:
|
|
110
|
-
agent_version:
|
|
111
|
-
request_id:
|
|
112
|
-
labels:
|
|
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
|
|
117
|
-
var nonEmptyStringSchema =
|
|
118
|
-
var isoDateTimeSchema =
|
|
119
|
-
var ipAddressSchema =
|
|
120
|
-
var intNonNegSchema =
|
|
121
|
-
var numNonNegSchema =
|
|
122
|
-
var geolocationSchema =
|
|
123
|
-
country:
|
|
124
|
-
region:
|
|
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 =
|
|
127
|
-
version:
|
|
128
|
-
cipher:
|
|
129
|
-
protocol:
|
|
130
|
-
curve:
|
|
131
|
-
ech:
|
|
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 =
|
|
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 =
|
|
139
|
-
|
|
140
|
-
|
|
147
|
+
var httpHeadersSchema = z4.record(
|
|
148
|
+
z4.string(),
|
|
149
|
+
z4.union([z4.string(), z4.array(z4.string())])
|
|
141
150
|
);
|
|
142
|
-
var httpProtocolSchema =
|
|
143
|
-
var httpRequestSchema =
|
|
151
|
+
var httpProtocolSchema = z4.enum(["http/1.1", "h2", "h2c", "h3"]);
|
|
152
|
+
var httpRequestSchema = z4.object({
|
|
144
153
|
method: nonEmptyStringSchema,
|
|
145
|
-
scheme:
|
|
154
|
+
scheme: z4.string().min(1).optional(),
|
|
146
155
|
host: nonEmptyStringSchema.optional(),
|
|
147
156
|
path: nonEmptyStringSchema.optional(),
|
|
148
|
-
query:
|
|
157
|
+
query: z4.string().optional(),
|
|
149
158
|
url: nonEmptyStringSchema.optional(),
|
|
150
159
|
headers: httpHeadersSchema.optional(),
|
|
151
|
-
userAgent:
|
|
160
|
+
userAgent: z4.string().optional()
|
|
152
161
|
});
|
|
153
|
-
var httpResponseSchema =
|
|
154
|
-
status:
|
|
162
|
+
var httpResponseSchema = z4.object({
|
|
163
|
+
status: z4.number().int().min(100).max(999),
|
|
155
164
|
headers: httpHeadersSchema.optional()
|
|
156
165
|
});
|
|
157
|
-
var httpRequestStageSchema =
|
|
166
|
+
var httpRequestStageSchema = z4.object({
|
|
158
167
|
protocol: httpProtocolSchema.optional(),
|
|
159
168
|
request: httpRequestSchema
|
|
160
169
|
});
|
|
161
|
-
var httpResponseStageSchema =
|
|
170
|
+
var httpResponseStageSchema = z4.object({
|
|
162
171
|
protocol: httpProtocolSchema.optional(),
|
|
163
172
|
response: httpResponseSchema
|
|
164
173
|
});
|
|
165
|
-
var streamEntrySchema =
|
|
166
|
-
kind:
|
|
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:
|
|
181
|
+
transport: z4.enum(["rstream", "tls", "quic", "dtls", "http", "tcp"]).optional()
|
|
173
182
|
});
|
|
174
|
-
var tokenSourceSchema =
|
|
183
|
+
var tokenSourceSchema = z4.enum([
|
|
175
184
|
"authorization",
|
|
176
185
|
"query",
|
|
177
186
|
"client",
|
|
178
187
|
"unknown"
|
|
179
188
|
]);
|
|
180
|
-
var tokenTypeSchema =
|
|
181
|
-
var firewallRuleSchema =
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
kind:
|
|
186
|
-
source:
|
|
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
|
-
|
|
189
|
-
kind:
|
|
190
|
-
source:
|
|
197
|
+
z4.object({
|
|
198
|
+
kind: z4.literal("rstream"),
|
|
199
|
+
source: z4.literal("private_rstream").optional()
|
|
191
200
|
}),
|
|
192
|
-
|
|
193
|
-
kind:
|
|
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 =
|
|
207
|
+
var unauthorizedSourceSchema = z4.object({
|
|
199
208
|
source: tokenSourceSchema
|
|
200
209
|
});
|
|
201
|
-
var unauthorizedReasonSchema = (shape) =>
|
|
202
|
-
var unauthorizedSchema =
|
|
210
|
+
var unauthorizedReasonSchema = (shape) => z4.object(shape).merge(unauthorizedSourceSchema);
|
|
211
|
+
var unauthorizedSchema = z4.discriminatedUnion("reason", [
|
|
203
212
|
unauthorizedReasonSchema({
|
|
204
|
-
reason:
|
|
213
|
+
reason: z4.literal("missing_token")
|
|
205
214
|
}),
|
|
206
215
|
unauthorizedReasonSchema({
|
|
207
|
-
reason:
|
|
216
|
+
reason: z4.literal("invalid_token")
|
|
208
217
|
}),
|
|
209
218
|
unauthorizedReasonSchema({
|
|
210
|
-
reason:
|
|
219
|
+
reason: z4.literal("expired_token")
|
|
211
220
|
}),
|
|
212
221
|
unauthorizedReasonSchema({
|
|
213
|
-
reason:
|
|
222
|
+
reason: z4.literal("invalid_secret")
|
|
214
223
|
}),
|
|
215
224
|
unauthorizedReasonSchema({
|
|
216
|
-
reason:
|
|
225
|
+
reason: z4.literal("user_mismatch")
|
|
217
226
|
}),
|
|
218
227
|
unauthorizedReasonSchema({
|
|
219
|
-
reason:
|
|
228
|
+
reason: z4.literal("insufficient_scope")
|
|
220
229
|
}),
|
|
221
230
|
unauthorizedReasonSchema({
|
|
222
|
-
reason:
|
|
223
|
-
policy:
|
|
224
|
-
value:
|
|
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 =
|
|
228
|
-
|
|
229
|
-
kind:
|
|
236
|
+
var failureSchema = z4.discriminatedUnion("kind", [
|
|
237
|
+
z4.object({
|
|
238
|
+
kind: z4.literal("timeout"),
|
|
230
239
|
timeoutMs: intNonNegSchema.optional(),
|
|
231
|
-
message:
|
|
240
|
+
message: z4.string().optional()
|
|
232
241
|
}),
|
|
233
|
-
|
|
234
|
-
kind:
|
|
242
|
+
z4.object({
|
|
243
|
+
kind: z4.literal("unauthorized"),
|
|
235
244
|
why: unauthorizedSchema,
|
|
236
|
-
message:
|
|
245
|
+
message: z4.string().optional()
|
|
237
246
|
}),
|
|
238
|
-
|
|
239
|
-
kind:
|
|
240
|
-
resource:
|
|
241
|
-
message:
|
|
247
|
+
z4.object({
|
|
248
|
+
kind: z4.literal("not_found"),
|
|
249
|
+
resource: z4.enum(["tunnel", "client", "route"]),
|
|
250
|
+
message: z4.string().optional()
|
|
242
251
|
}),
|
|
243
|
-
|
|
244
|
-
kind:
|
|
245
|
-
reason:
|
|
246
|
-
message:
|
|
252
|
+
z4.object({
|
|
253
|
+
kind: z4.literal("refused"),
|
|
254
|
+
reason: z4.enum(["capacity", "policy", "unsupported", "other"]),
|
|
255
|
+
message: z4.string().optional()
|
|
247
256
|
}),
|
|
248
|
-
|
|
249
|
-
|
|
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 =
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
decision:
|
|
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 =
|
|
268
|
+
var routedTunnelSchema = z4.object({
|
|
260
269
|
tunnelId: nonEmptyStringSchema.optional(),
|
|
261
|
-
tunnelName:
|
|
262
|
-
hostname:
|
|
263
|
-
protocol:
|
|
264
|
-
published:
|
|
265
|
-
type:
|
|
266
|
-
tlsMode:
|
|
267
|
-
httpVersion:
|
|
268
|
-
httpUseTls:
|
|
269
|
-
upstreamTls:
|
|
270
|
-
tokenAuth:
|
|
271
|
-
mtls_auth:
|
|
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 =
|
|
282
|
+
var routingNodeSchema = z4.object({
|
|
274
283
|
engineId: nonEmptyStringSchema,
|
|
275
284
|
region: nonEmptyStringSchema,
|
|
276
285
|
generation: nonEmptyStringSchema.optional()
|
|
277
286
|
});
|
|
278
|
-
var routingPathSchema =
|
|
279
|
-
mode:
|
|
280
|
-
crossRegionRoutingAllowed:
|
|
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 =
|
|
286
|
-
|
|
287
|
-
decision:
|
|
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
|
-
|
|
300
|
+
z4.object({ decision: z4.literal("not_routed"), failure: failureSchema })
|
|
292
301
|
]);
|
|
293
|
-
var streamConnectedMetricsSchema =
|
|
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 =
|
|
308
|
+
var streamFailedMetricsSchema = z4.object({
|
|
300
309
|
time_to_fail_ms: numNonNegSchema.optional(),
|
|
301
310
|
establish_ms: numNonNegSchema.optional()
|
|
302
311
|
});
|
|
303
|
-
var terminationSchema =
|
|
304
|
-
by:
|
|
305
|
-
reason:
|
|
306
|
-
message:
|
|
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 =
|
|
309
|
-
outcome:
|
|
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 =
|
|
317
|
-
outcome:
|
|
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 =
|
|
333
|
+
var responseSchema = z4.discriminatedUnion("outcome", [
|
|
325
334
|
responseConnectedSchema,
|
|
326
335
|
responseFailedSchema
|
|
327
336
|
]);
|
|
328
|
-
var streamWebTTYMetadataSchema =
|
|
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:
|
|
343
|
+
controller: z4.boolean().optional(),
|
|
335
344
|
recording_mode: webTTYRecordingModeSchema.optional(),
|
|
336
345
|
encryption_mode: webTTYEncryptionModeSchema.optional(),
|
|
337
|
-
encryption_policy:
|
|
338
|
-
e2e:
|
|
339
|
-
client_proof:
|
|
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:
|
|
353
|
+
origin_id: z4.string().optional(),
|
|
345
354
|
initiator_kind: webTTYInitiatorKindSchema.optional(),
|
|
346
|
-
device_id:
|
|
347
|
-
browser_id:
|
|
355
|
+
device_id: z4.string().optional(),
|
|
356
|
+
browser_id: z4.string().optional()
|
|
348
357
|
}).passthrough();
|
|
349
|
-
var streamSummarySchema =
|
|
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:
|
|
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
|
|
372
|
-
var isoDateTimeSchema2 =
|
|
373
|
-
var decimalCursorSchema =
|
|
374
|
-
var webTTYSequenceCursorInputSchema =
|
|
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
|
-
|
|
385
|
+
z5.number().int().nonnegative().safe().transform(String)
|
|
377
386
|
]);
|
|
378
|
-
var webTTYSessionStatusSchema =
|
|
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 =
|
|
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 =
|
|
401
|
+
var webTTYEventDirectionSchema = z5.enum([
|
|
393
402
|
"client_to_server",
|
|
394
403
|
"server_to_client",
|
|
395
404
|
"engine_internal"
|
|
396
405
|
]);
|
|
397
|
-
var webTTYStreamTypeSchema =
|
|
398
|
-
var webTTYSessionEventTypeSchema =
|
|
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 =
|
|
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:
|
|
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 =
|
|
423
|
-
managed_protocol:
|
|
424
|
-
store_configured:
|
|
425
|
-
session_listing:
|
|
426
|
-
recording:
|
|
427
|
-
replay:
|
|
428
|
-
live_attach:
|
|
429
|
-
control_transfer:
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
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 =
|
|
437
|
-
available:
|
|
438
|
-
attachable:
|
|
439
|
-
participant_count:
|
|
440
|
-
controller_participant_id:
|
|
441
|
-
has_upstream:
|
|
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 =
|
|
444
|
-
connected:
|
|
445
|
-
controller:
|
|
456
|
+
var webTTYParticipantLiveSchema = z5.object({
|
|
457
|
+
connected: z5.boolean(),
|
|
458
|
+
controller: z5.boolean()
|
|
446
459
|
});
|
|
447
|
-
var webTTYSessionSchema =
|
|
448
|
-
id:
|
|
449
|
-
workspace_id:
|
|
450
|
-
project_id:
|
|
451
|
-
cluster_id:
|
|
452
|
-
server_id:
|
|
453
|
-
tunnel_id:
|
|
454
|
-
client_id:
|
|
455
|
-
initiator_user_id:
|
|
456
|
-
group_id:
|
|
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:
|
|
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:
|
|
468
|
-
error_code:
|
|
469
|
-
error_message:
|
|
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 =
|
|
473
|
-
id:
|
|
474
|
-
workspace_id:
|
|
475
|
-
project_id:
|
|
476
|
-
initiator_user_id:
|
|
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 =
|
|
483
|
-
id:
|
|
484
|
-
session_id:
|
|
485
|
-
user_id:
|
|
486
|
-
device_id:
|
|
487
|
-
browser_id:
|
|
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:
|
|
492
|
-
grant_state:
|
|
493
|
-
attach_grant:
|
|
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 =
|
|
498
|
-
payload_suite:
|
|
499
|
-
payload_key_id:
|
|
500
|
-
nonce:
|
|
501
|
-
key_envelope_suite:
|
|
502
|
-
key_envelopes:
|
|
503
|
-
key_context:
|
|
504
|
-
key_context_raw:
|
|
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 =
|
|
507
|
-
id:
|
|
508
|
-
session_id:
|
|
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:
|
|
515
|
-
payload_length:
|
|
516
|
-
payload_ciphertext:
|
|
517
|
-
payload_plaintext:
|
|
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:
|
|
520
|
-
hash:
|
|
521
|
-
metadata:
|
|
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:
|
|
527
|
-
session_id:
|
|
528
|
-
recipient_id:
|
|
529
|
-
recipient_kind:
|
|
530
|
-
granted_by:
|
|
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 =
|
|
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:
|
|
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 =
|
|
558
|
+
var webTTYKeyGrantDecryptMaterialSchema = z5.object({
|
|
546
559
|
...webTTYKeyGrantBaseShape,
|
|
547
|
-
wrapped_key:
|
|
560
|
+
wrapped_key: z5.string().optional()
|
|
548
561
|
}).passthrough();
|
|
549
|
-
var webTTYControlRequestSchema =
|
|
550
|
-
id:
|
|
551
|
-
session_id:
|
|
552
|
-
requester_participant_id:
|
|
553
|
-
requester_user_id:
|
|
554
|
-
approver_participant_id:
|
|
555
|
-
approver_user_id:
|
|
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:
|
|
558
|
-
metadata:
|
|
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 =
|
|
565
|
-
server_id:
|
|
566
|
-
tunnel_id:
|
|
567
|
-
user_id:
|
|
568
|
-
group_id:
|
|
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 =
|
|
575
|
-
limit:
|
|
587
|
+
var listWebTTYSessionsParamsSchema = z5.object({
|
|
588
|
+
limit: z5.number().int().min(1).optional(),
|
|
576
589
|
filters: listWebTTYSessionsFiltersSchema.optional()
|
|
577
590
|
});
|
|
578
|
-
var listWebTTYSessionGroupsFiltersSchema =
|
|
579
|
-
initiator_user_id:
|
|
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 =
|
|
585
|
-
limit:
|
|
597
|
+
var listWebTTYSessionGroupsParamsSchema = z5.object({
|
|
598
|
+
limit: z5.number().int().min(1).optional(),
|
|
586
599
|
filters: listWebTTYSessionGroupsFiltersSchema.optional()
|
|
587
600
|
});
|
|
588
|
-
var readWebTTYSessionEventsParamsSchema =
|
|
601
|
+
var readWebTTYSessionEventsParamsSchema = z5.object({
|
|
589
602
|
from_seq: webTTYSequenceCursorInputSchema.optional(),
|
|
590
|
-
limit:
|
|
603
|
+
limit: z5.number().int().min(1).optional()
|
|
591
604
|
});
|
|
592
|
-
var listWebTTYKeyGrantDecryptMaterialParamsSchema =
|
|
593
|
-
recipient_id:
|
|
594
|
-
recipient_kind:
|
|
605
|
+
var listWebTTYKeyGrantDecryptMaterialParamsSchema = z5.object({
|
|
606
|
+
recipient_id: z5.string().optional(),
|
|
607
|
+
recipient_kind: z5.string().optional()
|
|
595
608
|
});
|
|
596
|
-
var listWebTTYControlRequestsFiltersSchema =
|
|
609
|
+
var listWebTTYControlRequestsFiltersSchema = z5.object({
|
|
597
610
|
status: webTTYControlRequestStatusSchema.optional(),
|
|
598
|
-
requester_user_id:
|
|
611
|
+
requester_user_id: z5.string().optional()
|
|
599
612
|
});
|
|
600
|
-
var listWebTTYControlRequestsParamsSchema =
|
|
601
|
-
limit:
|
|
613
|
+
var listWebTTYControlRequestsParamsSchema = z5.object({
|
|
614
|
+
limit: z5.number().int().min(1).optional(),
|
|
602
615
|
filters: listWebTTYControlRequestsFiltersSchema.optional()
|
|
603
616
|
});
|
|
604
|
-
var attachWebTTYParticipantParamsSchema =
|
|
605
|
-
role:
|
|
606
|
-
device_id:
|
|
607
|
-
browser_id:
|
|
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:
|
|
622
|
+
grant_state: z5.string().optional(),
|
|
610
623
|
metadata: jsonRecordSchema.optional()
|
|
611
624
|
});
|
|
612
|
-
var detachWebTTYParticipantParamsSchema =
|
|
613
|
-
reason:
|
|
625
|
+
var detachWebTTYParticipantParamsSchema = z5.object({
|
|
626
|
+
reason: z5.string().optional(),
|
|
614
627
|
metadata: jsonRecordSchema.optional()
|
|
615
628
|
});
|
|
616
|
-
var createWebTTYControlRequestParamsSchema =
|
|
617
|
-
participant_id:
|
|
618
|
-
reason:
|
|
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 =
|
|
623
|
-
action:
|
|
624
|
-
approver_participant_id:
|
|
625
|
-
reason:
|
|
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 =
|
|
628
|
-
var webTTYSessionGroupListSchema =
|
|
629
|
-
var webTTYParticipantListSchema =
|
|
630
|
-
var webTTYSessionEventListSchema =
|
|
631
|
-
var webTTYKeyGrantListSchema =
|
|
632
|
-
var webTTYKeyGrantDecryptMaterialListSchema =
|
|
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 =
|
|
648
|
+
var webTTYControlRequestListSchema = z5.array(webTTYControlRequestSchema);
|
|
636
649
|
|
|
637
650
|
// src/event.ts
|
|
638
|
-
var
|
|
639
|
-
var
|
|
640
|
-
var isoDateTimeSchema3 =
|
|
641
|
-
var initialStateSchema =
|
|
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:
|
|
644
|
-
tunnels:
|
|
656
|
+
clients: z6.array(listedClientSchema),
|
|
657
|
+
tunnels: z6.array(listedTunnelSchema)
|
|
645
658
|
});
|
|
646
|
-
var eventBaseSchema =
|
|
647
|
-
id:
|
|
659
|
+
var eventBaseSchema = z6.object({
|
|
660
|
+
id: z6.string().optional(),
|
|
648
661
|
created_at: isoDateTimeSchema3.optional(),
|
|
649
|
-
user_id:
|
|
650
|
-
workspace_id:
|
|
651
|
-
project_id:
|
|
652
|
-
cluster_id:
|
|
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) =>
|
|
667
|
+
var withEventBase = (shape) => z6.object(shape).merge(eventBaseSchema).passthrough();
|
|
655
668
|
var stateInitialEventSchema = withEventBase({
|
|
656
|
-
type:
|
|
669
|
+
type: z6.literal("state.initial"),
|
|
657
670
|
object: initialStateSchema
|
|
658
671
|
});
|
|
659
672
|
var streamSummaryEventSchema = withEventBase({
|
|
660
|
-
type:
|
|
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:
|
|
666
|
-
object:
|
|
704
|
+
type: z6.literal("client.created"),
|
|
705
|
+
object: listedClientSchema
|
|
667
706
|
}),
|
|
668
707
|
withEventBase({
|
|
669
|
-
type:
|
|
670
|
-
object:
|
|
708
|
+
type: z6.literal("client.updated"),
|
|
709
|
+
object: listedClientSchema
|
|
671
710
|
}),
|
|
672
711
|
withEventBase({
|
|
673
|
-
type:
|
|
674
|
-
object:
|
|
712
|
+
type: z6.literal("client.deleted"),
|
|
713
|
+
object: listedClientSchema
|
|
675
714
|
}),
|
|
676
715
|
withEventBase({
|
|
677
|
-
type:
|
|
678
|
-
object:
|
|
716
|
+
type: z6.literal("tunnel.created"),
|
|
717
|
+
object: listedTunnelSchema
|
|
679
718
|
}),
|
|
680
719
|
withEventBase({
|
|
681
|
-
type:
|
|
682
|
-
object:
|
|
720
|
+
type: z6.literal("tunnel.updated"),
|
|
721
|
+
object: listedTunnelSchema
|
|
683
722
|
}),
|
|
684
723
|
withEventBase({
|
|
685
|
-
type:
|
|
686
|
-
object:
|
|
724
|
+
type: z6.literal("tunnel.deleted"),
|
|
725
|
+
object: listedTunnelSchema
|
|
687
726
|
})
|
|
688
727
|
];
|
|
689
728
|
var webTTYEventsSchema = [
|
|
690
729
|
withEventBase({
|
|
691
|
-
type:
|
|
730
|
+
type: z6.literal("webtty.session.created"),
|
|
692
731
|
object: webTTYSessionSchema
|
|
693
732
|
}),
|
|
694
733
|
withEventBase({
|
|
695
|
-
type:
|
|
696
|
-
object:
|
|
734
|
+
type: z6.literal("webtty.session.updated"),
|
|
735
|
+
object: z6.union([webTTYSessionSchema, webTTYSessionGroupSchema])
|
|
697
736
|
}),
|
|
698
737
|
withEventBase({
|
|
699
|
-
type:
|
|
738
|
+
type: z6.literal("webtty.session.ended"),
|
|
700
739
|
object: webTTYSessionSchema
|
|
701
740
|
}),
|
|
702
741
|
withEventBase({
|
|
703
|
-
type:
|
|
742
|
+
type: z6.literal("webtty.participant.joined"),
|
|
704
743
|
object: webTTYParticipantSchema
|
|
705
744
|
}),
|
|
706
745
|
withEventBase({
|
|
707
|
-
type:
|
|
746
|
+
type: z6.literal("webtty.participant.updated"),
|
|
708
747
|
object: webTTYParticipantSchema
|
|
709
748
|
}),
|
|
710
749
|
withEventBase({
|
|
711
|
-
type:
|
|
750
|
+
type: z6.literal("webtty.participant.left"),
|
|
712
751
|
object: webTTYParticipantSchema
|
|
713
752
|
}),
|
|
714
753
|
withEventBase({
|
|
715
|
-
type:
|
|
754
|
+
type: z6.literal("webtty.control.requested"),
|
|
716
755
|
object: webTTYControlRequestSchema
|
|
717
756
|
}),
|
|
718
757
|
withEventBase({
|
|
719
|
-
type:
|
|
758
|
+
type: z6.literal("webtty.control.granted"),
|
|
720
759
|
object: webTTYControlRequestSchema
|
|
721
760
|
}),
|
|
722
761
|
withEventBase({
|
|
723
|
-
type:
|
|
762
|
+
type: z6.literal("webtty.control.refused"),
|
|
724
763
|
object: webTTYControlRequestSchema
|
|
725
764
|
}),
|
|
726
765
|
withEventBase({
|
|
727
|
-
type:
|
|
766
|
+
type: z6.literal("webtty.control.revoked"),
|
|
728
767
|
object: webTTYControlRequestSchema
|
|
729
768
|
})
|
|
730
769
|
];
|
|
731
770
|
var webhookDeliverableEventsSchema = [
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
771
|
+
fullInventoryEventsSchema[0],
|
|
772
|
+
fullInventoryEventsSchema[2],
|
|
773
|
+
fullInventoryEventsSchema[3],
|
|
774
|
+
fullInventoryEventsSchema[5],
|
|
736
775
|
...webTTYEventsSchema
|
|
737
776
|
];
|
|
738
|
-
var wsEventsSchema =
|
|
777
|
+
var wsEventsSchema = z6.union([
|
|
739
778
|
stateInitialEventSchema,
|
|
740
779
|
...commonEventsSchema,
|
|
741
780
|
...webTTYEventsSchema
|
|
742
781
|
]);
|
|
743
|
-
var webhookEventsSchema =
|
|
782
|
+
var webhookEventsSchema = z6.union(webhookDeliverableEventsSchema);
|
|
744
783
|
var projectLogEventsSchema = streamSummaryEventSchema;
|
|
745
|
-
var eventSchema =
|
|
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(
|
|
1098
|
+
Client: jsonSchemaFor(listedClientSchema),
|
|
1089
1099
|
Event: jsonSchemaFor(wsEventsSchema),
|
|
1090
1100
|
ListClientsParams: jsonSchemaFor(listClientsParamsSchema),
|
|
1091
1101
|
ListTunnelsParams: jsonSchemaFor(listTunnelsParamsSchema),
|
|
1092
|
-
TunnelListItem: jsonSchemaFor(
|
|
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":
|
|
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-
|
|
1316
|
+
"x-rstream-token-scope": "resources.tunnels.scopes.tunnels.list"
|
|
1306
1317
|
}
|
|
1307
1318
|
},
|
|
1308
1319
|
"/api/sse": {
|