@daytonaio/sdk 0.20.1 → 0.20.2
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/package.json +3 -1
- package/src/Daytona.d.ts +25 -25
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daytonaio/sdk",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.2",
|
|
4
4
|
"description": "TypeScript SDK for Daytona",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
"@babel/preset-typescript": "7.27.1",
|
|
30
30
|
"@dotenvx/dotenvx": "^1.25.1",
|
|
31
31
|
"@iarna/toml": "^2.2.5",
|
|
32
|
+
"@types/shell-quote": "1.7.5",
|
|
33
|
+
"@types/tar": "6.1.13",
|
|
32
34
|
"axios": "^1.6.1",
|
|
33
35
|
"dotenv": "16.5.0",
|
|
34
36
|
"fast-glob": "^3.3.0",
|
package/src/Daytona.d.ts
CHANGED
|
@@ -197,24 +197,27 @@ export declare class Daytona {
|
|
|
197
197
|
*/
|
|
198
198
|
constructor(config?: DaytonaConfig);
|
|
199
199
|
/**
|
|
200
|
-
* @deprecated Use `create` with `options` object instead. This method will be removed in a future version.
|
|
201
|
-
*
|
|
202
200
|
* Creates Sandboxes with default or custom configurations. You can specify various parameters,
|
|
203
201
|
* including language, image, resources, environment variables, and volumes for the Sandbox.
|
|
204
202
|
*
|
|
205
203
|
* @param {CreateSandboxParams} [params] - Parameters for Sandbox creation
|
|
206
|
-
* @param {
|
|
204
|
+
* @param {object} [options] - Options for the create operation
|
|
205
|
+
* @param {number} [options.timeout] - Timeout in seconds (0 means no timeout, default is 60)
|
|
206
|
+
* @param {function} [options.onImageBuildLogs] - Callback function to handle image build logs.
|
|
207
|
+
* It's invoked only when `params.image` is an instance of `Image` and there's no existing
|
|
208
|
+
* image in Daytona with the same configuration.
|
|
207
209
|
* @returns {Promise<Sandbox>} The created Sandbox instance
|
|
208
210
|
*
|
|
209
211
|
* @example
|
|
210
|
-
*
|
|
211
|
-
* const sandbox = await daytona.create();
|
|
212
|
+
* const image = Image.debianSlim('3.12').pipInstall('numpy');
|
|
213
|
+
* const sandbox = await daytona.create({ image }, { timeout: 90, onImageBuildLogs: console.log });
|
|
212
214
|
*
|
|
213
215
|
* @example
|
|
214
216
|
* // Create a custom sandbox
|
|
217
|
+
* const image = Image.debianSlim('3.12').pipInstall('numpy');
|
|
215
218
|
* const params: CreateSandboxParams = {
|
|
216
219
|
* language: 'typescript',
|
|
217
|
-
* image
|
|
220
|
+
* image,
|
|
218
221
|
* envVars: {
|
|
219
222
|
* NODE_ENV: 'development',
|
|
220
223
|
* DEBUG: 'true'
|
|
@@ -223,34 +226,33 @@ export declare class Daytona {
|
|
|
223
226
|
* cpu: 2,
|
|
224
227
|
* memory: 4 // 4GB RAM
|
|
225
228
|
* },
|
|
226
|
-
* autoStopInterval: 60
|
|
227
|
-
* autoArchiveInterval: 60
|
|
229
|
+
* autoStopInterval: 60
|
|
228
230
|
* };
|
|
229
|
-
* const sandbox = await daytona.create(params,
|
|
231
|
+
* const sandbox = await daytona.create(params, { timeout: 100, onImageBuildLogs: console.log });
|
|
230
232
|
*/
|
|
231
|
-
create(params?: CreateSandboxParams, options?:
|
|
233
|
+
create(params?: CreateSandboxParams, options?: {
|
|
234
|
+
onImageBuildLogs?: (chunk: string) => void;
|
|
235
|
+
timeout?: number;
|
|
236
|
+
}): Promise<Sandbox>;
|
|
232
237
|
/**
|
|
238
|
+
* @deprecated Use `create` with `options` object instead. This method will be removed in a future version.
|
|
239
|
+
*
|
|
233
240
|
* Creates Sandboxes with default or custom configurations. You can specify various parameters,
|
|
234
241
|
* including language, image, resources, environment variables, and volumes for the Sandbox.
|
|
235
242
|
*
|
|
236
243
|
* @param {CreateSandboxParams} [params] - Parameters for Sandbox creation
|
|
237
|
-
* @param {
|
|
238
|
-
* @param {number} [options.timeout] - Timeout in seconds (0 means no timeout, default is 60)
|
|
239
|
-
* @param {function} [options.onImageBuildLogs] - Callback function to handle image build logs.
|
|
240
|
-
* It's invoked only when `params.image` is an instance of `Image` and there's no existing
|
|
241
|
-
* image in Daytona with the same configuration.
|
|
244
|
+
* @param {number} [timeout] - Timeout in seconds (0 means no timeout, default is 60)
|
|
242
245
|
* @returns {Promise<Sandbox>} The created Sandbox instance
|
|
243
246
|
*
|
|
244
247
|
* @example
|
|
245
|
-
*
|
|
246
|
-
* const sandbox = await daytona.create(
|
|
248
|
+
* // Create a default sandbox
|
|
249
|
+
* const sandbox = await daytona.create();
|
|
247
250
|
*
|
|
248
251
|
* @example
|
|
249
252
|
* // Create a custom sandbox
|
|
250
|
-
* const image = Image.debianSlim('3.12').pipInstall('numpy');
|
|
251
253
|
* const params: CreateSandboxParams = {
|
|
252
254
|
* language: 'typescript',
|
|
253
|
-
* image,
|
|
255
|
+
* image: 'node:18',
|
|
254
256
|
* envVars: {
|
|
255
257
|
* NODE_ENV: 'development',
|
|
256
258
|
* DEBUG: 'true'
|
|
@@ -259,14 +261,12 @@ export declare class Daytona {
|
|
|
259
261
|
* cpu: 2,
|
|
260
262
|
* memory: 4 // 4GB RAM
|
|
261
263
|
* },
|
|
262
|
-
* autoStopInterval: 60
|
|
264
|
+
* autoStopInterval: 60,
|
|
265
|
+
* autoArchiveInterval: 60
|
|
263
266
|
* };
|
|
264
|
-
* const sandbox = await daytona.create(params,
|
|
267
|
+
* const sandbox = await daytona.create(params, 40);
|
|
265
268
|
*/
|
|
266
|
-
create(params?: CreateSandboxParams, options?:
|
|
267
|
-
onImageBuildLogs?: (chunk: string) => void;
|
|
268
|
-
timeout?: number;
|
|
269
|
-
}): Promise<Sandbox>;
|
|
269
|
+
create(params?: CreateSandboxParams, options?: number): Promise<Sandbox>;
|
|
270
270
|
/**
|
|
271
271
|
* Gets a Sandbox by its ID.
|
|
272
272
|
*
|