fleet-python 0.2.108__tar.gz → 0.2.110__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.
- {fleet_python-0.2.108/fleet_python.egg-info → fleet_python-0.2.110}/PKG-INFO +1 -1
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/__init__.py +1 -1
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/__init__.py +1 -1
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/base.py +1 -1
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/resources/filesystem.py +11 -38
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/resources/sqlite.py +9 -4
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/base.py +1 -1
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/instance/models.py +1 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/resources/filesystem.py +11 -38
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/resources/sqlite.py +12 -7
- {fleet_python-0.2.108 → fleet_python-0.2.110/fleet_python.egg-info}/PKG-INFO +1 -1
- {fleet_python-0.2.108 → fleet_python-0.2.110}/pyproject.toml +1 -1
- {fleet_python-0.2.108 → fleet_python-0.2.110}/LICENSE +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/README.md +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/diff_example.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/dsl_example.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/example.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/exampleResume.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/example_account.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/example_action_log.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/example_client.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/example_mcp_anthropic.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/example_mcp_openai.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/example_sync.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/example_task.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/example_tasks.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/example_verifier.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/export_tasks.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/export_tasks_filtered.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/fetch_tasks.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/gemini_example.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/import_tasks.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/iterate_verifiers.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/json_tasks_example.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/nova_act_example.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/openai_example.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/openai_simple_example.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/query_builder_example.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/quickstart.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/examples/test_cdp_logging.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/client.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/env/__init__.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/env/client.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/exceptions.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/global_client.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/instance/__init__.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/instance/base.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/instance/client.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/models.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/resources/__init__.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/resources/api.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/resources/base.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/resources/browser.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/resources/mcp.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/tasks.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/verifiers/__init__.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/verifiers/bundler.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/_async/verifiers/verifier.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/agent/__init__.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/agent/gemini_cua/Dockerfile +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/agent/gemini_cua/__init__.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/agent/gemini_cua/agent.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/agent/gemini_cua/mcp/main.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/agent/gemini_cua/mcp_server/__init__.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/agent/gemini_cua/mcp_server/main.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/agent/gemini_cua/mcp_server/tools.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/agent/gemini_cua/requirements.txt +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/agent/gemini_cua/start.sh +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/agent/orchestrator.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/agent/types.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/agent/utils.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/cli.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/client.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/config.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/env/__init__.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/env/client.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/eval/__init__.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/eval/uploader.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/exceptions.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/global_client.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/instance/__init__.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/instance/base.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/instance/client.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/models.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/proxy/__init__.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/proxy/proxy.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/proxy/whitelist.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/resources/__init__.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/resources/api.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/resources/base.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/resources/browser.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/resources/mcp.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/tasks.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/types.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/utils/__init__.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/utils/http_logging.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/utils/logging.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/utils/playwright.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/verifiers/__init__.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/verifiers/bundler.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/verifiers/code.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/verifiers/db.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/verifiers/decorator.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/verifiers/parse.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/verifiers/sql_differ.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet/verifiers/verifier.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet_python.egg-info/SOURCES.txt +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet_python.egg-info/dependency_links.txt +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet_python.egg-info/entry_points.txt +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet_python.egg-info/requires.txt +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/fleet_python.egg-info/top_level.txt +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/scripts/fix_sync_imports.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/scripts/unasync.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/setup.cfg +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/tests/__init__.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/tests/test_app_method.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/tests/test_expect_exactly.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/tests/test_expect_only.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/tests/test_instance_dispatch.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/tests/test_sqlite_resource_dual_mode.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/tests/test_sqlite_shared_memory_behavior.py +0 -0
- {fleet_python-0.2.108 → fleet_python-0.2.110}/tests/test_verifier_from_string.py +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from typing import Any, Dict, List, Optional
|
|
2
2
|
from ...instance.models import (
|
|
3
3
|
Resource as ResourceModel,
|
|
4
|
-
FsDiffRequest,
|
|
5
4
|
FsDiffResponse,
|
|
6
5
|
FsFileDiffEntry,
|
|
7
6
|
FileStateRequest,
|
|
@@ -24,7 +23,11 @@ if TYPE_CHECKING:
|
|
|
24
23
|
# Document extensions that need /fs/doc/text for readable content extraction
|
|
25
24
|
_DOC_EXTENSIONS = {
|
|
26
25
|
".docx", ".doc", ".pptx", ".ppt", ".xlsx", ".xls",
|
|
27
|
-
".
|
|
26
|
+
".xlsm", ".xltx", ".xltm",
|
|
27
|
+
".odt", ".ott", ".odm", ".ods", ".ots", ".odp", ".otp",
|
|
28
|
+
".odg", ".otg", ".odf",
|
|
29
|
+
".rtf", ".pdf", ".epub",
|
|
30
|
+
".xps", ".oxps", ".fb2", ".cbz", ".mobi",
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
|
|
@@ -246,26 +249,23 @@ class AsyncFilesystemResource(Resource):
|
|
|
246
249
|
include_content: bool = True,
|
|
247
250
|
max_content_size: int = 102400,
|
|
248
251
|
exclude_patterns: Optional[List[str]] = None,
|
|
252
|
+
extract_documents: bool = True,
|
|
249
253
|
) -> AsyncFilesystemDiff:
|
|
250
254
|
"""Get filesystem diff from the environment.
|
|
251
255
|
|
|
252
256
|
Args:
|
|
253
|
-
include_content:
|
|
254
|
-
max_content_size:
|
|
255
|
-
exclude_patterns:
|
|
257
|
+
include_content: Kept for backwards compatibility, ignored by server
|
|
258
|
+
max_content_size: Kept for backwards compatibility, ignored by server
|
|
259
|
+
exclude_patterns: Kept for backwards compatibility, ignored by server
|
|
260
|
+
extract_documents: Kept for backwards compatibility, ignored by server
|
|
256
261
|
|
|
257
262
|
Returns:
|
|
258
263
|
AsyncFilesystemDiff with assertion helpers
|
|
259
264
|
"""
|
|
260
|
-
request = FsDiffRequest(
|
|
261
|
-
include_content=include_content,
|
|
262
|
-
max_content_size=max_content_size,
|
|
263
|
-
exclude_patterns=exclude_patterns,
|
|
264
|
-
)
|
|
265
265
|
response = await self.client.request(
|
|
266
266
|
"POST",
|
|
267
267
|
"/diff/fs",
|
|
268
|
-
json=
|
|
268
|
+
json={},
|
|
269
269
|
)
|
|
270
270
|
result = response.json()
|
|
271
271
|
fs_response = FsDiffResponse(**result)
|
|
@@ -275,33 +275,6 @@ class AsyncFilesystemResource(Resource):
|
|
|
275
275
|
)
|
|
276
276
|
return AsyncFilesystemDiff(fs_response, self)
|
|
277
277
|
|
|
278
|
-
async def diff_simple(
|
|
279
|
-
self,
|
|
280
|
-
include_content: bool = True,
|
|
281
|
-
max_content_size: int = 102400,
|
|
282
|
-
) -> AsyncFilesystemDiff:
|
|
283
|
-
"""Get filesystem diff using the simple GET endpoint.
|
|
284
|
-
|
|
285
|
-
Args:
|
|
286
|
-
include_content: Whether to include file contents (default True)
|
|
287
|
-
max_content_size: Max file size to include content for (default 100KB)
|
|
288
|
-
|
|
289
|
-
Returns:
|
|
290
|
-
AsyncFilesystemDiff with assertion helpers
|
|
291
|
-
"""
|
|
292
|
-
params = {
|
|
293
|
-
"include_content": include_content,
|
|
294
|
-
"max_content_size": max_content_size,
|
|
295
|
-
}
|
|
296
|
-
response = await self.client.request("GET", "/diff/fs", params=params)
|
|
297
|
-
result = response.json()
|
|
298
|
-
fs_response = FsDiffResponse(**result)
|
|
299
|
-
if not fs_response.success:
|
|
300
|
-
raise RuntimeError(
|
|
301
|
-
f"Filesystem diff failed: {fs_response.error or fs_response.message}"
|
|
302
|
-
)
|
|
303
|
-
return AsyncFilesystemDiff(fs_response, self)
|
|
304
|
-
|
|
305
278
|
# ── Single file endpoints ─────────────────────────────────────────
|
|
306
279
|
|
|
307
280
|
async def file(
|
|
@@ -99,10 +99,11 @@ class AsyncDatabaseSnapshot:
|
|
|
99
99
|
self,
|
|
100
100
|
other: "AsyncDatabaseSnapshot",
|
|
101
101
|
ignore_config: Optional[IgnoreConfig] = None,
|
|
102
|
+
use_structured_diff: bool = False,
|
|
102
103
|
) -> "AsyncSnapshotDiff":
|
|
103
104
|
"""Compare this snapshot with another."""
|
|
104
105
|
# No need to fetch all data upfront - diff will fetch on demand
|
|
105
|
-
return AsyncSnapshotDiff(self, other, ignore_config)
|
|
106
|
+
return AsyncSnapshotDiff(self, other, ignore_config, use_structured_diff=use_structured_diff)
|
|
106
107
|
|
|
107
108
|
|
|
108
109
|
class AsyncSnapshotQueryBuilder:
|
|
@@ -275,10 +276,12 @@ class AsyncSnapshotDiff:
|
|
|
275
276
|
before: AsyncDatabaseSnapshot,
|
|
276
277
|
after: AsyncDatabaseSnapshot,
|
|
277
278
|
ignore_config: Optional[IgnoreConfig] = None,
|
|
279
|
+
use_structured_diff: bool = False,
|
|
278
280
|
):
|
|
279
281
|
self.before = before
|
|
280
282
|
self.after = after
|
|
281
283
|
self.ignore_config = ignore_config or IgnoreConfig()
|
|
284
|
+
self.use_structured_diff = use_structured_diff
|
|
282
285
|
self._cached: Optional[Dict[str, Any]] = None
|
|
283
286
|
self._targeted_mode = False # Flag to use targeted queries
|
|
284
287
|
|
|
@@ -1766,8 +1769,7 @@ class AsyncSnapshotDiff:
|
|
|
1766
1769
|
return await self._expect_no_changes()
|
|
1767
1770
|
|
|
1768
1771
|
resource = self.after.resource
|
|
1769
|
-
|
|
1770
|
-
if False and resource.client is not None and resource._mode == "http":
|
|
1772
|
+
if self.use_structured_diff and resource.client is not None and resource._mode == "http":
|
|
1771
1773
|
api_diff = None
|
|
1772
1774
|
try:
|
|
1773
1775
|
payload = {}
|
|
@@ -2478,12 +2480,15 @@ class AsyncSQLiteResource(Resource):
|
|
|
2478
2480
|
self,
|
|
2479
2481
|
other: "AsyncSQLiteResource",
|
|
2480
2482
|
ignore_config: Optional[IgnoreConfig] = None,
|
|
2483
|
+
use_structured_diff: bool = False,
|
|
2481
2484
|
) -> AsyncSnapshotDiff:
|
|
2482
2485
|
"""Compare this database with another AsyncSQLiteResource.
|
|
2483
2486
|
|
|
2484
2487
|
Args:
|
|
2485
2488
|
other: Another AsyncSQLiteResource to compare against
|
|
2486
2489
|
ignore_config: Optional configuration for ignoring specific tables/fields
|
|
2490
|
+
use_structured_diff: If True, use server-side structured diff API in expect_only_v2.
|
|
2491
|
+
Defaults to False (local diff only).
|
|
2487
2492
|
|
|
2488
2493
|
Returns:
|
|
2489
2494
|
AsyncSnapshotDiff: Object containing the differences between the two databases
|
|
@@ -2497,4 +2502,4 @@ class AsyncSQLiteResource(Resource):
|
|
|
2497
2502
|
)
|
|
2498
2503
|
|
|
2499
2504
|
# Return the diff between the snapshots
|
|
2500
|
-
return await before_snapshot.diff(after_snapshot, ignore_config)
|
|
2505
|
+
return await before_snapshot.diff(after_snapshot, ignore_config, use_structured_diff=use_structured_diff)
|
|
@@ -146,6 +146,7 @@ class FsDiffRequest(BaseModel):
|
|
|
146
146
|
include_content: bool = Field(True, title="Include Content")
|
|
147
147
|
max_content_size: int = Field(102400, title="Max Content Size")
|
|
148
148
|
exclude_patterns: Optional[List[str]] = Field(None, title="Exclude Patterns")
|
|
149
|
+
extract_documents: bool = Field(True, title="Extract Documents")
|
|
149
150
|
|
|
150
151
|
|
|
151
152
|
class FsFileDiffEntry(BaseModel):
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from typing import Any, Dict, List, Optional
|
|
2
2
|
from ..instance.models import (
|
|
3
3
|
Resource as ResourceModel,
|
|
4
|
-
FsDiffRequest,
|
|
5
4
|
FsDiffResponse,
|
|
6
5
|
FsFileDiffEntry,
|
|
7
6
|
FileStateRequest,
|
|
@@ -24,7 +23,11 @@ if TYPE_CHECKING:
|
|
|
24
23
|
# Document extensions that need /fs/doc/text for readable content extraction
|
|
25
24
|
_DOC_EXTENSIONS = {
|
|
26
25
|
".docx", ".doc", ".pptx", ".ppt", ".xlsx", ".xls",
|
|
27
|
-
".
|
|
26
|
+
".xlsm", ".xltx", ".xltm",
|
|
27
|
+
".odt", ".ott", ".odm", ".ods", ".ots", ".odp", ".otp",
|
|
28
|
+
".odg", ".otg", ".odf",
|
|
29
|
+
".rtf", ".pdf", ".epub",
|
|
30
|
+
".xps", ".oxps", ".fb2", ".cbz", ".mobi",
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
|
|
@@ -246,26 +249,23 @@ class FilesystemResource(Resource):
|
|
|
246
249
|
include_content: bool = True,
|
|
247
250
|
max_content_size: int = 102400,
|
|
248
251
|
exclude_patterns: Optional[List[str]] = None,
|
|
252
|
+
extract_documents: bool = True,
|
|
249
253
|
) -> SyncFilesystemDiff:
|
|
250
254
|
"""Get filesystem diff from the environment.
|
|
251
255
|
|
|
252
256
|
Args:
|
|
253
|
-
include_content:
|
|
254
|
-
max_content_size:
|
|
255
|
-
exclude_patterns:
|
|
257
|
+
include_content: Kept for backwards compatibility, ignored by server
|
|
258
|
+
max_content_size: Kept for backwards compatibility, ignored by server
|
|
259
|
+
exclude_patterns: Kept for backwards compatibility, ignored by server
|
|
260
|
+
extract_documents: Kept for backwards compatibility, ignored by server
|
|
256
261
|
|
|
257
262
|
Returns:
|
|
258
263
|
SyncFilesystemDiff with assertion helpers
|
|
259
264
|
"""
|
|
260
|
-
request = FsDiffRequest(
|
|
261
|
-
include_content=include_content,
|
|
262
|
-
max_content_size=max_content_size,
|
|
263
|
-
exclude_patterns=exclude_patterns,
|
|
264
|
-
)
|
|
265
265
|
response = self.client.request(
|
|
266
266
|
"POST",
|
|
267
267
|
"/diff/fs",
|
|
268
|
-
json=
|
|
268
|
+
json={},
|
|
269
269
|
)
|
|
270
270
|
result = response.json()
|
|
271
271
|
fs_response = FsDiffResponse(**result)
|
|
@@ -275,33 +275,6 @@ class FilesystemResource(Resource):
|
|
|
275
275
|
)
|
|
276
276
|
return SyncFilesystemDiff(fs_response, self)
|
|
277
277
|
|
|
278
|
-
def diff_simple(
|
|
279
|
-
self,
|
|
280
|
-
include_content: bool = True,
|
|
281
|
-
max_content_size: int = 102400,
|
|
282
|
-
) -> SyncFilesystemDiff:
|
|
283
|
-
"""Get filesystem diff using the simple GET endpoint.
|
|
284
|
-
|
|
285
|
-
Args:
|
|
286
|
-
include_content: Whether to include file contents (default True)
|
|
287
|
-
max_content_size: Max file size to include content for (default 100KB)
|
|
288
|
-
|
|
289
|
-
Returns:
|
|
290
|
-
SyncFilesystemDiff with assertion helpers
|
|
291
|
-
"""
|
|
292
|
-
params = {
|
|
293
|
-
"include_content": include_content,
|
|
294
|
-
"max_content_size": max_content_size,
|
|
295
|
-
}
|
|
296
|
-
response = self.client.request("GET", "/diff/fs", params=params)
|
|
297
|
-
result = response.json()
|
|
298
|
-
fs_response = FsDiffResponse(**result)
|
|
299
|
-
if not fs_response.success:
|
|
300
|
-
raise RuntimeError(
|
|
301
|
-
f"Filesystem diff failed: {fs_response.error or fs_response.message}"
|
|
302
|
-
)
|
|
303
|
-
return SyncFilesystemDiff(fs_response, self)
|
|
304
|
-
|
|
305
278
|
# ── Single file endpoints ─────────────────────────────────────────
|
|
306
279
|
|
|
307
280
|
def file(
|
|
@@ -98,10 +98,11 @@ class SyncDatabaseSnapshot:
|
|
|
98
98
|
self,
|
|
99
99
|
other: "SyncDatabaseSnapshot",
|
|
100
100
|
ignore_config: Optional[IgnoreConfig] = None,
|
|
101
|
+
use_structured_diff: bool = False,
|
|
101
102
|
) -> "SyncSnapshotDiff":
|
|
102
103
|
"""Compare this snapshot with another."""
|
|
103
104
|
# No need to fetch all data upfront - diff will fetch on demand
|
|
104
|
-
return SyncSnapshotDiff(self, other, ignore_config)
|
|
105
|
+
return SyncSnapshotDiff(self, other, ignore_config, use_structured_diff=use_structured_diff)
|
|
105
106
|
|
|
106
107
|
|
|
107
108
|
class SyncSnapshotQueryBuilder:
|
|
@@ -274,10 +275,12 @@ class SyncSnapshotDiff:
|
|
|
274
275
|
before: SyncDatabaseSnapshot,
|
|
275
276
|
after: SyncDatabaseSnapshot,
|
|
276
277
|
ignore_config: Optional[IgnoreConfig] = None,
|
|
278
|
+
use_structured_diff: bool = False,
|
|
277
279
|
):
|
|
278
280
|
self.before = before
|
|
279
281
|
self.after = after
|
|
280
282
|
self.ignore_config = ignore_config or IgnoreConfig()
|
|
283
|
+
self.use_structured_diff = use_structured_diff
|
|
281
284
|
self._cached: Optional[Dict[str, Any]] = None
|
|
282
285
|
self._targeted_mode = False # Flag to use targeted queries
|
|
283
286
|
|
|
@@ -1814,8 +1817,7 @@ class SyncSnapshotDiff:
|
|
|
1814
1817
|
return self._expect_no_changes()
|
|
1815
1818
|
|
|
1816
1819
|
resource = self.after.resource
|
|
1817
|
-
|
|
1818
|
-
if False and resource.client is not None and resource._mode == "http":
|
|
1820
|
+
if self.use_structured_diff and resource.client is not None and resource._mode == "http":
|
|
1819
1821
|
api_diff = None
|
|
1820
1822
|
try:
|
|
1821
1823
|
payload = {}
|
|
@@ -2516,19 +2518,22 @@ class SQLiteResource(Resource):
|
|
|
2516
2518
|
self,
|
|
2517
2519
|
other: "SQLiteResource",
|
|
2518
2520
|
ignore_config: Optional[IgnoreConfig] = None,
|
|
2521
|
+
use_structured_diff: bool = False,
|
|
2519
2522
|
) -> SyncSnapshotDiff:
|
|
2520
|
-
"""Compare this database with another
|
|
2523
|
+
"""Compare this database with another SQLiteResource.
|
|
2521
2524
|
|
|
2522
2525
|
Args:
|
|
2523
|
-
other: Another
|
|
2526
|
+
other: Another SQLiteResource to compare against
|
|
2524
2527
|
ignore_config: Optional configuration for ignoring specific tables/fields
|
|
2528
|
+
use_structured_diff: If True, use server-side structured diff API in expect_only_v2.
|
|
2529
|
+
Defaults to False (local diff only).
|
|
2525
2530
|
|
|
2526
2531
|
Returns:
|
|
2527
|
-
|
|
2532
|
+
SyncSnapshotDiff: Object containing the differences between the two databases
|
|
2528
2533
|
"""
|
|
2529
2534
|
# Create snapshots of both databases
|
|
2530
2535
|
before_snapshot = self.snapshot(name=f"before_{datetime.utcnow().isoformat()}")
|
|
2531
2536
|
after_snapshot = other.snapshot(name=f"after_{datetime.utcnow().isoformat()}")
|
|
2532
2537
|
|
|
2533
2538
|
# Return the diff between the snapshots
|
|
2534
|
-
return before_snapshot.diff(after_snapshot, ignore_config)
|
|
2539
|
+
return before_snapshot.diff(after_snapshot, ignore_config, use_structured_diff=use_structured_diff)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|