diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 86b0e83d..cb9d2541 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.21.0" + ".": "0.22.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 9f25f613..36517827 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 13 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-14d23949fc9a5cf375c542a7a2bda08334079fab55f43b80a3d94ede34244da3.yml -openapi_spec_hash: b80c4f0e0311ff9125dfe27a5a405395 -config_hash: bf6196b98ec72829d458bc45ccd5a5f9 +configured_endpoints: 14 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-ec1420af27ac837f49a977cb95726af45a5ee5b5cd367e54b8a611de47ee3c84.yml +openapi_spec_hash: 0fc5dd84801ee8f46a9b5d0941bdefda +config_hash: 985dd1bd217ba3c5c5b614da08d43e5f diff --git a/CHANGELOG.md b/CHANGELOG.md index 01fe0a4f..10724ba7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 0.22.0 (2025-08-06) + +Full Changelog: [v0.21.0...v0.22.0](https://github.com/hyperspell/python-sdk/compare/v0.21.0...v0.22.0) + +### Features + +* **api:** api update ([853645f](https://github.com/hyperspell/python-sdk/commit/853645f31184d6be577afe6ef7e872bca5198b3c)) +* **api:** api update ([e6c05cd](https://github.com/hyperspell/python-sdk/commit/e6c05cd496db6e9df09da720bd74e6c2f0f853b7)) +* **api:** update via SDK Studio ([5d3bc9c](https://github.com/hyperspell/python-sdk/commit/5d3bc9c68523ff572bb27e8d77e24a2819f6e6be)) +* **api:** update via SDK Studio ([37def01](https://github.com/hyperspell/python-sdk/commit/37def01e5290efee8228c0e81f6ef2c9e7fb2b0b)) + + +### Chores + +* **internal:** fix ruff target version ([9454556](https://github.com/hyperspell/python-sdk/commit/945455659b4896b89be368476adeb8c062e8d520)) + ## 0.21.0 (2025-08-05) Full Changelog: [v0.20.0...v0.21.0](https://github.com/hyperspell/python-sdk/compare/v0.20.0...v0.21.0) diff --git a/api.md b/api.md index f59feeb3..6a65d499 100644 --- a/api.md +++ b/api.md @@ -75,10 +75,11 @@ Methods: Types: ```python -from hyperspell.types import Token, AuthMeResponse +from hyperspell.types import Token, AuthDeleteUserResponse, AuthMeResponse ``` Methods: +- client.auth.delete_user() -> AuthDeleteUserResponse - client.auth.me() -> AuthMeResponse - client.auth.user_token(\*\*params) -> Token diff --git a/pyproject.toml b/pyproject.toml index 540ac080..e446cb1f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "hyperspell" -version = "0.21.0" +version = "0.22.0" description = "The official Python library for the hyperspell API" dynamic = ["readme"] license = "MIT" @@ -159,7 +159,7 @@ reportPrivateUsage = false [tool.ruff] line-length = 120 output-format = "grouped" -target-version = "py37" +target-version = "py38" [tool.ruff.format] docstring-code-format = true diff --git a/src/hyperspell/_version.py b/src/hyperspell/_version.py index c436a1d2..c89716fe 100644 --- a/src/hyperspell/_version.py +++ b/src/hyperspell/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "hyperspell" -__version__ = "0.21.0" # x-release-please-version +__version__ = "0.22.0" # x-release-please-version diff --git a/src/hyperspell/resources/auth.py b/src/hyperspell/resources/auth.py index b9e17f87..a81f560e 100644 --- a/src/hyperspell/resources/auth.py +++ b/src/hyperspell/resources/auth.py @@ -20,6 +20,7 @@ from ..types.token import Token from .._base_client import make_request_options from ..types.auth_me_response import AuthMeResponse +from ..types.auth_delete_user_response import AuthDeleteUserResponse __all__ = ["AuthResource", "AsyncAuthResource"] @@ -44,6 +45,25 @@ def with_streaming_response(self) -> AuthResourceWithStreamingResponse: """ return AuthResourceWithStreamingResponse(self) + def delete_user( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AuthDeleteUserResponse: + """Endpoint to delete user.""" + return self._delete( + "/auth/delete", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AuthDeleteUserResponse, + ) + def me( self, *, @@ -127,6 +147,25 @@ def with_streaming_response(self) -> AsyncAuthResourceWithStreamingResponse: """ return AsyncAuthResourceWithStreamingResponse(self) + async def delete_user( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AuthDeleteUserResponse: + """Endpoint to delete user.""" + return await self._delete( + "/auth/delete", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AuthDeleteUserResponse, + ) + async def me( self, *, @@ -194,6 +233,9 @@ class AuthResourceWithRawResponse: def __init__(self, auth: AuthResource) -> None: self._auth = auth + self.delete_user = to_raw_response_wrapper( + auth.delete_user, + ) self.me = to_raw_response_wrapper( auth.me, ) @@ -206,6 +248,9 @@ class AsyncAuthResourceWithRawResponse: def __init__(self, auth: AsyncAuthResource) -> None: self._auth = auth + self.delete_user = async_to_raw_response_wrapper( + auth.delete_user, + ) self.me = async_to_raw_response_wrapper( auth.me, ) @@ -218,6 +263,9 @@ class AuthResourceWithStreamingResponse: def __init__(self, auth: AuthResource) -> None: self._auth = auth + self.delete_user = to_streamed_response_wrapper( + auth.delete_user, + ) self.me = to_streamed_response_wrapper( auth.me, ) @@ -230,6 +278,9 @@ class AsyncAuthResourceWithStreamingResponse: def __init__(self, auth: AsyncAuthResource) -> None: self._auth = auth + self.delete_user = async_to_streamed_response_wrapper( + auth.delete_user, + ) self.me = async_to_streamed_response_wrapper( auth.me, ) diff --git a/src/hyperspell/types/__init__.py b/src/hyperspell/types/__init__.py index 1cb2bdab..5c43b83b 100644 --- a/src/hyperspell/types/__init__.py +++ b/src/hyperspell/types/__init__.py @@ -16,4 +16,5 @@ from .memory_delete_response import MemoryDeleteResponse as MemoryDeleteResponse from .memory_search_response import MemorySearchResponse as MemorySearchResponse from .memory_status_response import MemoryStatusResponse as MemoryStatusResponse +from .auth_delete_user_response import AuthDeleteUserResponse as AuthDeleteUserResponse from .integration_revoke_response import IntegrationRevokeResponse as IntegrationRevokeResponse diff --git a/src/hyperspell/types/auth_delete_user_response.py b/src/hyperspell/types/auth_delete_user_response.py new file mode 100644 index 00000000..64c8e293 --- /dev/null +++ b/src/hyperspell/types/auth_delete_user_response.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .._models import BaseModel + +__all__ = ["AuthDeleteUserResponse"] + + +class AuthDeleteUserResponse(BaseModel): + message: str + + success: bool diff --git a/src/hyperspell/types/memory.py b/src/hyperspell/types/memory.py index 021ba64d..c5e83e05 100644 --- a/src/hyperspell/types/memory.py +++ b/src/hyperspell/types/memory.py @@ -96,3 +96,5 @@ class Memory(BaseModel): score: Optional[float] = None """The relevance of the resource to the query""" + + title: Optional[str] = None diff --git a/tests/api_resources/test_auth.py b/tests/api_resources/test_auth.py index f4d88ecb..207e4c13 100644 --- a/tests/api_resources/test_auth.py +++ b/tests/api_resources/test_auth.py @@ -9,7 +9,7 @@ from hyperspell import Hyperspell, AsyncHyperspell from tests.utils import assert_matches_type -from hyperspell.types import Token, AuthMeResponse +from hyperspell.types import Token, AuthMeResponse, AuthDeleteUserResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -17,6 +17,31 @@ class TestAuth: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + def test_method_delete_user(self, client: Hyperspell) -> None: + auth = client.auth.delete_user() + assert_matches_type(AuthDeleteUserResponse, auth, path=["response"]) + + @parametrize + def test_raw_response_delete_user(self, client: Hyperspell) -> None: + response = client.auth.with_raw_response.delete_user() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + auth = response.parse() + assert_matches_type(AuthDeleteUserResponse, auth, path=["response"]) + + @parametrize + def test_streaming_response_delete_user(self, client: Hyperspell) -> None: + with client.auth.with_streaming_response.delete_user() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + auth = response.parse() + assert_matches_type(AuthDeleteUserResponse, auth, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_me(self, client: Hyperspell) -> None: auth = client.auth.me() @@ -87,6 +112,31 @@ class TestAsyncAuth: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) + @parametrize + async def test_method_delete_user(self, async_client: AsyncHyperspell) -> None: + auth = await async_client.auth.delete_user() + assert_matches_type(AuthDeleteUserResponse, auth, path=["response"]) + + @parametrize + async def test_raw_response_delete_user(self, async_client: AsyncHyperspell) -> None: + response = await async_client.auth.with_raw_response.delete_user() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + auth = await response.parse() + assert_matches_type(AuthDeleteUserResponse, auth, path=["response"]) + + @parametrize + async def test_streaming_response_delete_user(self, async_client: AsyncHyperspell) -> None: + async with async_client.auth.with_streaming_response.delete_user() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + auth = await response.parse() + assert_matches_type(AuthDeleteUserResponse, auth, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_me(self, async_client: AsyncHyperspell) -> None: auth = await async_client.auth.me()