rxresume-python 0.2.0__py3-none-any.whl → 0.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,10 +2,28 @@
2
2
 
3
3
  from .auth import AuthAPI, AsyncAuthAPI
4
4
  from .resumes import ResumesAPI, AsyncResumesAPI
5
+ from .statistics import StatisticsAPI, AsyncStatisticsAPI
6
+ from .agent import AgentAPI, AsyncAgentAPI
7
+ from .ai_providers import AiProvidersAPI, AsyncAiProvidersAPI
8
+ from .flags import FlagsAPI, AsyncFlagsAPI
9
+ from .ai import AIAPI, AsyncAIAPI
10
+ from .applications import ApplicationsAPI, AsyncApplicationsAPI
5
11
 
6
12
  __all__ = [
7
13
  "AuthAPI",
8
14
  "AsyncAuthAPI",
9
15
  "ResumesAPI",
10
16
  "AsyncResumesAPI",
17
+ "StatisticsAPI",
18
+ "AsyncStatisticsAPI",
19
+ "AgentAPI",
20
+ "AsyncAgentAPI",
21
+ "AiProvidersAPI",
22
+ "AsyncAiProvidersAPI",
23
+ "FlagsAPI",
24
+ "AsyncFlagsAPI",
25
+ "AIAPI",
26
+ "AsyncAIAPI",
27
+ "ApplicationsAPI",
28
+ "AsyncApplicationsAPI",
11
29
  ]
@@ -0,0 +1,243 @@
1
+ """Agent API endpoints implementation."""
2
+
3
+ from typing import List, Dict, Any, Optional
4
+
5
+
6
+ class AgentAPI:
7
+ """Synchronous AI Agent operations."""
8
+
9
+ def __init__(self, client) -> None:
10
+ self._client = client
11
+
12
+ def list_threads(self) -> List[Dict[str, Any]]:
13
+ """List all active agent threads."""
14
+ response = self._client._request("GET", "/api/openapi/agent/threads")
15
+ return list(response)
16
+
17
+ def get_thread(self, thread_id: str) -> Dict[str, Any]:
18
+ """Get details of a specific agent thread by ID."""
19
+ response = self._client._request("GET", f"/api/openapi/agent/threads/{thread_id}")
20
+ return dict(response)
21
+
22
+ def delete_thread(self, thread_id: str) -> None:
23
+ """Delete an agent thread by ID."""
24
+ self._client._request("DELETE", f"/api/openapi/agent/threads/{thread_id}")
25
+
26
+ def create_thread(
27
+ self, ai_provider_id: Optional[str] = None, source_resume_id: Optional[str] = None
28
+ ) -> Dict[str, Any]:
29
+ """Create a new agent thread."""
30
+ payload = {}
31
+ if ai_provider_id is not None:
32
+ payload["aiProviderId"] = ai_provider_id
33
+ if source_resume_id is not None:
34
+ payload["sourceResumeId"] = source_resume_id
35
+ response = self._client._request("POST", "/api/openapi/agent/threads", json=payload)
36
+ return dict(response)
37
+
38
+ def get_or_create_thread_for_resume(
39
+ self, ai_provider_id: Optional[str] = None, source_resume_id: Optional[str] = None
40
+ ) -> Dict[str, Any]:
41
+ """Get or create an in-resume agent thread."""
42
+ payload = {}
43
+ if ai_provider_id is not None:
44
+ payload["aiProviderId"] = ai_provider_id
45
+ if source_resume_id is not None:
46
+ payload["sourceResumeId"] = source_resume_id
47
+ response = self._client._request(
48
+ "POST", "/api/openapi/agent/threads/for-resume", json=payload
49
+ )
50
+ return dict(response)
51
+
52
+ def send_message(
53
+ self, thread_id: str, message: Any, attachment_ids: Optional[List[str]] = None
54
+ ) -> Dict[str, Any]:
55
+ """Send an agent message."""
56
+ payload = {
57
+ "threadId": thread_id,
58
+ "message": message,
59
+ }
60
+ if attachment_ids is not None:
61
+ payload["attachmentIds"] = attachment_ids
62
+ response = self._client._request("POST", "/api/openapi/agent/messages/send", json=payload)
63
+ return dict(response)
64
+
65
+ def archive_thread(
66
+ self,
67
+ thread_id: str,
68
+ ai_provider_id: Optional[str] = None,
69
+ source_resume_id: Optional[str] = None,
70
+ ) -> Dict[str, Any]:
71
+ """Archive an agent thread."""
72
+ payload = {}
73
+ if ai_provider_id is not None:
74
+ payload["aiProviderId"] = ai_provider_id
75
+ if source_resume_id is not None:
76
+ payload["sourceResumeId"] = source_resume_id
77
+ response = self._client._request(
78
+ "POST", f"/api/openapi/agent/threads/{thread_id}/archive", json=payload
79
+ )
80
+ return dict(response)
81
+
82
+ def stop_run(self, thread_id: str, partial_message: Optional[Any] = None) -> Dict[str, Any]:
83
+ """Stop active agent run."""
84
+ payload = {
85
+ "threadId": thread_id,
86
+ }
87
+ if partial_message is not None:
88
+ payload["partialMessage"] = partial_message
89
+ response = self._client._request("POST", "/api/openapi/agent/messages/stop", json=payload)
90
+ return dict(response)
91
+
92
+ def resume_message_stream(self, thread_id: str) -> Any:
93
+ """Resume agent message stream."""
94
+ return self._client._request(
95
+ "GET", f"/api/openapi/agent/messages/resume?threadId={thread_id}"
96
+ )
97
+
98
+ def create_attachment(
99
+ self, thread_id: str, filename: str, media_type: str, data: str
100
+ ) -> Dict[str, Any]:
101
+ """Create agent attachment."""
102
+ payload = {
103
+ "threadId": thread_id,
104
+ "filename": filename,
105
+ "mediaType": media_type,
106
+ "data": data,
107
+ }
108
+ response = self._client._request("POST", "/api/openapi/agent/attachments", json=payload)
109
+ return dict(response)
110
+
111
+ def delete_attachment(self, attachment_id: str) -> None:
112
+ """Delete agent attachment."""
113
+ self._client._request("DELETE", f"/api/openapi/agent/attachments/{attachment_id}")
114
+
115
+ def revert_action(self, action_id: str) -> Dict[str, Any]:
116
+ """Restore agent action snapshot."""
117
+ response = self._client._request("POST", f"/api/openapi/agent/actions/{action_id}/revert")
118
+ return dict(response)
119
+
120
+
121
+ class AsyncAgentAPI:
122
+ """Asynchronous AI Agent operations."""
123
+
124
+ def __init__(self, client) -> None:
125
+ self._client = client
126
+
127
+ async def list_threads(self) -> List[Dict[str, Any]]:
128
+ """List all active agent threads asynchronously."""
129
+ response = await self._client._request("GET", "/api/openapi/agent/threads")
130
+ return list(response)
131
+
132
+ async def get_thread(self, thread_id: str) -> Dict[str, Any]:
133
+ """Get details of a specific agent thread by ID asynchronously."""
134
+ response = await self._client._request("GET", f"/api/openapi/agent/threads/{thread_id}")
135
+ return dict(response)
136
+
137
+ async def delete_thread(self, thread_id: str) -> None:
138
+ """Delete an agent thread by ID asynchronously."""
139
+ await self._client._request("DELETE", f"/api/openapi/agent/threads/{thread_id}")
140
+
141
+ async def create_thread(
142
+ self, ai_provider_id: Optional[str] = None, source_resume_id: Optional[str] = None
143
+ ) -> Dict[str, Any]:
144
+ """Create a new agent thread asynchronously."""
145
+ payload = {}
146
+ if ai_provider_id is not None:
147
+ payload["aiProviderId"] = ai_provider_id
148
+ if source_resume_id is not None:
149
+ payload["sourceResumeId"] = source_resume_id
150
+ response = await self._client._request("POST", "/api/openapi/agent/threads", json=payload)
151
+ return dict(response)
152
+
153
+ async def get_or_create_thread_for_resume(
154
+ self, ai_provider_id: Optional[str] = None, source_resume_id: Optional[str] = None
155
+ ) -> Dict[str, Any]:
156
+ """Get or create an in-resume agent thread asynchronously."""
157
+ payload = {}
158
+ if ai_provider_id is not None:
159
+ payload["aiProviderId"] = ai_provider_id
160
+ if source_resume_id is not None:
161
+ payload["sourceResumeId"] = source_resume_id
162
+ response = await self._client._request(
163
+ "POST", "/api/openapi/agent/threads/for-resume", json=payload
164
+ )
165
+ return dict(response)
166
+
167
+ async def send_message(
168
+ self, thread_id: str, message: Any, attachment_ids: Optional[List[str]] = None
169
+ ) -> Dict[str, Any]:
170
+ """Send an agent message asynchronously."""
171
+ payload = {
172
+ "threadId": thread_id,
173
+ "message": message,
174
+ }
175
+ if attachment_ids is not None:
176
+ payload["attachmentIds"] = attachment_ids
177
+ response = await self._client._request(
178
+ "POST", "/api/openapi/agent/messages/send", json=payload
179
+ )
180
+ return dict(response)
181
+
182
+ async def archive_thread(
183
+ self,
184
+ thread_id: str,
185
+ ai_provider_id: Optional[str] = None,
186
+ source_resume_id: Optional[str] = None,
187
+ ) -> Dict[str, Any]:
188
+ """Archive an agent thread asynchronously."""
189
+ payload = {}
190
+ if ai_provider_id is not None:
191
+ payload["aiProviderId"] = ai_provider_id
192
+ if source_resume_id is not None:
193
+ payload["sourceResumeId"] = source_resume_id
194
+ response = await self._client._request(
195
+ "POST", f"/api/openapi/agent/threads/{thread_id}/archive", json=payload
196
+ )
197
+ return dict(response)
198
+
199
+ async def stop_run(
200
+ self, thread_id: str, partial_message: Optional[Any] = None
201
+ ) -> Dict[str, Any]:
202
+ """Stop active agent run asynchronously."""
203
+ payload = {
204
+ "threadId": thread_id,
205
+ }
206
+ if partial_message is not None:
207
+ payload["partialMessage"] = partial_message
208
+ response = await self._client._request(
209
+ "POST", "/api/openapi/agent/messages/stop", json=payload
210
+ )
211
+ return dict(response)
212
+
213
+ async def resume_message_stream(self, thread_id: str) -> Any:
214
+ """Resume agent message stream asynchronously."""
215
+ return await self._client._request(
216
+ "GET", f"/api/openapi/agent/messages/resume?threadId={thread_id}"
217
+ )
218
+
219
+ async def create_attachment(
220
+ self, thread_id: str, filename: str, media_type: str, data: str
221
+ ) -> Dict[str, Any]:
222
+ """Create agent attachment asynchronously."""
223
+ payload = {
224
+ "threadId": thread_id,
225
+ "filename": filename,
226
+ "mediaType": media_type,
227
+ "data": data,
228
+ }
229
+ response = await self._client._request(
230
+ "POST", "/api/openapi/agent/attachments", json=payload
231
+ )
232
+ return dict(response)
233
+
234
+ async def delete_attachment(self, attachment_id: str) -> None:
235
+ """Delete agent attachment asynchronously."""
236
+ await self._client._request("DELETE", f"/api/openapi/agent/attachments/{attachment_id}")
237
+
238
+ async def revert_action(self, action_id: str) -> Dict[str, Any]:
239
+ """Restore agent action snapshot asynchronously."""
240
+ response = await self._client._request(
241
+ "POST", f"/api/openapi/agent/actions/{action_id}/revert"
242
+ )
243
+ return dict(response)
@@ -0,0 +1,89 @@
1
+ """AI API endpoints implementation."""
2
+
3
+ from typing import Dict, Any
4
+
5
+
6
+ class AIAPI:
7
+ """Synchronous AI operations."""
8
+
9
+ def __init__(self, client) -> None:
10
+ self._client = client
11
+
12
+ def parse_pdf(self, file_name: str, file_data: str, provider_id: str) -> Dict[str, Any]:
13
+ """Parse a PDF file into resume data.
14
+
15
+ Args:
16
+ file_name: Name of the file.
17
+ file_data: Base64 or binary data representation.
18
+ provider_id: The ID of the configured AI provider.
19
+ """
20
+ payload = {
21
+ "file": {"name": file_name, "data": file_data},
22
+ "aiProviderId": provider_id,
23
+ }
24
+ response = self._client._request("POST", "/api/openapi/ai/parse-pdf", json=payload)
25
+ return dict(response)
26
+
27
+ def parse_docx(self, file_name: str, file_data: str, provider_id: str) -> Dict[str, Any]:
28
+ """Parse a DOCX file into resume data."""
29
+ payload = {
30
+ "file": {"name": file_name, "data": file_data},
31
+ "aiProviderId": provider_id,
32
+ }
33
+ response = self._client._request("POST", "/api/openapi/ai/parse-docx", json=payload)
34
+ return dict(response)
35
+
36
+ def chat(self, payload: Dict[str, Any]) -> Dict[str, Any]:
37
+ """Chat with AI to modify resume."""
38
+ response = self._client._request("POST", "/api/openapi/ai/chat", json=payload)
39
+ return dict(response)
40
+
41
+ def analyze_resume(self, resume_id: str, provider_id: str) -> Dict[str, Any]:
42
+ """Analyze a resume and persist the latest analysis."""
43
+ payload = {
44
+ "resumeId": resume_id,
45
+ "aiProviderId": provider_id,
46
+ }
47
+ response = self._client._request("POST", "/api/openapi/ai/analyze-resume", json=payload)
48
+ return dict(response)
49
+
50
+
51
+ class AsyncAIAPI:
52
+ """Asynchronous AI operations."""
53
+
54
+ def __init__(self, client) -> None:
55
+ self._client = client
56
+
57
+ async def parse_pdf(self, file_name: str, file_data: str, provider_id: str) -> Dict[str, Any]:
58
+ """Parse a PDF file into resume data asynchronously."""
59
+ payload = {
60
+ "file": {"name": file_name, "data": file_data},
61
+ "aiProviderId": provider_id,
62
+ }
63
+ response = await self._client._request("POST", "/api/openapi/ai/parse-pdf", json=payload)
64
+ return dict(response)
65
+
66
+ async def parse_docx(self, file_name: str, file_data: str, provider_id: str) -> Dict[str, Any]:
67
+ """Parse a DOCX file into resume data asynchronously."""
68
+ payload = {
69
+ "file": {"name": file_name, "data": file_data},
70
+ "aiProviderId": provider_id,
71
+ }
72
+ response = await self._client._request("POST", "/api/openapi/ai/parse-docx", json=payload)
73
+ return dict(response)
74
+
75
+ async def chat(self, payload: Dict[str, Any]) -> Dict[str, Any]:
76
+ """Chat with AI asynchronously to modify resume."""
77
+ response = await self._client._request("POST", "/api/openapi/ai/chat", json=payload)
78
+ return dict(response)
79
+
80
+ async def analyze_resume(self, resume_id: str, provider_id: str) -> Dict[str, Any]:
81
+ """Analyze a resume asynchronously and persist the latest analysis."""
82
+ payload = {
83
+ "resumeId": resume_id,
84
+ "aiProviderId": provider_id,
85
+ }
86
+ response = await self._client._request(
87
+ "POST", "/api/openapi/ai/analyze-resume", json=payload
88
+ )
89
+ return dict(response)
@@ -0,0 +1,89 @@
1
+ """AI Providers API endpoints implementation."""
2
+
3
+ from typing import List, Dict, Any
4
+
5
+
6
+ class AiProvidersAPI:
7
+ """Synchronous AI Providers operations."""
8
+
9
+ def __init__(self, client) -> None:
10
+ self._client = client
11
+
12
+ def list(self) -> List[Dict[str, Any]]:
13
+ """List all configured AI Providers."""
14
+ response = self._client._request("GET", "/api/openapi/ai-providers")
15
+ if isinstance(response, list):
16
+ return response
17
+ return [response]
18
+
19
+ def create(self, label: str, model: str, api_key: str, base_url: str = "") -> Dict[str, Any]:
20
+ """Create a new AI provider configuration."""
21
+ payload = {
22
+ "label": label,
23
+ "model": model,
24
+ "apiKey": api_key,
25
+ "baseURL": base_url,
26
+ }
27
+ response = self._client._request("POST", "/api/openapi/ai-providers", json=payload)
28
+ return dict(response)
29
+
30
+ def delete(self, provider_id: str) -> None:
31
+ """Delete an AI provider configuration."""
32
+ self._client._request("DELETE", f"/api/openapi/ai-providers/{provider_id}")
33
+
34
+ def test(self, provider_id: str) -> bool:
35
+ """Test the connection of a saved AI provider."""
36
+ response = self._client._request("POST", f"/api/openapi/ai-providers/{provider_id}/test")
37
+ return bool(response.get("success", True))
38
+
39
+ def update(self, provider_id: str, data: Dict[str, Any]) -> Dict[str, Any]:
40
+ """Update an AI provider configuration."""
41
+ response = self._client._request(
42
+ "PATCH", f"/api/openapi/ai-providers/{provider_id}", json=data
43
+ )
44
+ return dict(response)
45
+
46
+
47
+ class AsyncAiProvidersAPI:
48
+ """Asynchronous AI Providers operations."""
49
+
50
+ def __init__(self, client) -> None:
51
+ self._client = client
52
+
53
+ async def list(self) -> List[Dict[str, Any]]:
54
+ """List all configured AI Providers asynchronously."""
55
+ response = await self._client._request("GET", "/api/openapi/ai-providers")
56
+ if isinstance(response, list):
57
+ return response
58
+ return [response]
59
+
60
+ async def create(
61
+ self, label: str, model: str, api_key: str, base_url: str = ""
62
+ ) -> Dict[str, Any]:
63
+ """Create a new AI provider configuration asynchronously."""
64
+ payload = {
65
+ "label": label,
66
+ "model": model,
67
+ "apiKey": api_key,
68
+ "baseURL": base_url,
69
+ }
70
+ response = await self._client._request("POST", "/api/openapi/ai-providers", json=payload)
71
+ return dict(response)
72
+
73
+ async def delete(self, provider_id: str) -> None:
74
+ """Delete an AI provider configuration asynchronously."""
75
+ await self._client._request("DELETE", f"/api/openapi/ai-providers/{provider_id}")
76
+
77
+ async def test(self, provider_id: str) -> bool:
78
+ """Test the connection of a saved AI provider asynchronously."""
79
+ response = await self._client._request(
80
+ "POST", f"/api/openapi/ai-providers/{provider_id}/test"
81
+ )
82
+ return bool(response.get("success", True))
83
+
84
+ async def update(self, provider_id: str, data: Dict[str, Any]) -> Dict[str, Any]:
85
+ """Update an AI provider configuration asynchronously."""
86
+ response = await self._client._request(
87
+ "PATCH", f"/api/openapi/ai-providers/{provider_id}", json=data
88
+ )
89
+ return dict(response)
@@ -0,0 +1,100 @@
1
+ """Applications API endpoints implementation."""
2
+
3
+ from typing import List, Dict, Any
4
+ from ..models.application import Application, ApplicationCreate
5
+
6
+
7
+ class ApplicationsAPI:
8
+ """Synchronous Job Applications operations."""
9
+
10
+ def __init__(self, client) -> None:
11
+ self._client = client
12
+
13
+ def list(self) -> List[Application]:
14
+ """List all job applications."""
15
+ response = self._client._request("GET", "/api/openapi/applications")
16
+ if isinstance(response, dict) and "data" in response:
17
+ items = response["data"]
18
+ else:
19
+ items = response
20
+ return [Application.model_validate(item) for item in items]
21
+
22
+ def get(self, app_id: str) -> Application:
23
+ """Retrieve a specific job application by ID."""
24
+ response = self._client._request("GET", f"/api/openapi/applications/{app_id}")
25
+ return Application.model_validate(response)
26
+
27
+ def create(self, data: ApplicationCreate) -> Application:
28
+ """Log/create a new job application."""
29
+ payload = data.model_dump(by_alias=True, exclude_none=True)
30
+ response = self._client._request("POST", "/api/openapi/applications", json=payload)
31
+ return Application.model_validate(response)
32
+
33
+ def delete(self, app_id: str) -> None:
34
+ """Delete a job application by ID."""
35
+ self._client._request("DELETE", f"/api/openapi/applications/{app_id}")
36
+
37
+ def list_tags(self) -> List[str]:
38
+ """List all application tags."""
39
+ response = self._client._request("GET", "/api/openapi/applications/tags")
40
+ return list(response)
41
+
42
+ def get_pipeline_stats(self) -> Dict[str, Any]:
43
+ """Get application pipeline statistics."""
44
+ response = self._client._request("GET", "/api/openapi/applications/stats")
45
+ return dict(response)
46
+
47
+ def bulk_import(self, items: List[Dict[str, Any]]) -> Dict[str, Any]:
48
+ """Bulk import job applications."""
49
+ payload = {"items": items}
50
+ response = self._client._request("POST", "/api/openapi/applications/import", json=payload)
51
+ return dict(response)
52
+
53
+
54
+ class AsyncApplicationsAPI:
55
+ """Asynchronous Job Applications operations."""
56
+
57
+ def __init__(self, client) -> None:
58
+ self._client = client
59
+
60
+ async def list(self) -> List[Application]:
61
+ """List all job applications asynchronously."""
62
+ response = await self._client._request("GET", "/api/openapi/applications")
63
+ if isinstance(response, dict) and "data" in response:
64
+ items = response["data"]
65
+ else:
66
+ items = response
67
+ return [Application.model_validate(item) for item in items]
68
+
69
+ async def get(self, app_id: str) -> Application:
70
+ """Retrieve a specific job application by ID asynchronously."""
71
+ response = await self._client._request("GET", f"/api/openapi/applications/{app_id}")
72
+ return Application.model_validate(response)
73
+
74
+ async def create(self, data: ApplicationCreate) -> Application:
75
+ """Log/create a new job application asynchronously."""
76
+ payload = data.model_dump(by_alias=True, exclude_none=True)
77
+ response = await self._client._request("POST", "/api/openapi/applications", json=payload)
78
+ return Application.model_validate(response)
79
+
80
+ async def delete(self, app_id: str) -> None:
81
+ """Delete a job application by ID asynchronously."""
82
+ await self._client._request("DELETE", f"/api/openapi/applications/{app_id}")
83
+
84
+ async def list_tags(self) -> List[str]:
85
+ """List all application tags asynchronously."""
86
+ response = await self._client._request("GET", "/api/openapi/applications/tags")
87
+ return list(response)
88
+
89
+ async def get_pipeline_stats(self) -> Dict[str, Any]:
90
+ """Get application pipeline statistics asynchronously."""
91
+ response = await self._client._request("GET", "/api/openapi/applications/stats")
92
+ return dict(response)
93
+
94
+ async def bulk_import(self, items: List[Dict[str, Any]]) -> Dict[str, Any]:
95
+ """Bulk import job applications asynchronously."""
96
+ payload = {"items": items}
97
+ response = await self._client._request(
98
+ "POST", "/api/openapi/applications/import", json=payload
99
+ )
100
+ return dict(response)
@@ -1,7 +1,6 @@
1
1
  """Authentication endpoints implementation."""
2
2
 
3
- from typing import Tuple
4
- from ..models.user import User
3
+ from typing import List, Dict, Any
5
4
 
6
5
 
7
6
  class AuthAPI:
@@ -10,30 +9,19 @@ class AuthAPI:
10
9
  def __init__(self, client) -> None:
11
10
  self._client = client
12
11
 
13
- def login(self, email: str, password: str) -> Tuple[str, User]:
14
- """Log in with email and password.
12
+ def list_providers(self) -> List[str]:
13
+ """List all configured authentication providers."""
14
+ response = self._client._request("GET", "/api/openapi/auth/providers")
15
+ return list(response)
15
16
 
16
- Args:
17
- email: User's email.
18
- password: User's password.
17
+ def export_account(self) -> Dict[str, Any]:
18
+ """Export user account data."""
19
+ response = self._client._request("GET", "/api/openapi/auth/account/export")
20
+ return dict(response)
19
21
 
20
- Returns:
21
- A tuple of (access_token, User object).
22
- """
23
- payload = {"identifier": email, "password": password}
24
- response = self._client._request("POST", "/api/auth/login", json=payload)
25
-
26
- # Typically returns token in cookies or response body
27
- # Let's extract token and user
28
- token = response.get("token") or response.get("accessToken", "")
29
- user_data = response.get("user") or response
30
- user = User.model_validate(user_data)
31
- return token, user
32
-
33
- def me(self) -> User:
34
- """Get the current authenticated user profile."""
35
- response = self._client._request("GET", "/api/user/me")
36
- return User.model_validate(response)
22
+ def delete_account(self) -> None:
23
+ """Delete user account."""
24
+ self._client._request("DELETE", "/api/openapi/auth/account")
37
25
 
38
26
 
39
27
  class AsyncAuthAPI:
@@ -42,25 +30,16 @@ class AsyncAuthAPI:
42
30
  def __init__(self, client) -> None:
43
31
  self._client = client
44
32
 
45
- async def login(self, email: str, password: str) -> Tuple[str, User]:
46
- """Log in asynchronously with email and password.
47
-
48
- Args:
49
- email: User's email.
50
- password: User's password.
51
-
52
- Returns:
53
- A tuple of (access_token, User object).
54
- """
55
- payload = {"identifier": email, "password": password}
56
- response = await self._client._request("POST", "/api/auth/login", json=payload)
33
+ async def list_providers(self) -> List[str]:
34
+ """List all configured authentication providers asynchronously."""
35
+ response = await self._client._request("GET", "/api/openapi/auth/providers")
36
+ return list(response)
57
37
 
58
- token = response.get("token") or response.get("accessToken", "")
59
- user_data = response.get("user") or response
60
- user = User.model_validate(user_data)
61
- return token, user
38
+ async def export_account(self) -> Dict[str, Any]:
39
+ """Export user account data asynchronously."""
40
+ response = await self._client._request("GET", "/api/openapi/auth/account/export")
41
+ return dict(response)
62
42
 
63
- async def me(self) -> User:
64
- """Get the current authenticated user profile asynchronously."""
65
- response = await self._client._request("GET", "/api/user/me")
66
- return User.model_validate(response)
43
+ async def delete_account(self) -> None:
44
+ """Delete user account asynchronously."""
45
+ await self._client._request("DELETE", "/api/openapi/auth/account")
@@ -0,0 +1,27 @@
1
+ """Flags API endpoints implementation."""
2
+
3
+ from typing import Dict, Any
4
+
5
+
6
+ class FlagsAPI:
7
+ """Synchronous Flags operations."""
8
+
9
+ def __init__(self, client) -> None:
10
+ self._client = client
11
+
12
+ def list(self) -> Dict[str, Any]:
13
+ """List all available feature flags."""
14
+ response = self._client._request("GET", "/api/openapi/flags")
15
+ return dict(response)
16
+
17
+
18
+ class AsyncFlagsAPI:
19
+ """Asynchronous Flags operations."""
20
+
21
+ def __init__(self, client) -> None:
22
+ self._client = client
23
+
24
+ async def list(self) -> Dict[str, Any]:
25
+ """List all available feature flags asynchronously."""
26
+ response = await self._client._request("GET", "/api/openapi/flags")
27
+ return dict(response)