Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/e2b-dev/e2b
Browse files Browse the repository at this point in the history
  • Loading branch information
mlejva committed Nov 9, 2023
2 parents cf6b3cf + 7a8dadf commit 6cc3c95
Show file tree
Hide file tree
Showing 13 changed files with 178 additions and 135 deletions.
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"browserslist": "defaults, not ie <= 11",
"dependencies": {
"@algolia/autocomplete-core": "^1.7.3",
"@e2b/sdk": "^0.8.1",
"@e2b/sdk": "^0.8.2",
"@headlessui/react": "^1.7.15",
"@headlessui/tailwindcss": "^0.2.0",
"@mdx-js/loader": "^2.1.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/js-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@e2b/sdk",
"version": "0.8.1",
"version": "0.8.2",
"description": "E2B SDK that give agents cloud environments",
"homepage": "https://e2b.dev",
"license": "MIT",
Expand Down
100 changes: 50 additions & 50 deletions packages/js-sdk/src/api/schema.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,65 +4,65 @@
*/

export interface paths {
'/health': {
"/health": {
/** Health check */
get: {
responses: {
/** Request was successful */
200: unknown;
401: components['responses']['401'];
401: components["responses"]["401"];
};
};
};
'/instances': {
"/instances": {
/** Create an instance from the environment */
post: {
responses: {
/** The instance was created successfully */
201: {
content: {
'application/json': components['schemas']['Instance'];
"application/json": components["schemas"]["Instance"];
};
};
400: components['responses']['400'];
401: components['responses']['401'];
500: components['responses']['500'];
400: components["responses"]["400"];
401: components["responses"]["401"];
500: components["responses"]["500"];
};
requestBody: {
content: {
'application/json': components['schemas']['NewInstance'];
"application/json": components["schemas"]["NewInstance"];
};
};
};
};
'/instances/{instanceID}/refreshes': {
"/instances/{instanceID}/refreshes": {
/** Refresh the instance extending its time to live */
post: {
parameters: {
path: {
instanceID: components['parameters']['instanceID'];
instanceID: components["parameters"]["instanceID"];
};
};
responses: {
/** Successfully refreshed the instance */
204: never;
401: components['responses']['401'];
404: components['responses']['404'];
401: components["responses"]["401"];
404: components["responses"]["404"];
};
};
};
'/envs': {
"/envs": {
/** List all environments */
get: {
responses: {
/** Successfully returned all environments */
200: {
content: {
'application/json': components['schemas']['Environment'][];
"application/json": components["schemas"]["Environment"][];
};
};
401: components['responses']['401'];
500: components['responses']['500'];
401: components["responses"]["401"];
500: components["responses"]["500"];
};
};
/** Create a new environment */
Expand All @@ -71,15 +71,17 @@ export interface paths {
/** The build has started */
202: {
content: {
'application/json': components['schemas']['Environment'];
"application/json": components["schemas"]["Environment"];
};
};
401: components['responses']['401'];
500: components['responses']['500'];
401: components["responses"]["401"];
500: components["responses"]["500"];
};
requestBody: {
content: {
'multipart/form-data': {
"multipart/form-data": {
/** @description Alias of the environment */
alias?: string;
/**
* Format: binary
* @description Docker build context
Expand All @@ -92,48 +94,46 @@ export interface paths {
};
};
};
'/envs/{envID}': {
"/envs/{envID}": {
/** Rebuild an environment */
post: {
parameters: {
path: {
envID: components['parameters']['envID'];
envID: components["parameters"]["envID"];
};
};
responses: {
/** The build has started */
202: {
content: {
'application/json': components['schemas']['Environment'];
"application/json": components["schemas"]["Environment"];
};
};
401: components['responses']['401'];
500: components['responses']['500'];
401: components["responses"]["401"];
500: components["responses"]["500"];
};
requestBody: {
content: {
'multipart/form-data': {
"multipart/form-data": {
/**
* Format: binary
* @description Docker build context
*/
buildContext: string;
/** @description Dockerfile content */
dockerfile: string;
/** @description ID of the environment */
envID: string;
};
};
};
};
};
'/envs/{envID}/builds/{buildID}': {
"/envs/{envID}/builds/{buildID}": {
/** Get environment build info */
get: {
parameters: {
path: {
envID: components['parameters']['envID'];
buildID: components['parameters']['buildID'];
envID: components["parameters"]["envID"];
buildID: components["parameters"]["buildID"];
};
query: {
/** Index of the starting build log that should be returned with the environment */
Expand All @@ -144,33 +144,33 @@ export interface paths {
/** Successfully returned the environment */
200: {
content: {
'application/json': components['schemas']['EnvironmentBuild'];
"application/json": components["schemas"]["EnvironmentBuild"];
};
};
401: components['responses']['401'];
404: components['responses']['404'];
500: components['responses']['500'];
401: components["responses"]["401"];
404: components["responses"]["404"];
500: components["responses"]["500"];
};
};
};
'/envs/{envID}/builds/{buildID}/logs': {
"/envs/{envID}/builds/{buildID}/logs": {
/** Add a build log */
post: {
parameters: {
path: {
envID: components['parameters']['envID'];
buildID: components['parameters']['buildID'];
envID: components["parameters"]["envID"];
buildID: components["parameters"]["buildID"];
};
};
responses: {
/** Successfully added log */
201: unknown;
401: components['responses']['401'];
404: components['responses']['404'];
401: components["responses"]["401"];
404: components["responses"]["404"];
};
requestBody: {
content: {
'application/json': {
"application/json": {
/** @description API secret */
apiSecret: string;
logs: string[];
Expand All @@ -194,6 +194,8 @@ export interface components {
buildID: string;
/** @description Whether the environment is public or only accessible by the team */
public: boolean;
/** @description Aliases of the environment */
aliases?: string[];
};
EnvironmentBuild: {
/**
Expand All @@ -209,7 +211,7 @@ export interface components {
* @description Status of the environment
* @enum {string}
*/
status?: 'building' | 'ready' | 'error';
status?: "building" | "ready" | "error";
} & {
finished: unknown;
};
Expand All @@ -235,25 +237,25 @@ export interface components {
/** Bad request */
400: {
content: {
'application/json': components['schemas']['Error'];
"application/json": components["schemas"]["Error"];
};
};
/** Authentication error */
401: {
content: {
'application/json': components['schemas']['Error'];
"application/json": components["schemas"]["Error"];
};
};
/** Not found */
404: {
content: {
'application/json': components['schemas']['Error'];
"application/json": components["schemas"]["Error"];
};
};
/** Server error */
500: {
content: {
'application/json': components['schemas']['Error'];
"application/json": components["schemas"]["Error"];
};
};
};
Expand All @@ -264,8 +266,6 @@ export interface components {
};
}

export interface operations {
}
export interface operations {}

export interface external {
}
export interface external {}
2 changes: 1 addition & 1 deletion packages/js-sdk/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const WS_RECONNECT_INTERVAL = 600 // 600ms
export const TIMEOUT = 60_000 // 60s

export const API_DOMAIN = 'api.e2b.dev'
export const API_HOST = process?.env?.DEBUG
export const API_HOST = process?.env?.E2B_DEBUG
? 'http://localhost:3000'
: `https://${API_DOMAIN}`
export const SANDBOX_DOMAIN = 'e2b.dev'
Expand Down
9 changes: 7 additions & 2 deletions packages/python-sdk/e2b/api/v1/client/models/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
import json


from pydantic import BaseModel, Field, StrictBool, StrictStr
from typing import List, Optional
from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist


class Environment(BaseModel):
Expand All @@ -38,7 +39,10 @@ class Environment(BaseModel):
...,
description="Whether the environment is public or only accessible by the team",
)
__properties = ["envID", "buildID", "public"]
aliases: Optional[conlist(StrictStr)] = Field(
None, description="Aliases of the environment"
)
__properties = ["envID", "buildID", "public", "aliases"]

class Config:
"""Pydantic configuration"""
Expand Down Expand Up @@ -86,6 +90,7 @@ def from_dict(cls, obj: dict) -> Environment:
"env_id": obj.get("envID"),
"build_id": obj.get("buildID"),
"public": obj.get("public"),
"aliases": obj.get("aliases"),
}
)
return _obj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
import json


from pydantic import BaseModel, Field, StrictBool, StrictStr
from typing import List, Optional
from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist


class EnvsGet200ResponseInner(BaseModel):
Expand All @@ -38,7 +39,10 @@ class EnvsGet200ResponseInner(BaseModel):
...,
description="Whether the environment is public or only accessible by the team",
)
__properties = ["envID", "buildID", "public"]
aliases: Optional[conlist(StrictStr)] = Field(
None, description="Aliases of the environment"
)
__properties = ["envID", "buildID", "public", "aliases"]

class Config:
"""Pydantic configuration"""
Expand Down Expand Up @@ -86,6 +90,7 @@ def from_dict(cls, obj: dict) -> EnvsGet200ResponseInner:
"env_id": obj.get("envID"),
"build_id": obj.get("buildID"),
"public": obj.get("public"),
"aliases": obj.get("aliases"),
}
)
return _obj
9 changes: 7 additions & 2 deletions packages/python-sdk/e2b/api/v2/client/models/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
import json


from pydantic import BaseModel, Field, StrictBool, StrictStr
from typing import List, Optional
from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist


class Environment(BaseModel):
Expand All @@ -38,6 +39,9 @@ class Environment(BaseModel):
...,
description="Whether the environment is public or only accessible by the team",
)
aliases: Optional[conlist(StrictStr)] = Field(
None, description="Aliases of the environment"
)

"""Pydantic configuration"""
model_config = {
Expand Down Expand Up @@ -74,7 +78,7 @@ def from_dict(cls, obj: dict) -> Environment:

# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in ["envID", "buildID", "public"]:
if _key not in ["envID", "buildID", "public", "aliases"]:
raise ValueError(
"Error due to additional fields (not defined in Environment) in the input: "
+ obj
Expand All @@ -85,6 +89,7 @@ def from_dict(cls, obj: dict) -> Environment:
"env_id": obj.get("envID"),
"build_id": obj.get("buildID"),
"public": obj.get("public"),
"aliases": obj.get("aliases"),
}
)
return _obj
4 changes: 3 additions & 1 deletion packages/python-sdk/e2b/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
TIMEOUT = 60

API_DOMAIN = "api.e2b.dev"
API_HOST = "http://localhost:3000" if os.getenv("DEBUG") else f"https://{API_DOMAIN}"
API_HOST = (
"http://localhost:3000" if os.getenv("E2B_DEBUG") else f"https://{API_DOMAIN}"
)

SANDBOX_DOMAIN = "e2b.dev"

Expand Down
Loading

1 comment on commit 6cc3c95

@vercel
Copy link

@vercel vercel bot commented on 6cc3c95 Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

e2b-docs – ./apps/docs

e2b-docs.vercel.app
e2b-docs-git-main-e2b.vercel.app
e2b-docs-e2b.vercel.app

Please sign in to comment.