Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Commit 9d23adb

Browse files
authored
chore: bump sdk version to 0.18.0 (#350)
Signed-off-by: MDzaja <[email protected]>
1 parent 7454a41 commit 9d23adb

File tree

9 files changed

+282
-161
lines changed

9 files changed

+282
-161
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "docs",
33
"license": "Apache-2.0",
44
"type": "module",
5-
"version": "0.17.0",
5+
"version": "0.18.0",
66
"scripts": {
77
"postinstall": "is-ci || husky",
88
"dev": "astro dev --host",

public/llms-full.txt

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Daytona Documentation v0.17.0
2-
# Generated on: 2025-05-07
1+
# Daytona Documentation v0.18.0
2+
# Generated on: 2025-05-22
33

44

55
title: API Keys
@@ -220,18 +220,14 @@ If you want to upload a single file, you can do it as follows:
220220

221221
with open("local_file.txt", "rb") as f:
222222
content = f.read()
223-
sandbox.fs.upload_file("remote_file.txt", content)
223+
sandbox.fs.upload_file(content, "remote_file.txt")
224224

225225
```
226226
```typescript
227227

228228
// Upload a single file
229-
const fileContent = new File(
230-
[Buffer.from('Hello, World!')],
231-
'data.txt',
232-
{ type: 'text/plain' }
233-
)
234-
await workspace.fs.uploadFile("data.txt", fileContent)
229+
const fileContent = Buffer.from('Hello, World!')
230+
await workspace.fs.uploadFile(fileContent, "data.txt")
235231

236232
```
237233

@@ -248,20 +244,20 @@ files_to_upload = []
248244

249245
with open("file1.txt", "rb") as f1:
250246
files_to_upload.append(FileUpload(
251-
path="data/file1.txt",
252-
content=f1.read()
247+
source=f1.read(),
248+
destination="data/file1.txt",
253249
))
254250

255251
with open("file2.txt", "rb") as f2:
256252
files_to_upload.append(FileUpload(
257-
path="data/file1.txt",
258-
content=f2.read()
253+
source=f2.read(),
254+
destination="data/file2.txt",
259255
))
260256

261257
with open("settings.json", "rb") as f3:
262258
files_to_upload.append(FileUpload(
263-
path="config/settings.json",
264-
content=f3.read()
259+
source=f3.read(),
260+
destination="config/settings.json",
265261
))
266262

267263
sandbox.fs.upload_files(files_to_upload)
@@ -272,16 +268,16 @@ sandbox.fs.upload_files(files_to_upload)
272268
// Upload multiple files at once
273269
const files = [
274270
{
275-
path: 'data/file1.txt',
276-
content: new File(['Content of file 1'], 'file1.txt')
271+
source: Buffer.from('Content of file 1'),
272+
destination: 'data/file1.txt',
277273
},
278274
{
279-
path: 'data/file2.txt',
280-
content: new File(['Content of file 2'], 'file2.txt')
275+
source: Buffer.from('Content of file 2'),
276+
destination: 'data/file2.txt',
281277
},
282278
{
283-
path: 'config/settings.json',
284-
content: new File(['{"key": "value"}'], 'settings.json')
279+
source: Buffer.from('{"key": "value"}'),
280+
destination: 'config/settings.json',
285281
}
286282
]
287283

@@ -543,7 +539,7 @@ if __name__ == '__main__':
543539

544540
# Save the Flask app to a file
545541

546-
sandbox.fs.upload_file("app.py", app_code)
542+
sandbox.fs.upload_file(app_code, "app.py")
547543

548544
# Create a new session and execute a command
549545

@@ -572,7 +568,7 @@ const daytona = new Daytona(({
572568
async function main() {
573569
const sandbox = await daytona.create();
574570

575-
const appCode = `
571+
const appCode = Buffer.from(`
576572
from flask import Flask
577573

578574
app = Flask(__name__)
@@ -597,12 +593,10 @@ def hello():
597593

598594
if __name__ == '__main__':
599595
app.run(host='0.0.0.0', port=3000)
600-
`;
601-
602-
const fileContent = new File([appCode], "app.py")
596+
`);
603597

604598
// Save the Flask app to a file
605-
await sandbox.fs.uploadFile("app.py", fileContent);
599+
await sandbox.fs.uploadFile(appCode, "app.py");
606600

607601
// Create a new session and execute a command
608602
const execSessionId = "python-app-session";

public/llms.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Daytona Documentation v0.17.0
2-
# Generated on: 2025-05-07
1+
# Daytona Documentation v0.18.0
2+
# Generated on: 2025-05-22
33

44
# Daytona
55

src/content/docs/file-system-operations.mdx

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,16 @@ If you want to upload a single file, you can do it as follows:
9090

9191
with open("local_file.txt", "rb") as f:
9292
content = f.read()
93-
sandbox.fs.upload_file("remote_file.txt", content)
93+
sandbox.fs.upload_file(content, "remote_file.txt")
9494

9595
```
9696
</TabItem>
9797
<TabItem label="TypeScript" icon="seti:typescript">
9898
```typescript
9999

100100
// Upload a single file
101-
const fileContent = new File(
102-
[Buffer.from('Hello, World!')],
103-
'data.txt',
104-
{ type: 'text/plain' }
105-
)
106-
await workspace.fs.uploadFile("data.txt", fileContent)
101+
const fileContent = Buffer.from('Hello, World!')
102+
await workspace.fs.uploadFile(fileContent, "data.txt")
107103

108104
```
109105

@@ -124,20 +120,20 @@ files_to_upload = []
124120

125121
with open("file1.txt", "rb") as f1:
126122
files_to_upload.append(FileUpload(
127-
path="data/file1.txt",
128-
content=f1.read()
123+
source=f1.read(),
124+
destination="data/file1.txt",
129125
))
130126

131127
with open("file2.txt", "rb") as f2:
132128
files_to_upload.append(FileUpload(
133-
path="data/file1.txt",
134-
content=f2.read()
129+
source=f2.read(),
130+
destination="data/file2.txt",
135131
))
136132

137133
with open("settings.json", "rb") as f3:
138134
files_to_upload.append(FileUpload(
139-
path="config/settings.json",
140-
content=f3.read()
135+
source=f3.read(),
136+
destination="config/settings.json",
141137
))
142138

143139
sandbox.fs.upload_files(files_to_upload)
@@ -150,16 +146,16 @@ sandbox.fs.upload_files(files_to_upload)
150146
// Upload multiple files at once
151147
const files = [
152148
{
153-
path: 'data/file1.txt',
154-
content: new File(['Content of file 1'], 'file1.txt')
149+
source: Buffer.from('Content of file 1'),
150+
destination: 'data/file1.txt',
155151
},
156152
{
157-
path: 'data/file2.txt',
158-
content: new File(['Content of file 2'], 'file2.txt')
153+
source: Buffer.from('Content of file 2'),
154+
destination: 'data/file2.txt',
159155
},
160156
{
161-
path: 'config/settings.json',
162-
content: new File(['{"key": "value"}'], 'settings.json')
157+
source: Buffer.from('{"key": "value"}'),
158+
destination: 'config/settings.json',
163159
}
164160
]
165161

src/content/docs/getting-started.mdx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ if __name__ == '__main__':
162162

163163
# Save the Flask app to a file
164164

165-
sandbox.fs.upload_file("app.py", app_code)
165+
sandbox.fs.upload_file(app_code, "app.py")
166166

167167
# Create a new session and execute a command
168168

@@ -193,7 +193,7 @@ const daytona = new Daytona(({
193193
async function main() {
194194
const sandbox = await daytona.create();
195195

196-
const appCode = `
196+
const appCode = Buffer.from(`
197197
from flask import Flask
198198
199199
app = Flask(__name__)
@@ -218,12 +218,10 @@ def hello():
218218
219219
if __name__ == '__main__':
220220
app.run(host='0.0.0.0', port=3000)
221-
`;
222-
223-
const fileContent = new File([appCode], "app.py")
221+
`);
224222

225223
// Save the Flask app to a file
226-
await sandbox.fs.uploadFile("app.py", fileContent);
224+
await sandbox.fs.uploadFile(appCode, "app.py");
227225

228226
// Create a new session and execute a command
229227
const execSessionId = "python-app-session";

src/content/docs/python-sdk/daytona.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@ Parameters for creating a new Sandbox.
384384
- `env_vars` _Optional[Dict[str, str]]_ - Environment variables to set in the Sandbox.
385385
- `labels` _Optional[Dict[str, str]]_ - Custom labels for the Sandbox.
386386
- `public` _Optional[bool]_ - Whether the Sandbox should be public.
387-
- `target` _Optional[str]_ - Target location for the Sandbox. Can be "us", "eu", or "asia".
388387
- `resources` _Optional[SandboxResources]_ - Resource configuration for the Sandbox.
389388
- `timeout` _Optional[float]_ - Timeout in seconds for Sandbox to be created and started.
390389
- `auto_stop_interval` _Optional[int]_ - Interval in minutes after which Sandbox will

0 commit comments

Comments
 (0)