@daytona/sdk 0.161.0-alpha.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.
Files changed (95) hide show
  1. package/README.md +180 -0
  2. package/package.json +56 -0
  3. package/src/CodeInterpreter.d.ts +94 -0
  4. package/src/CodeInterpreter.js +297 -0
  5. package/src/CodeInterpreter.js.map +1 -0
  6. package/src/ComputerUse.d.ts +538 -0
  7. package/src/ComputerUse.js +808 -0
  8. package/src/ComputerUse.js.map +1 -0
  9. package/src/Daytona.d.ts +340 -0
  10. package/src/Daytona.js +538 -0
  11. package/src/Daytona.js.map +1 -0
  12. package/src/FileSystem.d.ts +326 -0
  13. package/src/FileSystem.js +412 -0
  14. package/src/FileSystem.js.map +1 -0
  15. package/src/Git.d.ts +202 -0
  16. package/src/Git.js +326 -0
  17. package/src/Git.js.map +1 -0
  18. package/src/Image.d.ts +264 -0
  19. package/src/Image.js +546 -0
  20. package/src/Image.js.map +1 -0
  21. package/src/LspServer.d.ts +171 -0
  22. package/src/LspServer.js +258 -0
  23. package/src/LspServer.js.map +1 -0
  24. package/src/ObjectStorage.d.ts +78 -0
  25. package/src/ObjectStorage.js +199 -0
  26. package/src/ObjectStorage.js.map +1 -0
  27. package/src/Process.d.ts +490 -0
  28. package/src/Process.js +790 -0
  29. package/src/Process.js.map +1 -0
  30. package/src/PtyHandle.d.ts +154 -0
  31. package/src/PtyHandle.js +416 -0
  32. package/src/PtyHandle.js.map +1 -0
  33. package/src/Sandbox.d.ts +425 -0
  34. package/src/Sandbox.js +776 -0
  35. package/src/Sandbox.js.map +1 -0
  36. package/src/Snapshot.d.ts +139 -0
  37. package/src/Snapshot.js +248 -0
  38. package/src/Snapshot.js.map +1 -0
  39. package/src/Volume.d.ts +83 -0
  40. package/src/Volume.js +119 -0
  41. package/src/Volume.js.map +1 -0
  42. package/src/code-toolbox/SandboxJsCodeToolbox.d.ts +5 -0
  43. package/src/code-toolbox/SandboxJsCodeToolbox.js +20 -0
  44. package/src/code-toolbox/SandboxJsCodeToolbox.js.map +1 -0
  45. package/src/code-toolbox/SandboxPythonCodeToolbox.d.ts +11 -0
  46. package/src/code-toolbox/SandboxPythonCodeToolbox.js +359 -0
  47. package/src/code-toolbox/SandboxPythonCodeToolbox.js.map +1 -0
  48. package/src/code-toolbox/SandboxTsCodeToolbox.d.ts +5 -0
  49. package/src/code-toolbox/SandboxTsCodeToolbox.js +29 -0
  50. package/src/code-toolbox/SandboxTsCodeToolbox.js.map +1 -0
  51. package/src/errors/DaytonaError.d.ts +31 -0
  52. package/src/errors/DaytonaError.js +51 -0
  53. package/src/errors/DaytonaError.js.map +1 -0
  54. package/src/index.d.ts +21 -0
  55. package/src/index.js +45 -0
  56. package/src/index.js.map +1 -0
  57. package/src/types/Charts.d.ts +151 -0
  58. package/src/types/Charts.js +46 -0
  59. package/src/types/Charts.js.map +1 -0
  60. package/src/types/CodeInterpreter.d.ts +76 -0
  61. package/src/types/CodeInterpreter.js +7 -0
  62. package/src/types/CodeInterpreter.js.map +1 -0
  63. package/src/types/ExecuteResponse.d.ts +25 -0
  64. package/src/types/ExecuteResponse.js +7 -0
  65. package/src/types/ExecuteResponse.js.map +1 -0
  66. package/src/types/Pty.d.ts +47 -0
  67. package/src/types/Pty.js +7 -0
  68. package/src/types/Pty.js.map +1 -0
  69. package/src/utils/ArtifactParser.d.ts +13 -0
  70. package/src/utils/ArtifactParser.js +55 -0
  71. package/src/utils/ArtifactParser.js.map +1 -0
  72. package/src/utils/Binary.d.ts +38 -0
  73. package/src/utils/Binary.js +168 -0
  74. package/src/utils/Binary.js.map +1 -0
  75. package/src/utils/FileTransfer.d.ts +14 -0
  76. package/src/utils/FileTransfer.js +216 -0
  77. package/src/utils/FileTransfer.js.map +1 -0
  78. package/src/utils/Import.d.ts +97 -0
  79. package/src/utils/Import.js +79 -0
  80. package/src/utils/Import.js.map +1 -0
  81. package/src/utils/Multipart.d.ts +26 -0
  82. package/src/utils/Multipart.js +113 -0
  83. package/src/utils/Multipart.js.map +1 -0
  84. package/src/utils/Runtime.d.ts +43 -0
  85. package/src/utils/Runtime.js +95 -0
  86. package/src/utils/Runtime.js.map +1 -0
  87. package/src/utils/Stream.d.ts +19 -0
  88. package/src/utils/Stream.js +364 -0
  89. package/src/utils/Stream.js.map +1 -0
  90. package/src/utils/WebSocket.d.ts +9 -0
  91. package/src/utils/WebSocket.js +26 -0
  92. package/src/utils/WebSocket.js.map +1 -0
  93. package/src/utils/otel.decorator.d.ts +82 -0
  94. package/src/utils/otel.decorator.js +141 -0
  95. package/src/utils/otel.decorator.js.map +1 -0
@@ -0,0 +1,425 @@
1
+ import { SandboxState, SandboxApi, Sandbox as SandboxDto, PaginatedSandboxes as PaginatedSandboxesDto, PortPreviewUrl, SandboxVolume, BuildInfo, SandboxBackupStateEnum, Configuration, SshAccessDto, SshAccessValidationDto, SignedPortPreviewUrl } from '@daytonaio/api-client';
2
+ import { Resources } from './Daytona';
3
+ import { FileSystem } from './FileSystem';
4
+ import { Git } from './Git';
5
+ import { CodeRunParams, Process } from './Process';
6
+ import { LspLanguageId, LspServer } from './LspServer';
7
+ import { ComputerUse } from './ComputerUse';
8
+ import { AxiosInstance } from 'axios';
9
+ import { CodeInterpreter } from './CodeInterpreter';
10
+ /**
11
+ * Interface defining methods that a code toolbox must implement
12
+ * @interface
13
+ */
14
+ export interface SandboxCodeToolbox {
15
+ /** Generates a command to run the provided code */
16
+ getRunCommand(code: string, params?: CodeRunParams): string;
17
+ }
18
+ /**
19
+ * Represents a Daytona Sandbox.
20
+ *
21
+ * @property {FileSystem} fs - File system operations interface
22
+ * @property {Git} git - Git operations interface
23
+ * @property {Process} process - Process execution interface
24
+ * @property {CodeInterpreter} codeInterpreter - Stateful interpreter interface for executing code.
25
+ * Currently supports only Python. For other languages, use the `process.codeRun` method.
26
+ * @property {ComputerUse} computerUse - Computer use operations interface for desktop automation
27
+ * @property {string} id - Unique identifier for the Sandbox
28
+ * @property {string} organizationId - Organization ID of the Sandbox
29
+ * @property {string} [snapshot] - Daytona snapshot used to create the Sandbox
30
+ * @property {string} user - OS user running in the Sandbox
31
+ * @property {Record<string, string>} env - Environment variables set in the Sandbox
32
+ * @property {Record<string, string>} labels - Custom labels attached to the Sandbox
33
+ * @property {boolean} public - Whether the Sandbox is publicly accessible
34
+ * @property {string} target - Target location of the runner where the Sandbox runs
35
+ * @property {number} cpu - Number of CPUs allocated to the Sandbox
36
+ * @property {number} gpu - Number of GPUs allocated to the Sandbox
37
+ * @property {number} memory - Amount of memory allocated to the Sandbox in GiB
38
+ * @property {number} disk - Amount of disk space allocated to the Sandbox in GiB
39
+ * @property {SandboxState} state - Current state of the Sandbox (e.g., "started", "stopped")
40
+ * @property {string} [errorReason] - Error message if Sandbox is in error state
41
+ * @property {boolean} [recoverable] - Whether the Sandbox error is recoverable.
42
+ * @property {SandboxBackupStateEnum} [backupState] - Current state of Sandbox backup
43
+ * @property {string} [backupCreatedAt] - When the backup was created
44
+ * @property {number} [autoStopInterval] - Auto-stop interval in minutes
45
+ * @property {number} [autoArchiveInterval] - Auto-archive interval in minutes
46
+ * @property {number} [autoDeleteInterval] - Auto-delete interval in minutes
47
+ * @property {Array<SandboxVolume>} [volumes] - Volumes attached to the Sandbox
48
+ * @property {BuildInfo} [buildInfo] - Build information for the Sandbox if it was created from dynamic build
49
+ * @property {string} [createdAt] - When the Sandbox was created
50
+ * @property {string} [updatedAt] - When the Sandbox was last updated
51
+ * @property {boolean} networkBlockAll - Whether to block all network access for the Sandbox
52
+ * @property {string} [networkAllowList] - Comma-separated list of allowed CIDR network addresses for the Sandbox
53
+ *
54
+ * @class
55
+ */
56
+ export declare class Sandbox implements SandboxDto {
57
+ private readonly clientConfig;
58
+ private readonly axiosInstance;
59
+ private readonly sandboxApi;
60
+ private readonly codeToolbox;
61
+ readonly fs: FileSystem;
62
+ readonly git: Git;
63
+ readonly process: Process;
64
+ readonly computerUse: ComputerUse;
65
+ readonly codeInterpreter: CodeInterpreter;
66
+ id: string;
67
+ name: string;
68
+ organizationId: string;
69
+ snapshot?: string;
70
+ user: string;
71
+ env: Record<string, string>;
72
+ labels: Record<string, string>;
73
+ public: boolean;
74
+ target: string;
75
+ cpu: number;
76
+ gpu: number;
77
+ memory: number;
78
+ disk: number;
79
+ state?: SandboxState;
80
+ errorReason?: string;
81
+ recoverable?: boolean;
82
+ backupState?: SandboxBackupStateEnum;
83
+ backupCreatedAt?: string;
84
+ autoStopInterval?: number;
85
+ autoArchiveInterval?: number;
86
+ autoDeleteInterval?: number;
87
+ volumes?: Array<SandboxVolume>;
88
+ buildInfo?: BuildInfo;
89
+ createdAt?: string;
90
+ updatedAt?: string;
91
+ networkBlockAll: boolean;
92
+ networkAllowList?: string;
93
+ toolboxProxyUrl: string;
94
+ private infoApi;
95
+ /**
96
+ * Creates a new Sandbox instance
97
+ *
98
+ * @param {SandboxDto} sandboxDto - The API Sandbox instance
99
+ * @param {SandboxApi} sandboxApi - API client for Sandbox operations
100
+ * @param {InfoApi} infoApi - API client for info operations
101
+ * @param {SandboxCodeToolbox} codeToolbox - Language-specific toolbox implementation
102
+ */
103
+ constructor(sandboxDto: SandboxDto, clientConfig: Configuration, axiosInstance: AxiosInstance, sandboxApi: SandboxApi, codeToolbox: SandboxCodeToolbox);
104
+ /**
105
+ * Gets the user's home directory path for the logged in user inside the Sandbox.
106
+ *
107
+ * @returns {Promise<string | undefined>} The absolute path to the Sandbox user's home directory for the logged in user
108
+ *
109
+ * @example
110
+ * const userHomeDir = await sandbox.getUserHomeDir();
111
+ * console.log(`Sandbox user home: ${userHomeDir}`);
112
+ */
113
+ getUserHomeDir(): Promise<string | undefined>;
114
+ /**
115
+ * @deprecated Use `getUserHomeDir` instead. This method will be removed in a future version.
116
+ */
117
+ getUserRootDir(): Promise<string | undefined>;
118
+ /**
119
+ * Gets the working directory path inside the Sandbox.
120
+ *
121
+ * @returns {Promise<string | undefined>} The absolute path to the Sandbox working directory. Uses the WORKDIR specified
122
+ * in the Dockerfile if present, or falling back to the user's home directory if not.
123
+ *
124
+ * @example
125
+ * const workDir = await sandbox.getWorkDir();
126
+ * console.log(`Sandbox working directory: ${workDir}`);
127
+ */
128
+ getWorkDir(): Promise<string | undefined>;
129
+ /**
130
+ * Creates a new Language Server Protocol (LSP) server instance.
131
+ *
132
+ * The LSP server provides language-specific features like code completion,
133
+ * diagnostics, and more.
134
+ *
135
+ * @param {LspLanguageId} languageId - The language server type (e.g., "typescript")
136
+ * @param {string} pathToProject - Path to the project root directory. Relative paths are resolved based on the sandbox working directory.
137
+ * @returns {LspServer} A new LSP server instance configured for the specified language
138
+ *
139
+ * @example
140
+ * const lsp = await sandbox.createLspServer('typescript', 'workspace/project');
141
+ */
142
+ createLspServer(languageId: LspLanguageId | string, pathToProject: string): Promise<LspServer>;
143
+ /**
144
+ * Sets labels for the Sandbox.
145
+ *
146
+ * Labels are key-value pairs that can be used to organize and identify Sandboxes.
147
+ *
148
+ * @param {Record<string, string>} labels - Dictionary of key-value pairs representing Sandbox labels
149
+ * @returns {Promise<void>}
150
+ *
151
+ * @example
152
+ * // Set sandbox labels
153
+ * await sandbox.setLabels({
154
+ * project: 'my-project',
155
+ * environment: 'development',
156
+ * team: 'backend'
157
+ * });
158
+ */
159
+ setLabels(labels: Record<string, string>): Promise<Record<string, string>>;
160
+ /**
161
+ * Start the Sandbox.
162
+ *
163
+ * This method starts the Sandbox and waits for it to be ready.
164
+ *
165
+ * @param {number} [timeout] - Maximum time to wait in seconds. 0 means no timeout.
166
+ * Defaults to 60-second timeout.
167
+ * @returns {Promise<void>}
168
+ * @throws {DaytonaError} - `DaytonaError` - If Sandbox fails to start or times out
169
+ *
170
+ * @example
171
+ * const sandbox = await daytona.getCurrentSandbox('my-sandbox');
172
+ * await sandbox.start(40); // Wait up to 40 seconds
173
+ * console.log('Sandbox started successfully');
174
+ */
175
+ start(timeout?: number): Promise<void>;
176
+ /**
177
+ * Recover the Sandbox from a recoverable error and wait for it to be ready.
178
+ *
179
+ * @param {number} [timeout] - Maximum time to wait in seconds. 0 means no timeout.
180
+ * Defaults to 60-second timeout.
181
+ * @returns {Promise<void>}
182
+ * @throws {DaytonaError} - `DaytonaError` - If Sandbox fails to recover or times out
183
+ *
184
+ * @example
185
+ * const sandbox = await daytona.get('my-sandbox-id');
186
+ * await sandbox.recover();
187
+ * console.log('Sandbox recovered successfully');
188
+ */
189
+ recover(timeout?: number): Promise<void>;
190
+ /**
191
+ * Stops the Sandbox.
192
+ *
193
+ * This method stops the Sandbox and waits for it to be fully stopped.
194
+ *
195
+ * @param {number} [timeout] - Maximum time to wait in seconds. 0 means no timeout.
196
+ * Defaults to 60-second timeout.
197
+ * @param {boolean} [force] - If true, uses SIGKILL instead of SIGTERM. Defaults to false.
198
+ * @returns {Promise<void>}
199
+ *
200
+ * @example
201
+ * const sandbox = await daytona.get('my-sandbox-id');
202
+ * await sandbox.stop();
203
+ * console.log('Sandbox stopped successfully');
204
+ */
205
+ stop(timeout?: number, force?: boolean): Promise<void>;
206
+ /**
207
+ * Deletes the Sandbox.
208
+ * @returns {Promise<void>}
209
+ */
210
+ delete(timeout?: number): Promise<void>;
211
+ /**
212
+ * Waits for the Sandbox to reach the 'started' state.
213
+ *
214
+ * This method polls the Sandbox status until it reaches the 'started' state
215
+ * or encounters an error.
216
+ *
217
+ * @param {number} [timeout] - Maximum time to wait in seconds. 0 means no timeout.
218
+ * Defaults to 60 seconds.
219
+ * @returns {Promise<void>}
220
+ * @throws {DaytonaError} - `DaytonaError` - If the sandbox ends up in an error state or fails to start within the timeout period.
221
+ */
222
+ waitUntilStarted(timeout?: number): Promise<void>;
223
+ /**
224
+ * Wait for Sandbox to reach 'stopped' state.
225
+ *
226
+ * This method polls the Sandbox status until it reaches the 'stopped' state
227
+ * or encounters an error.
228
+ *
229
+ * @param {number} [timeout] - Maximum time to wait in seconds. 0 means no timeout.
230
+ * Defaults to 60 seconds.
231
+ * @returns {Promise<void>}
232
+ * @throws {DaytonaError} - `DaytonaError` - If the sandbox fails to stop within the timeout period.
233
+ */
234
+ waitUntilStopped(timeout?: number): Promise<void>;
235
+ /**
236
+ * Refreshes the Sandbox data from the API.
237
+ *
238
+ * @returns {Promise<void>}
239
+ *
240
+ * @example
241
+ * await sandbox.refreshData();
242
+ * console.log(`Sandbox ${sandbox.id}:`);
243
+ * console.log(`State: ${sandbox.state}`);
244
+ * console.log(`Resources: ${sandbox.cpu} CPU, ${sandbox.memory} GiB RAM`);
245
+ */
246
+ refreshData(): Promise<void>;
247
+ /**
248
+ * Refreshes the sandbox activity to reset the timer for automated lifecycle management actions.
249
+ *
250
+ * This method updates the sandbox's last activity timestamp without changing its state.
251
+ * It is useful for keeping long-running sessions alive while there is still user activity.
252
+ *
253
+ * @returns {Promise<void>}
254
+ *
255
+ * @example
256
+ * // Keep sandbox activity alive
257
+ * await sandbox.refreshActivity();
258
+ */
259
+ refreshActivity(): Promise<void>;
260
+ /**
261
+ * Set the auto-stop interval for the Sandbox.
262
+ *
263
+ * The Sandbox will automatically stop after being idle (no new events) for the specified interval.
264
+ * Events include any state changes or interactions with the Sandbox through the sdk.
265
+ * Interactions using Sandbox Previews are not included.
266
+ *
267
+ * @param {number} interval - Number of minutes of inactivity before auto-stopping.
268
+ * Set to 0 to disable auto-stop. Default is 15 minutes.
269
+ * @returns {Promise<void>}
270
+ * @throws {DaytonaError} - `DaytonaError` - If interval is not a non-negative integer
271
+ *
272
+ * @example
273
+ * // Auto-stop after 1 hour
274
+ * await sandbox.setAutostopInterval(60);
275
+ * // Or disable auto-stop
276
+ * await sandbox.setAutostopInterval(0);
277
+ */
278
+ setAutostopInterval(interval: number): Promise<void>;
279
+ /**
280
+ * Set the auto-archive interval for the Sandbox.
281
+ *
282
+ * The Sandbox will automatically archive after being continuously stopped for the specified interval.
283
+ *
284
+ * @param {number} interval - Number of minutes after which a continuously stopped Sandbox will be auto-archived.
285
+ * Set to 0 for the maximum interval. Default is 7 days.
286
+ * @returns {Promise<void>}
287
+ * @throws {DaytonaError} - `DaytonaError` - If interval is not a non-negative integer
288
+ *
289
+ * @example
290
+ * // Auto-archive after 1 hour
291
+ * await sandbox.setAutoArchiveInterval(60);
292
+ * // Or use the maximum interval
293
+ * await sandbox.setAutoArchiveInterval(0);
294
+ */
295
+ setAutoArchiveInterval(interval: number): Promise<void>;
296
+ /**
297
+ * Set the auto-delete interval for the Sandbox.
298
+ *
299
+ * The Sandbox will automatically delete after being continuously stopped for the specified interval.
300
+ *
301
+ * @param {number} interval - Number of minutes after which a continuously stopped Sandbox will be auto-deleted.
302
+ * Set to negative value to disable auto-delete. Set to 0 to delete immediately upon stopping.
303
+ * By default, auto-delete is disabled.
304
+ * @returns {Promise<void>}
305
+ *
306
+ * @example
307
+ * // Auto-delete after 1 hour
308
+ * await sandbox.setAutoDeleteInterval(60);
309
+ * // Or delete immediately upon stopping
310
+ * await sandbox.setAutoDeleteInterval(0);
311
+ * // Or disable auto-delete
312
+ * await sandbox.setAutoDeleteInterval(-1);
313
+ */
314
+ setAutoDeleteInterval(interval: number): Promise<void>;
315
+ /**
316
+ * Retrieves the preview link for the sandbox at the specified port. If the port is closed,
317
+ * it will be opened automatically. For private sandboxes, a token is included to grant access
318
+ * to the URL.
319
+ *
320
+ * @param {number} port - The port to open the preview link on.
321
+ * @returns {PortPreviewUrl} The response object for the preview link, which includes the `url`
322
+ * and the `token` (to access private sandboxes).
323
+ *
324
+ * @example
325
+ * const previewLink = await sandbox.getPreviewLink(3000);
326
+ * console.log(`Preview URL: ${previewLink.url}`);
327
+ * console.log(`Token: ${previewLink.token}`);
328
+ */
329
+ getPreviewLink(port: number): Promise<PortPreviewUrl>;
330
+ /**
331
+ * Retrieves a signed preview url for the sandbox at the specified port.
332
+ *
333
+ * @param {number} port - The port to open the preview link on.
334
+ * @param {number} [expiresInSeconds] - The number of seconds the signed preview url will be valid for. Defaults to 60 seconds.
335
+ * @returns {Promise<SignedPortPreviewUrl>} The response object for the signed preview url.
336
+ */
337
+ getSignedPreviewUrl(port: number, expiresInSeconds?: number): Promise<SignedPortPreviewUrl>;
338
+ /**
339
+ * Expires a signed preview url for the sandbox at the specified port.
340
+ *
341
+ * @param {number} port - The port to expire the signed preview url on.
342
+ * @param {string} token - The token to expire the signed preview url on.
343
+ * @returns {Promise<void>}
344
+ */
345
+ expireSignedPreviewUrl(port: number, token: string): Promise<void>;
346
+ /**
347
+ * Archives the sandbox, making it inactive and preserving its state. When sandboxes are archived, the entire filesystem
348
+ * state is moved to cost-effective object storage, making it possible to keep sandboxes available for an extended period.
349
+ * The tradeoff between archived and stopped states is that starting an archived sandbox takes more time, depending on its size.
350
+ * Sandbox must be stopped before archiving.
351
+ */
352
+ archive(): Promise<void>;
353
+ /**
354
+ * Resizes the Sandbox resources.
355
+ *
356
+ * Changes the CPU, memory, or disk allocation for the Sandbox. Hot resize (on running
357
+ * sandbox) only allows CPU/memory increases. Disk resize requires a stopped sandbox.
358
+ *
359
+ * @param {Resources} resources - New resource configuration. Only specified fields will be updated.
360
+ * - cpu: Number of CPU cores (minimum: 1). For hot resize, can only be increased.
361
+ * - memory: Memory in GiB (minimum: 1). For hot resize, can only be increased.
362
+ * - disk: Disk space in GiB (can only be increased, requires stopped sandbox).
363
+ * @param {number} [timeout=60] - Timeout in seconds for the resize operation. 0 means no timeout.
364
+ * @returns {Promise<void>}
365
+ * @throws {DaytonaError} - If hot resize constraints are violated, disk resize attempted on running sandbox,
366
+ * disk size decrease is attempted, no resource changes are specified, or resize operation times out.
367
+ *
368
+ * @example
369
+ * // Increase CPU/memory on running sandbox (hot resize)
370
+ * await sandbox.resize({ cpu: 4, memory: 8 });
371
+ *
372
+ * // Change disk (sandbox must be stopped)
373
+ * await sandbox.stop();
374
+ * await sandbox.resize({ cpu: 2, memory: 4, disk: 30 });
375
+ */
376
+ resize(resources: Resources, timeout?: number): Promise<void>;
377
+ /**
378
+ * Waits for the Sandbox resize operation to complete.
379
+ *
380
+ * This method polls the Sandbox status until the state is no longer 'resizing'.
381
+ *
382
+ * @param {number} [timeout=60] - Maximum time to wait in seconds. 0 means no timeout.
383
+ * @returns {Promise<void>}
384
+ * @throws {DaytonaError} - If the sandbox ends up in an error state or resize times out.
385
+ */
386
+ waitForResizeComplete(timeout?: number): Promise<void>;
387
+ /**
388
+ * Creates an SSH access token for the sandbox.
389
+ *
390
+ * @param {number} expiresInMinutes - The number of minutes the SSH access token will be valid for.
391
+ * @returns {Promise<SshAccessDto>} The SSH access token.
392
+ */
393
+ createSshAccess(expiresInMinutes?: number): Promise<SshAccessDto>;
394
+ /**
395
+ * Revokes an SSH access token for the sandbox.
396
+ *
397
+ * @param {string} token - The token to revoke.
398
+ * @returns {Promise<void>}
399
+ */
400
+ revokeSshAccess(token: string): Promise<void>;
401
+ /**
402
+ * Validates an SSH access token for the sandbox.
403
+ *
404
+ * @param {string} token - The token to validate.
405
+ * @returns {Promise<SshAccessValidationDto>} The SSH access validation result.
406
+ */
407
+ validateSshAccess(token: string): Promise<SshAccessValidationDto>;
408
+ /**
409
+ * Assigns the API sandbox data to the Sandbox object.
410
+ *
411
+ * @param {SandboxDto} sandboxDto - The API sandbox instance to assign data from
412
+ * @returns {void}
413
+ */
414
+ private processSandboxDto;
415
+ /**
416
+ * Refreshes the Sandbox data from the API, but does not throw an error if the sandbox has been deleted.
417
+ * Instead, it sets the state to destroyed.
418
+ *
419
+ * @returns {Promise<void>}
420
+ */
421
+ private refreshDataSafe;
422
+ }
423
+ export interface PaginatedSandboxes extends Omit<PaginatedSandboxesDto, 'items'> {
424
+ items: Sandbox[];
425
+ }