diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b56c3d0..e8285b7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.4" + ".": "0.1.0-alpha.5" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d791715..e50bc04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 0.1.0-alpha.5 (2025-01-22) + +Full Changelog: [v0.1.0-alpha.4...v0.1.0-alpha.5](https://github.com/cleanlab/codex-python/compare/v0.1.0-alpha.4...v0.1.0-alpha.5) + +### Features + +* **api:** api update ([#30](https://github.com/cleanlab/codex-python/issues/30)) ([13e6f7c](https://github.com/cleanlab/codex-python/commit/13e6f7c566ecdf91ae576f6bdba03b883d43ee21)) +* **api:** api update ([#33](https://github.com/cleanlab/codex-python/issues/33)) ([038e1d0](https://github.com/cleanlab/codex-python/commit/038e1d0f548c90530efcdcc40b84728640d86cc1)) +* **api:** update prod api url ([#32](https://github.com/cleanlab/codex-python/issues/32)) ([58ef0f2](https://github.com/cleanlab/codex-python/commit/58ef0f2fd8243f7bf8a1d11962b254e2624dba1f)) + ## 0.1.0-alpha.4 (2025-01-21) Full Changelog: [v0.1.0-alpha.3...v0.1.0-alpha.4](https://github.com/cleanlab/codex-python/compare/v0.1.0-alpha.3...v0.1.0-alpha.4) diff --git a/api.md b/api.md index 48af8b6..d4720cc 100644 --- a/api.md +++ b/api.md @@ -108,7 +108,7 @@ Methods: - client.projects.access_keys.update(access_key_id, \*, project_id, \*\*params) -> AccessKeySchema - client.projects.access_keys.list(project_id) -> AccessKeyListResponse - client.projects.access_keys.delete(access_key_id, \*, project_id) -> None -- client.projects.access_keys.retrieve_project_id() -> str +- client.projects.access_keys.retrieve_project_id() -> AccessKeyRetrieveProjectIDResponse - client.projects.access_keys.revoke(access_key_id, \*, project_id) -> None ## Entries diff --git a/pyproject.toml b/pyproject.toml index 6461357..1992774 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "codex-sdk" -version = "0.1.0-alpha.4" +version = "0.1.0-alpha.5" description = "The official Python library for the Codex API" dynamic = ["readme"] license = "MIT" diff --git a/src/codex/_client.py b/src/codex/_client.py index 884d2f3..74f0c87 100644 --- a/src/codex/_client.py +++ b/src/codex/_client.py @@ -50,7 +50,7 @@ ] ENVIRONMENTS: Dict[str, str] = { - "production": "https://api-codex-o3gxj3oajfu.cleanlab.ai", + "production": "https://api-codex.cleanlab.ai", "staging": "https://api-codex-staging-o3gxj3oajfu.cleanlab.ai", "local": "http://localhost:8080", } diff --git a/src/codex/_version.py b/src/codex/_version.py index 751ac5d..134b2ca 100644 --- a/src/codex/_version.py +++ b/src/codex/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "codex" -__version__ = "0.1.0-alpha.4" # x-release-please-version +__version__ = "0.1.0-alpha.5" # x-release-please-version diff --git a/src/codex/resources/projects/access_keys.py b/src/codex/resources/projects/access_keys.py index bb0dc2f..d375dbc 100644 --- a/src/codex/resources/projects/access_keys.py +++ b/src/codex/resources/projects/access_keys.py @@ -24,6 +24,7 @@ from ...types.projects import access_key_create_params, access_key_update_params from ...types.projects.access_key_schema import AccessKeySchema from ...types.projects.access_key_list_response import AccessKeyListResponse +from ...types.projects.access_key_retrieve_project_id_response import AccessKeyRetrieveProjectIDResponse __all__ = ["AccessKeysResource", "AsyncAccessKeysResource"] @@ -254,14 +255,14 @@ def retrieve_project_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: + ) -> AccessKeyRetrieveProjectIDResponse: """Get the project ID from an access key.""" return self._get( "/api/projects/id_from_access_key", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=str, + cast_to=AccessKeyRetrieveProjectIDResponse, ) def revoke( @@ -528,14 +529,14 @@ async def retrieve_project_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: + ) -> AccessKeyRetrieveProjectIDResponse: """Get the project ID from an access key.""" return await self._get( "/api/projects/id_from_access_key", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=str, + cast_to=AccessKeyRetrieveProjectIDResponse, ) async def revoke( diff --git a/src/codex/types/projects/access_key_retrieve_project_id_response.py b/src/codex/types/projects/access_key_retrieve_project_id_response.py index b7b5313..2277508 100644 --- a/src/codex/types/projects/access_key_retrieve_project_id_response.py +++ b/src/codex/types/projects/access_key_retrieve_project_id_response.py @@ -1,7 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing_extensions import TypeAlias + +from ..._models import BaseModel __all__ = ["AccessKeyRetrieveProjectIDResponse"] -AccessKeyRetrieveProjectIDResponse: TypeAlias = str + +class AccessKeyRetrieveProjectIDResponse(BaseModel): + project_id: str diff --git a/src/codex/types/users/user_schema.py b/src/codex/types/users/user_schema.py index ec6ad54..b1665f2 100644 --- a/src/codex/types/users/user_schema.py +++ b/src/codex/types/users/user_schema.py @@ -11,14 +11,28 @@ class UserSchema(BaseModel): id: str + account_activated_at: Optional[datetime] = None + api_key: str api_key_timestamp: datetime created_at: datetime + discovery_source: Optional[str] = None + email: str + updated_at: datetime + + user_provided_company_name: Optional[str] = None + + first_name: Optional[str] = None + + is_account_activated: Optional[bool] = None + + last_name: Optional[str] = None + name: Optional[str] = None - updated_at: datetime + phone_number: Optional[str] = None diff --git a/src/codex/types/users/user_schema_public.py b/src/codex/types/users/user_schema_public.py index 6d35550..181113b 100644 --- a/src/codex/types/users/user_schema_public.py +++ b/src/codex/types/users/user_schema_public.py @@ -14,6 +14,14 @@ class UserSchemaPublic(BaseModel): email: str + email_verified: Optional[bool] = None + + first_name: Optional[str] = None + + is_account_activated: Optional[bool] = None + + last_name: Optional[str] = None + name: Optional[str] = None - email_verified: Optional[bool] = None + phone_number: Optional[str] = None diff --git a/tests/api_resources/projects/test_access_keys.py b/tests/api_resources/projects/test_access_keys.py index 6ec8ef9..240c31e 100644 --- a/tests/api_resources/projects/test_access_keys.py +++ b/tests/api_resources/projects/test_access_keys.py @@ -13,6 +13,7 @@ from codex.types.projects import ( AccessKeySchema, AccessKeyListResponse, + AccessKeyRetrieveProjectIDResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -297,7 +298,7 @@ def test_path_params_delete(self, client: Codex) -> None: @parametrize def test_method_retrieve_project_id(self, client: Codex) -> None: access_key = client.projects.access_keys.retrieve_project_id() - assert_matches_type(str, access_key, path=["response"]) + assert_matches_type(AccessKeyRetrieveProjectIDResponse, access_key, path=["response"]) @pytest.mark.skip() @parametrize @@ -307,7 +308,7 @@ def test_raw_response_retrieve_project_id(self, client: Codex) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" access_key = response.parse() - assert_matches_type(str, access_key, path=["response"]) + assert_matches_type(AccessKeyRetrieveProjectIDResponse, access_key, path=["response"]) @pytest.mark.skip() @parametrize @@ -317,7 +318,7 @@ def test_streaming_response_retrieve_project_id(self, client: Codex) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" access_key = response.parse() - assert_matches_type(str, access_key, path=["response"]) + assert_matches_type(AccessKeyRetrieveProjectIDResponse, access_key, path=["response"]) assert cast(Any, response.is_closed) is True @@ -653,7 +654,7 @@ async def test_path_params_delete(self, async_client: AsyncCodex) -> None: @parametrize async def test_method_retrieve_project_id(self, async_client: AsyncCodex) -> None: access_key = await async_client.projects.access_keys.retrieve_project_id() - assert_matches_type(str, access_key, path=["response"]) + assert_matches_type(AccessKeyRetrieveProjectIDResponse, access_key, path=["response"]) @pytest.mark.skip() @parametrize @@ -663,7 +664,7 @@ async def test_raw_response_retrieve_project_id(self, async_client: AsyncCodex) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" access_key = await response.parse() - assert_matches_type(str, access_key, path=["response"]) + assert_matches_type(AccessKeyRetrieveProjectIDResponse, access_key, path=["response"]) @pytest.mark.skip() @parametrize @@ -673,7 +674,7 @@ async def test_streaming_response_retrieve_project_id(self, async_client: AsyncC assert response.http_request.headers.get("X-Stainless-Lang") == "python" access_key = await response.parse() - assert_matches_type(str, access_key, path=["response"]) + assert_matches_type(AccessKeyRetrieveProjectIDResponse, access_key, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/test_client.py b/tests/test_client.py index 3eaa653..b421541 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -522,7 +522,7 @@ def test_base_url_env(self) -> None: Codex(_strict_response_validation=True, environment="production") client = Codex(base_url=None, _strict_response_validation=True, environment="production") - assert str(client.base_url).startswith("https://api-codex-o3gxj3oajfu.cleanlab.ai") + assert str(client.base_url).startswith("https://api-codex.cleanlab.ai") @pytest.mark.parametrize( "client", @@ -1263,7 +1263,7 @@ def test_base_url_env(self) -> None: AsyncCodex(_strict_response_validation=True, environment="production") client = AsyncCodex(base_url=None, _strict_response_validation=True, environment="production") - assert str(client.base_url).startswith("https://api-codex-o3gxj3oajfu.cleanlab.ai") + assert str(client.base_url).startswith("https://api-codex.cleanlab.ai") @pytest.mark.parametrize( "client",