@vercel/sandbox 0.0.22 → 0.0.24
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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-typecheck.log +1 -1
- package/CHANGELOG.md +12 -0
- package/dist/api-client/api-client.d.ts +7 -2
- package/dist/api-client/api-client.js +9 -1
- package/dist/api-client/base-client.d.ts +2 -2
- package/dist/api-client/base-client.js +2 -2
- package/dist/api-client/validators.d.ts +87 -0
- package/dist/api-client/validators.js +4 -1
- package/dist/sandbox.d.ts +19 -1
- package/dist/sandbox.js +26 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/api-client/api-client.ts +19 -2
- package/src/api-client/base-client.ts +4 -4
- package/src/api-client/validators.ts +4 -0
- package/src/sandbox.test.ts +25 -0
- package/src/sandbox.ts +33 -1
- package/src/version.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @vercel/sandbox
|
|
2
2
|
|
|
3
|
+
## 0.0.24
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Change base URL to vercel.com/api ([#150](https://github.com/vercel/sandbox-sdk/pull/150))
|
|
8
|
+
|
|
9
|
+
## 0.0.23
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Add `Sandbox.extendTimeout()` ([#148](https://github.com/vercel/sandbox-sdk/pull/148))
|
|
14
|
+
|
|
3
15
|
## 0.0.22
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseClient, type Parsed, type RequestParams } from "./base-client";
|
|
2
|
-
import { SandboxResponse, CommandResponse, CommandFinishedResponse, LogLine } from "./validators";
|
|
2
|
+
import { SandboxResponse, CommandResponse, CommandFinishedResponse, LogLine, ExtendTimeoutResponse } from "./validators";
|
|
3
3
|
import { FileWriter } from "./file-writer";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { WithPrivate } from "../utils/types";
|
|
@@ -7,7 +7,7 @@ export declare class APIClient extends BaseClient {
|
|
|
7
7
|
private teamId;
|
|
8
8
|
private tokenExpiry;
|
|
9
9
|
constructor(params: {
|
|
10
|
-
|
|
10
|
+
baseUrl?: string;
|
|
11
11
|
teamId: string;
|
|
12
12
|
token: string;
|
|
13
13
|
});
|
|
@@ -218,4 +218,9 @@ export declare class APIClient extends BaseClient {
|
|
|
218
218
|
sandboxId: string;
|
|
219
219
|
signal?: AbortSignal;
|
|
220
220
|
}): Promise<Parsed<z.infer<typeof SandboxResponse>>>;
|
|
221
|
+
extendTimeout(params: {
|
|
222
|
+
sandboxId: string;
|
|
223
|
+
duration: number;
|
|
224
|
+
signal?: AbortSignal;
|
|
225
|
+
}): Promise<Parsed<z.infer<typeof ExtendTimeoutResponse>>>;
|
|
221
226
|
}
|
|
@@ -19,7 +19,7 @@ const types_1 = require("../utils/types");
|
|
|
19
19
|
class APIClient extends base_client_1.BaseClient {
|
|
20
20
|
constructor(params) {
|
|
21
21
|
super({
|
|
22
|
-
|
|
22
|
+
baseUrl: params.baseUrl ?? "https://vercel.com/api",
|
|
23
23
|
token: params.token,
|
|
24
24
|
debug: false,
|
|
25
25
|
});
|
|
@@ -212,6 +212,14 @@ class APIClient extends base_client_1.BaseClient {
|
|
|
212
212
|
const url = `/v1/sandboxes/${params.sandboxId}/stop`;
|
|
213
213
|
return (0, base_client_1.parseOrThrow)(validators_1.SandboxResponse, await this.request(url, { method: "POST", signal: params.signal }));
|
|
214
214
|
}
|
|
215
|
+
async extendTimeout(params) {
|
|
216
|
+
const url = `/v1/sandboxes/${params.sandboxId}/extend-timeout`;
|
|
217
|
+
return (0, base_client_1.parseOrThrow)(validators_1.ExtendTimeoutResponse, await this.request(url, {
|
|
218
|
+
method: "POST",
|
|
219
|
+
body: JSON.stringify({ duration: params.duration }),
|
|
220
|
+
signal: params.signal,
|
|
221
|
+
}));
|
|
222
|
+
}
|
|
215
223
|
}
|
|
216
224
|
exports.APIClient = APIClient;
|
|
217
225
|
async function pipe(readable, output) {
|
|
@@ -18,11 +18,11 @@ export declare class BaseClient {
|
|
|
18
18
|
protected token?: string;
|
|
19
19
|
private fetch;
|
|
20
20
|
private debug;
|
|
21
|
-
private
|
|
21
|
+
private baseUrl;
|
|
22
22
|
private agent;
|
|
23
23
|
constructor(params: {
|
|
24
24
|
debug?: boolean;
|
|
25
|
-
|
|
25
|
+
baseUrl: string;
|
|
26
26
|
token?: string;
|
|
27
27
|
});
|
|
28
28
|
protected request(path: string, opts?: RequestParams): Promise<Response>;
|
|
@@ -15,7 +15,7 @@ const undici_1 = require("undici");
|
|
|
15
15
|
class BaseClient {
|
|
16
16
|
constructor(params) {
|
|
17
17
|
this.fetch = (0, with_retry_1.withRetry)(globalThis.fetch);
|
|
18
|
-
this.
|
|
18
|
+
this.baseUrl = params.baseUrl;
|
|
19
19
|
this.debug = params.debug ?? process.env.DEBUG_FETCH === "true";
|
|
20
20
|
this.token = params.token;
|
|
21
21
|
this.agent = new undici_1.Agent({
|
|
@@ -23,7 +23,7 @@ class BaseClient {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
async request(path, opts) {
|
|
26
|
-
const url = new URL(
|
|
26
|
+
const url = new URL(`${this.baseUrl}${path}`);
|
|
27
27
|
if (opts?.query) {
|
|
28
28
|
for (const [key, value] of Object.entries(opts.query)) {
|
|
29
29
|
(0, array_1.array)(value).forEach((value) => {
|
|
@@ -540,3 +540,90 @@ export declare const SandboxesResponse: z.ZodObject<{
|
|
|
540
540
|
prev: number | null;
|
|
541
541
|
};
|
|
542
542
|
}>;
|
|
543
|
+
export declare const ExtendTimeoutResponse: z.ZodObject<{
|
|
544
|
+
sandbox: z.ZodObject<{
|
|
545
|
+
id: z.ZodString;
|
|
546
|
+
memory: z.ZodNumber;
|
|
547
|
+
vcpus: z.ZodNumber;
|
|
548
|
+
region: z.ZodString;
|
|
549
|
+
runtime: z.ZodString;
|
|
550
|
+
timeout: z.ZodNumber;
|
|
551
|
+
status: z.ZodEnum<["pending", "running", "stopping", "stopped", "failed"]>;
|
|
552
|
+
requestedAt: z.ZodNumber;
|
|
553
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
554
|
+
requestedStopAt: z.ZodOptional<z.ZodNumber>;
|
|
555
|
+
stoppedAt: z.ZodOptional<z.ZodNumber>;
|
|
556
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
557
|
+
createdAt: z.ZodNumber;
|
|
558
|
+
cwd: z.ZodString;
|
|
559
|
+
updatedAt: z.ZodNumber;
|
|
560
|
+
}, "strip", z.ZodTypeAny, {
|
|
561
|
+
region: string;
|
|
562
|
+
status: "pending" | "running" | "stopping" | "stopped" | "failed";
|
|
563
|
+
timeout: number;
|
|
564
|
+
cwd: string;
|
|
565
|
+
id: string;
|
|
566
|
+
memory: number;
|
|
567
|
+
vcpus: number;
|
|
568
|
+
runtime: string;
|
|
569
|
+
requestedAt: number;
|
|
570
|
+
createdAt: number;
|
|
571
|
+
updatedAt: number;
|
|
572
|
+
duration?: number | undefined;
|
|
573
|
+
startedAt?: number | undefined;
|
|
574
|
+
requestedStopAt?: number | undefined;
|
|
575
|
+
stoppedAt?: number | undefined;
|
|
576
|
+
}, {
|
|
577
|
+
region: string;
|
|
578
|
+
status: "pending" | "running" | "stopping" | "stopped" | "failed";
|
|
579
|
+
timeout: number;
|
|
580
|
+
cwd: string;
|
|
581
|
+
id: string;
|
|
582
|
+
memory: number;
|
|
583
|
+
vcpus: number;
|
|
584
|
+
runtime: string;
|
|
585
|
+
requestedAt: number;
|
|
586
|
+
createdAt: number;
|
|
587
|
+
updatedAt: number;
|
|
588
|
+
duration?: number | undefined;
|
|
589
|
+
startedAt?: number | undefined;
|
|
590
|
+
requestedStopAt?: number | undefined;
|
|
591
|
+
stoppedAt?: number | undefined;
|
|
592
|
+
}>;
|
|
593
|
+
}, "strip", z.ZodTypeAny, {
|
|
594
|
+
sandbox: {
|
|
595
|
+
region: string;
|
|
596
|
+
status: "pending" | "running" | "stopping" | "stopped" | "failed";
|
|
597
|
+
timeout: number;
|
|
598
|
+
cwd: string;
|
|
599
|
+
id: string;
|
|
600
|
+
memory: number;
|
|
601
|
+
vcpus: number;
|
|
602
|
+
runtime: string;
|
|
603
|
+
requestedAt: number;
|
|
604
|
+
createdAt: number;
|
|
605
|
+
updatedAt: number;
|
|
606
|
+
duration?: number | undefined;
|
|
607
|
+
startedAt?: number | undefined;
|
|
608
|
+
requestedStopAt?: number | undefined;
|
|
609
|
+
stoppedAt?: number | undefined;
|
|
610
|
+
};
|
|
611
|
+
}, {
|
|
612
|
+
sandbox: {
|
|
613
|
+
region: string;
|
|
614
|
+
status: "pending" | "running" | "stopping" | "stopped" | "failed";
|
|
615
|
+
timeout: number;
|
|
616
|
+
cwd: string;
|
|
617
|
+
id: string;
|
|
618
|
+
memory: number;
|
|
619
|
+
vcpus: number;
|
|
620
|
+
runtime: string;
|
|
621
|
+
requestedAt: number;
|
|
622
|
+
createdAt: number;
|
|
623
|
+
updatedAt: number;
|
|
624
|
+
duration?: number | undefined;
|
|
625
|
+
startedAt?: number | undefined;
|
|
626
|
+
requestedStopAt?: number | undefined;
|
|
627
|
+
stoppedAt?: number | undefined;
|
|
628
|
+
};
|
|
629
|
+
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SandboxesResponse = exports.LogLine = exports.EmptyResponse = exports.CommandFinishedResponse = exports.CommandResponse = exports.SandboxAndRoutesResponse = exports.SandboxResponse = exports.Command = exports.Pagination = exports.SandboxRoute = exports.Sandbox = void 0;
|
|
3
|
+
exports.ExtendTimeoutResponse = exports.SandboxesResponse = exports.LogLine = exports.EmptyResponse = exports.CommandFinishedResponse = exports.CommandResponse = exports.SandboxAndRoutesResponse = exports.SandboxResponse = exports.Command = exports.Pagination = exports.SandboxRoute = exports.Sandbox = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.Sandbox = zod_1.z.object({
|
|
6
6
|
id: zod_1.z.string(),
|
|
@@ -74,3 +74,6 @@ exports.SandboxesResponse = zod_1.z.object({
|
|
|
74
74
|
sandboxes: zod_1.z.array(exports.Sandbox),
|
|
75
75
|
pagination: exports.Pagination,
|
|
76
76
|
});
|
|
77
|
+
exports.ExtendTimeoutResponse = zod_1.z.object({
|
|
78
|
+
sandbox: exports.Sandbox,
|
|
79
|
+
});
|
package/dist/sandbox.d.ts
CHANGED
|
@@ -130,10 +130,14 @@ export declare class Sandbox {
|
|
|
130
130
|
* The status of the sandbox.
|
|
131
131
|
*/
|
|
132
132
|
get status(): SandboxMetaData["status"];
|
|
133
|
+
/**
|
|
134
|
+
* The timeout of the sandbox in milliseconds.
|
|
135
|
+
*/
|
|
136
|
+
get timeout(): number;
|
|
133
137
|
/**
|
|
134
138
|
* Internal metadata about this sandbox.
|
|
135
139
|
*/
|
|
136
|
-
private
|
|
140
|
+
private sandbox;
|
|
137
141
|
/**
|
|
138
142
|
* Allow to get a list of sandboxes for a team narrowed to the given params.
|
|
139
143
|
* It returns both the sandboxes and the pagination metadata to allow getting
|
|
@@ -294,5 +298,19 @@ export declare class Sandbox {
|
|
|
294
298
|
stop(opts?: {
|
|
295
299
|
signal?: AbortSignal;
|
|
296
300
|
}): Promise<void>;
|
|
301
|
+
/**
|
|
302
|
+
* Extend the timeout of the sandbox by the specified duration.
|
|
303
|
+
*
|
|
304
|
+
* This allows you to extend the lifetime of a sandbox up until the maximum
|
|
305
|
+
* execution timeout for your plan.
|
|
306
|
+
*
|
|
307
|
+
* @param duration - The duration in milliseconds to extend the timeout by
|
|
308
|
+
* @param opts - Optional parameters.
|
|
309
|
+
* @param opts.signal - An AbortSignal to cancel the operation.
|
|
310
|
+
* @returns A promise that resolves when the timeout is extended
|
|
311
|
+
*/
|
|
312
|
+
extendTimeout(duration: number, opts?: {
|
|
313
|
+
signal?: AbortSignal;
|
|
314
|
+
}): Promise<void>;
|
|
297
315
|
}
|
|
298
316
|
export {};
|
package/dist/sandbox.js
CHANGED
|
@@ -24,6 +24,12 @@ class Sandbox {
|
|
|
24
24
|
get status() {
|
|
25
25
|
return this.sandbox.status;
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* The timeout of the sandbox in milliseconds.
|
|
29
|
+
*/
|
|
30
|
+
get timeout() {
|
|
31
|
+
return this.sandbox.timeout;
|
|
32
|
+
}
|
|
27
33
|
/**
|
|
28
34
|
* Allow to get a list of sandboxes for a team narrowed to the given params.
|
|
29
35
|
* It returns both the sandboxes and the pagination metadata to allow getting
|
|
@@ -242,5 +248,25 @@ class Sandbox {
|
|
|
242
248
|
signal: opts?.signal,
|
|
243
249
|
});
|
|
244
250
|
}
|
|
251
|
+
/**
|
|
252
|
+
* Extend the timeout of the sandbox by the specified duration.
|
|
253
|
+
*
|
|
254
|
+
* This allows you to extend the lifetime of a sandbox up until the maximum
|
|
255
|
+
* execution timeout for your plan.
|
|
256
|
+
*
|
|
257
|
+
* @param duration - The duration in milliseconds to extend the timeout by
|
|
258
|
+
* @param opts - Optional parameters.
|
|
259
|
+
* @param opts.signal - An AbortSignal to cancel the operation.
|
|
260
|
+
* @returns A promise that resolves when the timeout is extended
|
|
261
|
+
*/
|
|
262
|
+
async extendTimeout(duration, opts) {
|
|
263
|
+
const response = await this.client.extendTimeout({
|
|
264
|
+
sandboxId: this.sandbox.id,
|
|
265
|
+
duration,
|
|
266
|
+
signal: opts?.signal,
|
|
267
|
+
});
|
|
268
|
+
// Update the internal sandbox metadata with the new timeout value
|
|
269
|
+
this.sandbox = response.json.sandbox;
|
|
270
|
+
}
|
|
245
271
|
}
|
|
246
272
|
exports.Sandbox = Sandbox;
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.0.
|
|
1
|
+
export declare const VERSION = "0.0.24";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
EmptyResponse,
|
|
13
13
|
LogLine,
|
|
14
14
|
SandboxesResponse,
|
|
15
|
+
ExtendTimeoutResponse,
|
|
15
16
|
} from "./validators";
|
|
16
17
|
import { APIError } from "./api-error";
|
|
17
18
|
import { FileWriter } from "./file-writer";
|
|
@@ -29,9 +30,9 @@ export class APIClient extends BaseClient {
|
|
|
29
30
|
private teamId: string;
|
|
30
31
|
private tokenExpiry: JwtExpiry | null;
|
|
31
32
|
|
|
32
|
-
constructor(params: {
|
|
33
|
+
constructor(params: { baseUrl?: string; teamId: string; token: string }) {
|
|
33
34
|
super({
|
|
34
|
-
|
|
35
|
+
baseUrl: params.baseUrl ?? "https://vercel.com/api",
|
|
35
36
|
token: params.token,
|
|
36
37
|
debug: false,
|
|
37
38
|
});
|
|
@@ -393,6 +394,22 @@ export class APIClient extends BaseClient {
|
|
|
393
394
|
await this.request(url, { method: "POST", signal: params.signal }),
|
|
394
395
|
);
|
|
395
396
|
}
|
|
397
|
+
|
|
398
|
+
async extendTimeout(params: {
|
|
399
|
+
sandboxId: string;
|
|
400
|
+
duration: number;
|
|
401
|
+
signal?: AbortSignal;
|
|
402
|
+
}): Promise<Parsed<z.infer<typeof ExtendTimeoutResponse>>> {
|
|
403
|
+
const url = `/v1/sandboxes/${params.sandboxId}/extend-timeout`;
|
|
404
|
+
return parseOrThrow(
|
|
405
|
+
ExtendTimeoutResponse,
|
|
406
|
+
await this.request(url, {
|
|
407
|
+
method: "POST",
|
|
408
|
+
body: JSON.stringify({ duration: params.duration }),
|
|
409
|
+
signal: params.signal,
|
|
410
|
+
}),
|
|
411
|
+
);
|
|
412
|
+
}
|
|
396
413
|
}
|
|
397
414
|
|
|
398
415
|
async function pipe(
|
|
@@ -22,12 +22,12 @@ export class BaseClient {
|
|
|
22
22
|
protected token?: string;
|
|
23
23
|
private fetch: ReturnType<typeof withRetry<RequestInit>>;
|
|
24
24
|
private debug: boolean;
|
|
25
|
-
private
|
|
25
|
+
private baseUrl: string;
|
|
26
26
|
private agent: Agent;
|
|
27
27
|
|
|
28
|
-
constructor(params: { debug?: boolean;
|
|
28
|
+
constructor(params: { debug?: boolean; baseUrl: string; token?: string }) {
|
|
29
29
|
this.fetch = withRetry(globalThis.fetch);
|
|
30
|
-
this.
|
|
30
|
+
this.baseUrl = params.baseUrl;
|
|
31
31
|
this.debug = params.debug ?? process.env.DEBUG_FETCH === "true";
|
|
32
32
|
this.token = params.token;
|
|
33
33
|
this.agent = new Agent({
|
|
@@ -36,7 +36,7 @@ export class BaseClient {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
protected async request(path: string, opts?: RequestParams) {
|
|
39
|
-
const url = new URL(
|
|
39
|
+
const url = new URL(`${this.baseUrl}${path}`);
|
|
40
40
|
if (opts?.query) {
|
|
41
41
|
for (const [key, value] of Object.entries(opts.query)) {
|
|
42
42
|
array(value).forEach((value) => {
|
package/src/sandbox.test.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { it, beforeEach, afterEach, expect } from "vitest";
|
|
2
2
|
import { consumeReadable } from "./utils/consume-readable";
|
|
3
3
|
import { Sandbox } from "./sandbox";
|
|
4
|
+
import { APIError } from "./api-client/api-error";
|
|
5
|
+
import ms from "ms";
|
|
4
6
|
|
|
5
7
|
const PORTS = [3000, 4000];
|
|
6
8
|
let sandbox: Sandbox;
|
|
@@ -64,3 +66,26 @@ for (const port of ports) {
|
|
|
64
66
|
|
|
65
67
|
await server.kill();
|
|
66
68
|
});
|
|
69
|
+
|
|
70
|
+
it("allows extending the sandbox timeout", async () => {
|
|
71
|
+
const originalTimeout = sandbox.timeout;
|
|
72
|
+
const extensionDuration = ms("5m");
|
|
73
|
+
|
|
74
|
+
await sandbox.extendTimeout(extensionDuration);
|
|
75
|
+
expect(sandbox.timeout).toEqual(originalTimeout + extensionDuration);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("raises an error when the timeout cannot be updated", async () => {
|
|
79
|
+
try {
|
|
80
|
+
await sandbox.extendTimeout(ms("5d"));
|
|
81
|
+
expect.fail("Expected extendTimeout to throw an error");
|
|
82
|
+
} catch (error) {
|
|
83
|
+
expect(error).toBeInstanceOf(APIError);
|
|
84
|
+
expect(error).toMatchObject({
|
|
85
|
+
response: { status: 400 },
|
|
86
|
+
json: {
|
|
87
|
+
error: { code: "sandbox_timeout_invalid" },
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
});
|
package/src/sandbox.ts
CHANGED
|
@@ -142,10 +142,17 @@ export class Sandbox {
|
|
|
142
142
|
return this.sandbox.status;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
+
/**
|
|
146
|
+
* The timeout of the sandbox in milliseconds.
|
|
147
|
+
*/
|
|
148
|
+
public get timeout(): number {
|
|
149
|
+
return this.sandbox.timeout;
|
|
150
|
+
}
|
|
151
|
+
|
|
145
152
|
/**
|
|
146
153
|
* Internal metadata about this sandbox.
|
|
147
154
|
*/
|
|
148
|
-
private
|
|
155
|
+
private sandbox: SandboxMetaData;
|
|
149
156
|
|
|
150
157
|
/**
|
|
151
158
|
* Allow to get a list of sandboxes for a team narrowed to the given params.
|
|
@@ -444,4 +451,29 @@ export class Sandbox {
|
|
|
444
451
|
signal: opts?.signal,
|
|
445
452
|
});
|
|
446
453
|
}
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Extend the timeout of the sandbox by the specified duration.
|
|
457
|
+
*
|
|
458
|
+
* This allows you to extend the lifetime of a sandbox up until the maximum
|
|
459
|
+
* execution timeout for your plan.
|
|
460
|
+
*
|
|
461
|
+
* @param duration - The duration in milliseconds to extend the timeout by
|
|
462
|
+
* @param opts - Optional parameters.
|
|
463
|
+
* @param opts.signal - An AbortSignal to cancel the operation.
|
|
464
|
+
* @returns A promise that resolves when the timeout is extended
|
|
465
|
+
*/
|
|
466
|
+
async extendTimeout(
|
|
467
|
+
duration: number,
|
|
468
|
+
opts?: { signal?: AbortSignal },
|
|
469
|
+
): Promise<void> {
|
|
470
|
+
const response = await this.client.extendTimeout({
|
|
471
|
+
sandboxId: this.sandbox.id,
|
|
472
|
+
duration,
|
|
473
|
+
signal: opts?.signal,
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
// Update the internal sandbox metadata with the new timeout value
|
|
477
|
+
this.sandbox = response.json.sandbox;
|
|
478
|
+
}
|
|
447
479
|
}
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Autogenerated by inject-version.ts
|
|
2
|
-
export const VERSION = "0.0.
|
|
2
|
+
export const VERSION = "0.0.24";
|