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