code-analysis-client 1.0.4__tar.gz → 1.0.5__tar.gz
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.
- {code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/PKG-INFO +1 -1
- {code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client/file_session.py +23 -6
- code_analysis_client-1.0.5/code_analysis_client/version.txt +1 -0
- {code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client.egg-info/PKG-INFO +1 -1
- code_analysis_client-1.0.4/code_analysis_client/version.txt +0 -1
- {code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/README.md +0 -0
- {code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client/__init__.py +0 -0
- {code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client/client.py +0 -0
- {code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client/commands_proxy.py +0 -0
- {code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client/config.py +0 -0
- {code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client/exceptions.py +0 -0
- {code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client/py.typed +0 -0
- {code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client/responses.py +0 -0
- {code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client/server_api.py +0 -0
- {code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client/server_schema.py +0 -0
- {code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client/universal_file.py +0 -0
- {code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client/validation.py +0 -0
- {code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client.egg-info/SOURCES.txt +0 -0
- {code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client.egg-info/dependency_links.txt +0 -0
- {code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client.egg-info/requires.txt +0 -0
- {code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client.egg-info/top_level.txt +0 -0
- {code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/pyproject.toml +0 -0
- {code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/setup.cfg +0 -0
{code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client/file_session.py
RENAMED
|
@@ -32,6 +32,18 @@ def _unwrap(data: Dict[str, Any]) -> Dict[str, Any]:
|
|
|
32
32
|
)
|
|
33
33
|
|
|
34
34
|
|
|
35
|
+
def _extract_file_id(payload: Dict[str, Any], *, field: str = "file_id") -> str:
|
|
36
|
+
"""Return non-empty ``file_id`` from a command payload or raise."""
|
|
37
|
+
fid = str(payload.get(field) or "").strip()
|
|
38
|
+
if not fid:
|
|
39
|
+
raise ClientValidationError(
|
|
40
|
+
f"{field} missing from server response",
|
|
41
|
+
field=field,
|
|
42
|
+
details=payload,
|
|
43
|
+
)
|
|
44
|
+
return fid
|
|
45
|
+
|
|
46
|
+
|
|
35
47
|
class FileSessionClient:
|
|
36
48
|
"""Session-scoped file download/upload and lock helpers."""
|
|
37
49
|
|
|
@@ -217,7 +229,7 @@ class FileSessionClient:
|
|
|
217
229
|
chunk_size: Optional[int] = None,
|
|
218
230
|
include_backup_history: bool = False,
|
|
219
231
|
) -> Dict[str, Any]:
|
|
220
|
-
"""
|
|
232
|
+
"""Begin chunked download; returns payload including ``file_id`` and ``transfer_id``."""
|
|
221
233
|
await self.assert_session_exists(session_id)
|
|
222
234
|
params: Dict[str, Any] = {
|
|
223
235
|
"session_id": session_id,
|
|
@@ -233,12 +245,14 @@ class FileSessionClient:
|
|
|
233
245
|
params["file_path"] = file_path
|
|
234
246
|
if chunk_size is not None:
|
|
235
247
|
params["chunk_size"] = chunk_size
|
|
236
|
-
|
|
248
|
+
payload = _unwrap(
|
|
237
249
|
await self._client.call_validated(
|
|
238
250
|
"project_file_transfer_download_begin",
|
|
239
251
|
params,
|
|
240
252
|
)
|
|
241
253
|
)
|
|
254
|
+
_extract_file_id(payload)
|
|
255
|
+
return payload
|
|
242
256
|
|
|
243
257
|
async def download_to_path(
|
|
244
258
|
self,
|
|
@@ -262,7 +276,7 @@ class FileSessionClient:
|
|
|
262
276
|
compression: str = "identity",
|
|
263
277
|
lock_mode: str = "full",
|
|
264
278
|
) -> Tuple[Dict[str, Any], Any]:
|
|
265
|
-
"""Download + lock
|
|
279
|
+
"""Download + lock; returns (begin_payload with ``file_id``, download_receipt)."""
|
|
266
280
|
begin = await self.begin_download_locked(
|
|
267
281
|
session_id,
|
|
268
282
|
project_id=project_id,
|
|
@@ -313,7 +327,7 @@ class FileSessionClient:
|
|
|
313
327
|
dry_run: bool = False,
|
|
314
328
|
backup: bool = True,
|
|
315
329
|
) -> Dict[str, Any]:
|
|
316
|
-
"""Persist uploaded buffer and release locks
|
|
330
|
+
"""Persist uploaded buffer and release locks; response includes ``file_id``."""
|
|
317
331
|
await self.assert_session_exists(session_id)
|
|
318
332
|
params: Dict[str, Any] = {
|
|
319
333
|
"session_id": session_id,
|
|
@@ -328,12 +342,15 @@ class FileSessionClient:
|
|
|
328
342
|
params["file_id"] = file_id
|
|
329
343
|
if file_path is not None:
|
|
330
344
|
params["file_path"] = file_path
|
|
331
|
-
|
|
345
|
+
payload = _unwrap(
|
|
332
346
|
await self._client.call_validated(
|
|
333
347
|
"project_file_transfer_upload_save",
|
|
334
348
|
params,
|
|
335
349
|
)
|
|
336
350
|
)
|
|
351
|
+
if not dry_run:
|
|
352
|
+
_extract_file_id(payload)
|
|
353
|
+
return payload
|
|
337
354
|
|
|
338
355
|
async def upload_file_and_unlock(
|
|
339
356
|
self,
|
|
@@ -348,7 +365,7 @@ class FileSessionClient:
|
|
|
348
365
|
unlock_after_write: bool = True,
|
|
349
366
|
backup: bool = True,
|
|
350
367
|
) -> Dict[str, Any]:
|
|
351
|
-
"""Upload bytes
|
|
368
|
+
"""Upload bytes, save to project file, unlock; returns save payload with ``file_id``."""
|
|
352
369
|
name = filename or (Path(file_path).name if file_path else "payload.bin")
|
|
353
370
|
receipt = await self.upload_bytes(
|
|
354
371
|
payload,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.0.5
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.0.4
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client/commands_proxy.py
RENAMED
|
File without changes
|
|
File without changes
|
{code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client/exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client/server_api.py
RENAMED
|
File without changes
|
{code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client/server_schema.py
RENAMED
|
File without changes
|
{code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client/universal_file.py
RENAMED
|
File without changes
|
{code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client/validation.py
RENAMED
|
File without changes
|
{code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{code_analysis_client-1.0.4 → code_analysis_client-1.0.5}/code_analysis_client.egg-info/requires.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|