artdam-cli 0.4.1__tar.gz → 0.4.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.
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/PKG-INFO +1 -1
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/commands/update.py +16 -4
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli.egg-info/PKG-INFO +1 -1
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/pyproject.toml +1 -1
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/README.md +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/__init__.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/client.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/commands/__init__.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/commands/comment.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/commands/delete_cmd.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/commands/download.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/commands/engine.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/commands/favorite.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/commands/folder_cmd.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/commands/folders.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/commands/get.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/commands/login.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/commands/project.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/commands/projects.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/commands/rate.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/commands/restore.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/commands/search.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/commands/tag_cmd.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/commands/tags.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/commands/upload.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/config.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/main.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/update_check.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli/uploader.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli.egg-info/SOURCES.txt +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli.egg-info/dependency_links.txt +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli.egg-info/entry_points.txt +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli.egg-info/requires.txt +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/artdam_cli.egg-info/top_level.txt +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/setup.cfg +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/tests/test_search_pagination.py +0 -0
- {artdam_cli-0.4.1 → artdam_cli-0.4.2}/tests/test_uploader.py +0 -0
|
@@ -8,10 +8,17 @@ from artdam_cli import client
|
|
|
8
8
|
@click.option("--name", "-n", default=None, help="新文件名")
|
|
9
9
|
@click.option("--description", "-d", default=None, help="新描述")
|
|
10
10
|
@click.option("--folder", "-f", type=int, default=None, help="目标文件夹 ID(0 = 移出文件夹)")
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
@click.option("--supplier", default=None, help="供应商真名(传空串 = 清空为 null)")
|
|
12
|
+
def update(
|
|
13
|
+
asset_id: int,
|
|
14
|
+
name: str | None,
|
|
15
|
+
description: str | None,
|
|
16
|
+
folder: int | None,
|
|
17
|
+
supplier: str | None,
|
|
18
|
+
) -> None:
|
|
19
|
+
"""更新资产:重命名、改描述、移动文件夹、改供应商。"""
|
|
20
|
+
if name is None and description is None and folder is None and supplier is None:
|
|
21
|
+
raise SystemExit("请至少指定一个选项:--name / --description / --folder / --supplier")
|
|
15
22
|
|
|
16
23
|
if name is not None:
|
|
17
24
|
client.patch(f"/api/assets/{asset_id}/rename", {"filename": name})
|
|
@@ -25,3 +32,8 @@ def update(asset_id: int, name: str | None, description: str | None, folder: int
|
|
|
25
32
|
folder_id = folder if folder != 0 else None
|
|
26
33
|
client.patch(f"/api/assets/{asset_id}/folder", {"folder_id": folder_id})
|
|
27
34
|
click.echo(f"✓ 已移动到文件夹 {folder_id}")
|
|
35
|
+
|
|
36
|
+
if supplier is not None:
|
|
37
|
+
# 空串 → None:对齐 PATCH /supplier 契约的 null(清空供应商)
|
|
38
|
+
client.patch(f"/api/assets/{asset_id}/supplier", {"supplier_name": supplier or None})
|
|
39
|
+
click.echo("✓ 供应商已更新")
|
|
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
|