artdam-cli 0.4.1__tar.gz → 0.4.3__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.
Files changed (38) hide show
  1. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/PKG-INFO +1 -1
  2. artdam_cli-0.4.3/artdam_cli/commands/update.py +47 -0
  3. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli.egg-info/PKG-INFO +1 -1
  4. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/pyproject.toml +1 -1
  5. artdam_cli-0.4.1/artdam_cli/commands/update.py +0 -27
  6. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/README.md +0 -0
  7. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/__init__.py +0 -0
  8. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/client.py +0 -0
  9. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/commands/__init__.py +0 -0
  10. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/commands/comment.py +0 -0
  11. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/commands/delete_cmd.py +0 -0
  12. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/commands/download.py +0 -0
  13. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/commands/engine.py +0 -0
  14. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/commands/favorite.py +0 -0
  15. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/commands/folder_cmd.py +0 -0
  16. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/commands/folders.py +0 -0
  17. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/commands/get.py +0 -0
  18. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/commands/login.py +0 -0
  19. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/commands/project.py +0 -0
  20. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/commands/projects.py +0 -0
  21. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/commands/rate.py +0 -0
  22. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/commands/restore.py +0 -0
  23. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/commands/search.py +0 -0
  24. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/commands/tag_cmd.py +0 -0
  25. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/commands/tags.py +0 -0
  26. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/commands/upload.py +0 -0
  27. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/config.py +0 -0
  28. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/main.py +0 -0
  29. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/update_check.py +0 -0
  30. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli/uploader.py +0 -0
  31. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli.egg-info/SOURCES.txt +0 -0
  32. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli.egg-info/dependency_links.txt +0 -0
  33. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli.egg-info/entry_points.txt +0 -0
  34. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli.egg-info/requires.txt +0 -0
  35. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/artdam_cli.egg-info/top_level.txt +0 -0
  36. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/setup.cfg +0 -0
  37. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/tests/test_search_pagination.py +0 -0
  38. {artdam_cli-0.4.1 → artdam_cli-0.4.3}/tests/test_uploader.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: artdam-cli
3
- Version: 0.4.1
3
+ Version: 0.4.3
4
4
  Summary: ArtDAM 数字资产管理平台命令行工具
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -0,0 +1,47 @@
1
+ import click
2
+
3
+ from artdam_cli import client
4
+
5
+
6
+ @click.command()
7
+ @click.argument("asset_id", type=int)
8
+ @click.option("--name", "-n", default=None, help="新文件名")
9
+ @click.option("--description", "-d", default=None, help="新描述")
10
+ @click.option(
11
+ "--folder", "-f", type=int, default=None, help="目标文件夹 ID(0 = 移出文件夹)"
12
+ )
13
+ @click.option("--supplier", default=None, help="供应商真名(传空串 = 清空为 null)")
14
+ def update(
15
+ asset_id: int,
16
+ name: str | None,
17
+ description: str | None,
18
+ folder: int | None,
19
+ supplier: str | None,
20
+ ) -> None:
21
+ """更新资产:重命名、改描述、移动文件夹、改供应商。"""
22
+ if name is None and description is None and folder is None and supplier is None:
23
+ raise SystemExit(
24
+ "请至少指定一个选项:--name / --description / --folder / --supplier"
25
+ )
26
+
27
+ if name is not None:
28
+ client.patch(f"/api/assets/{asset_id}/rename", {"filename": name})
29
+ click.echo(f"✓ 已重命名为 {name}")
30
+
31
+ if description is not None:
32
+ client.patch(
33
+ f"/api/assets/{asset_id}/description", {"description": description}
34
+ )
35
+ click.echo("✓ 描述已更新")
36
+
37
+ if folder is not None:
38
+ folder_id = folder if folder != 0 else None
39
+ client.patch(f"/api/assets/{asset_id}/folder", {"folder_id": folder_id})
40
+ click.echo(f"✓ 已移动到文件夹 {folder_id}")
41
+
42
+ if supplier is not None:
43
+ # 空串 → None:对齐 PATCH /supplier 契约的 null(清空供应商)
44
+ client.patch(
45
+ f"/api/assets/{asset_id}/supplier", {"supplier_name": supplier or None}
46
+ )
47
+ click.echo("✓ 供应商已更新")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: artdam-cli
3
- Version: 0.4.1
3
+ Version: 0.4.3
4
4
  Summary: ArtDAM 数字资产管理平台命令行工具
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "artdam-cli"
7
- version = "0.4.1"
7
+ version = "0.4.3"
8
8
  requires-python = ">=3.10"
9
9
  description = "ArtDAM 数字资产管理平台命令行工具"
10
10
  readme = "README.md"
@@ -1,27 +0,0 @@
1
- import click
2
-
3
- from artdam_cli import client
4
-
5
-
6
- @click.command()
7
- @click.argument("asset_id", type=int)
8
- @click.option("--name", "-n", default=None, help="新文件名")
9
- @click.option("--description", "-d", default=None, help="新描述")
10
- @click.option("--folder", "-f", type=int, default=None, help="目标文件夹 ID(0 = 移出文件夹)")
11
- def update(asset_id: int, name: str | None, description: str | None, folder: int | None) -> None:
12
- """更新资产:重命名、改描述、移动文件夹。"""
13
- if name is None and description is None and folder is None:
14
- raise SystemExit("请至少指定一个选项:--name / --description / --folder")
15
-
16
- if name is not None:
17
- client.patch(f"/api/assets/{asset_id}/rename", {"filename": name})
18
- click.echo(f"✓ 已重命名为 {name}")
19
-
20
- if description is not None:
21
- client.patch(f"/api/assets/{asset_id}/description", {"description": description})
22
- click.echo("✓ 描述已更新")
23
-
24
- if folder is not None:
25
- folder_id = folder if folder != 0 else None
26
- client.patch(f"/api/assets/{asset_id}/folder", {"folder_id": folder_id})
27
- click.echo(f"✓ 已移动到文件夹 {folder_id}")
File without changes
File without changes