@daytona/sdk 0.171.0-alpha.3 → 0.171.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.
Files changed (147) hide show
  1. package/package.json +9 -3
  2. package/cjs/CodeInterpreter.d.ts.map +0 -1
  3. package/cjs/ComputerUse.d.ts.map +0 -1
  4. package/cjs/Daytona.d.ts.map +0 -1
  5. package/cjs/FileSystem.d.ts.map +0 -1
  6. package/cjs/Git.d.ts.map +0 -1
  7. package/cjs/Image.d.ts.map +0 -1
  8. package/cjs/LspServer.d.ts.map +0 -1
  9. package/cjs/ObjectStorage.d.ts.map +0 -1
  10. package/cjs/Process.d.ts.map +0 -1
  11. package/cjs/PtyHandle.d.ts.map +0 -1
  12. package/cjs/Sandbox.d.ts.map +0 -1
  13. package/cjs/Snapshot.d.ts.map +0 -1
  14. package/cjs/Volume.d.ts.map +0 -1
  15. package/cjs/__tests__/helpers.d.ts +0 -6
  16. package/cjs/__tests__/helpers.d.ts.map +0 -1
  17. package/cjs/__tests__/helpers.js +0 -26
  18. package/cjs/__tests__/helpers.js.map +0 -1
  19. package/cjs/errors/DaytonaError.d.ts.map +0 -1
  20. package/cjs/index.d.ts.map +0 -1
  21. package/cjs/types/Charts.d.ts.map +0 -1
  22. package/cjs/types/CodeInterpreter.d.ts.map +0 -1
  23. package/cjs/types/ExecuteResponse.d.ts.map +0 -1
  24. package/cjs/types/Pty.d.ts.map +0 -1
  25. package/cjs/utils/Binary.d.ts.map +0 -1
  26. package/cjs/utils/FileTransfer.d.ts.map +0 -1
  27. package/cjs/utils/Import.d.ts.map +0 -1
  28. package/cjs/utils/Multipart.d.ts.map +0 -1
  29. package/cjs/utils/Runtime.d.ts.map +0 -1
  30. package/cjs/utils/Stream.d.ts.map +0 -1
  31. package/cjs/utils/WebSocket.d.ts.map +0 -1
  32. package/cjs/utils/otel.decorator.d.ts.map +0 -1
  33. package/esm/CodeInterpreter.d.ts.map +0 -1
  34. package/esm/ComputerUse.d.ts.map +0 -1
  35. package/esm/Daytona.d.ts.map +0 -1
  36. package/esm/FileSystem.d.ts.map +0 -1
  37. package/esm/Git.d.ts.map +0 -1
  38. package/esm/Image.d.ts.map +0 -1
  39. package/esm/LspServer.d.ts.map +0 -1
  40. package/esm/ObjectStorage.d.ts.map +0 -1
  41. package/esm/Process.d.ts.map +0 -1
  42. package/esm/PtyHandle.d.ts.map +0 -1
  43. package/esm/Sandbox.d.ts.map +0 -1
  44. package/esm/Snapshot.d.ts.map +0 -1
  45. package/esm/Volume.d.ts.map +0 -1
  46. package/esm/__tests__/helpers.d.ts +0 -6
  47. package/esm/__tests__/helpers.d.ts.map +0 -1
  48. package/esm/__tests__/helpers.js +0 -20
  49. package/esm/__tests__/helpers.js.map +0 -1
  50. package/esm/errors/DaytonaError.d.ts.map +0 -1
  51. package/esm/index.d.ts.map +0 -1
  52. package/esm/types/Charts.d.ts.map +0 -1
  53. package/esm/types/CodeInterpreter.d.ts.map +0 -1
  54. package/esm/types/ExecuteResponse.d.ts.map +0 -1
  55. package/esm/types/Pty.d.ts.map +0 -1
  56. package/esm/utils/Binary.d.ts.map +0 -1
  57. package/esm/utils/FileTransfer.d.ts.map +0 -1
  58. package/esm/utils/Import.d.ts.map +0 -1
  59. package/esm/utils/Multipart.d.ts.map +0 -1
  60. package/esm/utils/Runtime.d.ts.map +0 -1
  61. package/esm/utils/Stream.d.ts.map +0 -1
  62. package/esm/utils/WebSocket.d.ts.map +0 -1
  63. package/esm/utils/otel.decorator.d.ts.map +0 -1
  64. package/src/CodeInterpreter.d.ts +0 -94
  65. package/src/CodeInterpreter.js +0 -297
  66. package/src/CodeInterpreter.js.map +0 -1
  67. package/src/ComputerUse.d.ts +0 -538
  68. package/src/ComputerUse.js +0 -808
  69. package/src/ComputerUse.js.map +0 -1
  70. package/src/Daytona.d.ts +0 -353
  71. package/src/Daytona.js +0 -521
  72. package/src/Daytona.js.map +0 -1
  73. package/src/FileSystem.d.ts +0 -344
  74. package/src/FileSystem.js +0 -420
  75. package/src/FileSystem.js.map +0 -1
  76. package/src/Git.d.ts +0 -202
  77. package/src/Git.js +0 -326
  78. package/src/Git.js.map +0 -1
  79. package/src/Image.d.ts +0 -264
  80. package/src/Image.js +0 -586
  81. package/src/Image.js.map +0 -1
  82. package/src/LspServer.d.ts +0 -171
  83. package/src/LspServer.js +0 -259
  84. package/src/LspServer.js.map +0 -1
  85. package/src/ObjectStorage.d.ts +0 -78
  86. package/src/ObjectStorage.js +0 -199
  87. package/src/ObjectStorage.js.map +0 -1
  88. package/src/Process.d.ts +0 -489
  89. package/src/Process.js +0 -647
  90. package/src/Process.js.map +0 -1
  91. package/src/PtyHandle.d.ts +0 -154
  92. package/src/PtyHandle.js +0 -416
  93. package/src/PtyHandle.js.map +0 -1
  94. package/src/Sandbox.d.ts +0 -458
  95. package/src/Sandbox.js +0 -876
  96. package/src/Sandbox.js.map +0 -1
  97. package/src/Snapshot.d.ts +0 -139
  98. package/src/Snapshot.js +0 -248
  99. package/src/Snapshot.js.map +0 -1
  100. package/src/Volume.d.ts +0 -83
  101. package/src/Volume.js +0 -119
  102. package/src/Volume.js.map +0 -1
  103. package/src/__tests__/helpers.d.ts +0 -5
  104. package/src/__tests__/helpers.js +0 -24
  105. package/src/__tests__/helpers.js.map +0 -1
  106. package/src/errors/DaytonaError.d.ts +0 -170
  107. package/src/errors/DaytonaError.js +0 -258
  108. package/src/errors/DaytonaError.js.map +0 -1
  109. package/src/index.d.ts +0 -21
  110. package/src/index.js +0 -49
  111. package/src/index.js.map +0 -1
  112. package/src/types/Charts.d.ts +0 -37
  113. package/src/types/Charts.js +0 -37
  114. package/src/types/Charts.js.map +0 -1
  115. package/src/types/CodeInterpreter.d.ts +0 -76
  116. package/src/types/CodeInterpreter.js +0 -7
  117. package/src/types/CodeInterpreter.js.map +0 -1
  118. package/src/types/ExecuteResponse.d.ts +0 -25
  119. package/src/types/ExecuteResponse.js +0 -7
  120. package/src/types/ExecuteResponse.js.map +0 -1
  121. package/src/types/Pty.d.ts +0 -47
  122. package/src/types/Pty.js +0 -7
  123. package/src/types/Pty.js.map +0 -1
  124. package/src/utils/Binary.d.ts +0 -38
  125. package/src/utils/Binary.js +0 -168
  126. package/src/utils/Binary.js.map +0 -1
  127. package/src/utils/FileTransfer.d.ts +0 -14
  128. package/src/utils/FileTransfer.js +0 -258
  129. package/src/utils/FileTransfer.js.map +0 -1
  130. package/src/utils/Import.d.ts +0 -97
  131. package/src/utils/Import.js +0 -79
  132. package/src/utils/Import.js.map +0 -1
  133. package/src/utils/Multipart.d.ts +0 -28
  134. package/src/utils/Multipart.js +0 -115
  135. package/src/utils/Multipart.js.map +0 -1
  136. package/src/utils/Runtime.d.ts +0 -43
  137. package/src/utils/Runtime.js +0 -95
  138. package/src/utils/Runtime.js.map +0 -1
  139. package/src/utils/Stream.d.ts +0 -19
  140. package/src/utils/Stream.js +0 -364
  141. package/src/utils/Stream.js.map +0 -1
  142. package/src/utils/WebSocket.d.ts +0 -9
  143. package/src/utils/WebSocket.js +0 -26
  144. package/src/utils/WebSocket.js.map +0 -1
  145. package/src/utils/otel.decorator.d.ts +0 -82
  146. package/src/utils/otel.decorator.js +0 -141
  147. package/src/utils/otel.decorator.js.map +0 -1
package/src/FileSystem.js DELETED
@@ -1,420 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright 2025 Daytona Platforms Inc.
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.FileSystem = void 0;
8
- const tslib_1 = require("tslib");
9
- const pathe = tslib_1.__importStar(require("pathe"));
10
- const Import_1 = require("./utils/Import");
11
- const Runtime_1 = require("./utils/Runtime");
12
- const DaytonaError_1 = require("./errors/DaytonaError");
13
- const FileTransfer_1 = require("./utils/FileTransfer");
14
- const otel_decorator_1 = require("./utils/otel.decorator");
15
- function createFileDownloadError(error, errorDetails) {
16
- if (!errorDetails) {
17
- return new DaytonaError_1.DaytonaError(error);
18
- }
19
- return (0, DaytonaError_1.createDaytonaError)(errorDetails.message, errorDetails.statusCode, undefined, errorDetails.errorCode);
20
- }
21
- /**
22
- * Provides file system operations within a Sandbox.
23
- *
24
- * @class
25
- */
26
- class FileSystem {
27
- clientConfig;
28
- apiClient;
29
- constructor(clientConfig, apiClient) {
30
- this.clientConfig = clientConfig;
31
- this.apiClient = apiClient;
32
- }
33
- /**
34
- * Create a new directory in the Sandbox with specified permissions.
35
- *
36
- * @param {string} path - Path where the directory should be created. Relative paths are resolved based on the sandbox working directory.
37
- * @param {string} mode - Directory permissions in octal format (e.g. "755")
38
- * @returns {Promise<void>}
39
- *
40
- * @example
41
- * // Create a directory with standard permissions
42
- * await fs.createFolder('app/data', '755');
43
- */
44
- async createFolder(path, mode) {
45
- const response = await this.apiClient.createFolder(path, mode);
46
- return response.data;
47
- }
48
- /**
49
- * Deletes a file or directory from the Sandbox.
50
- *
51
- * @param {string} path - Path to the file or directory to delete. Relative paths are resolved based on the sandbox working directory.
52
- * @param {boolean} [recursive] - If the file is a directory, this must be true to delete it.
53
- * @returns {Promise<void>}
54
- *
55
- * @example
56
- * // Delete a file
57
- * await fs.deleteFile('app/temp.log');
58
- */
59
- async deleteFile(path, recursive) {
60
- const response = await this.apiClient.deleteFile(path, recursive);
61
- return response.data;
62
- }
63
- async downloadFile(src, dst, timeout = 30 * 60) {
64
- const remotePath = src;
65
- if (typeof dst !== 'string') {
66
- if (dst) {
67
- timeout = dst;
68
- }
69
- const response = await this.downloadFiles([{ source: remotePath }], timeout);
70
- if (response[0].error) {
71
- throw createFileDownloadError(response[0].error, response[0].errorDetails);
72
- }
73
- return response[0].result;
74
- }
75
- const response = await this.downloadFiles([{ source: remotePath, destination: dst }], timeout);
76
- if (response[0].error) {
77
- throw createFileDownloadError(response[0].error, response[0].errorDetails);
78
- }
79
- }
80
- /**
81
- * Downloads multiple files from the Sandbox. If the files already exist locally, they will be overwritten.
82
- *
83
- * @param {FileDownloadRequest[]} files - Array of file download requests.
84
- * @param {number} [timeoutSec] - Timeout for the download operation in seconds. 0 means no timeout.
85
- * Default is 30 minutes.
86
- * @returns {Promise<FileDownloadResponse[]>} Array of download results.
87
- *
88
- * @throws {DaytonaError} If the request itself fails (network issues, invalid request/response, etc.). Individual
89
- * file download errors are returned in `FileDownloadResponse.error`. When the daemon provides structured
90
- * per-file metadata, it is also available in `FileDownloadResponse.errorDetails`.
91
- *
92
- * @example
93
- * // Download multiple files
94
- * const results = await fs.downloadFiles([
95
- * { source: 'tmp/data.json' },
96
- * { source: 'tmp/config.json', destination: 'local_config.json' }
97
- * ]);
98
- * results.forEach(result => {
99
- * if (result.error) {
100
- * console.error(`Error downloading ${result.source}: ${result.error}`);
101
- * } else if (result.result) {
102
- * console.log(`Downloaded ${result.source} to ${result.result}`);
103
- * }
104
- * });
105
- */
106
- async downloadFiles(files, timeoutSec = 30 * 60) {
107
- if (files.length === 0)
108
- return [];
109
- const isNonStreamingRuntime = Runtime_1.RUNTIME === Runtime_1.Runtime.BROWSER || Runtime_1.RUNTIME === Runtime_1.Runtime.SERVERLESS;
110
- // Prepare destinations and metadata
111
- const metadataMap = new Map();
112
- for (const f of files) {
113
- metadataMap.set(f.source, { destination: f.destination });
114
- if (f.destination) {
115
- const fs = await (0, Import_1.dynamicImport)('fs', 'Downloading files to local files is not supported: ');
116
- await fs.promises.mkdir(pathe.dirname(f.destination), { recursive: true });
117
- }
118
- }
119
- const response = await this.apiClient.downloadFiles({ paths: files.map((f) => f.source) }, {
120
- responseType: isNonStreamingRuntime ? 'arraybuffer' : 'stream',
121
- timeout: timeoutSec * 1000,
122
- });
123
- const stream = (0, FileTransfer_1.normalizeResponseStream)(response.data);
124
- // Node.js path: use busboy for efficient streaming
125
- if (isNonStreamingRuntime) {
126
- await (0, FileTransfer_1.processDownloadFilesResponseWithBuffered)(stream, response.headers, metadataMap);
127
- }
128
- else {
129
- await (0, FileTransfer_1.processDownloadFilesResponseWithBusboy)(stream, response.headers, metadataMap);
130
- }
131
- return files.map((f) => {
132
- const metadata = metadataMap.get(f.source);
133
- const error = metadata?.error || (!metadata?.result ? 'No data received for this file' : undefined);
134
- return {
135
- source: f.source,
136
- result: error ? undefined : metadata.result,
137
- error,
138
- errorDetails: error ? metadata?.errorDetails : undefined,
139
- };
140
- });
141
- }
142
- /**
143
- * Searches for text patterns within files in the Sandbox.
144
- *
145
- * @param {string} path - Directory to search in. Relative paths are resolved based on the sandbox working directory.
146
- * @param {string} pattern - Search pattern
147
- * @returns {Promise<Array<Match>>} Array of matches with file and line information
148
- *
149
- * @example
150
- * // Find all TODO comments in TypeScript files
151
- * const matches = await fs.findFiles('app/src', 'TODO:');
152
- * matches.forEach(match => {
153
- * console.log(`${match.file}:${match.line}: ${match.content}`);
154
- * });
155
- */
156
- async findFiles(path, pattern) {
157
- const response = await this.apiClient.findInFiles(path, pattern);
158
- return response.data;
159
- }
160
- /**
161
- * Retrieves detailed information about a file or directory.
162
- *
163
- * @param {string} path - Path to the file or directory. Relative paths are resolved based on the sandbox working directory.
164
- * @returns {Promise<FileInfo>} Detailed file information including size, permissions, modification time
165
- *
166
- * @example
167
- * // Get file details
168
- * const info = await fs.getFileDetails('app/config.json');
169
- * console.log(`Size: ${info.size}, Modified: ${info.modTime}`);
170
- */
171
- async getFileDetails(path) {
172
- const response = await this.apiClient.getFileInfo(path);
173
- return response.data;
174
- }
175
- /**
176
- * Lists contents of a directory in the Sandbox.
177
- *
178
- * @param {string} path - Directory path to list. Relative paths are resolved based on the sandbox working directory.
179
- * @returns {Promise<FileInfo[]>} Array of file and directory information
180
- *
181
- * @example
182
- * // List directory contents
183
- * const files = await fs.listFiles('app/src');
184
- * files.forEach(file => {
185
- * console.log(`${file.name} (${file.size} bytes)`);
186
- * });
187
- */
188
- async listFiles(path) {
189
- const response = await this.apiClient.listFiles(path);
190
- return response.data;
191
- }
192
- /**
193
- * Moves or renames a file or directory.
194
- *
195
- * @param {string} source - Source path. Relative paths are resolved based on the sandbox working directory.
196
- * @param {string} destination - Destination path. Relative paths are resolved based on the sandbox working directory.
197
- * @returns {Promise<void>}
198
- *
199
- * @example
200
- * // Move a file to a new location
201
- * await fs.moveFiles('app/temp/data.json', 'app/data/data.json');
202
- */
203
- async moveFiles(source, destination) {
204
- const response = await this.apiClient.moveFile(source, destination);
205
- return response.data;
206
- }
207
- /**
208
- * Replaces text content in multiple files.
209
- *
210
- * @param {string[]} files - Array of file paths to process. Relative paths are resolved based on the sandbox working directory.
211
- * @param {string} pattern - Pattern to replace
212
- * @param {string} newValue - Replacement text
213
- * @returns {Promise<Array<ReplaceResult>>} Results of the replace operation for each file
214
- *
215
- * @example
216
- * // Update version number across multiple files
217
- * const results = await fs.replaceInFiles(
218
- * ['app/package.json', 'app/version.ts'],
219
- * '"version": "1.0.0"',
220
- * '"version": "1.1.0"'
221
- * );
222
- */
223
- async replaceInFiles(files, pattern, newValue) {
224
- const replaceRequest = {
225
- files,
226
- newValue,
227
- pattern,
228
- };
229
- const response = await this.apiClient.replaceInFiles(replaceRequest);
230
- return response.data;
231
- }
232
- /**
233
- * Searches for files and directories by name pattern in the Sandbox.
234
- *
235
- * @param {string} path - Directory to search in. Relative paths are resolved based on the sandbox working directory.
236
- * @param {string} pattern - File name pattern (supports globs)
237
- * @returns {Promise<SearchFilesResponse>} Search results with matching files
238
- *
239
- * @example
240
- * // Find all TypeScript files
241
- * const result = await fs.searchFiles('app', '*.ts');
242
- * result.files.forEach(file => console.log(file));
243
- */
244
- async searchFiles(path, pattern) {
245
- const response = await this.apiClient.searchFiles(path, pattern);
246
- return response.data;
247
- }
248
- /**
249
- * Sets permissions and ownership for a file or directory.
250
- *
251
- * @param {string} path - Path to the file or directory. Relative paths are resolved based on the sandbox working directory.
252
- * @param {FilePermissionsParams} permissions - Permission settings
253
- * @returns {Promise<void>}
254
- *
255
- * @example
256
- * // Set file permissions and ownership
257
- * await fs.setFilePermissions('app/script.sh', {
258
- * owner: 'daytona',
259
- * group: 'users',
260
- * mode: '755' // Execute permission for shell script
261
- * });
262
- */
263
- async setFilePermissions(path, permissions) {
264
- const response = await this.apiClient.setFilePermissions(path, permissions.owner, permissions.group, permissions.mode);
265
- return response.data;
266
- }
267
- async uploadFile(src, dst, timeout = 30 * 60) {
268
- await this.uploadFiles([{ source: src, destination: dst }], timeout);
269
- }
270
- /**
271
- * Uploads multiple files to the Sandbox. If files already exist at the destination paths,
272
- * they will be overwritten.
273
- *
274
- * @param {FileUpload[]} files - Array of files to upload.
275
- * @param {number} [timeout] - Timeout for the upload operation in seconds. 0 means no timeout.
276
- * Default is 30 minutes.
277
- * @returns {Promise<void>}
278
- *
279
- * @example
280
- * // Upload multiple text files
281
- * const files = [
282
- * {
283
- * source: Buffer.from('Content of file 1'),
284
- * destination: '/tmp/file1.txt'
285
- * },
286
- * {
287
- * source: 'app/data/file2.txt',
288
- * destination: '/tmp/file2.txt'
289
- * },
290
- * {
291
- * source: Buffer.from('{"key": "value"}'),
292
- * destination: '/tmp/config.json'
293
- * }
294
- * ];
295
- * await fs.uploadFiles(files);
296
- */
297
- async uploadFiles(files, timeout = 30 * 60) {
298
- const isNonStreamingRuntime = Runtime_1.RUNTIME === Runtime_1.Runtime.DENO || Runtime_1.RUNTIME === Runtime_1.Runtime.BROWSER || Runtime_1.RUNTIME === Runtime_1.Runtime.SERVERLESS;
299
- const FormDataClass = isNonStreamingRuntime
300
- ? FormData
301
- : (await (0, Import_1.dynamicImport)('form-data', 'Uploading files is not supported: '));
302
- const form = new FormDataClass();
303
- for (const [i, { source, destination }] of files.entries()) {
304
- form.append(`files[${i}].path`, destination);
305
- const payload = await this.makeFilePayload(source);
306
- form.append(`files[${i}].file`, payload, destination);
307
- }
308
- if (isNonStreamingRuntime) {
309
- const url = `${this.clientConfig.basePath}/files/bulk-upload`;
310
- await fetch(url, {
311
- method: 'POST',
312
- headers: this.clientConfig.baseOptions.headers,
313
- body: form,
314
- signal: timeout ? AbortSignal.timeout(timeout * 1000) : undefined,
315
- });
316
- }
317
- else {
318
- await this.apiClient.uploadFiles({
319
- data: form,
320
- maxRedirects: 0,
321
- timeout: timeout * 1000,
322
- });
323
- }
324
- }
325
- async makeFilePayload(source) {
326
- // String = file path
327
- if (typeof source === 'string') {
328
- const fs = await (0, Import_1.dynamicImport)('fs', 'Uploading file from local file system is not supported: ');
329
- return fs.createReadStream(source);
330
- }
331
- // Blob
332
- if (Runtime_1.RUNTIME === Runtime_1.Runtime.BROWSER || Runtime_1.RUNTIME === Runtime_1.Runtime.SERVERLESS || Runtime_1.RUNTIME === Runtime_1.Runtime.DENO) {
333
- // Use .slice() to ensure we have a concrete ArrayBuffer, not ArrayBufferLike
334
- return new Blob([source.slice()], { type: 'application/octet-stream' });
335
- }
336
- // Readable stream
337
- const stream = await (0, Import_1.dynamicImport)('stream', 'Uploading file is not supported: ');
338
- return stream.Readable.from(source);
339
- }
340
- }
341
- exports.FileSystem = FileSystem;
342
- tslib_1.__decorate([
343
- (0, otel_decorator_1.WithInstrumentation)(),
344
- tslib_1.__metadata("design:type", Function),
345
- tslib_1.__metadata("design:paramtypes", [String, String]),
346
- tslib_1.__metadata("design:returntype", Promise)
347
- ], FileSystem.prototype, "createFolder", null);
348
- tslib_1.__decorate([
349
- (0, otel_decorator_1.WithInstrumentation)(),
350
- tslib_1.__metadata("design:type", Function),
351
- tslib_1.__metadata("design:paramtypes", [String, Boolean]),
352
- tslib_1.__metadata("design:returntype", Promise)
353
- ], FileSystem.prototype, "deleteFile", null);
354
- tslib_1.__decorate([
355
- (0, otel_decorator_1.WithInstrumentation)(),
356
- tslib_1.__metadata("design:type", Function),
357
- tslib_1.__metadata("design:paramtypes", [String, Object, Number]),
358
- tslib_1.__metadata("design:returntype", Promise)
359
- ], FileSystem.prototype, "downloadFile", null);
360
- tslib_1.__decorate([
361
- (0, otel_decorator_1.WithInstrumentation)(),
362
- tslib_1.__metadata("design:type", Function),
363
- tslib_1.__metadata("design:paramtypes", [Array, Number]),
364
- tslib_1.__metadata("design:returntype", Promise)
365
- ], FileSystem.prototype, "downloadFiles", null);
366
- tslib_1.__decorate([
367
- (0, otel_decorator_1.WithInstrumentation)(),
368
- tslib_1.__metadata("design:type", Function),
369
- tslib_1.__metadata("design:paramtypes", [String, String]),
370
- tslib_1.__metadata("design:returntype", Promise)
371
- ], FileSystem.prototype, "findFiles", null);
372
- tslib_1.__decorate([
373
- (0, otel_decorator_1.WithInstrumentation)(),
374
- tslib_1.__metadata("design:type", Function),
375
- tslib_1.__metadata("design:paramtypes", [String]),
376
- tslib_1.__metadata("design:returntype", Promise)
377
- ], FileSystem.prototype, "getFileDetails", null);
378
- tslib_1.__decorate([
379
- (0, otel_decorator_1.WithInstrumentation)(),
380
- tslib_1.__metadata("design:type", Function),
381
- tslib_1.__metadata("design:paramtypes", [String]),
382
- tslib_1.__metadata("design:returntype", Promise)
383
- ], FileSystem.prototype, "listFiles", null);
384
- tslib_1.__decorate([
385
- (0, otel_decorator_1.WithInstrumentation)(),
386
- tslib_1.__metadata("design:type", Function),
387
- tslib_1.__metadata("design:paramtypes", [String, String]),
388
- tslib_1.__metadata("design:returntype", Promise)
389
- ], FileSystem.prototype, "moveFiles", null);
390
- tslib_1.__decorate([
391
- (0, otel_decorator_1.WithInstrumentation)(),
392
- tslib_1.__metadata("design:type", Function),
393
- tslib_1.__metadata("design:paramtypes", [Array, String, String]),
394
- tslib_1.__metadata("design:returntype", Promise)
395
- ], FileSystem.prototype, "replaceInFiles", null);
396
- tslib_1.__decorate([
397
- (0, otel_decorator_1.WithInstrumentation)(),
398
- tslib_1.__metadata("design:type", Function),
399
- tslib_1.__metadata("design:paramtypes", [String, String]),
400
- tslib_1.__metadata("design:returntype", Promise)
401
- ], FileSystem.prototype, "searchFiles", null);
402
- tslib_1.__decorate([
403
- (0, otel_decorator_1.WithInstrumentation)(),
404
- tslib_1.__metadata("design:type", Function),
405
- tslib_1.__metadata("design:paramtypes", [String, Object]),
406
- tslib_1.__metadata("design:returntype", Promise)
407
- ], FileSystem.prototype, "setFilePermissions", null);
408
- tslib_1.__decorate([
409
- (0, otel_decorator_1.WithInstrumentation)(),
410
- tslib_1.__metadata("design:type", Function),
411
- tslib_1.__metadata("design:paramtypes", [Object, String, Number]),
412
- tslib_1.__metadata("design:returntype", Promise)
413
- ], FileSystem.prototype, "uploadFile", null);
414
- tslib_1.__decorate([
415
- (0, otel_decorator_1.WithInstrumentation)(),
416
- tslib_1.__metadata("design:type", Function),
417
- tslib_1.__metadata("design:paramtypes", [Array, Number]),
418
- tslib_1.__metadata("design:returntype", Promise)
419
- ], FileSystem.prototype, "uploadFiles", null);
420
- //# sourceMappingURL=FileSystem.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FileSystem.js","sourceRoot":"","sources":["../../../../libs/sdk-typescript/src/FileSystem.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,qDAA8B;AAU9B,2CAA8C;AAC9C,6CAAkD;AAClD,wDAAwE;AACxE,uDAI6B;AAC7B,2DAA4D;AAqG5D,SAAS,uBAAuB,CAAC,KAAa,EAAE,YAAuC;IACrF,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,IAAI,2BAAY,CAAC,KAAK,CAAC,CAAA;IAChC,CAAC;IAED,OAAO,IAAA,iCAAkB,EAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,UAAU,EAAE,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,CAAA;AAC7G,CAAC;AAED;;;;GAIG;AACH,MAAa,UAAU;IAEF;IACA;IAFnB,YACmB,YAA2B,EAC3B,SAAwB;QADxB,iBAAY,GAAZ,YAAY,CAAe;QAC3B,cAAS,GAAT,SAAS,CAAe;IACxC,CAAC;IAEJ;;;;;;;;;;OAUG;IAEU,AAAN,KAAK,CAAC,YAAY,CAAC,IAAY,EAAE,IAAY;QAClD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QAC9D,OAAO,QAAQ,CAAC,IAAI,CAAA;IACtB,CAAC;IAED;;;;;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,IAAA,oCAAmB,GAAE;;;;+CAgDrB;AAiBY;IADZ,IAAA,oCAAmB,GAAE;;;;2CAIrB;AAcY;IADZ,IAAA,oCAAmB,GAAE;;;;gDAIrB;AAgBY;IADZ,IAAA,oCAAmB,GAAE;;;;2CAIrB;AAcY;IADZ,IAAA,oCAAmB,GAAE;;;;2CAIrB;AAmBY;IADZ,IAAA,oCAAmB,GAAE;;;;gDAUrB;AAeY;IADZ,IAAA,oCAAmB,GAAE;;;;6CAIrB;AAkBY;IADZ,IAAA,oCAAmB,GAAE;;;;oDASrB;AAiCY;IADZ,IAAA,oCAAmB,GAAE;;;;4CAGrB;AA8BY;IADZ,IAAA,oCAAmB,GAAE;;;;6CA8BrB"}
package/src/Git.d.ts DELETED
@@ -1,202 +0,0 @@
1
- import { GitApi, ListBranchResponse, GitStatus } from '@daytona/toolbox-api-client';
2
- /**
3
- * Response from the git commit.
4
- *
5
- * @interface
6
- * @property {string} sha - The SHA of the commit
7
- */
8
- export interface GitCommitResponse {
9
- sha: string;
10
- }
11
- /**
12
- * Provides Git operations within a Sandbox.
13
- *
14
- * @class
15
- */
16
- export declare class Git {
17
- private readonly apiClient;
18
- constructor(apiClient: GitApi);
19
- /**
20
- * Stages the specified files for the next commit, similar to
21
- * running 'git add' on the command line.
22
- *
23
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
24
- * @param {string[]} files - List of file paths or directories to stage, relative to the repository root
25
- * @returns {Promise<void>}
26
- *
27
- * @example
28
- * // Stage a single file
29
- * await git.add('workspace/repo', ['file.txt']);
30
- *
31
- * @example
32
- * // Stage whole repository
33
- * await git.add('workspace/repo', ['.']);
34
- */
35
- add(path: string, files: string[]): Promise<void>;
36
- /**
37
- * List branches in the repository.
38
- *
39
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
40
- * @returns {Promise<ListBranchResponse>} List of branches in the repository
41
- *
42
- * @example
43
- * const response = await git.branches('workspace/repo');
44
- * console.log(`Branches: ${response.branches}`);
45
- */
46
- branches(path: string): Promise<ListBranchResponse>;
47
- /**
48
- * Create branch in the repository.
49
- *
50
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
51
- * @param {string} name - Name of the new branch to create
52
- * @returns {Promise<void>}
53
- *
54
- * @example
55
- * await git.createBranch('workspace/repo', 'new-feature');
56
- */
57
- createBranch(path: string, name: string): Promise<void>;
58
- /**
59
- * Delete branche in the repository.
60
- *
61
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
62
- * @param {string} name - Name of the branch to delete
63
- * @returns {Promise<void>}
64
- *
65
- * @example
66
- * await git.deleteBranch('workspace/repo', 'new-feature');
67
- */
68
- deleteBranch(path: string, name: string): Promise<void>;
69
- /**
70
- * Checkout branche in the repository.
71
- *
72
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
73
- * @param {string} branch - Name of the branch to checkout
74
- * @returns {Promise<void>}
75
- *
76
- * @example
77
- * await git.checkoutBranch('workspace/repo', 'new-feature');
78
- */
79
- checkoutBranch(path: string, branch: string): Promise<void>;
80
- /**
81
- * Clones a Git repository into the specified path. It supports
82
- * cloning specific branches or commits, and can authenticate with the remote
83
- * repository if credentials are provided.
84
- *
85
- * @param {string} url - Repository URL to clone from
86
- * @param {string} path - Path where the repository should be cloned. Relative paths are resolved based on the sandbox working directory.
87
- * @param {string} [branch] - Specific branch to clone. If not specified, clones the default branch
88
- * @param {string} [commitId] - Specific commit to clone. If specified, the repository will be left in a detached HEAD state at this commit
89
- * @param {string} [username] - Git username for authentication
90
- * @param {string} [password] - Git password or token for authentication
91
- * @returns {Promise<void>}
92
- *
93
- * @example
94
- * // Clone the default branch
95
- * await git.clone(
96
- * 'https://github.com/user/repo.git',
97
- * 'workspace/repo'
98
- * );
99
- *
100
- * @example
101
- * // Clone a specific branch with authentication
102
- * await git.clone(
103
- * 'https://github.com/user/private-repo.git',
104
- * 'workspace/private',
105
- * branch='develop',
106
- * username='user',
107
- * password='token'
108
- * );
109
- *
110
- * @example
111
- * // Clone a specific commit
112
- * await git.clone(
113
- * 'https://github.com/user/repo.git',
114
- * 'workspace/repo-old',
115
- * commitId='abc123'
116
- * );
117
- */
118
- clone(url: string, path: string, branch?: string, commitId?: string, username?: string, password?: string): Promise<void>;
119
- /**
120
- * Commits staged changes.
121
- *
122
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
123
- * @param {string} message - Commit message describing the changes
124
- * @param {string} author - Name of the commit author
125
- * @param {string} email - Email address of the commit author
126
- * @param {boolean} [allowEmpty] - Allow creating an empty commit when no changes are staged
127
- * @returns {Promise<void>}
128
- *
129
- * @example
130
- * // Stage and commit changes
131
- * await git.add('workspace/repo', ['README.md']);
132
- * await git.commit(
133
- * 'workspace/repo',
134
- * 'Update documentation',
135
- * 'John Doe',
136
- * 'john@example.com',
137
- * true
138
- * );
139
- *
140
- */
141
- commit(path: string, message: string, author: string, email: string, allowEmpty?: boolean): Promise<GitCommitResponse>;
142
- /**
143
- * Push local changes to the remote repository.
144
- *
145
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
146
- * @param {string} [username] - Git username for authentication
147
- * @param {string} [password] - Git password or token for authentication
148
- * @returns {Promise<void>}
149
- *
150
- * @example
151
- * // Push to a public repository
152
- * await git.push('workspace/repo');
153
- *
154
- * @example
155
- * // Push to a private repository
156
- * await git.push(
157
- * 'workspace/repo',
158
- * 'user',
159
- * 'token'
160
- * );
161
- */
162
- push(path: string, username?: string, password?: string): Promise<void>;
163
- /**
164
- * Pulls changes from the remote repository.
165
- *
166
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
167
- * @param {string} [username] - Git username for authentication
168
- * @param {string} [password] - Git password or token for authentication
169
- * @returns {Promise<void>}
170
- *
171
- * @example
172
- * // Pull from a public repository
173
- * await git.pull('workspace/repo');
174
- *
175
- * @example
176
- * // Pull from a private repository
177
- * await git.pull(
178
- * 'workspace/repo',
179
- * 'user',
180
- * 'token'
181
- * );
182
- */
183
- pull(path: string, username?: string, password?: string): Promise<void>;
184
- /**
185
- * Gets the current status of the Git repository.
186
- *
187
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
188
- * @returns {Promise<GitStatus>} Current repository status including:
189
- * - currentBranch: Name of the current branch
190
- * - ahead: Number of commits ahead of the remote branch
191
- * - behind: Number of commits behind the remote branch
192
- * - branchPublished: Whether the branch has been published to the remote repository
193
- * - fileStatus: List of file statuses
194
- *
195
- * @example
196
- * const status = await sandbox.git.status('workspace/repo');
197
- * console.log(`Current branch: ${status.currentBranch}`);
198
- * console.log(`Commits ahead: ${status.ahead}`);
199
- * console.log(`Commits behind: ${status.behind}`);
200
- */
201
- status(path: string): Promise<GitStatus>;
202
- }