@daytonaio/sdk 0.192.0 → 0.193.0-alpha.4

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/Git.js CHANGED
@@ -24,6 +24,16 @@ let Git = (() => {
24
24
  let _push_decorators;
25
25
  let _pull_decorators;
26
26
  let _status_decorators;
27
+ let _init_decorators;
28
+ let _reset_decorators;
29
+ let _restore_decorators;
30
+ let _remoteAdd_decorators;
31
+ let _remotes_decorators;
32
+ let _remoteGet_decorators;
33
+ let _setConfig_decorators;
34
+ let _getConfig_decorators;
35
+ let _configureUser_decorators;
36
+ let _dangerouslyAuthenticate_decorators;
27
37
  return class Git {
28
38
  static {
29
39
  const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
@@ -37,6 +47,16 @@ let Git = (() => {
37
47
  _push_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
38
48
  _pull_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
39
49
  _status_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
50
+ _init_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
51
+ _reset_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
52
+ _restore_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
53
+ _remoteAdd_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
54
+ _remotes_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
55
+ _remoteGet_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
56
+ _setConfig_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
57
+ _getConfig_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
58
+ _configureUser_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
59
+ _dangerouslyAuthenticate_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
40
60
  tslib_1.__esDecorate(this, null, _add_decorators, { kind: "method", name: "add", static: false, private: false, access: { has: obj => "add" in obj, get: obj => obj.add }, metadata: _metadata }, null, _instanceExtraInitializers);
41
61
  tslib_1.__esDecorate(this, null, _branches_decorators, { kind: "method", name: "branches", static: false, private: false, access: { has: obj => "branches" in obj, get: obj => obj.branches }, metadata: _metadata }, null, _instanceExtraInitializers);
42
62
  tslib_1.__esDecorate(this, null, _createBranch_decorators, { kind: "method", name: "createBranch", static: false, private: false, access: { has: obj => "createBranch" in obj, get: obj => obj.createBranch }, metadata: _metadata }, null, _instanceExtraInitializers);
@@ -47,6 +67,16 @@ let Git = (() => {
47
67
  tslib_1.__esDecorate(this, null, _push_decorators, { kind: "method", name: "push", static: false, private: false, access: { has: obj => "push" in obj, get: obj => obj.push }, metadata: _metadata }, null, _instanceExtraInitializers);
48
68
  tslib_1.__esDecorate(this, null, _pull_decorators, { kind: "method", name: "pull", static: false, private: false, access: { has: obj => "pull" in obj, get: obj => obj.pull }, metadata: _metadata }, null, _instanceExtraInitializers);
49
69
  tslib_1.__esDecorate(this, null, _status_decorators, { kind: "method", name: "status", static: false, private: false, access: { has: obj => "status" in obj, get: obj => obj.status }, metadata: _metadata }, null, _instanceExtraInitializers);
70
+ tslib_1.__esDecorate(this, null, _init_decorators, { kind: "method", name: "init", static: false, private: false, access: { has: obj => "init" in obj, get: obj => obj.init }, metadata: _metadata }, null, _instanceExtraInitializers);
71
+ tslib_1.__esDecorate(this, null, _reset_decorators, { kind: "method", name: "reset", static: false, private: false, access: { has: obj => "reset" in obj, get: obj => obj.reset }, metadata: _metadata }, null, _instanceExtraInitializers);
72
+ tslib_1.__esDecorate(this, null, _restore_decorators, { kind: "method", name: "restore", static: false, private: false, access: { has: obj => "restore" in obj, get: obj => obj.restore }, metadata: _metadata }, null, _instanceExtraInitializers);
73
+ tslib_1.__esDecorate(this, null, _remoteAdd_decorators, { kind: "method", name: "remoteAdd", static: false, private: false, access: { has: obj => "remoteAdd" in obj, get: obj => obj.remoteAdd }, metadata: _metadata }, null, _instanceExtraInitializers);
74
+ tslib_1.__esDecorate(this, null, _remotes_decorators, { kind: "method", name: "remotes", static: false, private: false, access: { has: obj => "remotes" in obj, get: obj => obj.remotes }, metadata: _metadata }, null, _instanceExtraInitializers);
75
+ tslib_1.__esDecorate(this, null, _remoteGet_decorators, { kind: "method", name: "remoteGet", static: false, private: false, access: { has: obj => "remoteGet" in obj, get: obj => obj.remoteGet }, metadata: _metadata }, null, _instanceExtraInitializers);
76
+ tslib_1.__esDecorate(this, null, _setConfig_decorators, { kind: "method", name: "setConfig", static: false, private: false, access: { has: obj => "setConfig" in obj, get: obj => obj.setConfig }, metadata: _metadata }, null, _instanceExtraInitializers);
77
+ tslib_1.__esDecorate(this, null, _getConfig_decorators, { kind: "method", name: "getConfig", static: false, private: false, access: { has: obj => "getConfig" in obj, get: obj => obj.getConfig }, metadata: _metadata }, null, _instanceExtraInitializers);
78
+ tslib_1.__esDecorate(this, null, _configureUser_decorators, { kind: "method", name: "configureUser", static: false, private: false, access: { has: obj => "configureUser" in obj, get: obj => obj.configureUser }, metadata: _metadata }, null, _instanceExtraInitializers);
79
+ tslib_1.__esDecorate(this, null, _dangerouslyAuthenticate_decorators, { kind: "method", name: "dangerouslyAuthenticate", static: false, private: false, access: { has: obj => "dangerouslyAuthenticate" in obj, get: obj => obj.dangerouslyAuthenticate }, metadata: _metadata }, null, _instanceExtraInitializers);
50
80
  if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
51
81
  }
52
82
  apiClient = tslib_1.__runInitializers(this, _instanceExtraInitializers);
@@ -152,6 +182,7 @@ let Git = (() => {
152
182
  * @param {string} [username] - Git username for authentication
153
183
  * @param {string} [password] - Git password or token for authentication
154
184
  * @param {boolean} [insecureSkipTls] - Skip TLS certificate verification (insecure). Use only for trusted internal Git servers with self-signed or private-CA certs.
185
+ * @param {number} [depth] - Create a shallow clone truncated to the given number of commits.
155
186
  * @returns {Promise<void>}
156
187
  *
157
188
  * @example
@@ -179,7 +210,7 @@ let Git = (() => {
179
210
  * commitId='abc123'
180
211
  * );
181
212
  */
182
- async clone(url, path, branch, commitId, username, password, insecureSkipTls) {
213
+ async clone(url, path, branch, commitId, username, password, insecureSkipTls, depth) {
183
214
  await this.apiClient.cloneRepository({
184
215
  url: url,
185
216
  branch: branch,
@@ -188,6 +219,7 @@ let Git = (() => {
188
219
  password,
189
220
  commit_id: commitId,
190
221
  insecure_skip_tls: insecureSkipTls,
222
+ depth,
191
223
  });
192
224
  }
193
225
  /**
@@ -230,6 +262,9 @@ let Git = (() => {
230
262
  * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
231
263
  * @param {string} [username] - Git username for authentication
232
264
  * @param {string} [password] - Git password or token for authentication
265
+ * @param {string} [branch] - Branch to push. Defaults to the current branch
266
+ * @param {string} [remote] - Remote to push to. Defaults to "origin"
267
+ * @param {boolean} [setUpstream] - Record the pushed branch as the upstream tracking branch
233
268
  * @returns {Promise<void>}
234
269
  *
235
270
  * @example
@@ -243,12 +278,19 @@ let Git = (() => {
243
278
  * 'user',
244
279
  * 'token'
245
280
  * );
281
+ *
282
+ * @example
283
+ * // Push a new branch and set its upstream
284
+ * await git.push('workspace/repo', undefined, undefined, 'feature', undefined, true);
246
285
  */
247
- async push(path, username, password) {
286
+ async push(path, username, password, branch, remote, setUpstream) {
248
287
  await this.apiClient.pushChanges({
249
288
  path,
250
289
  username,
251
290
  password,
291
+ branch,
292
+ remote,
293
+ set_upstream: setUpstream,
252
294
  });
253
295
  }
254
296
  /**
@@ -257,6 +299,8 @@ let Git = (() => {
257
299
  * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
258
300
  * @param {string} [username] - Git username for authentication
259
301
  * @param {string} [password] - Git password or token for authentication
302
+ * @param {string} [branch] - Branch to pull. Defaults to the current branch's upstream
303
+ * @param {string} [remote] - Remote to pull from. Defaults to "origin"
260
304
  * @returns {Promise<void>}
261
305
  *
262
306
  * @example
@@ -270,12 +314,18 @@ let Git = (() => {
270
314
  * 'user',
271
315
  * 'token'
272
316
  * );
317
+ *
318
+ * @example
319
+ * // Pull a specific branch from a specific remote
320
+ * await git.pull('workspace/repo', undefined, undefined, 'main', 'upstream');
273
321
  */
274
- async pull(path, username, password) {
322
+ async pull(path, username, password, branch, remote) {
275
323
  await this.apiClient.pullChanges({
276
324
  path,
277
325
  username,
278
326
  password,
327
+ branch,
328
+ remote,
279
329
  });
280
330
  }
281
331
  /**
@@ -299,6 +349,204 @@ let Git = (() => {
299
349
  const response = await this.apiClient.getStatus(path);
300
350
  return response.data;
301
351
  }
352
+ /**
353
+ * Initializes a new Git repository at the specified path.
354
+ *
355
+ * @param {string} path - Path where the repository should be initialized. Relative paths are resolved based on the sandbox working directory.
356
+ * @param {boolean} [bare] - Create a bare repository without a working tree
357
+ * @param {string} [initialBranch] - Name of the initial branch. If not specified, uses the Git default
358
+ * @returns {Promise<void>}
359
+ *
360
+ * @example
361
+ * await git.init('workspace/repo', false, 'main');
362
+ */
363
+ async init(path, bare, initialBranch) {
364
+ await this.apiClient.initRepository({
365
+ path,
366
+ bare,
367
+ initial_branch: initialBranch,
368
+ });
369
+ }
370
+ /**
371
+ * Resets the current HEAD to the specified state.
372
+ *
373
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
374
+ * @param {string} [mode] - Reset mode, one of "soft", "mixed" (default), "hard", "merge" or "keep"
375
+ * @param {string} [target] - Revision to reset to. Defaults to HEAD
376
+ * @param {string[]} [files] - Constrain the reset to the given paths
377
+ * @returns {Promise<void>}
378
+ *
379
+ * @example
380
+ * // Unstage all changes (mixed reset to HEAD)
381
+ * await git.reset('workspace/repo');
382
+ *
383
+ * @example
384
+ * // Hard reset to a previous commit
385
+ * await git.reset('workspace/repo', 'hard', 'HEAD~1');
386
+ */
387
+ async reset(path, mode, target, files) {
388
+ await this.apiClient.resetChanges({
389
+ path,
390
+ mode,
391
+ target,
392
+ files,
393
+ });
394
+ }
395
+ /**
396
+ * Restores working tree files or unstages changes.
397
+ *
398
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
399
+ * @param {string[]} files - File paths to restore
400
+ * @param {boolean} [staged] - Restore the staging index for the given files
401
+ * @param {boolean} [worktree] - Restore the working tree for the given files. Defaults to true when neither staged nor worktree is provided
402
+ * @param {string} [source] - Restore file contents from the given revision instead of the index
403
+ * @returns {Promise<void>}
404
+ *
405
+ * @example
406
+ * // Discard working tree changes
407
+ * await git.restore('workspace/repo', ['file.txt']);
408
+ *
409
+ * @example
410
+ * // Unstage changes
411
+ * await git.restore('workspace/repo', ['file.txt'], true);
412
+ */
413
+ async restore(path, files, staged, worktree, source) {
414
+ await this.apiClient.restoreFiles({
415
+ path,
416
+ files,
417
+ staged,
418
+ worktree,
419
+ source,
420
+ });
421
+ }
422
+ /**
423
+ * Adds (or overwrites) a remote in the repository.
424
+ *
425
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
426
+ * @param {string} name - Name of the remote
427
+ * @param {string} url - URL of the remote
428
+ * @param {boolean} [fetch] - Fetch from the remote immediately after adding it
429
+ * @param {boolean} [overwrite] - Replace an existing remote with the same name
430
+ * @returns {Promise<void>}
431
+ *
432
+ * @example
433
+ * await git.remoteAdd('workspace/repo', 'origin', 'https://github.com/user/repo.git');
434
+ */
435
+ async remoteAdd(path, name, url, fetch, overwrite) {
436
+ await this.apiClient.addRemote({
437
+ path,
438
+ name,
439
+ url,
440
+ fetch,
441
+ overwrite,
442
+ });
443
+ }
444
+ /**
445
+ * Lists the remotes configured in the repository.
446
+ *
447
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
448
+ * @returns {Promise<ListRemotesResponse>} The configured remotes (name + URL)
449
+ *
450
+ * @example
451
+ * const response = await git.remotes('workspace/repo');
452
+ * response.remotes.forEach((r) => console.log(`${r.name}: ${r.url}`));
453
+ */
454
+ async remotes(path) {
455
+ const response = await this.apiClient.listRemotes(path);
456
+ return response.data;
457
+ }
458
+ /**
459
+ * Gets the URL of a remote, or undefined when it does not exist.
460
+ *
461
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
462
+ * @param {string} name - Name of the remote
463
+ * @returns {Promise<string | undefined>} The remote URL, or undefined when the remote does not exist
464
+ *
465
+ * @example
466
+ * const url = await git.remoteGet('workspace/repo', 'origin');
467
+ */
468
+ async remoteGet(path, name) {
469
+ const response = await this.apiClient.listRemotes(path);
470
+ return response.data.remotes.find((r) => r.name === name)?.url;
471
+ }
472
+ /**
473
+ * Sets a Git config value at the given scope.
474
+ *
475
+ * @param {string} key - Config key in dotted form (e.g. "user.name")
476
+ * @param {string} value - Config value
477
+ * @param {string} [scope] - Config scope, one of "global" (default), "local" or "system"
478
+ * @param {string} [path] - Repository path, required when scope is "local"
479
+ * @returns {Promise<void>}
480
+ *
481
+ * @example
482
+ * await git.setConfig('user.name', 'John Doe');
483
+ */
484
+ async setConfig(key, value, scope = 'global', path) {
485
+ await this.apiClient.setGitConfig({
486
+ key,
487
+ value,
488
+ scope,
489
+ path,
490
+ });
491
+ }
492
+ /**
493
+ * Gets a Git config value at the given scope, or undefined when unset.
494
+ *
495
+ * @param {string} key - Config key in dotted form (e.g. "user.name")
496
+ * @param {string} [scope] - Config scope, one of "global" (default), "local" or "system"
497
+ * @param {string} [path] - Repository path, required when scope is "local"
498
+ * @returns {Promise<string | undefined>} The config value, or undefined when the key is not set
499
+ *
500
+ * @example
501
+ * const name = await git.getConfig('user.name');
502
+ */
503
+ async getConfig(key, scope = 'global', path) {
504
+ const response = await this.apiClient.getGitConfig(key, path, scope);
505
+ return response.data.value;
506
+ }
507
+ /**
508
+ * Configures the Git user name and email at the given scope.
509
+ *
510
+ * @param {string} name - User name (user.name)
511
+ * @param {string} email - User email (user.email)
512
+ * @param {string} [scope] - Config scope, one of "global" (default), "local" or "system"
513
+ * @param {string} [path] - Repository path, required when scope is "local"
514
+ * @returns {Promise<void>}
515
+ *
516
+ * @example
517
+ * await git.configureUser('John Doe', 'john@example.com');
518
+ */
519
+ async configureUser(name, email, scope = 'global', path) {
520
+ await this.apiClient.configureUser({
521
+ name,
522
+ email,
523
+ scope,
524
+ path,
525
+ });
526
+ }
527
+ /**
528
+ * Persists Git credentials globally so that subsequent operations against the
529
+ * given host authenticate automatically.
530
+ *
531
+ * @remarks This stores the password in plaintext on disk via the Git credential store.
532
+ *
533
+ * @param {string} username - Git username
534
+ * @param {string} password - Git password or token
535
+ * @param {string} [host] - Host to authenticate against. Defaults to "github.com"
536
+ * @param {string} [protocol] - Protocol to authenticate against. Defaults to "https"
537
+ * @returns {Promise<void>}
538
+ *
539
+ * @example
540
+ * await git.dangerouslyAuthenticate('user', 'github_token');
541
+ */
542
+ async dangerouslyAuthenticate(username, password, host, protocol) {
543
+ await this.apiClient.authenticate({
544
+ username,
545
+ password,
546
+ host,
547
+ protocol,
548
+ });
549
+ }
302
550
  };
303
551
  })();
304
552
  exports.Git = Git;
package/cjs/Git.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Git.js","sourceRoot":"","sources":["../../../../sdk-typescript/src/Git.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAIH,2DAA4D;AAY5D;;;;GAIG;IACU,GAAG;;;;;;;;;;;;iBAAH,GAAG;;;+BAmBb,IAAA,oCAAmB,GAAE;oCAkBrB,IAAA,oCAAmB,GAAE;wCAgBrB,IAAA,oCAAmB,GAAE;wCAmBrB,IAAA,oCAAmB,GAAE;0CAmBrB,IAAA,oCAAmB,GAAE;iCAgDrB,IAAA,oCAAmB,GAAE;kCA2CrB,IAAA,oCAAmB,GAAE;gCAwCrB,IAAA,oCAAmB,GAAE;gCA6BrB,IAAA,oCAAmB,GAAE;kCA0BrB,IAAA,oCAAmB,GAAE;YAjQtB,oKAAa,GAAG,6DAKf;YAaD,mLAAa,QAAQ,6DAGpB;YAaD,+LAAa,YAAY,6DAMxB;YAaD,+LAAa,YAAY,6DAMxB;YAaD,qMAAa,cAAc,6DAM1B;YA0CD,0KAAa,KAAK,6DAkBjB;YAyBD,6KAAa,M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AAC;QAED;;;;;;;;;;;;;;WAcG;QAEI,KAAK,CAAC,uBAAuB,CAClC,QAAgB,EAChB,QAAgB,EAChB,IAAa,EACb,QAAiB;YAEjB,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;gBAChC,QAAQ;gBACR,QAAQ;gBACR,IAAI;gBACJ,QAAQ;aACT,CAAC,CAAA;QACJ,CAAC;;;AAhiBU,kBAAG"}
package/cjs/Secret.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { SecretApi } from '@daytona/api-client';
2
- import type { Secret as SecretModel } from '@daytona/api-client';
2
+ import type { Secret as SecretModel, ListSecretsResponse as ListSecretsResponseDto, ListSecretsPaginatedSortEnum, ListSecretsPaginatedOrderEnum } from '@daytona/api-client';
3
3
  /**
4
4
  * Represents an organization-scoped Secret.
5
5
  *
@@ -51,6 +51,33 @@ export interface UpdateSecretParams {
51
51
  description?: string;
52
52
  hosts?: string[];
53
53
  }
54
+ /**
55
+ * Query parameters for listing Secrets with pagination.
56
+ *
57
+ * @interface
58
+ * @property {string} [cursor] - Pagination cursor from a previous response. Omit to fetch the first page.
59
+ * @property {number} [limit] - Number of results per page (1-200). Defaults to 100.
60
+ * @property {string} [name] - Filters the results to Secrets whose name partially matches the value
61
+ * @property {ListSecretsPaginatedSortEnum} [sort] - Field to sort by. Defaults to `createdAt`.
62
+ * @property {ListSecretsPaginatedOrderEnum} [order] - Direction to sort by. Defaults to `desc`.
63
+ */
64
+ export interface ListSecretsQuery {
65
+ cursor?: string;
66
+ limit?: number;
67
+ name?: string;
68
+ sort?: ListSecretsPaginatedSortEnum;
69
+ order?: ListSecretsPaginatedOrderEnum;
70
+ }
71
+ /**
72
+ * Represents a paginated list of Daytona Secrets.
73
+ *
74
+ * @property {Secret[]} items - List of Secrets in the current page.
75
+ * @property {number} total - Total number of Secrets matching the filters.
76
+ * @property {string | null} nextCursor - Cursor for the next page of results. `null` when there are no more pages.
77
+ */
78
+ export interface ListSecretsResponse extends Omit<ListSecretsResponseDto, 'items'> {
79
+ items: Secret[];
80
+ }
54
81
  /**
55
82
  * Service for managing organization-scoped Daytona Secrets.
56
83
  *
@@ -65,17 +92,23 @@ export declare class SecretService {
65
92
  private secretApi;
66
93
  constructor(secretApi: SecretApi);
67
94
  /**
68
- * Lists all Secrets in the organization.
95
+ * Lists Secrets in the organization with cursor-based pagination.
69
96
  *
70
- * @returns {Promise<Secret[]>} List of all Secrets in the organization
97
+ * @param {ListSecretsQuery} [query] - Optional filters, sorting, pagination cursor, and per-page size
98
+ * @returns {Promise<ListSecretsResponse>} A page of Secrets together with the total count and the
99
+ * cursor for the next page
71
100
  *
72
101
  * @example
73
102
  * const daytona = new Daytona();
74
- * const secrets = await daytona.secret.list();
75
- * console.log(`Found ${secrets.length} secrets`);
76
- * secrets.forEach(secret => console.log(`${secret.name} (${secret.id})`));
103
+ * let cursor: string | undefined = undefined;
104
+ * do {
105
+ * const page = await daytona.secret.list({ cursor, limit: 50 });
106
+ * console.log(`Fetched ${page.items.length} of ${page.total} secrets`);
107
+ * page.items.forEach(secret => console.log(`${secret.name} (${secret.id})`));
108
+ * cursor = page.nextCursor ?? undefined;
109
+ * } while (cursor);
77
110
  */
78
- list(): Promise<Secret[]>;
111
+ list(query?: ListSecretsQuery): Promise<ListSecretsResponse>;
79
112
  /**
80
113
  * Gets a Secret by its ID.
81
114
  *
package/cjs/Secret.js CHANGED
@@ -44,19 +44,29 @@ let SecretService = (() => {
44
44
  this.secretApi = secretApi;
45
45
  }
46
46
  /**
47
- * Lists all Secrets in the organization.
47
+ * Lists Secrets in the organization with cursor-based pagination.
48
48
  *
49
- * @returns {Promise<Secret[]>} List of all Secrets in the organization
49
+ * @param {ListSecretsQuery} [query] - Optional filters, sorting, pagination cursor, and per-page size
50
+ * @returns {Promise<ListSecretsResponse>} A page of Secrets together with the total count and the
51
+ * cursor for the next page
50
52
  *
51
53
  * @example
52
54
  * const daytona = new Daytona();
53
- * const secrets = await daytona.secret.list();
54
- * console.log(`Found ${secrets.length} secrets`);
55
- * secrets.forEach(secret => console.log(`${secret.name} (${secret.id})`));
55
+ * let cursor: string | undefined = undefined;
56
+ * do {
57
+ * const page = await daytona.secret.list({ cursor, limit: 50 });
58
+ * console.log(`Fetched ${page.items.length} of ${page.total} secrets`);
59
+ * page.items.forEach(secret => console.log(`${secret.name} (${secret.id})`));
60
+ * cursor = page.nextCursor ?? undefined;
61
+ * } while (cursor);
56
62
  */
57
- async list() {
58
- const response = await this.secretApi.listSecrets();
59
- return response.data;
63
+ async list(query) {
64
+ const response = await this.secretApi.listSecretsPaginated(undefined, query?.cursor, query?.limit, query?.name, query?.sort, query?.order);
65
+ return {
66
+ items: response.data.items.map((secret) => secret),
67
+ total: response.data.total,
68
+ nextCursor: response.data.nextCursor,
69
+ };
60
70
  }
61
71
  /**
62
72
  * Gets a Secret by its ID.
package/cjs/Secret.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Secret.js","sourceRoot":"","sources":["../../../../sdk-typescript/src/Secret.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAIH,2DAA4D;AAsD5D;;;;;;;;;GASG;IACU,aAAa;;;;;;;iBAAb,aAAa;;;gCAcvB,IAAA,oCAAmB,GAAE;+BAkBrB,IAAA,oCAAmB,GAAE;kCAsBrB,IAAA,oCAAmB,GAAE;kCA0BrB,IAAA,oCAAmB,GAAE;kCAsBrB,IAAA,oCAAmB,GAAE;YAvFtB,uKAAM,IAAI,6DAGT;YAeD,oKAAM,GAAG,6DAGR;YAmBD,6KAAM,MAAM,6DAQX;YAkBD,6KAAM,MAAM,6DAOX;YAeD,6KAAM,MAAM,6DAEX;;;QAxGmB,SAAS,GADlB,2DAAa;QACxB,YAAoB,SAAoB;YAApB,cAAS,GAAT,SAAS,CAAW;QAAG,CAAC;QAE5C;;;;;;;;;;WAUG;QAEH,KAAK,CAAC,IAAI;YACR,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,CAAA;YACnD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AS,CAAC,YAAY,CAAC;gBACjD,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,KAAK,EAAE,MAAM,CAAC,KAAK;aACpB,CAAC,CAAA;YACF,OAAO,QAAQ,CAAC,IAAc,CAAA;QAChC,CAAC;QAED;;;;;;;;;;;;;;WAcG;QAEH,KAAK,CAAC,MAAM,CAAC,QAAgB,EAAE,MAA0B;YACvD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,QAAQ,EAAE;gBAC3D,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,KAAK,EAAE,MAAM,CAAC,KAAK;aACpB,CAAC,CAAA;YACF,OAAO,QAAQ,CAAC,IAAc,CAAA;QAChC,CAAC;QAED;;;;;;;;;;;WAWG;QAEH,KAAK,CAAC,MAAM,CAAC,QAAgB;YAC3B,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAA;QAC7C,CAAC;;;AA1HU,sCAAa"}
package/cjs/index.d.ts CHANGED
@@ -9,13 +9,13 @@ export { DaytonaAuthenticationError, DaytonaAuthorizationError, DaytonaConflictE
9
9
  export { Image } from './Image';
10
10
  export { Sandbox } from './Sandbox';
11
11
  export type { ListSandboxesQuery } from './Sandbox';
12
- export type { Secret, CreateSecretParams, UpdateSecretParams } from './Secret';
12
+ export type { Secret, CreateSecretParams, UpdateSecretParams, ListSecretsQuery, ListSecretsResponse } from './Secret';
13
13
  export type { CreateSnapshotParams } from './Snapshot';
14
14
  export { ComputerUse, Mouse, Keyboard, Screenshot, Display, Accessibility } from './ComputerUse';
15
15
  export type { BarChart, BarData, BoxAndWhiskerChart, BoxAndWhiskerData, Chart, Chart2D, ChartElement, CompositeChart, LineChart, PieChart, PieData, PointChart, PointData, ScatterChart, } from './types/Charts';
16
16
  export { ChartType } from './types/Charts';
17
17
  export type { ExecutionError, ExecutionResult, OutputMessage, RunCodeOptions } from './types/CodeInterpreter';
18
- export { GpuType, SandboxState, SandboxListSortField, SandboxListSortDirection, SandboxClass, } from '@daytona/api-client';
18
+ export { GpuType, SandboxState, SandboxListSortField, SandboxListSortDirection, SandboxClass, ListSecretsPaginatedSortEnum, ListSecretsPaginatedOrderEnum, } from '@daytona/api-client';
19
19
  export type { FileInfo, GitStatus, ListBranchResponse, Match, ReplaceResult, SearchFilesResponse, } from '@daytona/toolbox-api-client';
20
20
  export type { ScreenshotRegion, ScreenshotOptions, AccessibilityTreeOptions, AccessibilityFindOptions, } from './ComputerUse';
21
21
  export * from './Process';
package/cjs/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.SandboxClass = exports.SandboxListSortDirection = exports.SandboxListSortField = exports.SandboxState = exports.GpuType = exports.ChartType = exports.Accessibility = exports.Display = exports.Screenshot = exports.Keyboard = exports.Mouse = exports.ComputerUse = exports.Sandbox = exports.Image = exports.DaytonaValidationError = exports.DaytonaTimeoutError = exports.DaytonaRateLimitError = exports.DaytonaNotFoundError = exports.DaytonaError = exports.DaytonaConnectionError = exports.DaytonaConflictError = exports.DaytonaAuthorizationError = exports.DaytonaAuthenticationError = exports.Process = exports.LspLanguageId = exports.Git = exports.FileSystem = exports.Daytona = exports.CodeLanguage = void 0;
7
+ exports.ListSecretsPaginatedOrderEnum = exports.ListSecretsPaginatedSortEnum = exports.SandboxClass = exports.SandboxListSortDirection = exports.SandboxListSortField = exports.SandboxState = exports.GpuType = exports.ChartType = exports.Accessibility = exports.Display = exports.Screenshot = exports.Keyboard = exports.Mouse = exports.ComputerUse = exports.Sandbox = exports.Image = exports.DaytonaValidationError = exports.DaytonaTimeoutError = exports.DaytonaRateLimitError = exports.DaytonaNotFoundError = exports.DaytonaError = exports.DaytonaConnectionError = exports.DaytonaConflictError = exports.DaytonaAuthorizationError = exports.DaytonaAuthenticationError = exports.Process = exports.LspLanguageId = exports.Git = exports.FileSystem = exports.Daytona = exports.CodeLanguage = void 0;
8
8
  const tslib_1 = require("tslib");
9
9
  var Daytona_1 = require("./Daytona");
10
10
  Object.defineProperty(exports, "CodeLanguage", { enumerable: true, get: function () { return Daytona_1.CodeLanguage; } });
@@ -48,6 +48,8 @@ Object.defineProperty(exports, "SandboxState", { enumerable: true, get: function
48
48
  Object.defineProperty(exports, "SandboxListSortField", { enumerable: true, get: function () { return api_client_1.SandboxListSortField; } });
49
49
  Object.defineProperty(exports, "SandboxListSortDirection", { enumerable: true, get: function () { return api_client_1.SandboxListSortDirection; } });
50
50
  Object.defineProperty(exports, "SandboxClass", { enumerable: true, get: function () { return api_client_1.SandboxClass; } });
51
+ Object.defineProperty(exports, "ListSecretsPaginatedSortEnum", { enumerable: true, get: function () { return api_client_1.ListSecretsPaginatedSortEnum; } });
52
+ Object.defineProperty(exports, "ListSecretsPaginatedOrderEnum", { enumerable: true, get: function () { return api_client_1.ListSecretsPaginatedOrderEnum; } });
51
53
  tslib_1.__exportStar(require("./Process"), exports);
52
54
  tslib_1.__exportStar(require("./PtyHandle"), exports);
53
55
  tslib_1.__exportStar(require("./types/Pty"), exports);
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../sdk-typescript/src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,qCAAiD;AAAxC,uGAAA,YAAY,OAAA;AAAE,kGAAA,OAAO,OAAA;AAS9B,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AAcnB,6BAA2B;AAAlB,0FAAA,GAAG,OAAA;AACZ,yCAA2C;AAAlC,0GAAA,aAAa,OAAA;AACtB,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAChB,0CAA0C;AAC1C,6DAA6D;AAC7D,sDAU8B;AAT5B,0HAAA,0BA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,oHAAA,oBAAoB,OAAA;AACpB,qHAAA,qBAAqB,OAAA;AACrB,mHAAA,mBAAmB,OAAA;AACnB,sHAAA,sBAAsB,OAAA;AAExB,iCAA+B;AAAtB,8FAAA,KAAK,OAAA;AACd,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAIhB,6CAAgG;AAAvF,0GAAA,WAAW,OAAA;AAAE,oGAAA,KAAK,OAAA;AAAE,uGAAA,QAAQ,OAAA;AAAE,yGAAA,UAAU,OAAA;AAAE,sGAAA,OAAO,OAAA;AAAE,4GAAA,aAAa,OAAA;AAiBzE,yCAA0C;AAAjC,mGAAA,SAAS,OAAA;AAGlB,kDAQ4B;AAP1B,qGAAA,OAAO,OAAA;AACP,0GAAA,YAAY,OAAA;AACZ,kHAAA,oBAAoB,OAAA;AACpB,sHAAA,wBAAwB,OAAA;AACxB,0GAAA,YAAY,OAAA;AACZ,0HAAA,4BAA4B,OAAA;AAC5B,2HAAA,6BAA6B,OAAA;AAkB/B,oDAAyB;AACzB,sDAA2B;AAC3B,sDAA2B"}
@@ -294,6 +294,10 @@ export declare class FileSystem {
294
294
  * Lists contents of a directory in the Sandbox.
295
295
  *
296
296
  * @param {string} path - Directory path to list. Relative paths are resolved based on the sandbox working directory.
297
+ * @param {object} [options] - Listing options
298
+ * @param {number} [options.depth] - How many levels deep to list. depth=1 (default) lists the
299
+ * directory's entries, depth=2 also includes their children, and so on. Must be an integer >= 1.
300
+ * Each returned FileInfo carries a full `path` field.
297
301
  * @returns {Promise<FileInfo[]>} Array of file and directory information
298
302
  *
299
303
  * @example
@@ -302,8 +306,14 @@ export declare class FileSystem {
302
306
  * files.forEach(file => {
303
307
  * console.log(`${file.name} (${file.size} bytes)`);
304
308
  * });
309
+ *
310
+ * // List recursively two levels deep
311
+ * const tree = await fs.listFiles('app/src', { depth: 2 });
312
+ * tree.forEach(file => console.log(file.path));
305
313
  */
306
- listFiles(path: string): Promise<FileInfo[]>;
314
+ listFiles(path: string, options?: {
315
+ depth?: number;
316
+ }): Promise<FileInfo[]>;
307
317
  /**
308
318
  * Moves or renames a file or directory.
309
319
  *
package/esm/FileSystem.js CHANGED
@@ -343,6 +343,10 @@ let FileSystem = (() => {
343
343
  * Lists contents of a directory in the Sandbox.
344
344
  *
345
345
  * @param {string} path - Directory path to list. Relative paths are resolved based on the sandbox working directory.
346
+ * @param {object} [options] - Listing options
347
+ * @param {number} [options.depth] - How many levels deep to list. depth=1 (default) lists the
348
+ * directory's entries, depth=2 also includes their children, and so on. Must be an integer >= 1.
349
+ * Each returned FileInfo carries a full `path` field.
346
350
  * @returns {Promise<FileInfo[]>} Array of file and directory information
347
351
  *
348
352
  * @example
@@ -351,9 +355,16 @@ let FileSystem = (() => {
351
355
  * files.forEach(file => {
352
356
  * console.log(`${file.name} (${file.size} bytes)`);
353
357
  * });
358
+ *
359
+ * // List recursively two levels deep
360
+ * const tree = await fs.listFiles('app/src', { depth: 2 });
361
+ * tree.forEach(file => console.log(file.path));
354
362
  */
355
- async listFiles(path) {
356
- const response = await this.apiClient.listFiles(path);
363
+ async listFiles(path, options) {
364
+ if (options?.depth !== undefined && (!Number.isInteger(options.depth) || options.depth < 1)) {
365
+ throw new DaytonaError('depth must be an integer of at least 1');
366
+ }
367
+ const response = await this.apiClient.listFiles(path, options?.depth);
357
368
  return response.data;
358
369
  }
359
370
  /**