@daytonaio/sdk 0.201.0 → 0.203.0
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/cjs/CodeInterpreter.js +1 -1
- package/cjs/CodeInterpreter.js.map +1 -1
- package/cjs/Daytona.d.ts +32 -6
- package/cjs/Daytona.js +35 -21
- package/cjs/Daytona.js.map +1 -1
- package/cjs/Image.js +14 -14
- package/cjs/Image.js.map +1 -1
- package/cjs/LspServer.js +1 -1
- package/cjs/LspServer.js.map +1 -1
- package/cjs/Process.d.ts +9 -3
- package/cjs/Process.js +26 -5
- package/cjs/Process.js.map +1 -1
- package/cjs/README.md +43 -0
- package/cjs/Sandbox.d.ts +23 -11
- package/cjs/Sandbox.js +54 -35
- package/cjs/Sandbox.js.map +1 -1
- package/cjs/Secret.d.ts +4 -4
- package/cjs/Secret.js +4 -4
- package/cjs/Snapshot.d.ts +3 -3
- package/cjs/Snapshot.js +3 -3
- package/cjs/errors/DaytonaError.d.ts +50 -4
- package/cjs/errors/DaytonaError.js +74 -7
- package/cjs/errors/DaytonaError.js.map +1 -1
- package/cjs/index.d.ts +2 -2
- package/cjs/index.js +6 -2
- package/cjs/index.js.map +1 -1
- package/esm/CodeInterpreter.js +2 -2
- package/esm/CodeInterpreter.js.map +1 -1
- package/esm/Daytona.d.ts +32 -6
- package/esm/Daytona.js +36 -22
- package/esm/Daytona.js.map +1 -1
- package/esm/Image.js +15 -15
- package/esm/Image.js.map +1 -1
- package/esm/LspServer.js +2 -2
- package/esm/LspServer.js.map +1 -1
- package/esm/Process.d.ts +9 -3
- package/esm/Process.js +26 -5
- package/esm/Process.js.map +1 -1
- package/esm/README.md +43 -0
- package/esm/Sandbox.d.ts +23 -11
- package/esm/Sandbox.js +55 -36
- package/esm/Sandbox.js.map +1 -1
- package/esm/Secret.d.ts +4 -4
- package/esm/Secret.js +4 -4
- package/esm/Snapshot.d.ts +3 -3
- package/esm/Snapshot.js +3 -3
- package/esm/errors/DaytonaError.d.ts +50 -4
- package/esm/errors/DaytonaError.js +70 -6
- package/esm/errors/DaytonaError.js.map +1 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.js +3 -1
- package/esm/index.js.map +1 -1
- package/esm/utils/Import.js +1 -1
- package/package.json +5 -5
package/cjs/LspServer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LspServer.js","sourceRoot":"","sources":["../../../../sdk-typescript/src/LspServer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAIH,
|
|
1
|
+
{"version":3,"file":"LspServer.js","sourceRoot":"","sources":["../../../../sdk-typescript/src/LspServer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAIH,wDAAmE;AACnE,2DAA4D;AAE5D;;GAEG;AACH,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,kCAAiB,CAAA;IACjB,0CAAyB,CAAA;IACzB,0CAAyB,CAAA;AAC3B,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AAuBD;;;;;;;;;;GAUG;IACU,SAAS;;;;;;;;;;iBAAT,SAAS;;;iCAwBnB,IAAA,oCAAmB,GAAE;gCAkBrB,IAAA,oCAAmB,GAAE;mCAqBrB,IAAA,oCAAmB,GAAE;oCAqBrB,IAAA,oCAAmB,GAAE;2CA0BrB,IAAA,oCAAmB,GAAE;4CAiBrB,IAAA,oCAAmB,GAAE;0CAqBrB,IAAA,oCAAmB,GAAE;uCAiCrB,IAAA,oCAAmB,GAAE;YA5JtB,0KAAa,KAAK,6DAKjB;YAaD,uKAAa,IAAI,6DAKhB;YAgBD,gLAAa,OAAO,6DAMnB;YAeD,mLAAa,QAAQ,6DAMpB;YAoBD,wMAAa,eAAe,6DAG3B;YAcD,2MAAa,gBAAgB,6DAE5B;YAmBD,qMAAa,cAAc,6DAG1B;YA8BD,4LAAa,WAAW,6DAWvB;;;QA/LkB,UAAU,GAFlB,2DAAS;QAGD,aAAa;QACb,SAAS;QAH5B,YACmB,UAAy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@ export declare class Process {
|
|
|
38
38
|
private readonly apiClient;
|
|
39
39
|
private readonly getPreviewToken;
|
|
40
40
|
private readonly language?;
|
|
41
|
-
|
|
41
|
+
private readonly requestTimeoutMs?;
|
|
42
|
+
constructor(clientConfig: Configuration, apiClient: ProcessApi, getPreviewToken: () => Promise<string>, language?: string, requestTimeoutMs?: number);
|
|
43
|
+
private execRequestOptions;
|
|
42
44
|
/**
|
|
43
45
|
* Executes a shell command in the Sandbox.
|
|
44
46
|
*
|
|
45
47
|
* @param {string} command - Shell command to execute
|
|
46
48
|
* @param {string} [cwd] - Working directory for command execution. If not specified, uses the sandbox working directory.
|
|
47
49
|
* @param {Record<string, string>} [env] - Environment variables to set for the command
|
|
48
|
-
* @param {number} [timeout] - Maximum time in seconds to wait for the command to complete.
|
|
50
|
+
* @param {number} [timeout] - Maximum time in seconds to wait for the command to complete. The command is
|
|
51
|
+
* terminated when it elapses. The HTTP request waits for the full timeout, even beyond
|
|
52
|
+
* the client-wide `requestTimeoutMs`; `0` disables the server-side limit.
|
|
49
53
|
* @returns {Promise<ExecuteResponse>} Command execution results containing:
|
|
50
54
|
* - exitCode: The command's exit status
|
|
51
55
|
* - result: Standard output from the command
|
|
@@ -70,7 +74,9 @@ export declare class Process {
|
|
|
70
74
|
*
|
|
71
75
|
* @param {string} code - Code to execute
|
|
72
76
|
* @param {CodeRunParams} params - Parameters for code execution
|
|
73
|
-
* @param {number} [timeout] - Maximum time in seconds to wait for execution to complete
|
|
77
|
+
* @param {number} [timeout] - Maximum time in seconds to wait for execution to complete. The execution is
|
|
78
|
+
* terminated when it elapses. The HTTP request waits for the full timeout, even beyond
|
|
79
|
+
* the client-wide `requestTimeoutMs`; `0` disables the server-side limit.
|
|
74
80
|
* @returns {Promise<ExecuteResponse>} Code execution results containing:
|
|
75
81
|
* - exitCode: The execution's exit status
|
|
76
82
|
* - result: Standard output from the code
|
package/cjs/Process.js
CHANGED
|
@@ -19,6 +19,9 @@ exports.MAX_PREFIX_LEN = Math.max(exports.STDOUT_PREFIX_BYTES.length, exports.ST
|
|
|
19
19
|
// Capability token advertised on PTY WebSocket connects so the daemon sends the
|
|
20
20
|
// "exited" control message; clients that don't send it only get the close frame.
|
|
21
21
|
const PTY_EXIT_CONTROL_SUBPROTOCOL = 'X-Daytona-Pty-Exit-Control';
|
|
22
|
+
// Pads the per-request HTTP deadline over the server-side execution timeout,
|
|
23
|
+
// mirroring Go's execContext (timeout + 5s) and Python's `_request_timeout = timeout + 5`.
|
|
24
|
+
const EXEC_TIMEOUT_BUFFER_MS = 5000;
|
|
22
25
|
/**
|
|
23
26
|
* Parameters for code execution.
|
|
24
27
|
*/
|
|
@@ -94,11 +97,25 @@ let Process = (() => {
|
|
|
94
97
|
apiClient;
|
|
95
98
|
getPreviewToken;
|
|
96
99
|
language;
|
|
97
|
-
|
|
100
|
+
requestTimeoutMs;
|
|
101
|
+
constructor(clientConfig, apiClient, getPreviewToken, language, requestTimeoutMs) {
|
|
98
102
|
this.clientConfig = clientConfig;
|
|
99
103
|
this.apiClient = apiClient;
|
|
100
104
|
this.getPreviewToken = getPreviewToken;
|
|
101
105
|
this.language = language;
|
|
106
|
+
this.requestTimeoutMs = requestTimeoutMs;
|
|
107
|
+
}
|
|
108
|
+
// With an explicit execution timeout the HTTP wait must not be capped by a
|
|
109
|
+
// configured bounded DaytonaConfig.requestTimeoutMs: the request is bounded by
|
|
110
|
+
// the execution timeout + buffer instead. A non-positive execution timeout
|
|
111
|
+
// leaves the wait uncapped (0 disables the server-side limit; negatives fail
|
|
112
|
+
// fast at the API). Without a configured positive requestTimeoutMs no override
|
|
113
|
+
// is applied, preserving the client-wide default deadline as-is.
|
|
114
|
+
execRequestOptions(timeout) {
|
|
115
|
+
if (timeout === undefined || this.requestTimeoutMs === undefined || this.requestTimeoutMs <= 0) {
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
return { timeout: timeout > 0 ? timeout * 1000 + EXEC_TIMEOUT_BUFFER_MS : 0 };
|
|
102
119
|
}
|
|
103
120
|
/**
|
|
104
121
|
* Executes a shell command in the Sandbox.
|
|
@@ -106,7 +123,9 @@ let Process = (() => {
|
|
|
106
123
|
* @param {string} command - Shell command to execute
|
|
107
124
|
* @param {string} [cwd] - Working directory for command execution. If not specified, uses the sandbox working directory.
|
|
108
125
|
* @param {Record<string, string>} [env] - Environment variables to set for the command
|
|
109
|
-
* @param {number} [timeout] - Maximum time in seconds to wait for the command to complete.
|
|
126
|
+
* @param {number} [timeout] - Maximum time in seconds to wait for the command to complete. The command is
|
|
127
|
+
* terminated when it elapses. The HTTP request waits for the full timeout, even beyond
|
|
128
|
+
* the client-wide `requestTimeoutMs`; `0` disables the server-side limit.
|
|
110
129
|
* @returns {Promise<ExecuteResponse>} Command execution results containing:
|
|
111
130
|
* - exitCode: The command's exit status
|
|
112
131
|
* - result: Standard output from the command
|
|
@@ -131,7 +150,7 @@ let Process = (() => {
|
|
|
131
150
|
timeout,
|
|
132
151
|
cwd: cwd,
|
|
133
152
|
envs: env && Object.keys(env).length ? env : undefined,
|
|
134
|
-
});
|
|
153
|
+
}, this.execRequestOptions(timeout));
|
|
135
154
|
const result = response.data.result ?? '';
|
|
136
155
|
return {
|
|
137
156
|
exitCode: response.data.exitCode ?? response.data.code,
|
|
@@ -146,7 +165,9 @@ let Process = (() => {
|
|
|
146
165
|
*
|
|
147
166
|
* @param {string} code - Code to execute
|
|
148
167
|
* @param {CodeRunParams} params - Parameters for code execution
|
|
149
|
-
* @param {number} [timeout] - Maximum time in seconds to wait for execution to complete
|
|
168
|
+
* @param {number} [timeout] - Maximum time in seconds to wait for execution to complete. The execution is
|
|
169
|
+
* terminated when it elapses. The HTTP request waits for the full timeout, even beyond
|
|
170
|
+
* the client-wide `requestTimeoutMs`; `0` disables the server-side limit.
|
|
150
171
|
* @returns {Promise<ExecuteResponse>} Code execution results containing:
|
|
151
172
|
* - exitCode: The execution's exit status
|
|
152
173
|
* - result: Standard output from the code
|
|
@@ -210,7 +231,7 @@ let Process = (() => {
|
|
|
210
231
|
envs: params?.env,
|
|
211
232
|
timeout,
|
|
212
233
|
};
|
|
213
|
-
const response = await this.apiClient.codeRun(request);
|
|
234
|
+
const response = await this.apiClient.codeRun(request, this.execRequestOptions(timeout));
|
|
214
235
|
const data = response.data;
|
|
215
236
|
const charts = data.artifacts?.charts?.map(Charts_1.parseChart) ?? [];
|
|
216
237
|
return {
|
package/cjs/Process.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Process.js","sourceRoot":"","sources":["../../../../sdk-typescript/src/Process.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;
|
|
1
|
+
{"version":3,"file":"Process.js","sourceRoot":"","sources":["../../../../sdk-typescript/src/Process.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAaH,2CAA2C;AAC3C,2CAA+C;AAC/C,2CAAuC;AAEvC,iDAA0D;AAC1D,2CAAyC;AACzC,2DAA4D;AAE5D,6DAA6D;AAChD,QAAA,mBAAmB,GAAG,IAAI,UAAU,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AACxD,QAAA,mBAAmB,GAAG,IAAI,UAAU,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AACxD,QAAA,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,2BAAmB,CAAC,MAAM,EAAE,2BAAmB,CAAC,MAAM,CAAC,CAAA;AAE9F,gFAAgF;AAChF,iFAAiF;AACjF,MAAM,4BAA4B,GAAG,4BAA4B,CAAA;AAEjE,6EAA6E;AAC7E,2FAA2F;AAC3F,MAAM,sBAAsB,GAAG,IAAI,CAAA;AAEnC;;GAEG;AACH,MAAa,aAAa;IACxB;;OAEG;IACH,IAAI,CAAW;IACf;;OAEG;IACH,GAAG,CAAyB;CAC7B;AATD,sCASC;AAaD;;;;GAIG;IACU,OAAO;;;;;;;;;;;;;;;;;iBAAP,OAAO;;;0CAiDjB,IAA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AAK,CAAC,iBAAiB,CAAC,SAAiB;YAC9C,OAAO,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAA;QAC7D,CAAC;QAED;;;;;;;;;;;;;;;;;;;;;;;;WAwBG;QAEI,KAAK,CAAC,cAAc,CAAC,SAAiB;YAC3C,MAAM,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAA;QAClD,CAAC;QAED;;;;;;;;;;;;;;;;;;;;;;;;WAwBG;QAEI,KAAK,CAAC,gBAAgB,CAAC,SAAiB,EAAE,IAAY,EAAE,IAAY;YACzE,OAAO,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;QAChF,CAAC;;;AA7sBU,0BAAO"}
|
package/cjs/README.md
CHANGED
|
@@ -174,3 +174,46 @@ const completions = await lsp.completions('path/to/file.ts', {
|
|
|
174
174
|
character: 15,
|
|
175
175
|
})
|
|
176
176
|
```
|
|
177
|
+
|
|
178
|
+
## List method return shapes
|
|
179
|
+
|
|
180
|
+
Each `list` method returns a different shape depending on the resource. The table below shows the exact return type and how to access the elements.
|
|
181
|
+
|
|
182
|
+
| Method | Return type | Shape | Access elements |
|
|
183
|
+
| --- | --- | --- | --- |
|
|
184
|
+
| `daytona.snapshot.list(page?, limit?)` | `Promise<PaginatedSnapshots>` | Paginated wrapper | `result.items.forEach(...)` |
|
|
185
|
+
| `daytona.secret.list(query?)` | `Promise<ListSecretsResponse>` | Cursor-paginated wrapper | `page.items.forEach(...)` |
|
|
186
|
+
| `daytona.volume.list()` | `Promise<Volume[]>` | Bare array | `volumes.forEach(...)` |
|
|
187
|
+
| `daytona.list(query?)` | `AsyncIterableIterator<Sandbox>` | Lazy iterator | `for await (const s of daytona.list())` |
|
|
188
|
+
|
|
189
|
+
`PaginatedSnapshots` and `ListSecretsResponse` are **wrapper objects**, not arrays. Calling `.map()` or `.forEach()` directly on them throws `TypeError: result.map is not a function`. Always go through `.items`:
|
|
190
|
+
|
|
191
|
+
```typescript
|
|
192
|
+
// snapshots — page-number pagination
|
|
193
|
+
const result = await daytona.snapshot.list(1, 20)
|
|
194
|
+
// result.items → Snapshot[]
|
|
195
|
+
// result.total → number (total across all pages)
|
|
196
|
+
// result.page → number (current page, 1-indexed)
|
|
197
|
+
// result.totalPages → number
|
|
198
|
+
result.items.forEach(snapshot => console.log(snapshot.name))
|
|
199
|
+
|
|
200
|
+
// secrets — cursor pagination
|
|
201
|
+
let cursor: string | undefined
|
|
202
|
+
do {
|
|
203
|
+
const page = await daytona.secret.list({ cursor, limit: 50 })
|
|
204
|
+
// page.items → Secret[]
|
|
205
|
+
// page.total → number
|
|
206
|
+
// page.nextCursor → string | null (null = no more pages)
|
|
207
|
+
page.items.forEach(secret => console.log(secret.name))
|
|
208
|
+
cursor = page.nextCursor ?? undefined
|
|
209
|
+
} while (cursor)
|
|
210
|
+
|
|
211
|
+
// volumes — bare array, iterate directly
|
|
212
|
+
const volumes = await daytona.volume.list()
|
|
213
|
+
volumes.forEach(vol => console.log(vol.name))
|
|
214
|
+
|
|
215
|
+
// sandboxes — lazy async iterator, fetches pages on demand
|
|
216
|
+
for await (const sandbox of daytona.list({ labels: { env: 'dev' } })) {
|
|
217
|
+
console.log(sandbox.id)
|
|
218
|
+
}
|
|
219
|
+
```
|
package/cjs/Sandbox.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SandboxState, SandboxApi, SandboxBackupStateEnum, Configuration } from '@daytona/api-client';
|
|
2
2
|
import type { Sandbox as SandboxDto, SandboxListItem as SandboxListItemDto, PortPreviewUrl, SandboxVolume, BuildInfo, SshAccessDto, SshAccessValidationDto, SignedPortPreviewUrl, UpdateSandboxNetworkSettings, SandboxListSortField, SandboxListSortDirection } from '@daytona/api-client';
|
|
3
|
-
import type { Resources } from './Daytona';
|
|
3
|
+
import type { ForkSandboxParams, Resources } from './Daytona';
|
|
4
4
|
import { FileSystem } from './FileSystem';
|
|
5
5
|
import { Git } from './Git';
|
|
6
6
|
import { Process } from './Process';
|
|
@@ -66,6 +66,7 @@ export declare class Sandbox {
|
|
|
66
66
|
private readonly sandboxApi;
|
|
67
67
|
private readonly getAnalyticsApiUrl;
|
|
68
68
|
private readonly subscriptionManager;
|
|
69
|
+
private readonly requestTimeoutMs?;
|
|
69
70
|
readonly fs: FileSystem;
|
|
70
71
|
readonly git: Git;
|
|
71
72
|
readonly process: Process;
|
|
@@ -123,7 +124,7 @@ export declare class Sandbox {
|
|
|
123
124
|
* @param {InfoApi} infoApi - API client for info operations
|
|
124
125
|
* @param {EventSubscriptionManager} subscriptionManager - Event subscription manager for real-time updates
|
|
125
126
|
*/
|
|
126
|
-
constructor(sandboxDto: SandboxDto | SandboxListItemDto, clientConfig: Configuration, axiosInstance: AxiosInstance, sandboxApi: SandboxApi, getAnalyticsApiUrl: () => Promise<string | undefined>, subscriptionManager: EventSubscriptionManager);
|
|
127
|
+
constructor(sandboxDto: SandboxDto | SandboxListItemDto, clientConfig: Configuration, axiosInstance: AxiosInstance, sandboxApi: SandboxApi, getAnalyticsApiUrl: () => Promise<string | undefined>, subscriptionManager: EventSubscriptionManager, requestTimeoutMs?: number);
|
|
127
128
|
/**
|
|
128
129
|
* Gets the user's home directory path for the logged in user inside the Sandbox.
|
|
129
130
|
*
|
|
@@ -260,22 +261,25 @@ export declare class Sandbox {
|
|
|
260
261
|
* The forked Sandbox is a copy-on-write clone of the original. It starts
|
|
261
262
|
* with the same disk contents but operates independently from that point on.
|
|
262
263
|
*
|
|
263
|
-
* @param {
|
|
264
|
+
* @param {ForkSandboxParams} [params] - Fork parameters
|
|
264
265
|
* @param {string} [params.name] - Optional name for the forked Sandbox. If not provided, a unique name will be generated.
|
|
265
266
|
* @param {number} [timeout] - Maximum time to wait in seconds. 0 means no timeout.
|
|
266
267
|
* Defaults to 60-second timeout.
|
|
267
268
|
* @returns {Promise<Sandbox>} The forked Sandbox.
|
|
268
|
-
* @throws {
|
|
269
|
+
* @throws {DaytonaInvalidArgumentError} - If timeout is a negative number
|
|
269
270
|
* @throws {DaytonaError} - If the fork operation fails or times out
|
|
270
271
|
*
|
|
271
272
|
* @example
|
|
272
273
|
* const sandbox = await daytona.get('my-sandbox');
|
|
273
|
-
* const forked = await sandbox.
|
|
274
|
+
* const forked = await sandbox.fork({ name: 'my-fork' });
|
|
274
275
|
* console.log(`Forked sandbox: ${forked.id}`);
|
|
275
276
|
*/
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
277
|
+
fork(params?: ForkSandboxParams, timeout?: number): Promise<Sandbox>;
|
|
278
|
+
/**
|
|
279
|
+
* @deprecated Use `fork` instead. This method will be removed in a future version.
|
|
280
|
+
* @see {@link Sandbox.fork}
|
|
281
|
+
*/
|
|
282
|
+
_experimental_fork(params?: ForkSandboxParams, timeout?: number): Promise<Sandbox>;
|
|
279
283
|
/**
|
|
280
284
|
* Creates a snapshot from the current state of the Sandbox.
|
|
281
285
|
*
|
|
@@ -287,14 +291,22 @@ export declare class Sandbox {
|
|
|
287
291
|
* @param {number} [timeout] - Maximum time to wait in seconds. 0 means no timeout.
|
|
288
292
|
* Defaults to 60-second timeout.
|
|
289
293
|
* @returns {Promise<void>}
|
|
290
|
-
* @throws {
|
|
294
|
+
* @throws {DaytonaInvalidArgumentError} - If timeout is a negative number
|
|
291
295
|
* @throws {DaytonaError} - If the snapshot operation fails or times out
|
|
292
296
|
*
|
|
293
297
|
* @example
|
|
294
298
|
* const sandbox = await daytona.get('my-sandbox');
|
|
295
|
-
* await sandbox.
|
|
299
|
+
* await sandbox.createSnapshot('my-snapshot');
|
|
296
300
|
* console.log('Snapshot created successfully');
|
|
297
301
|
*/
|
|
302
|
+
createSnapshot(name: string, timeout?: number): Promise<void>;
|
|
303
|
+
/**
|
|
304
|
+
* @param {string} name - Name for the new snapshot
|
|
305
|
+
* @param {number} [timeout] - Maximum time to wait in seconds. 0 means no timeout.
|
|
306
|
+
* Defaults to 60-second timeout.
|
|
307
|
+
* @deprecated Use `createSnapshot` instead. This method will be removed in a future version.
|
|
308
|
+
* @see {@link Sandbox.createSnapshot}
|
|
309
|
+
*/
|
|
298
310
|
_experimental_createSnapshot(name: string, timeout?: number): Promise<void>;
|
|
299
311
|
private waitForSnapshotComplete;
|
|
300
312
|
/**
|
|
@@ -307,7 +319,7 @@ export declare class Sandbox {
|
|
|
307
319
|
* @param {number} [timeout] - Maximum time to wait in seconds. 0 means no timeout.
|
|
308
320
|
* Defaults to 60-second timeout.
|
|
309
321
|
* @returns {Promise<void>}
|
|
310
|
-
* @throws {
|
|
322
|
+
* @throws {DaytonaInvalidArgumentError} - If timeout is a negative number
|
|
311
323
|
* @throws {DaytonaError} - If the pause operation fails or times out
|
|
312
324
|
*
|
|
313
325
|
* @example
|
package/cjs/Sandbox.js
CHANGED
|
@@ -90,8 +90,8 @@ let Sandbox = (() => {
|
|
|
90
90
|
let _start_decorators;
|
|
91
91
|
let _recover_decorators;
|
|
92
92
|
let _stop_decorators;
|
|
93
|
-
let
|
|
94
|
-
let
|
|
93
|
+
let _fork_decorators;
|
|
94
|
+
let _createSnapshot_decorators;
|
|
95
95
|
let _pause_decorators;
|
|
96
96
|
let _delete_decorators;
|
|
97
97
|
let _waitUntilStarted_decorators;
|
|
@@ -131,8 +131,8 @@ let Sandbox = (() => {
|
|
|
131
131
|
_start_decorators = [(0, otel_decorator_1.WithInstrumentation)(), withEvents];
|
|
132
132
|
_recover_decorators = [withEvents];
|
|
133
133
|
_stop_decorators = [(0, otel_decorator_1.WithInstrumentation)(), withEvents];
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
_fork_decorators = [(0, otel_decorator_1.WithInstrumentation)(), withEvents];
|
|
135
|
+
_createSnapshot_decorators = [(0, otel_decorator_1.WithInstrumentation)(), withEvents];
|
|
136
136
|
_pause_decorators = [(0, otel_decorator_1.WithInstrumentation)(), withEvents];
|
|
137
137
|
_delete_decorators = [(0, otel_decorator_1.WithInstrumentation)(), withEvents];
|
|
138
138
|
_waitUntilStarted_decorators = [(0, otel_decorator_1.WithInstrumentation)(), withEvents];
|
|
@@ -169,8 +169,8 @@ let Sandbox = (() => {
|
|
|
169
169
|
tslib_1.__esDecorate(this, null, _start_decorators, { kind: "method", name: "start", static: false, private: false, access: { has: obj => "start" in obj, get: obj => obj.start }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
170
170
|
tslib_1.__esDecorate(this, null, _recover_decorators, { kind: "method", name: "recover", static: false, private: false, access: { has: obj => "recover" in obj, get: obj => obj.recover }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
171
171
|
tslib_1.__esDecorate(this, null, _stop_decorators, { kind: "method", name: "stop", static: false, private: false, access: { has: obj => "stop" in obj, get: obj => obj.stop }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
172
|
-
tslib_1.__esDecorate(this, null,
|
|
173
|
-
tslib_1.__esDecorate(this, null,
|
|
172
|
+
tslib_1.__esDecorate(this, null, _fork_decorators, { kind: "method", name: "fork", static: false, private: false, access: { has: obj => "fork" in obj, get: obj => obj.fork }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
173
|
+
tslib_1.__esDecorate(this, null, _createSnapshot_decorators, { kind: "method", name: "createSnapshot", static: false, private: false, access: { has: obj => "createSnapshot" in obj, get: obj => obj.createSnapshot }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
174
174
|
tslib_1.__esDecorate(this, null, _pause_decorators, { kind: "method", name: "pause", static: false, private: false, access: { has: obj => "pause" in obj, get: obj => obj.pause }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
175
175
|
tslib_1.__esDecorate(this, null, _delete_decorators, { kind: "method", name: "delete", static: false, private: false, access: { has: obj => "delete" in obj, get: obj => obj.delete }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
176
176
|
tslib_1.__esDecorate(this, null, _waitUntilStarted_decorators, { kind: "method", name: "waitUntilStarted", static: false, private: false, access: { has: obj => "waitUntilStarted" in obj, get: obj => obj.waitUntilStarted }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
@@ -204,6 +204,7 @@ let Sandbox = (() => {
|
|
|
204
204
|
sandboxApi;
|
|
205
205
|
getAnalyticsApiUrl;
|
|
206
206
|
subscriptionManager;
|
|
207
|
+
requestTimeoutMs;
|
|
207
208
|
fs;
|
|
208
209
|
git;
|
|
209
210
|
process;
|
|
@@ -261,18 +262,19 @@ let Sandbox = (() => {
|
|
|
261
262
|
* @param {InfoApi} infoApi - API client for info operations
|
|
262
263
|
* @param {EventSubscriptionManager} subscriptionManager - Event subscription manager for real-time updates
|
|
263
264
|
*/
|
|
264
|
-
constructor(sandboxDto, clientConfig, axiosInstance, sandboxApi, getAnalyticsApiUrl, subscriptionManager) {
|
|
265
|
+
constructor(sandboxDto, clientConfig, axiosInstance, sandboxApi, getAnalyticsApiUrl, subscriptionManager, requestTimeoutMs) {
|
|
265
266
|
this.clientConfig = clientConfig;
|
|
266
267
|
this.axiosInstance = axiosInstance;
|
|
267
268
|
this.sandboxApi = sandboxApi;
|
|
268
269
|
this.getAnalyticsApiUrl = getAnalyticsApiUrl;
|
|
269
270
|
this.subscriptionManager = subscriptionManager;
|
|
271
|
+
this.requestTimeoutMs = requestTimeoutMs;
|
|
270
272
|
this.processSandboxDto(sandboxDto);
|
|
271
273
|
const getPreviewToken = async () => (await this.getPreviewLink(1)).token;
|
|
272
274
|
this.fs = new FileSystem_1.FileSystem(this.clientConfig, new toolbox_api_client_1.FileSystemApi(this.clientConfig, '', this.axiosInstance));
|
|
273
275
|
this.git = new Git_1.Git(new toolbox_api_client_1.GitApi(this.clientConfig, '', this.axiosInstance));
|
|
274
276
|
const language = sandboxDto.labels?.[Daytona_2.CODE_TOOLBOX_LANGUAGE_LABEL];
|
|
275
|
-
this.process = new Process_1.Process(this.clientConfig, new toolbox_api_client_1.ProcessApi(this.clientConfig, '', this.axiosInstance), getPreviewToken, language);
|
|
277
|
+
this.process = new Process_1.Process(this.clientConfig, new toolbox_api_client_1.ProcessApi(this.clientConfig, '', this.axiosInstance), getPreviewToken, language, this.requestTimeoutMs);
|
|
276
278
|
this.codeInterpreter = new CodeInterpreter_1.CodeInterpreter(this.clientConfig, new toolbox_api_client_1.InterpreterApi(this.clientConfig, '', this.axiosInstance), getPreviewToken);
|
|
277
279
|
this.computerUse = new ComputerUse_1.ComputerUse(new toolbox_api_client_1.ComputerUseApi(this.clientConfig, '', this.axiosInstance));
|
|
278
280
|
this.infoApi = new toolbox_api_client_1.InfoApi(this.clientConfig, '', this.axiosInstance);
|
|
@@ -338,7 +340,7 @@ let Sandbox = (() => {
|
|
|
338
340
|
basePath: analyticsApiUrl,
|
|
339
341
|
apiKey: this.clientConfig.baseOptions?.headers?.Authorization,
|
|
340
342
|
});
|
|
341
|
-
return new analytics_api_client_1.TelemetryApi(analyticsConfig, undefined, Daytona_1.Daytona.createAxiosInstance());
|
|
343
|
+
return new analytics_api_client_1.TelemetryApi(analyticsConfig, undefined, Daytona_1.Daytona.createAxiosInstance(this.requestTimeoutMs));
|
|
342
344
|
}
|
|
343
345
|
/**
|
|
344
346
|
* @deprecated Use `getUserHomeDir` instead. This method will be removed in a future version.
|
|
@@ -413,7 +415,7 @@ let Sandbox = (() => {
|
|
|
413
415
|
*/
|
|
414
416
|
async start(timeout = 60) {
|
|
415
417
|
if (timeout < 0) {
|
|
416
|
-
throw new DaytonaError_1.
|
|
418
|
+
throw new DaytonaError_1.DaytonaInvalidArgumentError('Timeout must be a non-negative number');
|
|
417
419
|
}
|
|
418
420
|
const startTime = Date.now();
|
|
419
421
|
const response = await this.sandboxApi.startSandbox(this.id, undefined, { timeout: timeout * 1000 });
|
|
@@ -436,7 +438,7 @@ let Sandbox = (() => {
|
|
|
436
438
|
*/
|
|
437
439
|
async recover(timeout = 60) {
|
|
438
440
|
if (timeout < 0) {
|
|
439
|
-
throw new DaytonaError_1.
|
|
441
|
+
throw new DaytonaError_1.DaytonaInvalidArgumentError('Timeout must be a non-negative number');
|
|
440
442
|
}
|
|
441
443
|
const startTime = Date.now();
|
|
442
444
|
const response = await this.sandboxApi.recoverSandbox(this.id, undefined, undefined, { timeout: timeout * 1000 });
|
|
@@ -461,7 +463,7 @@ let Sandbox = (() => {
|
|
|
461
463
|
*/
|
|
462
464
|
async stop(timeout = 60, force = false) {
|
|
463
465
|
if (timeout < 0) {
|
|
464
|
-
throw new DaytonaError_1.
|
|
466
|
+
throw new DaytonaError_1.DaytonaInvalidArgumentError('Timeout must be a non-negative number');
|
|
465
467
|
}
|
|
466
468
|
const startTime = Date.now();
|
|
467
469
|
await this.sandboxApi.stopSandbox(this.id, undefined, force, { timeout: timeout * 1000 });
|
|
@@ -475,22 +477,22 @@ let Sandbox = (() => {
|
|
|
475
477
|
* The forked Sandbox is a copy-on-write clone of the original. It starts
|
|
476
478
|
* with the same disk contents but operates independently from that point on.
|
|
477
479
|
*
|
|
478
|
-
* @param {
|
|
480
|
+
* @param {ForkSandboxParams} [params] - Fork parameters
|
|
479
481
|
* @param {string} [params.name] - Optional name for the forked Sandbox. If not provided, a unique name will be generated.
|
|
480
482
|
* @param {number} [timeout] - Maximum time to wait in seconds. 0 means no timeout.
|
|
481
483
|
* Defaults to 60-second timeout.
|
|
482
484
|
* @returns {Promise<Sandbox>} The forked Sandbox.
|
|
483
|
-
* @throws {
|
|
485
|
+
* @throws {DaytonaInvalidArgumentError} - If timeout is a negative number
|
|
484
486
|
* @throws {DaytonaError} - If the fork operation fails or times out
|
|
485
487
|
*
|
|
486
488
|
* @example
|
|
487
489
|
* const sandbox = await daytona.get('my-sandbox');
|
|
488
|
-
* const forked = await sandbox.
|
|
490
|
+
* const forked = await sandbox.fork({ name: 'my-fork' });
|
|
489
491
|
* console.log(`Forked sandbox: ${forked.id}`);
|
|
490
492
|
*/
|
|
491
|
-
async
|
|
493
|
+
async fork(params, timeout = 60) {
|
|
492
494
|
if (timeout < 0) {
|
|
493
|
-
throw new DaytonaError_1.
|
|
495
|
+
throw new DaytonaError_1.DaytonaInvalidArgumentError('Timeout must be a non-negative number');
|
|
494
496
|
}
|
|
495
497
|
const startTime = Date.now();
|
|
496
498
|
const response = await this.sandboxApi.forkSandbox(this.id, { name: params?.name }, undefined, {
|
|
@@ -503,12 +505,19 @@ let Sandbox = (() => {
|
|
|
503
505
|
...sandboxDto,
|
|
504
506
|
toolboxProxyUrl: (await this.sandboxApi.getToolboxProxyUrl(sandboxDto.id)).data.url,
|
|
505
507
|
};
|
|
506
|
-
const forkedSandbox = new Sandbox(sandboxWithProxyUrl, structuredClone(this.clientConfig), Daytona_1.Daytona.createAxiosInstance(), this.sandboxApi, this.getAnalyticsApiUrl, this.subscriptionManager);
|
|
508
|
+
const forkedSandbox = new Sandbox(sandboxWithProxyUrl, structuredClone(this.clientConfig), Daytona_1.Daytona.createAxiosInstance(this.requestTimeoutMs), this.sandboxApi, this.getAnalyticsApiUrl, this.subscriptionManager, this.requestTimeoutMs);
|
|
507
509
|
const timeElapsed = Date.now() - startTime;
|
|
508
510
|
const remainingTimeout = timeout ? Math.max(0.001, timeout - timeElapsed / 1000) : timeout;
|
|
509
511
|
await forkedSandbox.waitUntilStarted(remainingTimeout);
|
|
510
512
|
return forkedSandbox;
|
|
511
513
|
}
|
|
514
|
+
/**
|
|
515
|
+
* @deprecated Use `fork` instead. This method will be removed in a future version.
|
|
516
|
+
* @see {@link Sandbox.fork}
|
|
517
|
+
*/
|
|
518
|
+
async _experimental_fork(params, timeout = 60) {
|
|
519
|
+
return this.fork(params, timeout);
|
|
520
|
+
}
|
|
512
521
|
/**
|
|
513
522
|
* Creates a snapshot from the current state of the Sandbox.
|
|
514
523
|
*
|
|
@@ -520,17 +529,17 @@ let Sandbox = (() => {
|
|
|
520
529
|
* @param {number} [timeout] - Maximum time to wait in seconds. 0 means no timeout.
|
|
521
530
|
* Defaults to 60-second timeout.
|
|
522
531
|
* @returns {Promise<void>}
|
|
523
|
-
* @throws {
|
|
532
|
+
* @throws {DaytonaInvalidArgumentError} - If timeout is a negative number
|
|
524
533
|
* @throws {DaytonaError} - If the snapshot operation fails or times out
|
|
525
534
|
*
|
|
526
535
|
* @example
|
|
527
536
|
* const sandbox = await daytona.get('my-sandbox');
|
|
528
|
-
* await sandbox.
|
|
537
|
+
* await sandbox.createSnapshot('my-snapshot');
|
|
529
538
|
* console.log('Snapshot created successfully');
|
|
530
539
|
*/
|
|
531
|
-
async
|
|
540
|
+
async createSnapshot(name, timeout = 60) {
|
|
532
541
|
if (timeout < 0) {
|
|
533
|
-
throw new DaytonaError_1.
|
|
542
|
+
throw new DaytonaError_1.DaytonaInvalidArgumentError('Timeout must be a non-negative number');
|
|
534
543
|
}
|
|
535
544
|
const startTime = Date.now();
|
|
536
545
|
const req = { name };
|
|
@@ -542,6 +551,16 @@ let Sandbox = (() => {
|
|
|
542
551
|
const remainingTimeout = timeout ? Math.max(0.001, timeout - timeElapsed / 1000) : timeout;
|
|
543
552
|
await this.waitForSnapshotComplete(remainingTimeout);
|
|
544
553
|
}
|
|
554
|
+
/**
|
|
555
|
+
* @param {string} name - Name for the new snapshot
|
|
556
|
+
* @param {number} [timeout] - Maximum time to wait in seconds. 0 means no timeout.
|
|
557
|
+
* Defaults to 60-second timeout.
|
|
558
|
+
* @deprecated Use `createSnapshot` instead. This method will be removed in a future version.
|
|
559
|
+
* @see {@link Sandbox.createSnapshot}
|
|
560
|
+
*/
|
|
561
|
+
async _experimental_createSnapshot(name, timeout = 60) {
|
|
562
|
+
return this.createSnapshot(name, timeout);
|
|
563
|
+
}
|
|
545
564
|
async waitForSnapshotComplete(timeout) {
|
|
546
565
|
const errorStates = [api_client_1.SandboxState.ERROR, api_client_1.SandboxState.BUILD_FAILED];
|
|
547
566
|
const excludeStates = new Set([api_client_1.SandboxState.SNAPSHOTTING, ...errorStates]);
|
|
@@ -558,7 +577,7 @@ let Sandbox = (() => {
|
|
|
558
577
|
* @param {number} [timeout] - Maximum time to wait in seconds. 0 means no timeout.
|
|
559
578
|
* Defaults to 60-second timeout.
|
|
560
579
|
* @returns {Promise<void>}
|
|
561
|
-
* @throws {
|
|
580
|
+
* @throws {DaytonaInvalidArgumentError} - If timeout is a negative number
|
|
562
581
|
* @throws {DaytonaError} - If the pause operation fails or times out
|
|
563
582
|
*
|
|
564
583
|
* @example
|
|
@@ -568,7 +587,7 @@ let Sandbox = (() => {
|
|
|
568
587
|
*/
|
|
569
588
|
async pause(timeout = 60) {
|
|
570
589
|
if (timeout < 0) {
|
|
571
|
-
throw new DaytonaError_1.
|
|
590
|
+
throw new DaytonaError_1.DaytonaInvalidArgumentError('Timeout must be a non-negative number');
|
|
572
591
|
}
|
|
573
592
|
const startTime = Date.now();
|
|
574
593
|
await this.sandboxApi.pauseSandbox(this.id, undefined, {
|
|
@@ -599,7 +618,7 @@ let Sandbox = (() => {
|
|
|
599
618
|
*/
|
|
600
619
|
async delete(timeout = 60, wait = false) {
|
|
601
620
|
if (timeout < 0) {
|
|
602
|
-
throw new DaytonaError_1.
|
|
621
|
+
throw new DaytonaError_1.DaytonaInvalidArgumentError('Timeout must be a non-negative number');
|
|
603
622
|
}
|
|
604
623
|
const startTime = Date.now();
|
|
605
624
|
const response = await this.sandboxApi.deleteSandbox(this.id, undefined, { timeout: timeout * 1000 });
|
|
@@ -632,7 +651,7 @@ let Sandbox = (() => {
|
|
|
632
651
|
*/
|
|
633
652
|
async waitUntilStarted(timeout = 60) {
|
|
634
653
|
if (timeout < 0) {
|
|
635
|
-
throw new DaytonaError_1.
|
|
654
|
+
throw new DaytonaError_1.DaytonaInvalidArgumentError('Timeout must be a non-negative number');
|
|
636
655
|
}
|
|
637
656
|
if (this.state === api_client_1.SandboxState.STARTED) {
|
|
638
657
|
return;
|
|
@@ -652,7 +671,7 @@ let Sandbox = (() => {
|
|
|
652
671
|
*/
|
|
653
672
|
async waitUntilStopped(timeout = 60) {
|
|
654
673
|
if (timeout < 0) {
|
|
655
|
-
throw new DaytonaError_1.
|
|
674
|
+
throw new DaytonaError_1.DaytonaInvalidArgumentError('Timeout must be a non-negative number');
|
|
656
675
|
}
|
|
657
676
|
// Treat destroyed as stopped to cover ephemeral sandboxes that are automatically deleted after stopping
|
|
658
677
|
if (this.state === api_client_1.SandboxState.STOPPED || this.state === api_client_1.SandboxState.DESTROYED) {
|
|
@@ -710,7 +729,7 @@ let Sandbox = (() => {
|
|
|
710
729
|
*/
|
|
711
730
|
async setAutostopInterval(interval) {
|
|
712
731
|
if (!Number.isInteger(interval) || interval < 0) {
|
|
713
|
-
throw new DaytonaError_1.
|
|
732
|
+
throw new DaytonaError_1.DaytonaInvalidArgumentError('autoStopInterval must be a non-negative integer');
|
|
714
733
|
}
|
|
715
734
|
await this.sandboxApi.setAutostopInterval(this.id, interval);
|
|
716
735
|
this.autoStopInterval = interval;
|
|
@@ -740,7 +759,7 @@ let Sandbox = (() => {
|
|
|
740
759
|
*/
|
|
741
760
|
async setAutoPauseInterval(interval) {
|
|
742
761
|
if (!Number.isInteger(interval) || interval < 0) {
|
|
743
|
-
throw new DaytonaError_1.
|
|
762
|
+
throw new DaytonaError_1.DaytonaInvalidArgumentError('autoPauseInterval must be a non-negative integer');
|
|
744
763
|
}
|
|
745
764
|
await this.sandboxApi.setAutoPauseInterval(this.id, interval);
|
|
746
765
|
this.autoPauseInterval = interval;
|
|
@@ -765,7 +784,7 @@ let Sandbox = (() => {
|
|
|
765
784
|
*/
|
|
766
785
|
async setTtl(ttlMinutes) {
|
|
767
786
|
if (!Number.isInteger(ttlMinutes) || ttlMinutes < 0) {
|
|
768
|
-
throw new DaytonaError_1.
|
|
787
|
+
throw new DaytonaError_1.DaytonaInvalidArgumentError('ttlMinutes must be a non-negative integer');
|
|
769
788
|
}
|
|
770
789
|
await this.sandboxApi.setTtl(this.id, ttlMinutes);
|
|
771
790
|
}
|
|
@@ -787,7 +806,7 @@ let Sandbox = (() => {
|
|
|
787
806
|
*/
|
|
788
807
|
async setAutoArchiveInterval(interval) {
|
|
789
808
|
if (!Number.isInteger(interval) || interval < 0) {
|
|
790
|
-
throw new DaytonaError_1.
|
|
809
|
+
throw new DaytonaError_1.DaytonaInvalidArgumentError('autoArchiveInterval must be a non-negative integer');
|
|
791
810
|
}
|
|
792
811
|
await this.sandboxApi.setAutoArchiveInterval(this.id, interval);
|
|
793
812
|
this.autoArchiveInterval = interval;
|
|
@@ -837,7 +856,7 @@ let Sandbox = (() => {
|
|
|
837
856
|
if (settings.networkBlockAll === undefined &&
|
|
838
857
|
settings.networkAllowList === undefined &&
|
|
839
858
|
settings.domainAllowList === undefined) {
|
|
840
|
-
throw new DaytonaError_1.
|
|
859
|
+
throw new DaytonaError_1.DaytonaInvalidArgumentError('At least one of networkBlockAll, networkAllowList or domainAllowList must be set');
|
|
841
860
|
}
|
|
842
861
|
const response = await this.sandboxApi.updateNetworkSettings(this.id, settings);
|
|
843
862
|
this.processSandboxDto(response.data);
|
|
@@ -1010,10 +1029,10 @@ let Sandbox = (() => {
|
|
|
1010
1029
|
*/
|
|
1011
1030
|
async resize(resources, timeout = 60) {
|
|
1012
1031
|
if (timeout < 0) {
|
|
1013
|
-
throw new DaytonaError_1.
|
|
1032
|
+
throw new DaytonaError_1.DaytonaInvalidArgumentError('Timeout must be a non-negative number');
|
|
1014
1033
|
}
|
|
1015
1034
|
if ('gpu' in resources || 'gpuType' in resources) {
|
|
1016
|
-
throw new DaytonaError_1.
|
|
1035
|
+
throw new DaytonaError_1.DaytonaInvalidArgumentError('Resize does not support changes to gpu or gpuType — to change GPU, create a new Sandbox');
|
|
1017
1036
|
}
|
|
1018
1037
|
const startTime = Date.now();
|
|
1019
1038
|
const resizeRequest = {
|
|
@@ -1039,7 +1058,7 @@ let Sandbox = (() => {
|
|
|
1039
1058
|
*/
|
|
1040
1059
|
async waitForResizeComplete(timeout = 60) {
|
|
1041
1060
|
if (timeout < 0) {
|
|
1042
|
-
throw new DaytonaError_1.
|
|
1061
|
+
throw new DaytonaError_1.DaytonaInvalidArgumentError('Timeout must be a non-negative number');
|
|
1043
1062
|
}
|
|
1044
1063
|
if (this.state !== api_client_1.SandboxState.RESIZING) {
|
|
1045
1064
|
return;
|