@daytonaio/sdk 0.128.0-alpha.1 → 0.128.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.
Files changed (277) hide show
  1. package/package.json +8 -20
  2. package/{cjs → src}/CodeInterpreter.d.ts +0 -1
  3. package/src/CodeInterpreter.js.map +1 -0
  4. package/{esm → src}/ComputerUse.d.ts +0 -1
  5. package/src/ComputerUse.js.map +1 -0
  6. package/{cjs → src}/Daytona.d.ts +0 -1
  7. package/{cjs → src}/Daytona.js +0 -1
  8. package/src/Daytona.js.map +1 -0
  9. package/{esm → src}/FileSystem.d.ts +0 -1
  10. package/src/FileSystem.js.map +1 -0
  11. package/{esm → src}/Git.d.ts +0 -1
  12. package/src/Git.js.map +1 -0
  13. package/{cjs → src}/Image.d.ts +0 -21
  14. package/{cjs → src}/Image.js +91 -123
  15. package/src/Image.js.map +1 -0
  16. package/{cjs → src}/LspServer.d.ts +0 -1
  17. package/src/LspServer.js.map +1 -0
  18. package/{esm → src}/ObjectStorage.d.ts +0 -1
  19. package/src/ObjectStorage.js.map +1 -0
  20. package/{cjs → src}/Process.d.ts +0 -1
  21. package/src/Process.js.map +1 -0
  22. package/{cjs → src}/PtyHandle.d.ts +0 -1
  23. package/src/PtyHandle.js.map +1 -0
  24. package/{cjs → src}/Sandbox.d.ts +17 -2
  25. package/{cjs → src}/Sandbox.js +27 -1
  26. package/src/Sandbox.js.map +1 -0
  27. package/{cjs → src}/Snapshot.d.ts +0 -2
  28. package/{cjs → src}/Snapshot.js +1 -9
  29. package/src/Snapshot.js.map +1 -0
  30. package/{esm → src}/Volume.d.ts +0 -1
  31. package/src/Volume.js.map +1 -0
  32. package/{cjs → src}/code-toolbox/SandboxJsCodeToolbox.d.ts +0 -1
  33. package/src/code-toolbox/SandboxJsCodeToolbox.js.map +1 -0
  34. package/{cjs → src}/code-toolbox/SandboxPythonCodeToolbox.d.ts +0 -1
  35. package/src/code-toolbox/SandboxPythonCodeToolbox.js.map +1 -0
  36. package/{cjs → src}/code-toolbox/SandboxTsCodeToolbox.d.ts +0 -1
  37. package/src/code-toolbox/SandboxTsCodeToolbox.js.map +1 -0
  38. package/{esm → src}/errors/DaytonaError.d.ts +0 -1
  39. package/src/errors/DaytonaError.js.map +1 -0
  40. package/{cjs → src}/index.d.ts +0 -1
  41. package/src/index.js.map +1 -0
  42. package/{esm → src}/types/Charts.d.ts +0 -1
  43. package/src/types/Charts.js.map +1 -0
  44. package/{esm → src}/types/CodeInterpreter.d.ts +0 -1
  45. package/src/types/CodeInterpreter.js.map +1 -0
  46. package/{cjs → src}/types/ExecuteResponse.d.ts +0 -1
  47. package/src/types/ExecuteResponse.js.map +1 -0
  48. package/{cjs → src}/types/Pty.d.ts +0 -1
  49. package/src/types/Pty.js.map +1 -0
  50. package/{cjs → src}/utils/ArtifactParser.d.ts +0 -1
  51. package/src/utils/ArtifactParser.js.map +1 -0
  52. package/{esm → src}/utils/Binary.d.ts +0 -1
  53. package/src/utils/Binary.js.map +1 -0
  54. package/{cjs → src}/utils/FileTransfer.d.ts +0 -1
  55. package/src/utils/FileTransfer.js.map +1 -0
  56. package/{cjs → src}/utils/Import.d.ts +15 -2
  57. package/src/utils/Import.js +77 -0
  58. package/src/utils/Import.js.map +1 -0
  59. package/{esm → src}/utils/Multipart.d.ts +0 -1
  60. package/src/utils/Multipart.js.map +1 -0
  61. package/{cjs → src}/utils/Runtime.d.ts +0 -1
  62. package/src/utils/Runtime.js.map +1 -0
  63. package/{cjs → src}/utils/Stream.d.ts +0 -1
  64. package/src/utils/Stream.js.map +1 -0
  65. package/{esm → src}/utils/WebSocket.d.ts +0 -1
  66. package/src/utils/WebSocket.js.map +1 -0
  67. package/LICENSE +0 -190
  68. package/cjs/CodeInterpreter.d.ts.map +0 -1
  69. package/cjs/CodeInterpreter.js.map +0 -1
  70. package/cjs/ComputerUse.d.ts +0 -443
  71. package/cjs/ComputerUse.d.ts.map +0 -1
  72. package/cjs/ComputerUse.js.map +0 -1
  73. package/cjs/Daytona.d.ts.map +0 -1
  74. package/cjs/Daytona.js.map +0 -1
  75. package/cjs/FileSystem.d.ts +0 -328
  76. package/cjs/FileSystem.d.ts.map +0 -1
  77. package/cjs/FileSystem.js.map +0 -1
  78. package/cjs/Git.d.ts +0 -203
  79. package/cjs/Git.d.ts.map +0 -1
  80. package/cjs/Git.js.map +0 -1
  81. package/cjs/Image.d.ts.map +0 -1
  82. package/cjs/Image.js.map +0 -1
  83. package/cjs/LspServer.d.ts.map +0 -1
  84. package/cjs/LspServer.js.map +0 -1
  85. package/cjs/ObjectStorage.d.ts +0 -79
  86. package/cjs/ObjectStorage.d.ts.map +0 -1
  87. package/cjs/ObjectStorage.js.map +0 -1
  88. package/cjs/Process.d.ts.map +0 -1
  89. package/cjs/Process.js.map +0 -1
  90. package/cjs/PtyHandle.d.ts.map +0 -1
  91. package/cjs/PtyHandle.js.map +0 -1
  92. package/cjs/README.md +0 -147
  93. package/cjs/Sandbox.d.ts.map +0 -1
  94. package/cjs/Sandbox.js.map +0 -1
  95. package/cjs/Snapshot.d.ts.map +0 -1
  96. package/cjs/Snapshot.js.map +0 -1
  97. package/cjs/Volume.d.ts +0 -84
  98. package/cjs/Volume.d.ts.map +0 -1
  99. package/cjs/Volume.js.map +0 -1
  100. package/cjs/code-toolbox/SandboxJsCodeToolbox.d.ts.map +0 -1
  101. package/cjs/code-toolbox/SandboxJsCodeToolbox.js.map +0 -1
  102. package/cjs/code-toolbox/SandboxPythonCodeToolbox.d.ts.map +0 -1
  103. package/cjs/code-toolbox/SandboxPythonCodeToolbox.js.map +0 -1
  104. package/cjs/code-toolbox/SandboxTsCodeToolbox.d.ts.map +0 -1
  105. package/cjs/code-toolbox/SandboxTsCodeToolbox.js.map +0 -1
  106. package/cjs/errors/DaytonaError.d.ts +0 -32
  107. package/cjs/errors/DaytonaError.d.ts.map +0 -1
  108. package/cjs/errors/DaytonaError.js.map +0 -1
  109. package/cjs/index.d.ts.map +0 -1
  110. package/cjs/index.js.map +0 -1
  111. package/cjs/package.json +0 -3
  112. package/cjs/types/Charts.d.ts +0 -152
  113. package/cjs/types/Charts.d.ts.map +0 -1
  114. package/cjs/types/Charts.js.map +0 -1
  115. package/cjs/types/CodeInterpreter.d.ts +0 -77
  116. package/cjs/types/CodeInterpreter.d.ts.map +0 -1
  117. package/cjs/types/CodeInterpreter.js.map +0 -1
  118. package/cjs/types/ExecuteResponse.d.ts.map +0 -1
  119. package/cjs/types/ExecuteResponse.js.map +0 -1
  120. package/cjs/types/Pty.d.ts.map +0 -1
  121. package/cjs/types/Pty.js.map +0 -1
  122. package/cjs/utils/ArtifactParser.d.ts.map +0 -1
  123. package/cjs/utils/ArtifactParser.js.map +0 -1
  124. package/cjs/utils/Binary.d.ts +0 -39
  125. package/cjs/utils/Binary.d.ts.map +0 -1
  126. package/cjs/utils/Binary.js.map +0 -1
  127. package/cjs/utils/FileTransfer.d.ts.map +0 -1
  128. package/cjs/utils/FileTransfer.js.map +0 -1
  129. package/cjs/utils/Import.d.ts.map +0 -1
  130. package/cjs/utils/Import.js +0 -81
  131. package/cjs/utils/Import.js.map +0 -1
  132. package/cjs/utils/Multipart.d.ts +0 -27
  133. package/cjs/utils/Multipart.d.ts.map +0 -1
  134. package/cjs/utils/Multipart.js.map +0 -1
  135. package/cjs/utils/Runtime.d.ts.map +0 -1
  136. package/cjs/utils/Runtime.js.map +0 -1
  137. package/cjs/utils/Stream.d.ts.map +0 -1
  138. package/cjs/utils/Stream.js.map +0 -1
  139. package/cjs/utils/WebSocket.d.ts +0 -10
  140. package/cjs/utils/WebSocket.d.ts.map +0 -1
  141. package/cjs/utils/WebSocket.js.map +0 -1
  142. package/esm/CodeInterpreter.d.ts +0 -96
  143. package/esm/CodeInterpreter.d.ts.map +0 -1
  144. package/esm/CodeInterpreter.js +0 -295
  145. package/esm/CodeInterpreter.js.map +0 -1
  146. package/esm/ComputerUse.d.ts.map +0 -1
  147. package/esm/ComputerUse.js +0 -509
  148. package/esm/ComputerUse.js.map +0 -1
  149. package/esm/Daytona.d.ts +0 -354
  150. package/esm/Daytona.d.ts.map +0 -1
  151. package/esm/Daytona.js +0 -410
  152. package/esm/Daytona.js.map +0 -1
  153. package/esm/FileSystem.d.ts.map +0 -1
  154. package/esm/FileSystem.js +0 -331
  155. package/esm/FileSystem.js.map +0 -1
  156. package/esm/Git.d.ts.map +0 -1
  157. package/esm/Git.js +0 -260
  158. package/esm/Git.js.map +0 -1
  159. package/esm/Image.d.ts +0 -285
  160. package/esm/Image.d.ts.map +0 -1
  161. package/esm/Image.js +0 -569
  162. package/esm/Image.js.map +0 -1
  163. package/esm/LspServer.d.ts +0 -172
  164. package/esm/LspServer.d.ts.map +0 -1
  165. package/esm/LspServer.js +0 -204
  166. package/esm/LspServer.js.map +0 -1
  167. package/esm/ObjectStorage.d.ts.map +0 -1
  168. package/esm/ObjectStorage.js +0 -187
  169. package/esm/ObjectStorage.js.map +0 -1
  170. package/esm/Process.d.ts +0 -442
  171. package/esm/Process.d.ts.map +0 -1
  172. package/esm/Process.js +0 -644
  173. package/esm/Process.js.map +0 -1
  174. package/esm/PtyHandle.d.ts +0 -155
  175. package/esm/PtyHandle.d.ts.map +0 -1
  176. package/esm/PtyHandle.js +0 -374
  177. package/esm/PtyHandle.js.map +0 -1
  178. package/esm/README.md +0 -147
  179. package/esm/Sandbox.d.ts +0 -359
  180. package/esm/Sandbox.d.ts.map +0 -1
  181. package/esm/Sandbox.js +0 -532
  182. package/esm/Sandbox.js.map +0 -1
  183. package/esm/Snapshot.d.ts +0 -138
  184. package/esm/Snapshot.d.ts.map +0 -1
  185. package/esm/Snapshot.js +0 -207
  186. package/esm/Snapshot.js.map +0 -1
  187. package/esm/Volume.d.ts.map +0 -1
  188. package/esm/Volume.js +0 -95
  189. package/esm/Volume.js.map +0 -1
  190. package/esm/code-toolbox/SandboxJsCodeToolbox.d.ts +0 -6
  191. package/esm/code-toolbox/SandboxJsCodeToolbox.d.ts.map +0 -1
  192. package/esm/code-toolbox/SandboxJsCodeToolbox.js +0 -13
  193. package/esm/code-toolbox/SandboxJsCodeToolbox.js.map +0 -1
  194. package/esm/code-toolbox/SandboxPythonCodeToolbox.d.ts +0 -12
  195. package/esm/code-toolbox/SandboxPythonCodeToolbox.d.ts.map +0 -1
  196. package/esm/code-toolbox/SandboxPythonCodeToolbox.js +0 -355
  197. package/esm/code-toolbox/SandboxPythonCodeToolbox.js.map +0 -1
  198. package/esm/code-toolbox/SandboxTsCodeToolbox.d.ts +0 -6
  199. package/esm/code-toolbox/SandboxTsCodeToolbox.d.ts.map +0 -1
  200. package/esm/code-toolbox/SandboxTsCodeToolbox.js +0 -14
  201. package/esm/code-toolbox/SandboxTsCodeToolbox.js.map +0 -1
  202. package/esm/errors/DaytonaError.d.ts.map +0 -1
  203. package/esm/errors/DaytonaError.js +0 -44
  204. package/esm/errors/DaytonaError.js.map +0 -1
  205. package/esm/index.d.ts +0 -22
  206. package/esm/index.d.ts.map +0 -1
  207. package/esm/index.js +0 -22
  208. package/esm/index.js.map +0 -1
  209. package/esm/package.json +0 -3
  210. package/esm/types/Charts.d.ts.map +0 -1
  211. package/esm/types/Charts.js +0 -42
  212. package/esm/types/Charts.js.map +0 -1
  213. package/esm/types/CodeInterpreter.d.ts.map +0 -1
  214. package/esm/types/CodeInterpreter.js +0 -6
  215. package/esm/types/CodeInterpreter.js.map +0 -1
  216. package/esm/types/ExecuteResponse.d.ts +0 -26
  217. package/esm/types/ExecuteResponse.d.ts.map +0 -1
  218. package/esm/types/ExecuteResponse.js +0 -6
  219. package/esm/types/ExecuteResponse.js.map +0 -1
  220. package/esm/types/Pty.d.ts +0 -48
  221. package/esm/types/Pty.d.ts.map +0 -1
  222. package/esm/types/Pty.js +0 -6
  223. package/esm/types/Pty.js.map +0 -1
  224. package/esm/utils/ArtifactParser.d.ts +0 -14
  225. package/esm/utils/ArtifactParser.d.ts.map +0 -1
  226. package/esm/utils/ArtifactParser.js +0 -51
  227. package/esm/utils/ArtifactParser.js.map +0 -1
  228. package/esm/utils/Binary.d.ts.map +0 -1
  229. package/esm/utils/Binary.js +0 -157
  230. package/esm/utils/Binary.js.map +0 -1
  231. package/esm/utils/FileTransfer.d.ts +0 -15
  232. package/esm/utils/FileTransfer.d.ts.map +0 -1
  233. package/esm/utils/FileTransfer.js +0 -209
  234. package/esm/utils/FileTransfer.js.map +0 -1
  235. package/esm/utils/Import.d.ts +0 -211
  236. package/esm/utils/Import.d.ts.map +0 -1
  237. package/esm/utils/Import.js +0 -45
  238. package/esm/utils/Import.js.map +0 -1
  239. package/esm/utils/Multipart.d.ts.map +0 -1
  240. package/esm/utils/Multipart.js +0 -107
  241. package/esm/utils/Multipart.js.map +0 -1
  242. package/esm/utils/Runtime.d.ts +0 -37
  243. package/esm/utils/Runtime.d.ts.map +0 -1
  244. package/esm/utils/Runtime.js +0 -57
  245. package/esm/utils/Runtime.js.map +0 -1
  246. package/esm/utils/Stream.d.ts +0 -20
  247. package/esm/utils/Stream.d.ts.map +0 -1
  248. package/esm/utils/Stream.js +0 -360
  249. package/esm/utils/Stream.js.map +0 -1
  250. package/esm/utils/WebSocket.d.ts.map +0 -1
  251. package/esm/utils/WebSocket.js +0 -22
  252. package/esm/utils/WebSocket.js.map +0 -1
  253. /package/{cjs → src}/CodeInterpreter.js +0 -0
  254. /package/{cjs → src}/ComputerUse.js +0 -0
  255. /package/{cjs → src}/FileSystem.js +0 -0
  256. /package/{cjs → src}/Git.js +0 -0
  257. /package/{cjs → src}/LspServer.js +0 -0
  258. /package/{cjs → src}/ObjectStorage.js +0 -0
  259. /package/{cjs → src}/Process.js +0 -0
  260. /package/{cjs → src}/PtyHandle.js +0 -0
  261. /package/{cjs → src}/Volume.js +0 -0
  262. /package/{cjs → src}/code-toolbox/SandboxJsCodeToolbox.js +0 -0
  263. /package/{cjs → src}/code-toolbox/SandboxPythonCodeToolbox.js +0 -0
  264. /package/{cjs → src}/code-toolbox/SandboxTsCodeToolbox.js +0 -0
  265. /package/{cjs → src}/errors/DaytonaError.js +0 -0
  266. /package/{cjs → src}/index.js +0 -0
  267. /package/{cjs → src}/types/Charts.js +0 -0
  268. /package/{cjs → src}/types/CodeInterpreter.js +0 -0
  269. /package/{cjs → src}/types/ExecuteResponse.js +0 -0
  270. /package/{cjs → src}/types/Pty.js +0 -0
  271. /package/{cjs → src}/utils/ArtifactParser.js +0 -0
  272. /package/{cjs → src}/utils/Binary.js +0 -0
  273. /package/{cjs → src}/utils/FileTransfer.js +0 -0
  274. /package/{cjs → src}/utils/Multipart.js +0 -0
  275. /package/{cjs → src}/utils/Runtime.js +0 -0
  276. /package/{cjs → src}/utils/Stream.js +0 -0
  277. /package/{cjs → src}/utils/WebSocket.js +0 -0
package/esm/Daytona.d.ts DELETED
@@ -1,354 +0,0 @@
1
- import { SandboxVolume } from '@daytonaio/api-client';
2
- import { Image } from './Image.js';
3
- import { Sandbox, PaginatedSandboxes } from './Sandbox.js';
4
- import { SnapshotService } from './Snapshot.js';
5
- import { VolumeService } from './Volume.js';
6
- /**
7
- * Represents a volume mount for a Sandbox.
8
- *
9
- * @interface
10
- * @property {string} volumeId - ID of the Volume to mount
11
- * @property {string} mountPath - Path on the Sandbox to mount the Volume
12
- */
13
- export interface VolumeMount extends SandboxVolume {
14
- volumeId: string;
15
- mountPath: string;
16
- }
17
- /**
18
- * Configuration options for initializing the Daytona client.
19
- *
20
- * @interface
21
- * @property {string} apiKey - API key for authentication with the Daytona API
22
- * @property {string} jwtToken - JWT token for authentication with the Daytona API. If not set, it must be provided
23
- * via the environment variable `DAYTONA_JWT_TOKEN`, or an API key must be provided instead.
24
- * @property {string} organizationId - Organization ID used for JWT-based authentication. Required if a JWT token
25
- * is provided, and must be set either here or in the environment variable `DAYTONA_ORGANIZATION_ID`.
26
- * @property {string} apiUrl - URL of the Daytona API. Defaults to 'https://app.daytona.io/api'
27
- * if not set here and not set in environment variable DAYTONA_API_URL.
28
- * @property {string} target - Target location for Sandboxes
29
- *
30
- * @example
31
- * const config: DaytonaConfig = {
32
- * apiKey: "your-api-key",
33
- * apiUrl: "https://your-api.com",
34
- * target: "us"
35
- * };
36
- * const daytona = new Daytona(config);
37
- */
38
- export interface DaytonaConfig {
39
- /** API key for authentication with the Daytona API */
40
- apiKey?: string;
41
- /** JWT token for authentication with the Daytona API */
42
- jwtToken?: string;
43
- /** Organization ID for authentication with the Daytona API */
44
- organizationId?: string;
45
- /** URL of the Daytona API.
46
- */
47
- apiUrl?: string;
48
- /**
49
- * @deprecated Use `apiUrl` instead. This property will be removed in future versions.
50
- */
51
- serverUrl?: string;
52
- /** Target environment for sandboxes */
53
- target?: string;
54
- }
55
- /**
56
- * Supported programming languages for code execution
57
- *
58
- * Python is used as the default sandbox language when no language is explicitly specified.
59
- */
60
- export declare enum CodeLanguage {
61
- PYTHON = "python",
62
- TYPESCRIPT = "typescript",
63
- JAVASCRIPT = "javascript"
64
- }
65
- /**
66
- * Resource allocation for a Sandbox.
67
- *
68
- * @interface
69
- * @property {number} [cpu] - CPU allocation for the Sandbox in cores
70
- * @property {number} [gpu] - GPU allocation for the Sandbox in units
71
- * @property {number} [memory] - Memory allocation for the Sandbox in GiB
72
- * @property {number} [disk] - Disk space allocation for the Sandbox in GiB
73
- *
74
- * @example
75
- * const resources: SandboxResources = {
76
- * cpu: 2,
77
- * memory: 4, // 4GiB RAM
78
- * disk: 20 // 20GiB disk
79
- * };
80
- */
81
- export interface Resources {
82
- /** CPU allocation for the Sandbox */
83
- cpu?: number;
84
- /** GPU allocation for the Sandbox */
85
- gpu?: number;
86
- /** Memory allocation for the Sandbox in GiB */
87
- memory?: number;
88
- /** Disk space allocation for the Sandbox in GiB */
89
- disk?: number;
90
- }
91
- /**
92
- * Base parameters for creating a new Sandbox.
93
- *
94
- * @interface
95
- * @property {string} [user] - Optional os user to use for the Sandbox
96
- * @property {CodeLanguage | string} [language] - Programming language for direct code execution. Defaults to "python" if not specified.
97
- * @property {Record<string, string>} [envVars] - Optional environment variables to set in the Sandbox
98
- * @property {Record<string, string>} [labels] - Sandbox labels
99
- * @property {boolean} [public] - Is the Sandbox port preview public
100
- * @property {number} [autoStopInterval] - Auto-stop interval in minutes (0 means disabled). Default is 15 minutes.
101
- * @property {number} [autoArchiveInterval] - Auto-archive interval in minutes (0 means the maximum interval will be used). Default is 7 days.
102
- * @property {number} [autoDeleteInterval] - Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping). By default, auto-delete is disabled.
103
- * @property {VolumeMount[]} [volumes] - Optional array of volumes to mount to the Sandbox
104
- * @property {boolean} [networkBlockAll] - Whether to block all network access for the Sandbox
105
- * @property {string} [networkAllowList] - Comma-separated list of allowed CIDR network addresses for the Sandbox
106
- * @property {boolean} [ephemeral] - Whether the Sandbox should be ephemeral. If true, autoDeleteInterval will be set to 0.
107
- */
108
- export type CreateSandboxBaseParams = {
109
- name?: string;
110
- user?: string;
111
- language?: CodeLanguage | string;
112
- envVars?: Record<string, string>;
113
- labels?: Record<string, string>;
114
- public?: boolean;
115
- autoStopInterval?: number;
116
- autoArchiveInterval?: number;
117
- autoDeleteInterval?: number;
118
- volumes?: VolumeMount[];
119
- networkBlockAll?: boolean;
120
- networkAllowList?: string;
121
- ephemeral?: boolean;
122
- };
123
- /**
124
- * Parameters for creating a new Sandbox.
125
- *
126
- * @interface
127
- * @property {string | Image} [image] - Custom Docker image to use for the Sandbox. If an Image object is provided,
128
- * the image will be dynamically built.
129
- * @property {Resources} [resources] - Resource allocation for the Sandbox. If not provided, sandbox will
130
- * have default resources.
131
- */
132
- export type CreateSandboxFromImageParams = CreateSandboxBaseParams & {
133
- image: string | Image;
134
- resources?: Resources;
135
- };
136
- /**
137
- * Parameters for creating a new Sandbox from a snapshot.
138
- *
139
- * @interface
140
- * @property {string} [snapshot] - Name of the snapshot to use for the Sandbox.
141
- */
142
- export type CreateSandboxFromSnapshotParams = CreateSandboxBaseParams & {
143
- snapshot?: string;
144
- };
145
- /**
146
- * Filter for Sandboxes.
147
- *
148
- * @interface
149
- * @property {string} [idOrName] - The ID or name of the Sandbox to retrieve
150
- * @property {Record<string, string>} [labels] - Labels to filter Sandboxes
151
- */
152
- export type SandboxFilter = {
153
- idOrName?: string;
154
- labels?: Record<string, string>;
155
- };
156
- /**
157
- * Main class for interacting with the Daytona API.
158
- * Provides methods for creating, managing, and interacting with Daytona Sandboxes.
159
- * Can be initialized either with explicit configuration or using environment variables.
160
- *
161
- * @property {VolumeService} volume - Service for managing Daytona Volumes
162
- * @property {SnapshotService} snapshot - Service for managing Daytona Snapshots
163
- *
164
- * @example
165
- * // Using environment variables
166
- * // Uses DAYTONA_API_KEY, DAYTONA_API_URL, DAYTONA_TARGET
167
- * const daytona = new Daytona();
168
- * const sandbox = await daytona.create();
169
- *
170
- * @example
171
- * // Using explicit configuration
172
- * const config: DaytonaConfig = {
173
- * apiKey: "your-api-key",
174
- * apiUrl: "https://your-api.com",
175
- * target: "us"
176
- * };
177
- * const daytona = new Daytona(config);
178
- *
179
- * @class
180
- */
181
- export declare class Daytona {
182
- private readonly clientConfig;
183
- private readonly sandboxApi;
184
- private readonly objectStorageApi;
185
- private readonly configApi;
186
- private readonly target?;
187
- private readonly apiKey?;
188
- private readonly jwtToken?;
189
- private readonly organizationId?;
190
- private readonly apiUrl;
191
- private proxyToolboxUrl?;
192
- readonly volume: VolumeService;
193
- readonly snapshot: SnapshotService;
194
- /**
195
- * Creates a new Daytona client instance.
196
- *
197
- * @param {DaytonaConfig} [config] - Configuration options
198
- * @throws {DaytonaError} - `DaytonaError` - When API key is missing
199
- */
200
- constructor(config?: DaytonaConfig);
201
- /**
202
- * Creates Sandboxes from specified or default snapshot. You can specify various parameters,
203
- * including language, image, environment variables, and volumes.
204
- *
205
- * @param {CreateSandboxFromSnapshotParams} [params] - Parameters for Sandbox creation from snapshot
206
- * @param {object} [options] - Options for the create operation
207
- * @param {number} [options.timeout] - Timeout in seconds (0 means no timeout, default is 60)
208
- * @returns {Promise<Sandbox>} The created Sandbox instance
209
- *
210
- * @example
211
- * const sandbox = await daytona.create();
212
- *
213
- * @example
214
- * // Create a custom sandbox
215
- * const params: CreateSandboxFromSnapshotParams = {
216
- * language: 'typescript',
217
- * snapshot: 'my-snapshot-id',
218
- * envVars: {
219
- * NODE_ENV: 'development',
220
- * DEBUG: 'true'
221
- * },
222
- * autoStopInterval: 60,
223
- * autoArchiveInterval: 60,
224
- * autoDeleteInterval: 120
225
- * };
226
- * const sandbox = await daytona.create(params, { timeout: 100 });
227
- */
228
- create(params?: CreateSandboxFromSnapshotParams, options?: {
229
- timeout?: number;
230
- }): Promise<Sandbox>;
231
- /**
232
- * Creates Sandboxes from specified image available on some registry or declarative Daytona Image. You can specify various parameters,
233
- * including resources, language, image, environment variables, and volumes. Daytona creates snapshot from
234
- * provided image and uses it to create Sandbox.
235
- *
236
- * @param {CreateSandboxFromImageParams} [params] - Parameters for Sandbox creation from image
237
- * @param {object} [options] - Options for the create operation
238
- * @param {number} [options.timeout] - Timeout in seconds (0 means no timeout, default is 60)
239
- * @param {function} [options.onSnapshotCreateLogs] - Callback function to handle snapshot creation logs.
240
- * @returns {Promise<Sandbox>} The created Sandbox instance
241
- *
242
- * @example
243
- * const sandbox = await daytona.create({ image: 'debian:12.9' }, { timeout: 90, onSnapshotCreateLogs: console.log });
244
- *
245
- * @example
246
- * // Create a custom sandbox
247
- * const image = Image.base('alpine:3.18').pipInstall('numpy');
248
- * const params: CreateSandboxFromImageParams = {
249
- * language: 'typescript',
250
- * image,
251
- * envVars: {
252
- * NODE_ENV: 'development',
253
- * DEBUG: 'true'
254
- * },
255
- * resources: {
256
- * cpu: 2,
257
- * memory: 4 // 4GB RAM
258
- * },
259
- * autoStopInterval: 60,
260
- * autoArchiveInterval: 60,
261
- * autoDeleteInterval: 120
262
- * };
263
- * const sandbox = await daytona.create(params, { timeout: 100, onSnapshotCreateLogs: console.log });
264
- */
265
- create(params?: CreateSandboxFromImageParams, options?: {
266
- onSnapshotCreateLogs?: (chunk: string) => void;
267
- timeout?: number;
268
- }): Promise<Sandbox>;
269
- /**
270
- * Gets a Sandbox by its ID or name.
271
- *
272
- * @param {string} sandboxIdOrName - The ID or name of the Sandbox to retrieve
273
- * @returns {Promise<Sandbox>} The Sandbox
274
- *
275
- * @example
276
- * const sandbox = await daytona.get('my-sandbox-id-or-name');
277
- * console.log(`Sandbox state: ${sandbox.state}`);
278
- */
279
- get(sandboxIdOrName: string): Promise<Sandbox>;
280
- /**
281
- * Finds a Sandbox by its ID or name or labels.
282
- *
283
- * @param {SandboxFilter} filter - Filter for Sandboxes
284
- * @returns {Promise<Sandbox>} First Sandbox that matches the ID or name or labels.
285
- *
286
- * @example
287
- * const sandbox = await daytona.findOne({ labels: { 'my-label': 'my-value' } });
288
- * console.log(`Sandbox ID: ${sandbox.id}, State: ${sandbox.state}`);
289
- */
290
- findOne(filter: SandboxFilter): Promise<Sandbox>;
291
- /**
292
- * Returns paginated list of Sandboxes filtered by labels.
293
- *
294
- * @param {Record<string, string>} [labels] - Labels to filter Sandboxes
295
- * @param {number} [page] - Page number for pagination (starting from 1)
296
- * @param {number} [limit] - Maximum number of items per page
297
- * @returns {Promise<PaginatedSandboxes>} Paginated list of Sandboxes that match the labels.
298
- *
299
- * @example
300
- * const result = await daytona.list({ 'my-label': 'my-value' }, 2, 10);
301
- * for (const sandbox of result.items) {
302
- * console.log(`${sandbox.id}: ${sandbox.state}`);
303
- * }
304
- */
305
- list(labels?: Record<string, string>, page?: number, limit?: number): Promise<PaginatedSandboxes>;
306
- /**
307
- * Starts a Sandbox and waits for it to be ready.
308
- *
309
- * @param {Sandbox} sandbox - The Sandbox to start
310
- * @param {number} [timeout] - Optional timeout in seconds (0 means no timeout)
311
- * @returns {Promise<void>}
312
- *
313
- * @example
314
- * const sandbox = await daytona.get('my-sandbox-id');
315
- * // Wait up to 60 seconds for the sandbox to start
316
- * await daytona.start(sandbox, 60);
317
- */
318
- start(sandbox: Sandbox, timeout?: number): Promise<void>;
319
- /**
320
- * Stops a Sandbox.
321
- *
322
- * @param {Sandbox} sandbox - The Sandbox to stop
323
- * @returns {Promise<void>}
324
- *
325
- * @example
326
- * const sandbox = await daytona.get('my-sandbox-id');
327
- * await daytona.stop(sandbox);
328
- */
329
- stop(sandbox: Sandbox): Promise<void>;
330
- /**
331
- * Deletes a Sandbox.
332
- *
333
- * @param {Sandbox} sandbox - The Sandbox to delete
334
- * @param {number} timeout - Timeout in seconds (0 means no timeout, default is 60)
335
- * @returns {Promise<void>}
336
- *
337
- * @example
338
- * const sandbox = await daytona.get('my-sandbox-id');
339
- * await daytona.delete(sandbox);
340
- */
341
- delete(sandbox: Sandbox, timeout?: number): Promise<void>;
342
- /**
343
- * Gets the appropriate code toolbox based on language.
344
- *
345
- * @private
346
- * @param {CodeLanguage} [language] - Programming language for the toolbox
347
- * @returns {SandboxCodeToolbox} The appropriate code toolbox instance
348
- * @throws {DaytonaError} - `DaytonaError` - When an unsupported language is specified
349
- */
350
- private getCodeToolbox;
351
- private createAxiosInstance;
352
- getProxyToolboxUrl(): Promise<string>;
353
- }
354
- //# sourceMappingURL=Daytona.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Daytona.d.ts","sourceRoot":"","sources":["../../../../../libs/sdk-typescript/src/Daytona.ts"],"names":[],"mappings":"AAKA,OAAO,EAOL,aAAa,EAEd,MAAM,uBAAuB,CAAA;AAM9B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAKxC;;;;;;GAMG;AAEH,MAAM,WAAW,WAAY,SAAQ,aAAa;IAChD,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,aAAa;IAC5B,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAA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