@vercel/sandbox 2.0.0-beta.4 → 2.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-client/api-client.d.ts +201 -145
- package/dist/api-client/api-client.js +45 -56
- package/dist/api-client/api-client.js.map +1 -1
- package/dist/api-client/api-error.d.ts +6 -4
- package/dist/api-client/api-error.js +4 -3
- package/dist/api-client/api-error.js.map +1 -1
- package/dist/api-client/base-client.js +24 -9
- package/dist/api-client/base-client.js.map +1 -1
- package/dist/api-client/validators.d.ts +1315 -1275
- package/dist/api-client/validators.js +27 -32
- package/dist/api-client/validators.js.map +1 -1
- package/dist/command.d.ts +9 -9
- package/dist/command.js +10 -10
- package/dist/sandbox.d.ts +147 -101
- package/dist/sandbox.js +45 -46
- package/dist/sandbox.js.map +1 -1
- package/dist/session.d.ts +7 -7
- package/dist/session.js +53 -47
- package/dist/session.js.map +1 -1
- package/dist/snapshot.d.ts +3 -3
- package/dist/snapshot.js +3 -3
- package/dist/utils/convert-sandbox.d.ts +3 -3
- package/dist/utils/convert-sandbox.js +3 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseClient, type Parsed, type RequestParams } from "./base-client";
|
|
2
|
-
import { type CommandFinishedData,
|
|
2
|
+
import { type CommandFinishedData, SessionResponse, CommandResponse, CommandFinishedResponse, type LogLineStdout, type LogLineStderr, SnapshotResponse, CreateSnapshotResponse, type CommandData } from "./validators";
|
|
3
3
|
import { FileWriter } from "./file-writer";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { Readable } from "stream";
|
|
@@ -21,11 +21,11 @@ export declare class APIClient extends BaseClient {
|
|
|
21
21
|
});
|
|
22
22
|
private ensureValidToken;
|
|
23
23
|
protected request(path: string, params?: RequestParams): Promise<Response>;
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
getSession(params: WithPrivate<{
|
|
25
|
+
sessionId: string;
|
|
26
26
|
signal?: AbortSignal;
|
|
27
27
|
}>): Promise<Parsed<{
|
|
28
|
-
|
|
28
|
+
session: {
|
|
29
29
|
id: string;
|
|
30
30
|
memory: number;
|
|
31
31
|
vcpus: number;
|
|
@@ -73,6 +73,8 @@ export declare class APIClient extends BaseClient {
|
|
|
73
73
|
ingress: number;
|
|
74
74
|
egress: number;
|
|
75
75
|
} | undefined;
|
|
76
|
+
} & {
|
|
77
|
+
[k: string]: unknown;
|
|
76
78
|
};
|
|
77
79
|
routes: {
|
|
78
80
|
url: string;
|
|
@@ -108,7 +110,7 @@ export declare class APIClient extends BaseClient {
|
|
|
108
110
|
env?: Record<string, string>;
|
|
109
111
|
signal?: AbortSignal;
|
|
110
112
|
}>): Promise<Parsed<{
|
|
111
|
-
|
|
113
|
+
session: {
|
|
112
114
|
id: string;
|
|
113
115
|
memory: number;
|
|
114
116
|
vcpus: number;
|
|
@@ -156,24 +158,27 @@ export declare class APIClient extends BaseClient {
|
|
|
156
158
|
ingress: number;
|
|
157
159
|
egress: number;
|
|
158
160
|
} | undefined;
|
|
161
|
+
} & {
|
|
162
|
+
[k: string]: unknown;
|
|
159
163
|
};
|
|
160
164
|
routes: {
|
|
161
165
|
url: string;
|
|
162
166
|
subdomain: string;
|
|
163
167
|
port: number;
|
|
164
168
|
}[];
|
|
165
|
-
|
|
166
|
-
memory: number;
|
|
167
|
-
vcpus: number;
|
|
168
|
-
region: string;
|
|
169
|
-
runtime: string;
|
|
170
|
-
timeout: number;
|
|
169
|
+
sandbox: {
|
|
171
170
|
status: "aborted" | "pending" | "running" | "stopping" | "stopped" | "failed" | "snapshotting";
|
|
172
171
|
createdAt: number;
|
|
173
172
|
updatedAt: number;
|
|
174
173
|
name: string;
|
|
175
174
|
persistent: boolean;
|
|
176
|
-
|
|
175
|
+
currentSessionId: string;
|
|
176
|
+
memory?: number | undefined;
|
|
177
|
+
vcpus?: number | undefined;
|
|
178
|
+
region?: string | undefined;
|
|
179
|
+
runtime?: string | undefined;
|
|
180
|
+
timeout?: number | undefined;
|
|
181
|
+
cwd?: string | undefined;
|
|
177
182
|
networkPolicy?: z.objectInputType<{
|
|
178
183
|
mode: z.ZodLiteral<"allow-all">;
|
|
179
184
|
}, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
|
|
@@ -205,7 +210,7 @@ export declare class APIClient extends BaseClient {
|
|
|
205
210
|
};
|
|
206
211
|
}>>;
|
|
207
212
|
runCommand(params: {
|
|
208
|
-
|
|
213
|
+
sessionId: string;
|
|
209
214
|
cwd?: string;
|
|
210
215
|
command: string;
|
|
211
216
|
args: string[];
|
|
@@ -218,7 +223,7 @@ export declare class APIClient extends BaseClient {
|
|
|
218
223
|
finished: Promise<CommandFinishedData>;
|
|
219
224
|
}>;
|
|
220
225
|
runCommand(params: {
|
|
221
|
-
|
|
226
|
+
sessionId: string;
|
|
222
227
|
cwd?: string;
|
|
223
228
|
command: string;
|
|
224
229
|
args: string[];
|
|
@@ -228,83 +233,91 @@ export declare class APIClient extends BaseClient {
|
|
|
228
233
|
signal?: AbortSignal;
|
|
229
234
|
}): Promise<Parsed<z.infer<typeof CommandResponse>>>;
|
|
230
235
|
getCommand(params: {
|
|
231
|
-
|
|
236
|
+
sessionId: string;
|
|
232
237
|
cmdId: string;
|
|
233
238
|
wait: true;
|
|
234
239
|
signal?: AbortSignal;
|
|
235
240
|
}): Promise<Parsed<z.infer<typeof CommandFinishedResponse>>>;
|
|
236
241
|
getCommand(params: {
|
|
237
|
-
|
|
242
|
+
sessionId: string;
|
|
238
243
|
cmdId: string;
|
|
239
244
|
wait?: boolean;
|
|
240
245
|
signal?: AbortSignal;
|
|
241
246
|
}): Promise<Parsed<z.infer<typeof CommandResponse>>>;
|
|
242
247
|
mkDir(params: {
|
|
243
|
-
|
|
248
|
+
sessionId: string;
|
|
244
249
|
path: string;
|
|
245
250
|
cwd?: string;
|
|
246
251
|
signal?: AbortSignal;
|
|
247
252
|
}): Promise<Parsed<{}>>;
|
|
248
253
|
getFileWriter(params: {
|
|
249
|
-
|
|
254
|
+
sessionId: string;
|
|
250
255
|
extractDir: string;
|
|
251
256
|
signal?: AbortSignal;
|
|
252
257
|
}): {
|
|
253
258
|
response: Promise<Response>;
|
|
254
259
|
writer: FileWriter;
|
|
255
260
|
};
|
|
256
|
-
|
|
261
|
+
listSessions(params: {
|
|
257
262
|
/**
|
|
258
|
-
* The ID or name of the project to which the
|
|
263
|
+
* The ID or name of the project to which the sessions belong.
|
|
259
264
|
* @example "my-project"
|
|
260
265
|
*/
|
|
261
266
|
projectId: string;
|
|
262
267
|
/**
|
|
263
|
-
* Filter
|
|
268
|
+
* Filter sessions by sandbox name.
|
|
264
269
|
*/
|
|
265
270
|
name?: string;
|
|
266
271
|
/**
|
|
267
|
-
* Maximum number of
|
|
272
|
+
* Maximum number of sessions to list from a request.
|
|
268
273
|
* @example 10
|
|
269
274
|
*/
|
|
270
275
|
limit?: number;
|
|
271
276
|
/**
|
|
272
|
-
* Get
|
|
277
|
+
* Get sessions created after this JavaScript timestamp.
|
|
273
278
|
* @example 1540095775941
|
|
274
279
|
*/
|
|
275
280
|
since?: number | Date;
|
|
276
281
|
/**
|
|
277
|
-
* Get
|
|
282
|
+
* Get sessions created before this JavaScript timestamp.
|
|
278
283
|
* @example 1540095775951
|
|
279
284
|
*/
|
|
280
285
|
until?: number | Date;
|
|
281
286
|
signal?: AbortSignal;
|
|
282
287
|
}): Promise<Parsed<{
|
|
283
|
-
|
|
284
|
-
id:
|
|
285
|
-
memory:
|
|
286
|
-
vcpus:
|
|
287
|
-
region:
|
|
288
|
-
runtime:
|
|
289
|
-
timeout:
|
|
290
|
-
status: "
|
|
291
|
-
requestedAt:
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
interactivePort
|
|
303
|
-
networkPolicy
|
|
288
|
+
sessions: z.objectInputType<{
|
|
289
|
+
id: z.ZodString;
|
|
290
|
+
memory: z.ZodNumber;
|
|
291
|
+
vcpus: z.ZodNumber;
|
|
292
|
+
region: z.ZodString;
|
|
293
|
+
runtime: z.ZodString;
|
|
294
|
+
timeout: z.ZodNumber;
|
|
295
|
+
status: z.ZodEnum<["pending", "running", "stopping", "stopped", "failed", "aborted", "snapshotting"]>;
|
|
296
|
+
requestedAt: z.ZodNumber;
|
|
297
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
298
|
+
requestedStopAt: z.ZodOptional<z.ZodNumber>;
|
|
299
|
+
stoppedAt: z.ZodOptional<z.ZodNumber>;
|
|
300
|
+
abortedAt: z.ZodOptional<z.ZodNumber>;
|
|
301
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
302
|
+
sourceSnapshotId: z.ZodOptional<z.ZodString>;
|
|
303
|
+
snapshottedAt: z.ZodOptional<z.ZodNumber>;
|
|
304
|
+
createdAt: z.ZodNumber;
|
|
305
|
+
cwd: z.ZodString;
|
|
306
|
+
updatedAt: z.ZodNumber;
|
|
307
|
+
interactivePort: z.ZodOptional<z.ZodNumber>;
|
|
308
|
+
networkPolicy: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
304
309
|
mode: z.ZodLiteral<"allow-all">;
|
|
305
|
-
}, z.ZodTypeAny,
|
|
310
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
311
|
+
mode: z.ZodLiteral<"allow-all">;
|
|
312
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
313
|
+
mode: z.ZodLiteral<"allow-all">;
|
|
314
|
+
}, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
|
|
306
315
|
mode: z.ZodLiteral<"deny-all">;
|
|
307
|
-
}, z.ZodTypeAny,
|
|
316
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
317
|
+
mode: z.ZodLiteral<"deny-all">;
|
|
318
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
319
|
+
mode: z.ZodLiteral<"deny-all">;
|
|
320
|
+
}, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
|
|
308
321
|
mode: z.ZodLiteral<"custom">;
|
|
309
322
|
allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
310
323
|
allowedCIDRs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -322,13 +335,55 @@ export declare class APIClient extends BaseClient {
|
|
|
322
335
|
headers?: Record<string, string> | undefined;
|
|
323
336
|
headerNames?: string[] | undefined;
|
|
324
337
|
}>, "many">>;
|
|
325
|
-
}, z.ZodTypeAny,
|
|
326
|
-
|
|
327
|
-
|
|
338
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
339
|
+
mode: z.ZodLiteral<"custom">;
|
|
340
|
+
allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
341
|
+
allowedCIDRs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
342
|
+
deniedCIDRs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
343
|
+
injectionRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
344
|
+
domain: z.ZodString;
|
|
345
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
346
|
+
headerNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
347
|
+
}, "strip", z.ZodTypeAny, {
|
|
348
|
+
domain: string;
|
|
349
|
+
headers?: Record<string, string> | undefined;
|
|
350
|
+
headerNames?: string[] | undefined;
|
|
351
|
+
}, {
|
|
352
|
+
domain: string;
|
|
353
|
+
headers?: Record<string, string> | undefined;
|
|
354
|
+
headerNames?: string[] | undefined;
|
|
355
|
+
}>, "many">>;
|
|
356
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
357
|
+
mode: z.ZodLiteral<"custom">;
|
|
358
|
+
allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
359
|
+
allowedCIDRs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
360
|
+
deniedCIDRs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
361
|
+
injectionRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
362
|
+
domain: z.ZodString;
|
|
363
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
364
|
+
headerNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
365
|
+
}, "strip", z.ZodTypeAny, {
|
|
366
|
+
domain: string;
|
|
367
|
+
headers?: Record<string, string> | undefined;
|
|
368
|
+
headerNames?: string[] | undefined;
|
|
369
|
+
}, {
|
|
370
|
+
domain: string;
|
|
371
|
+
headers?: Record<string, string> | undefined;
|
|
372
|
+
headerNames?: string[] | undefined;
|
|
373
|
+
}>, "many">>;
|
|
374
|
+
}, z.ZodTypeAny, "passthrough">>]>>;
|
|
375
|
+
activeCpuDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
376
|
+
networkTransfer: z.ZodOptional<z.ZodObject<{
|
|
377
|
+
ingress: z.ZodNumber;
|
|
378
|
+
egress: z.ZodNumber;
|
|
379
|
+
}, "strip", z.ZodTypeAny, {
|
|
328
380
|
ingress: number;
|
|
329
381
|
egress: number;
|
|
330
|
-
}
|
|
331
|
-
|
|
382
|
+
}, {
|
|
383
|
+
ingress: number;
|
|
384
|
+
egress: number;
|
|
385
|
+
}>>;
|
|
386
|
+
}, z.ZodTypeAny, "passthrough">[];
|
|
332
387
|
pagination: {
|
|
333
388
|
count: number;
|
|
334
389
|
next: number | null;
|
|
@@ -342,7 +397,7 @@ export declare class APIClient extends BaseClient {
|
|
|
342
397
|
*/
|
|
343
398
|
projectId: string;
|
|
344
399
|
/**
|
|
345
|
-
* Filter snapshots by
|
|
400
|
+
* Filter snapshots by sandbox name.
|
|
346
401
|
*/
|
|
347
402
|
name?: string;
|
|
348
403
|
/**
|
|
@@ -373,13 +428,13 @@ export declare class APIClient extends BaseClient {
|
|
|
373
428
|
status: "failed" | "created" | "deleted";
|
|
374
429
|
createdAt: number;
|
|
375
430
|
updatedAt: number;
|
|
376
|
-
|
|
431
|
+
sourceSessionId: string;
|
|
377
432
|
sizeBytes: number;
|
|
378
433
|
expiresAt?: number | undefined;
|
|
379
434
|
}[];
|
|
380
435
|
}>>;
|
|
381
436
|
writeFiles(params: {
|
|
382
|
-
|
|
437
|
+
sessionId: string;
|
|
383
438
|
cwd: string;
|
|
384
439
|
files: {
|
|
385
440
|
path: string;
|
|
@@ -389,19 +444,19 @@ export declare class APIClient extends BaseClient {
|
|
|
389
444
|
signal?: AbortSignal;
|
|
390
445
|
}): Promise<void>;
|
|
391
446
|
readFile(params: {
|
|
392
|
-
|
|
447
|
+
sessionId: string;
|
|
393
448
|
path: string;
|
|
394
449
|
cwd?: string;
|
|
395
450
|
signal?: AbortSignal;
|
|
396
451
|
}): Promise<Readable | null>;
|
|
397
452
|
killCommand(params: {
|
|
398
|
-
|
|
453
|
+
sessionId: string;
|
|
399
454
|
commandId: string;
|
|
400
455
|
signal: number;
|
|
401
456
|
abortSignal?: AbortSignal;
|
|
402
457
|
}): Promise<Parsed<{
|
|
403
458
|
command: {
|
|
404
|
-
|
|
459
|
+
sessionId: string;
|
|
405
460
|
id: string;
|
|
406
461
|
startedAt: number;
|
|
407
462
|
cwd: string;
|
|
@@ -411,29 +466,29 @@ export declare class APIClient extends BaseClient {
|
|
|
411
466
|
};
|
|
412
467
|
}>>;
|
|
413
468
|
getLogs(params: {
|
|
414
|
-
|
|
469
|
+
sessionId: string;
|
|
415
470
|
cmdId: string;
|
|
416
471
|
signal?: AbortSignal;
|
|
417
472
|
}): AsyncGenerator<z.infer<typeof LogLineStdout> | z.infer<typeof LogLineStderr>, void, void> & Disposable & {
|
|
418
473
|
close(): void;
|
|
419
474
|
};
|
|
420
|
-
|
|
421
|
-
|
|
475
|
+
stopSession(params: {
|
|
476
|
+
sessionId: string;
|
|
422
477
|
signal?: AbortSignal;
|
|
423
478
|
blocking?: boolean;
|
|
424
|
-
}): Promise<Parsed<z.infer<typeof
|
|
479
|
+
}): Promise<Parsed<z.infer<typeof SessionResponse>>>;
|
|
425
480
|
updateNetworkPolicy(params: {
|
|
426
|
-
|
|
481
|
+
sessionId: string;
|
|
427
482
|
networkPolicy: NetworkPolicy;
|
|
428
483
|
signal?: AbortSignal;
|
|
429
|
-
}): Promise<Parsed<z.infer<typeof
|
|
484
|
+
}): Promise<Parsed<z.infer<typeof SessionResponse>>>;
|
|
430
485
|
extendTimeout(params: {
|
|
431
|
-
|
|
486
|
+
sessionId: string;
|
|
432
487
|
duration: number;
|
|
433
488
|
signal?: AbortSignal;
|
|
434
|
-
}): Promise<Parsed<z.infer<typeof
|
|
489
|
+
}): Promise<Parsed<z.infer<typeof SessionResponse>>>;
|
|
435
490
|
createSnapshot(params: {
|
|
436
|
-
|
|
491
|
+
sessionId: string;
|
|
437
492
|
expiration?: number;
|
|
438
493
|
signal?: AbortSignal;
|
|
439
494
|
}): Promise<Parsed<z.infer<typeof CreateSnapshotResponse>>>;
|
|
@@ -445,13 +500,13 @@ export declare class APIClient extends BaseClient {
|
|
|
445
500
|
snapshotId: string;
|
|
446
501
|
signal?: AbortSignal;
|
|
447
502
|
}): Promise<Parsed<z.infer<typeof SnapshotResponse>>>;
|
|
448
|
-
|
|
503
|
+
getSandbox(params: {
|
|
449
504
|
name: string;
|
|
450
505
|
projectId: string;
|
|
451
506
|
resume?: boolean;
|
|
452
507
|
signal?: AbortSignal;
|
|
453
508
|
}): Promise<Parsed<{
|
|
454
|
-
|
|
509
|
+
session: {
|
|
455
510
|
id: string;
|
|
456
511
|
memory: number;
|
|
457
512
|
vcpus: number;
|
|
@@ -499,24 +554,27 @@ export declare class APIClient extends BaseClient {
|
|
|
499
554
|
ingress: number;
|
|
500
555
|
egress: number;
|
|
501
556
|
} | undefined;
|
|
557
|
+
} & {
|
|
558
|
+
[k: string]: unknown;
|
|
502
559
|
};
|
|
503
560
|
routes: {
|
|
504
561
|
url: string;
|
|
505
562
|
subdomain: string;
|
|
506
563
|
port: number;
|
|
507
564
|
}[];
|
|
508
|
-
|
|
509
|
-
memory: number;
|
|
510
|
-
vcpus: number;
|
|
511
|
-
region: string;
|
|
512
|
-
runtime: string;
|
|
513
|
-
timeout: number;
|
|
565
|
+
sandbox: {
|
|
514
566
|
status: "aborted" | "pending" | "running" | "stopping" | "stopped" | "failed" | "snapshotting";
|
|
515
567
|
createdAt: number;
|
|
516
568
|
updatedAt: number;
|
|
517
569
|
name: string;
|
|
518
570
|
persistent: boolean;
|
|
519
|
-
|
|
571
|
+
currentSessionId: string;
|
|
572
|
+
memory?: number | undefined;
|
|
573
|
+
vcpus?: number | undefined;
|
|
574
|
+
region?: string | undefined;
|
|
575
|
+
runtime?: string | undefined;
|
|
576
|
+
timeout?: number | undefined;
|
|
577
|
+
cwd?: string | undefined;
|
|
520
578
|
networkPolicy?: z.objectInputType<{
|
|
521
579
|
mode: z.ZodLiteral<"allow-all">;
|
|
522
580
|
}, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
|
|
@@ -547,66 +605,63 @@ export declare class APIClient extends BaseClient {
|
|
|
547
605
|
currentSnapshotId?: string | undefined;
|
|
548
606
|
};
|
|
549
607
|
}>>;
|
|
550
|
-
|
|
608
|
+
listSandboxes(params: {
|
|
551
609
|
projectId: string;
|
|
552
610
|
limit?: number;
|
|
553
611
|
sortBy?: "createdAt" | "name";
|
|
554
612
|
namePrefix?: string;
|
|
555
613
|
cursor?: string;
|
|
556
614
|
signal?: AbortSignal;
|
|
557
|
-
}): Promise<{
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
region: string;
|
|
563
|
-
runtime: string;
|
|
564
|
-
timeout: number;
|
|
565
|
-
status: "aborted" | "pending" | "running" | "stopping" | "stopped" | "failed" | "snapshotting";
|
|
566
|
-
createdAt: number;
|
|
567
|
-
updatedAt: number;
|
|
568
|
-
name: string;
|
|
569
|
-
persistent: boolean;
|
|
570
|
-
currentSandboxId: string;
|
|
571
|
-
networkPolicy?: z.objectInputType<{
|
|
572
|
-
mode: z.ZodLiteral<"allow-all">;
|
|
573
|
-
}, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
|
|
574
|
-
mode: z.ZodLiteral<"deny-all">;
|
|
575
|
-
}, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
|
|
576
|
-
mode: z.ZodLiteral<"custom">;
|
|
577
|
-
allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
578
|
-
allowedCIDRs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
579
|
-
deniedCIDRs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
580
|
-
injectionRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
581
|
-
domain: z.ZodString;
|
|
582
|
-
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
583
|
-
headerNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
584
|
-
}, "strip", z.ZodTypeAny, {
|
|
585
|
-
domain: string;
|
|
586
|
-
headers?: Record<string, string> | undefined;
|
|
587
|
-
headerNames?: string[] | undefined;
|
|
588
|
-
}, {
|
|
589
|
-
domain: string;
|
|
590
|
-
headers?: Record<string, string> | undefined;
|
|
591
|
-
headerNames?: string[] | undefined;
|
|
592
|
-
}>, "many">>;
|
|
593
|
-
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
594
|
-
totalEgressBytes?: number | undefined;
|
|
595
|
-
totalIngressBytes?: number | undefined;
|
|
596
|
-
totalActiveCpuDurationMs?: number | undefined;
|
|
597
|
-
totalDurationMs?: number | undefined;
|
|
598
|
-
currentSnapshotId?: string | undefined;
|
|
599
|
-
}[];
|
|
600
|
-
pagination: {
|
|
601
|
-
count: number;
|
|
602
|
-
next: string | null;
|
|
603
|
-
total: number;
|
|
604
|
-
};
|
|
615
|
+
}): Promise<Parsed<{
|
|
616
|
+
pagination: {
|
|
617
|
+
count: number;
|
|
618
|
+
next: string | null;
|
|
619
|
+
total: number;
|
|
605
620
|
};
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
621
|
+
sandboxes: {
|
|
622
|
+
status: "aborted" | "pending" | "running" | "stopping" | "stopped" | "failed" | "snapshotting";
|
|
623
|
+
createdAt: number;
|
|
624
|
+
updatedAt: number;
|
|
625
|
+
name: string;
|
|
626
|
+
persistent: boolean;
|
|
627
|
+
currentSessionId: string;
|
|
628
|
+
memory?: number | undefined;
|
|
629
|
+
vcpus?: number | undefined;
|
|
630
|
+
region?: string | undefined;
|
|
631
|
+
runtime?: string | undefined;
|
|
632
|
+
timeout?: number | undefined;
|
|
633
|
+
cwd?: string | undefined;
|
|
634
|
+
networkPolicy?: z.objectInputType<{
|
|
635
|
+
mode: z.ZodLiteral<"allow-all">;
|
|
636
|
+
}, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
|
|
637
|
+
mode: z.ZodLiteral<"deny-all">;
|
|
638
|
+
}, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
|
|
639
|
+
mode: z.ZodLiteral<"custom">;
|
|
640
|
+
allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
641
|
+
allowedCIDRs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
642
|
+
deniedCIDRs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
643
|
+
injectionRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
644
|
+
domain: z.ZodString;
|
|
645
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
646
|
+
headerNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
647
|
+
}, "strip", z.ZodTypeAny, {
|
|
648
|
+
domain: string;
|
|
649
|
+
headers?: Record<string, string> | undefined;
|
|
650
|
+
headerNames?: string[] | undefined;
|
|
651
|
+
}, {
|
|
652
|
+
domain: string;
|
|
653
|
+
headers?: Record<string, string> | undefined;
|
|
654
|
+
headerNames?: string[] | undefined;
|
|
655
|
+
}>, "many">>;
|
|
656
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
657
|
+
totalEgressBytes?: number | undefined;
|
|
658
|
+
totalIngressBytes?: number | undefined;
|
|
659
|
+
totalActiveCpuDurationMs?: number | undefined;
|
|
660
|
+
totalDurationMs?: number | undefined;
|
|
661
|
+
currentSnapshotId?: string | undefined;
|
|
662
|
+
}[];
|
|
663
|
+
}>>;
|
|
664
|
+
updateSandbox(params: {
|
|
610
665
|
name: string;
|
|
611
666
|
projectId: string;
|
|
612
667
|
persistent?: boolean;
|
|
@@ -619,18 +674,19 @@ export declare class APIClient extends BaseClient {
|
|
|
619
674
|
networkPolicy?: NetworkPolicy;
|
|
620
675
|
signal?: AbortSignal;
|
|
621
676
|
}): Promise<Parsed<{
|
|
622
|
-
|
|
623
|
-
memory: number;
|
|
624
|
-
vcpus: number;
|
|
625
|
-
region: string;
|
|
626
|
-
runtime: string;
|
|
627
|
-
timeout: number;
|
|
677
|
+
sandbox: {
|
|
628
678
|
status: "aborted" | "pending" | "running" | "stopping" | "stopped" | "failed" | "snapshotting";
|
|
629
679
|
createdAt: number;
|
|
630
680
|
updatedAt: number;
|
|
631
681
|
name: string;
|
|
632
682
|
persistent: boolean;
|
|
633
|
-
|
|
683
|
+
currentSessionId: string;
|
|
684
|
+
memory?: number | undefined;
|
|
685
|
+
vcpus?: number | undefined;
|
|
686
|
+
region?: string | undefined;
|
|
687
|
+
runtime?: string | undefined;
|
|
688
|
+
timeout?: number | undefined;
|
|
689
|
+
cwd?: string | undefined;
|
|
634
690
|
networkPolicy?: z.objectInputType<{
|
|
635
691
|
mode: z.ZodLiteral<"allow-all">;
|
|
636
692
|
}, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
|
|
@@ -661,24 +717,24 @@ export declare class APIClient extends BaseClient {
|
|
|
661
717
|
currentSnapshotId?: string | undefined;
|
|
662
718
|
};
|
|
663
719
|
}>>;
|
|
664
|
-
|
|
720
|
+
deleteSandbox(params: {
|
|
665
721
|
name: string;
|
|
666
722
|
projectId: string;
|
|
667
|
-
preserveSnapshots?: boolean;
|
|
668
723
|
signal?: AbortSignal;
|
|
669
724
|
}): Promise<Parsed<{
|
|
670
|
-
|
|
671
|
-
memory: number;
|
|
672
|
-
vcpus: number;
|
|
673
|
-
region: string;
|
|
674
|
-
runtime: string;
|
|
675
|
-
timeout: number;
|
|
725
|
+
sandbox: {
|
|
676
726
|
status: "aborted" | "pending" | "running" | "stopping" | "stopped" | "failed" | "snapshotting";
|
|
677
727
|
createdAt: number;
|
|
678
728
|
updatedAt: number;
|
|
679
729
|
name: string;
|
|
680
730
|
persistent: boolean;
|
|
681
|
-
|
|
731
|
+
currentSessionId: string;
|
|
732
|
+
memory?: number | undefined;
|
|
733
|
+
vcpus?: number | undefined;
|
|
734
|
+
region?: string | undefined;
|
|
735
|
+
runtime?: string | undefined;
|
|
736
|
+
timeout?: number | undefined;
|
|
737
|
+
cwd?: string | undefined;
|
|
682
738
|
networkPolicy?: z.objectInputType<{
|
|
683
739
|
mode: z.ZodLiteral<"allow-all">;
|
|
684
740
|
}, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
|