codemie-sdk-python 0.1.712__py3-none-any.whl → 0.1.713__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.
@@ -100,6 +100,19 @@ class UserProjectsResponse(BaseModel):
100
100
  projects: List[AdminUserProject] = []
101
101
 
102
102
 
103
+ class AdminUserConversation(BaseModel):
104
+ """A conversation fetched by (user_id, conversation_id) via the admin API.
105
+
106
+ Only the fields the SDK's admin remap/ownership checks need; the backend
107
+ document carries many more (history, assistant data, etc.).
108
+ """
109
+
110
+ model_config = ConfigDict(extra="ignore")
111
+
112
+ conversation_id: str
113
+ user_id: Optional[str] = None
114
+
115
+
103
116
  class User(BaseModel):
104
117
  """Model representing a user profile."""
105
118
 
@@ -3,6 +3,7 @@
3
3
  from typing import Any, Dict, List, Optional
4
4
 
5
5
  from ..models.user import (
6
+ AdminUserConversation,
6
7
  AdminUserProject,
7
8
  CodeMieUserDetail,
8
9
  PaginatedUserListResponse,
@@ -220,3 +221,43 @@ class UserService:
220
221
  CodeMieUserDetail,
221
222
  wrap_response=False,
222
223
  )
224
+
225
+ def remap_user(self, old_user_id: str, new_user_id: str) -> CodeMieUserDetail:
226
+ """Remap a pre-Keycloak user id to a new id (SuperAdmin only).
227
+
228
+ Rewrites the user's row and every table that references it (true FKs,
229
+ denormalized user_id/created_by columns, JSONB CreatedByUser blobs) from
230
+ `old_user_id` to `new_user_id` in one transaction. Re-running the same pair
231
+ after a successful remap is a no-op that returns the existing user.
232
+
233
+ Args:
234
+ old_user_id: The id currently on the row.
235
+ new_user_id: The id to move the row (and its content) to.
236
+
237
+ Returns:
238
+ The remapped user's details, at its new id.
239
+ """
240
+ return self._api.post(
241
+ "/v1/admin/users/remap",
242
+ CodeMieUserDetail,
243
+ json_data={"old_user_id": old_user_id, "new_user_id": new_user_id},
244
+ wrap_response=False,
245
+ )
246
+
247
+ def get_admin_user_conversation(
248
+ self, user_id: str, conversation_id: str
249
+ ) -> AdminUserConversation:
250
+ """Get a conversation, scoped to the user id it must belong to (admin only).
251
+
252
+ Args:
253
+ user_id: The id the conversation's `user_id` must match.
254
+ conversation_id: The conversation's unique identifier.
255
+
256
+ Returns:
257
+ The conversation, including its own `user_id`.
258
+ """
259
+ return self._api.get(
260
+ f"/v1/admin/users/{user_id}/conversations/{conversation_id}",
261
+ AdminUserConversation,
262
+ wrap_response=False,
263
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codemie-sdk-python
3
- Version: 0.1.712
3
+ Version: 0.1.713
4
4
  Summary: CodeMie SDK for Python
5
5
  License: Apache-2.0
6
6
  Author: CodeMie
@@ -33,7 +33,7 @@ codemie_sdk/models/provisioning.py,sha256=hN7veiRThhKQd8tTFPfPBGX1KFfTiwE_T2M00h
33
33
  codemie_sdk/models/skill.py,sha256=KE4lsF8TMxIQa_UE0oRDMT6XIEHqKjsDyi0HYKEp1mM,6918
34
34
  codemie_sdk/models/task.py,sha256=YHu5DRnECS2wnqIWZ_YH8Z72p1I4aV3xWFW5joxN_8Q,1442
35
35
  codemie_sdk/models/usage_attribution.py,sha256=uMHmtcTGD65kf6ZWHvNpRGwpV-kAUl1b5S01vq76OV0,4444
36
- codemie_sdk/models/user.py,sha256=hHQW0lEhGJllGSIY4oD-fMr3jS9NRJX5e5UohcA9CsQ,4360
36
+ codemie_sdk/models/user.py,sha256=dIJxlINRDBld3KIkLBfdfmJpdta7HAo0soPoQG_nZv0,4738
37
37
  codemie_sdk/models/vendor_assistant.py,sha256=vdpFq8aRlLj7IgRMWTA6pkrq8HZty8rgwA-kWrKKf3A,6357
38
38
  codemie_sdk/models/vendor_guardrail.py,sha256=dQtuFZXFUs_IUQlnPQth0Sd49Sx9gfDtkA2bB2Qh5e0,5227
39
39
  codemie_sdk/models/vendor_knowledgebase.py,sha256=fDj526KDJocx1Tn_B0uP3UQ5e89RMvesExFPwyeqME0,4996
@@ -70,7 +70,7 @@ codemie_sdk/services/provisioning.py,sha256=NlgrSOCBML_a8PqcTQbje2OA7Mf_BVTq0Ozp
70
70
  codemie_sdk/services/skill.py,sha256=0mExdeKTMNqkEpKafD0ya1WyLj9CMCFaprkggKYqnQg,13216
71
71
  codemie_sdk/services/task.py,sha256=UaYh__xGF7VKWCJKPrncVjTvx46Gz1AN9XczPVL71oA,1052
72
72
  codemie_sdk/services/usage_attribution.py,sha256=iLjs4trg3Fj_uapLW1PAHgrtkVb2hiTPjRKOvO1vdaY,10782
73
- codemie_sdk/services/user.py,sha256=akK4HNC2-qrZP-Fd3ZGGDVQmosFhfkWDu4A1-aF6KqA,7180
73
+ codemie_sdk/services/user.py,sha256=ES8MkyF3SjSYyZOeuVeJNleSkVo78h3DwGY4kBKx3MU,8755
74
74
  codemie_sdk/services/vendor_assistant.py,sha256=Vwa0rH8TYTCV1iAeKuSP5skbX8V04NLXE0g9VQRKqGI,13484
75
75
  codemie_sdk/services/vendor_guardrail.py,sha256=HFDRPKb1wXhz4sG_XUISLcBHvZB2bJkqxLCUlG_SS5Q,14280
76
76
  codemie_sdk/services/vendor_knowledgebase.py,sha256=p0SWNdBg-zXfaco0edbBUQbp7wgqvi0UmcNofPH2FX4,10415
@@ -83,6 +83,6 @@ codemie_sdk/services/workflow_execution_state.py,sha256=u1xmGvaHjqvQS5ujhyvJ_Ac7
83
83
  codemie_sdk/services/workspace.py,sha256=eLwZ0fhi1BfOesrXaQlTdOll8q7ENP9b_jb5eybKSVw,5038
84
84
  codemie_sdk/utils/__init__.py,sha256=EzK_UrS5KHmAnE73Hci9LaObB5omjVUhIq4svh0gfwo,137
85
85
  codemie_sdk/utils/http.py,sha256=PWejBKa5pwzQ5eLVhdN8lYKEu1B1QtwGTRmZfnGFL6c,14158
86
- codemie_sdk_python-0.1.712.dist-info/METADATA,sha256=8sgXChkzMhIpoR8bkmFPo4GKkU-99cyeEEroOyxNHH8,51375
87
- codemie_sdk_python-0.1.712.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
88
- codemie_sdk_python-0.1.712.dist-info/RECORD,,
86
+ codemie_sdk_python-0.1.713.dist-info/METADATA,sha256=AvAM0hgjos7K-0B47DghQkoYJfKgU1JbcVHqBIwBDdw,51375
87
+ codemie_sdk_python-0.1.713.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
88
+ codemie_sdk_python-0.1.713.dist-info/RECORD,,