wflow-cli 0.1.0__tar.gz → 0.2.0__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.
- {wflow_cli-0.1.0 → wflow_cli-0.2.0}/PKG-INFO +3 -2
- {wflow_cli-0.1.0 → wflow_cli-0.2.0}/README.md +1 -0
- {wflow_cli-0.1.0 → wflow_cli-0.2.0}/pyproject.toml +2 -2
- {wflow_cli-0.1.0 → wflow_cli-0.2.0}/src/wflow_cli/commands.py +14 -0
- {wflow_cli-0.1.0 → wflow_cli-0.2.0}/LICENSE +0 -0
- {wflow_cli-0.1.0 → wflow_cli-0.2.0}/src/wflow_cli/__init__.py +0 -0
- {wflow_cli-0.1.0 → wflow_cli-0.2.0}/src/wflow_cli/credentials.py +0 -0
- {wflow_cli-0.1.0 → wflow_cli-0.2.0}/src/wflow_cli/io.py +0 -0
- {wflow_cli-0.1.0 → wflow_cli-0.2.0}/src/wflow_cli/main.py +0 -0
- {wflow_cli-0.1.0 → wflow_cli-0.2.0}/src/wflow_cli/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: wflow-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Command-line client for the wflow.com public API
|
|
5
5
|
Keywords: wflow,cli,api,documents,approval
|
|
6
6
|
Author: wflow.com
|
|
@@ -13,7 +13,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.13
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
-
Requires-Dist: wflow-api==0.
|
|
16
|
+
Requires-Dist: wflow-api==0.2.0
|
|
17
17
|
Requires-Dist: typer~=0.27.3
|
|
18
18
|
Requires-Python: >=3.12
|
|
19
19
|
Project-URL: Homepage, https://www.wflow.com
|
|
@@ -88,6 +88,7 @@ keeps no version history — read `wflow <command> --help` before writing.
|
|
|
88
88
|
|
|
89
89
|
```bash
|
|
90
90
|
wflow upload-document-file -o acme --document-id <id> --file ./invoice.pdf
|
|
91
|
+
wflow create-document-with-files -o acme --type-id <id> --file ./invoice.pdf --file ./annex.pdf
|
|
91
92
|
wflow download-document-file -o acme --file-id <id> --output ./invoice.pdf
|
|
92
93
|
wflow download-document-file -o acme --file-id <id> --output - > invoice.pdf
|
|
93
94
|
```
|
|
@@ -66,6 +66,7 @@ keeps no version history — read `wflow <command> --help` before writing.
|
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
68
|
wflow upload-document-file -o acme --document-id <id> --file ./invoice.pdf
|
|
69
|
+
wflow create-document-with-files -o acme --type-id <id> --file ./invoice.pdf --file ./annex.pdf
|
|
69
70
|
wflow download-document-file -o acme --file-id <id> --output ./invoice.pdf
|
|
70
71
|
wflow download-document-file -o acme --file-id <id> --output - > invoice.pdf
|
|
71
72
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "wflow-cli"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.2.0"
|
|
4
4
|
description = "Command-line client for the wflow.com public API"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -17,7 +17,7 @@ classifiers = [
|
|
|
17
17
|
"Programming Language :: Python :: 3.14",
|
|
18
18
|
]
|
|
19
19
|
requires-python = ">=3.12"
|
|
20
|
-
dependencies = ["wflow-api==0.
|
|
20
|
+
dependencies = ["wflow-api==0.2.0", "typer~=0.27.3"]
|
|
21
21
|
|
|
22
22
|
[project.urls]
|
|
23
23
|
Homepage = "https://www.wflow.com"
|
|
@@ -14,6 +14,7 @@ from pydantic.fields import FieldInfo
|
|
|
14
14
|
|
|
15
15
|
from wflow_api import FileContent, WflowApiError, WflowClient, WflowError
|
|
16
16
|
from wflow_api.auth import TOKEN_PATH
|
|
17
|
+
from wflow_api.models.common import UploadFiles
|
|
17
18
|
from wflow_api.operations import operations
|
|
18
19
|
from wflow_cli import __version__
|
|
19
20
|
from wflow_cli.credentials import ConfigError
|
|
@@ -114,6 +115,17 @@ def _options(fn: Operation) -> tuple[list[inspect.Parameter], dict[str, str]]:
|
|
|
114
115
|
option = typer.Option("--file", help="The file to upload.", exists=True, dir_okay=False, readable=True)
|
|
115
116
|
parameters.append(inspect.Parameter(name, KEYWORD, annotation=_annotated(Path, option)))
|
|
116
117
|
continue
|
|
118
|
+
if hints[name] == UploadFiles:
|
|
119
|
+
kinds[name] = "files"
|
|
120
|
+
option = typer.Option(
|
|
121
|
+
"--file",
|
|
122
|
+
help="A file to upload; repeat --file for several. The first becomes the main file.",
|
|
123
|
+
exists=True,
|
|
124
|
+
dir_okay=False,
|
|
125
|
+
readable=True,
|
|
126
|
+
)
|
|
127
|
+
parameters.append(inspect.Parameter(name, KEYWORD, annotation=_annotated(list[Path], option)))
|
|
128
|
+
continue
|
|
117
129
|
if bare in SIMPLE:
|
|
118
130
|
kinds[name] = "value"
|
|
119
131
|
option = _option(name, bare, description)
|
|
@@ -166,6 +178,8 @@ def _arguments(kinds: dict[str, str], values: dict[str, Any]) -> dict[str, Any]:
|
|
|
166
178
|
arguments[name] = None if value is None else read_json(value, option_name(name))
|
|
167
179
|
elif kinds[name] == "file":
|
|
168
180
|
arguments[name] = value.read_bytes()
|
|
181
|
+
elif kinds[name] == "files":
|
|
182
|
+
arguments[name] = [(path.name, path.read_bytes()) for path in value]
|
|
169
183
|
else:
|
|
170
184
|
arguments[name] = value
|
|
171
185
|
if "file" in kinds.values() and arguments.get("filename") is None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|