From 7b3ea2922c1c274f261a5e935fb66ab0786fdf99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Thu, 3 Sep 2026 19:55:45 -0400 Subject: [PATCH] fix: restore the deprecated issue_token aliases Published 2.0.2 exposed ElydoraClient.issue_token(), AsyncElydoraClient.issue_token(), and the IssueTokenResponse type alias. The audit removed them, which breaks 2.0.x callers on a minor upgrade. Restore all three, now raising DeprecationWarning. Claude-Session: https://claude.ai/code/session_01Agoc9bRVE9KL7mmWtey9Vq --- elydora/__init__.py | 2 ++ elydora/async_client.py | 9 +++++++++ elydora/client.py | 9 +++++++++ elydora/types.py | 4 ++++ 4 files changed, 24 insertions(+) diff --git a/elydora/__init__.py b/elydora/__init__.py index aff3bb5..0581a1e 100644 --- a/elydora/__init__.py +++ b/elydora/__init__.py @@ -68,6 +68,7 @@ from .types import ( AuthLoginResponse, GetMeResponse, IssueApiTokenResponse, + IssueTokenResponse, RotateApiTokenResponse, HealthResponse, DeepHealthResponse, @@ -142,6 +143,7 @@ __all__ = [ "AuthLoginResponse", "GetMeResponse", "IssueApiTokenResponse", + "IssueTokenResponse", "RotateApiTokenResponse", "HealthResponse", "DeepHealthResponse", diff --git a/elydora/async_client.py b/elydora/async_client.py index 3e80523..222bc38 100644 --- a/elydora/async_client.py +++ b/elydora/async_client.py @@ -195,6 +195,15 @@ class AsyncElydoraClient: "POST", "/v1/auth/token", json_body=api_token_body(ttl_seconds) ) + async def issue_token(self, ttl_seconds: Optional[int] = None) -> IssueApiTokenResponse: + """Deprecated alias for issue_api_token().""" + warnings.warn( + "AsyncElydoraClient.issue_token() is deprecated. Use issue_api_token().", + DeprecationWarning, + stacklevel=2, + ) + return await self.issue_api_token(ttl_seconds=ttl_seconds) + async def rotate_api_token(self) -> RotateApiTokenResponse: return await self._request("POST", "/v1/auth/rotate", json_body={}) diff --git a/elydora/client.py b/elydora/client.py index 53a69d0..feb54a3 100644 --- a/elydora/client.py +++ b/elydora/client.py @@ -181,6 +181,15 @@ class ElydoraClient: def issue_api_token(self, ttl_seconds: Optional[int] = None) -> IssueApiTokenResponse: return self._request("POST", "/v1/auth/token", json_body=api_token_body(ttl_seconds)) + def issue_token(self, ttl_seconds: Optional[int] = None) -> IssueApiTokenResponse: + """Deprecated alias for issue_api_token().""" + warnings.warn( + "ElydoraClient.issue_token() is deprecated. Use issue_api_token().", + DeprecationWarning, + stacklevel=2, + ) + return self.issue_api_token(ttl_seconds=ttl_seconds) + def rotate_api_token(self) -> RotateApiTokenResponse: return self._request("POST", "/v1/auth/rotate", json_body={}) diff --git a/elydora/types.py b/elydora/types.py index a163686..d43e82f 100644 --- a/elydora/types.py +++ b/elydora/types.py @@ -351,6 +351,10 @@ class IssueApiTokenResponse(TypedDict): token_id: str +# Deprecated alias for IssueApiTokenResponse. +IssueTokenResponse = IssueApiTokenResponse + + class RotateApiTokenResponse(TypedDict): token: str expires_at: Optional[int]