clerk-sdk 0.5.0.dev0__tar.gz → 0.5.2__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.
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/PKG-INFO +2 -2
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/README.md +1 -1
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/__init__.py +1 -1
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/client.py +2 -2
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/models/document.py +2 -2
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/pyproject.toml +1 -1
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/setup.py +1 -1
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/tests/test_client.py +7 -3
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/tests/test_document_models.py +11 -5
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/.github/workflows/ci.yaml +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/.github/workflows/pypi_publish.yml +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/.gitignore +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/LICENSE +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/MANIFEST.in +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/base.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/decorator/__init__.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/decorator/models.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/decorator/task_decorator.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/development/__init__.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/development/cli.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/development/gui/test_session.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/development/init_project.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/development/schema/fetch_schema.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/development/templates/exceptions.py.template +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/development/templates/main_basic.py.template +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/development/templates/main_gui.py.template +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/development/templates/rollbacks.py.template +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/development/templates/states.py.template +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/development/templates/transitions.py.template +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/exceptions/__init__.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/exceptions/exceptions.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/exceptions/remote_device.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/__init__.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/action_model/__init__.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/action_model/model.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/action_model/utils.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/client.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/client_actor/__init__.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/client_actor/client_actor.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/client_actor/exception.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/client_actor/model.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/decorators/__init__.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/decorators/gui_automation.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/exceptions/__init__.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/exceptions/agent_manager.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/exceptions/modality/__init__.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/exceptions/modality/exc.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/exceptions/websocket.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/requirements.txt +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/ui_actions/__init__.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/ui_actions/actions.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/ui_actions/base.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/ui_actions/support.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/ui_state_inspector/__init__.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/ui_state_inspector/gui_vision.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/ui_state_inspector/models.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/ui_state_machine/Readme.md +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/ui_state_machine/__init__.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/ui_state_machine/ai_recovery.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/ui_state_machine/decorators.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/ui_state_machine/exceptions.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/ui_state_machine/state_machine.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/models/__init__.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/models/document_statuses.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/models/file.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/models/remote_device.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/models/response_model.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/models/ui_operator.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/utils/__init__.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/utils/logger.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/utils/save_artifact.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/requirements.txt +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/tests/conftest.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/tests/test_base.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/tests/test_exceptions.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/tests/test_file_models.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/tests/test_gui_automation.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/tests/test_task_decorator.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/tests/test_utils.py +0 -0
- {clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: clerk-sdk
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
Summary: Library for interacting with Clerk
|
|
5
5
|
Project-URL: Homepage, https://github.com/F-ONE-Group/clerk_pypi
|
|
6
6
|
Author-email: F-One <contact@f-one.group>
|
|
@@ -128,7 +128,7 @@ Use `UploadDocumentRequest` to send metadata and file attachments. Files can be
|
|
|
128
128
|
from clerk.models.document import UploadDocumentRequest
|
|
129
129
|
|
|
130
130
|
upload_request = UploadDocumentRequest(
|
|
131
|
-
|
|
131
|
+
workflow_id="proj_456",
|
|
132
132
|
message_subject="Invoice 2024-01",
|
|
133
133
|
files=["/path/to/invoice.pdf"],
|
|
134
134
|
input_structured_data={"customer_id": "cust_789"},
|
|
@@ -104,7 +104,7 @@ Use `UploadDocumentRequest` to send metadata and file attachments. Files can be
|
|
|
104
104
|
from clerk.models.document import UploadDocumentRequest
|
|
105
105
|
|
|
106
106
|
upload_request = UploadDocumentRequest(
|
|
107
|
-
|
|
107
|
+
workflow_id="proj_456",
|
|
108
108
|
message_subject="Invoice 2024-01",
|
|
109
109
|
files=["/path/to/invoice.pdf"],
|
|
110
110
|
input_structured_data={"customer_id": "cust_789"},
|
|
@@ -81,9 +81,9 @@ class ClerkDocument(BaseClerk):
|
|
|
81
81
|
)
|
|
82
82
|
return Document(**res.data[0])
|
|
83
83
|
|
|
84
|
-
def reprocess_document(self, document_id: str) -> Document:
|
|
84
|
+
def reprocess_document(self, document_id: str, workflow_id: str) -> Document:
|
|
85
85
|
endpoint = f"/document/{document_id}/reprocess"
|
|
86
|
-
res = self.put_request(endpoint=endpoint)
|
|
86
|
+
res = self.put_request(endpoint=endpoint, data={"workflow_id": workflow_id})
|
|
87
87
|
return Document(**res.data[0])
|
|
88
88
|
|
|
89
89
|
def cancel_document_run(self, document_id: str) -> Document:
|
|
@@ -25,7 +25,7 @@ class Document(BaseModel):
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
class UploadDocumentRequest(BaseModel):
|
|
28
|
-
|
|
28
|
+
workflow_id: str
|
|
29
29
|
message_subject: Optional[str] = None
|
|
30
30
|
message_content: Optional[str] = None
|
|
31
31
|
files: List[str | ParsedFile] = []
|
|
@@ -85,7 +85,7 @@ class UploadDocumentRequest(BaseModel):
|
|
|
85
85
|
)
|
|
86
86
|
|
|
87
87
|
return dict(
|
|
88
|
-
|
|
88
|
+
workflow_id=self.workflow_id,
|
|
89
89
|
message_subject=self.message_subject,
|
|
90
90
|
mesasge_content=self.message_content,
|
|
91
91
|
input_structured_data=serialized_input_structured_data,
|
|
@@ -13,7 +13,7 @@ gui_requirements = get_requirements("./clerk/gui_automation")
|
|
|
13
13
|
|
|
14
14
|
setup(
|
|
15
15
|
name="clerk-sdk",
|
|
16
|
-
version="0.5.
|
|
16
|
+
version="0.5.2",
|
|
17
17
|
description="Library for interacting with Clerk",
|
|
18
18
|
long_description=open("README.md").read(),
|
|
19
19
|
long_description_content_type="text/markdown",
|
|
@@ -40,7 +40,7 @@ def test_upload_document_calls_post(monkeypatch):
|
|
|
40
40
|
content="ZmFrZQ==",
|
|
41
41
|
mimetype="text/plain",
|
|
42
42
|
)
|
|
43
|
-
request = UploadDocumentRequest(
|
|
43
|
+
request = UploadDocumentRequest(workflow_id="proj-1", files=[parsed_file])
|
|
44
44
|
|
|
45
45
|
captured: Dict[str, Any] = {}
|
|
46
46
|
|
|
@@ -63,7 +63,9 @@ def test_update_document_structured_data(monkeypatch):
|
|
|
63
63
|
|
|
64
64
|
def fake_put(self: Clerk, endpoint: str, json: Dict[str, Any]):
|
|
65
65
|
captured.update(endpoint=endpoint, json=json)
|
|
66
|
-
return StandardResponse(
|
|
66
|
+
return StandardResponse(
|
|
67
|
+
data=[make_document_payload(id="doc-3", structured_data={"a": 1})]
|
|
68
|
+
)
|
|
67
69
|
|
|
68
70
|
monkeypatch.setattr(Clerk, "put_request", fake_put)
|
|
69
71
|
|
|
@@ -102,7 +104,9 @@ def test_get_documents_calls_get(monkeypatch):
|
|
|
102
104
|
|
|
103
105
|
def fake_get(self: Clerk, endpoint: str, params: Dict[str, Any]):
|
|
104
106
|
captured.update(endpoint=endpoint, params=params)
|
|
105
|
-
return StandardResponse(
|
|
107
|
+
return StandardResponse(
|
|
108
|
+
data=[make_document_payload(id="doc-5"), make_document_payload(id="doc-6")]
|
|
109
|
+
)
|
|
106
110
|
|
|
107
111
|
monkeypatch.setattr(Clerk, "get_request", fake_get)
|
|
108
112
|
|
|
@@ -27,7 +27,7 @@ def make_document(**overrides: Dict[str, object]) -> Document:
|
|
|
27
27
|
def test_upload_document_request_files_handles_paths(tmp_path):
|
|
28
28
|
file_path = tmp_path / "doc.txt"
|
|
29
29
|
file_path.write_text("hello")
|
|
30
|
-
request = UploadDocumentRequest(
|
|
30
|
+
request = UploadDocumentRequest(workflow_id="proj-1", files=[str(file_path)])
|
|
31
31
|
|
|
32
32
|
files = request.files_
|
|
33
33
|
|
|
@@ -39,7 +39,7 @@ def test_upload_document_request_files_handles_paths(tmp_path):
|
|
|
39
39
|
def test_upload_document_request_files_handles_parsed_file():
|
|
40
40
|
content = base64.b64encode(b"hello").decode()
|
|
41
41
|
parsed = ParsedFile(name="doc.txt", content=content, mimetype="text/plain")
|
|
42
|
-
request = UploadDocumentRequest(
|
|
42
|
+
request = UploadDocumentRequest(workflow_id="proj-1", files=[parsed])
|
|
43
43
|
|
|
44
44
|
files = request.files_
|
|
45
45
|
|
|
@@ -48,21 +48,27 @@ def test_upload_document_request_files_handles_parsed_file():
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
def test_upload_document_request_invalid_path_raises(tmp_path):
|
|
51
|
-
request = UploadDocumentRequest(
|
|
51
|
+
request = UploadDocumentRequest(
|
|
52
|
+
workflow_id="proj-1", files=[str(tmp_path / "missing.txt")]
|
|
53
|
+
)
|
|
52
54
|
|
|
53
55
|
with pytest.raises(FileExistsError):
|
|
54
56
|
_ = request.files_
|
|
55
57
|
|
|
56
58
|
|
|
57
59
|
def test_upload_document_request_data_serializes_structured_data():
|
|
58
|
-
request = UploadDocumentRequest(
|
|
60
|
+
request = UploadDocumentRequest(
|
|
61
|
+
workflow_id="proj-1", input_structured_data={"a": 1}
|
|
62
|
+
)
|
|
59
63
|
payload = request.data
|
|
60
64
|
|
|
61
65
|
assert json.loads(payload["input_structured_data"]) == {"a": 1}
|
|
62
66
|
|
|
63
67
|
|
|
64
68
|
def test_upload_document_request_invalid_structured_data():
|
|
65
|
-
request = UploadDocumentRequest(
|
|
69
|
+
request = UploadDocumentRequest(
|
|
70
|
+
workflow_id="proj-1", input_structured_data={"bad": {1, 2, 3}}
|
|
71
|
+
)
|
|
66
72
|
|
|
67
73
|
with pytest.raises(ValueError):
|
|
68
74
|
_ = request.data
|
|
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
|
{clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/development/templates/transitions.py.template
RENAMED
|
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
|
{clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/exceptions/modality/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/ui_state_inspector/__init__.py
RENAMED
|
File without changes
|
{clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/ui_state_inspector/gui_vision.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/ui_state_machine/ai_recovery.py
RENAMED
|
File without changes
|
{clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/ui_state_machine/decorators.py
RENAMED
|
File without changes
|
{clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/ui_state_machine/exceptions.py
RENAMED
|
File without changes
|
{clerk_sdk-0.5.0.dev0 → clerk_sdk-0.5.2}/clerk/gui_automation/ui_state_machine/state_machine.py
RENAMED
|
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
|