Commit Graph

33 Commits

Author SHA1 Message Date
Jiri Sveceny 2def1305f3 Flag for securing envd access with auth token (#688)
Waiting until secure flag will be available in production cluster.

---------

Co-authored-by: Jakub Novák <jakub@e2b.dev>
2025-05-14 15:15:18 +00:00
0div a5b08de85f Add optional depth parameter to SDK file listing methods. (#649)
# Description

Do not merge before https://github.com/e2b-dev/infra/pull/524 is merged
and deployed.

The DX would look like this:
```js
const files = await sandbox.files.list(dirName, { depth: 3 })
```
- [x] update `envd` pb spec 
- [x] generate for `js-sdk`
- [x] update `js-sdk` `file.list` method to include optional depth param
- [x] update `js-sdk` tests
- [x] generate for `python-sdk`
- [x] update `python-sdk` `file.list` method to include optional depth
param
  - [x] sync
  - [x] async
- [x] update `python-sdk` tests
  - [x] sync
  - [x] async

---------

Co-authored-by: Mish <10400064+mishushakov@users.noreply.github.com>
2025-05-05 09:17:08 -07:00
0div e0c1bc752d Make codegen robust and deterministic for js and python SDKs (#664)
# Description 

This PR allows to codegen without worrying about your environment and
dependencies for consistent outcomes in what code is generated from
openapi and envd protobuf spec. Will generate files for `js-sdk` and
`python-sdk`

- [x] create Docker image with all the pinned deps needed to codegen
- [x] create codegen script using this container with mapped volumes
- [x] adapt Makefiles to this new approach
- [x] adapt where we install the connect-python protobuf binary for this
to work

# Test

```sh
make codegen # this command is similar to `make generate` but w/o the hassle

Generating SDK code from openapi and envd spec
cd packages/js-sdk && pnpm generate

> e2b@1.2.1 generate /workspace/packages/js-sdk
> python ./../../spec/remove_extra_tags.py sandboxes templates && openapi-typescript ../../spec/openapi_generated.yml -x api_key --arr
ay-length --alphabetize --output src/api/schema.gen.ts

 openapi-typescript 7.6.1
🚀 ../../spec/openapi_generated.yml → src/api/schema.gen.ts [44.2ms]
cd packages/js-sdk && pnpm generate-envd-api

> e2b@1.2.1 generate-envd-api /workspace/packages/js-sdk
> openapi-typescript ../../spec/envd/envd.yaml -x api_key --array-length --alphabetize --output src/envd/schema.gen.ts

 openapi-typescript 7.6.1
🚀 ../../spec/envd/envd.yaml → src/envd/schema.gen.ts [22.7ms]

[...]

cd packages/python-sdk && make generate-api

All done!  🍰 
```

---------

Co-authored-by: Jiri Sveceny <jiri.sveceny@icloud.com>
2025-04-07 17:00:31 +02:00
Jakub Dobrý 25c4539de6 Add watch dir recursive option (missing python client regeneration) 2025-01-28 11:25:42 -08:00
Jakub Novak 23ea4adfb1 Rename rpc methods for watcher 2024-10-14 19:51:05 -07:00
Jakub Novak bc42ba1e66 Refactor watch dir 2024-10-14 13:01:59 -07:00
Jakub Novak c5aa13ea86 Fix command for generating from rpc spec 2024-10-14 11:29:20 -07:00
Jakub Novak 81db2b1466 Add sync watch handler 2024-10-11 11:54:00 +02:00
Tomas Valenta b1c3e01c96 Split buf generation 2024-08-20 14:29:57 -07:00
Jakub Novak 2357fa3da7 Add possibility to add env vars on sandbox create 2024-08-14 11:08:25 +02:00
Jakub Novak e882d152bc Improve spec 2024-08-06 17:54:24 +02:00
Jakub Novak 0976c10a21 Remove file info from remove method 2024-08-06 15:47:03 +02:00
Jakub Novak 08fc1e4c8a Get paths for filesystem operations from envd 2024-08-06 14:48:48 +02:00
Tomas Valenta 6291c13adb Update generated clients; Ensure script cleanup 2024-06-28 16:13:54 -07:00
Tomas Valenta 6b32979f0f Fix python request timeout error; Change auth 2024-06-28 15:01:48 -07:00
Tomas Valenta 955876ef29 Fix openapi specs 2024-06-24 21:59:12 -07:00
Tomas Valenta 206d6744f0 Fix testing config; [WIP] Add tests; Fix python debug opt; Fix enum mapping 2024-06-24 20:51:47 -07:00
Tomas Valenta d8251e79c7 Client keepalive 2024-06-17 17:47:39 +02:00
Tomas Valenta 8f1839c710 Regenerate envd rpc clients 2024-06-16 21:24:44 +02:00
Tomas Valenta af449d7f5d Fix watch init error 2024-06-13 17:17:43 +02:00
Tomas Valenta 229c13524a Update scripts; Fix dir watch; Improve naming 2024-06-13 15:08:54 +02:00
Tomas Valenta b3617d99d9 [WIP] Fix bug and add proper errors 2024-06-11 13:11:36 +02:00
Tomas Valenta c18ada0b9d Python file handling 2024-06-08 23:22:19 +02:00
Tomas Valenta ef19d8f822 Regenrate RPC; Fix namespacing 2024-06-07 21:35:34 +02:00
Tomas Valenta b04342cbff Fix input stream; [WIP] Python SDK 2024-06-04 00:50:23 +02:00
Tomas Valenta ecf318a3ed Update spec and JS 2024-06-03 13:42:00 +02:00
Tomas Valenta b022dcfb80 [WIP] Upload and download handling 2024-06-02 23:06:37 +02:00
Tomas Valenta 9b83de35f2 Remove old deps; [WIP] JS SDK file handling 2024-06-02 14:28:25 +02:00
Tomas Valenta 1a6d34ea11 Improve types 2024-06-02 03:00:22 +02:00
Tomas Valenta 69744145fd Export types in TS SDK; [WIP] Python SDK process handling 2024-06-01 23:35:31 +02:00
Tomas Valenta 5bfcc9a20e Imrpove connection config; [WIP] Rework Python SDK 2024-06-01 21:07:13 +02:00
Tomas Valenta 068ff5613f Regenerate APIs 2024-05-31 06:40:42 +02:00
Tomas Valenta 3b4c915a48 Generate clients 2024-05-17 02:05:12 -07:00