@gaoding/cli 0.0.0 → 1.0.0

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 (136) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +40 -3
  3. package/contracts/operations/agent.send/input.schema.json +353 -0
  4. package/contracts/operations/agent.send/output.schema.json +271 -0
  5. package/contracts/operations/auth.status/input.schema.json +7 -0
  6. package/contracts/operations/auth.status/output.schema.json +132 -0
  7. package/contracts/operations/dam.copy/input.schema.json +19 -0
  8. package/contracts/operations/dam.copy/output.schema.json +19 -0
  9. package/contracts/operations/dam.delete/input.schema.json +23 -0
  10. package/contracts/operations/dam.delete/output.schema.json +6 -0
  11. package/contracts/operations/dam.download/input.schema.json +14 -0
  12. package/contracts/operations/dam.download/output.schema.json +25 -0
  13. package/contracts/operations/dam.folder.list/input.schema.json +15 -0
  14. package/contracts/operations/dam.folder.list/output.schema.json +37 -0
  15. package/contracts/operations/dam.get/input.schema.json +16 -0
  16. package/contracts/operations/dam.get/output.schema.json +46 -0
  17. package/contracts/operations/dam.list/input.schema.json +44 -0
  18. package/contracts/operations/dam.list/output.schema.json +71 -0
  19. package/contracts/operations/dam.move/input.schema.json +19 -0
  20. package/contracts/operations/dam.move/output.schema.json +18 -0
  21. package/contracts/operations/dam.recycle.list/input.schema.json +13 -0
  22. package/contracts/operations/dam.recycle.list/output.schema.json +34 -0
  23. package/contracts/operations/dam.recycle.restore/input.schema.json +14 -0
  24. package/contracts/operations/dam.recycle.restore/output.schema.json +6 -0
  25. package/contracts/operations/dam.rename/input.schema.json +18 -0
  26. package/contracts/operations/dam.rename/output.schema.json +18 -0
  27. package/contracts/operations/dam.repository.list/input.schema.json +8 -0
  28. package/contracts/operations/dam.repository.list/output.schema.json +52 -0
  29. package/contracts/operations/dam.search/input.schema.json +46 -0
  30. package/contracts/operations/dam.search/output.schema.json +71 -0
  31. package/contracts/operations/dam.tag.list/input.schema.json +12 -0
  32. package/contracts/operations/dam.tag.list/output.schema.json +26 -0
  33. package/contracts/operations/dam.upload/input.schema.json +31 -0
  34. package/contracts/operations/dam.upload/output.schema.json +46 -0
  35. package/contracts/operations/editor.apply/input.schema.json +134 -0
  36. package/contracts/operations/editor.apply/output.schema.json +15 -0
  37. package/contracts/operations/editor.connect/input.schema.json +15 -0
  38. package/contracts/operations/editor.connect/output.schema.json +17 -0
  39. package/contracts/operations/editor.disconnect/input.schema.json +8 -0
  40. package/contracts/operations/editor.disconnect/output.schema.json +14 -0
  41. package/contracts/operations/editor.save/input.schema.json +8 -0
  42. package/contracts/operations/editor.save/output.schema.json +23 -0
  43. package/contracts/operations/editor.screenshot/input.schema.json +8 -0
  44. package/contracts/operations/editor.screenshot/output.schema.json +16 -0
  45. package/contracts/operations/editor.snapshot/input.schema.json +8 -0
  46. package/contracts/operations/editor.snapshot/output.schema.json +113 -0
  47. package/contracts/operations/model.get/input.schema.json +18 -0
  48. package/contracts/operations/model.get/output.schema.json +191 -0
  49. package/contracts/operations/model.list/input.schema.json +15 -0
  50. package/contracts/operations/model.list/output.schema.json +111 -0
  51. package/contracts/operations/org.current/input.schema.json +7 -0
  52. package/contracts/operations/org.current/output.schema.json +49 -0
  53. package/contracts/operations/org.list/input.schema.json +7 -0
  54. package/contracts/operations/org.list/output.schema.json +71 -0
  55. package/contracts/operations/tool.call/input.schema.json +35 -0
  56. package/contracts/operations/tool.call/output.schema.json +129 -0
  57. package/contracts/operations/tool.list/input.schema.json +7 -0
  58. package/contracts/operations/tool.list/output.schema.json +45 -0
  59. package/dist/bin/gd-cli.js +60 -0
  60. package/dist/bin/postinstall.js +42 -0
  61. package/dist/src/bootstrap/create-cli.js +112 -0
  62. package/dist/src/bootstrap/create-runtime.js +290 -0
  63. package/dist/src/bootstrap/validators.js +157 -0
  64. package/dist/src/cli/action-binding.js +109 -0
  65. package/dist/src/cli/agent-commands.js +49 -0
  66. package/dist/src/cli/auth-commands.js +55 -0
  67. package/dist/src/cli/dam-commands.js +469 -0
  68. package/dist/src/cli/editor-commands.js +73 -0
  69. package/dist/src/cli/errors.js +157 -0
  70. package/dist/src/cli/model-commands.js +61 -0
  71. package/dist/src/cli/org-commands.js +58 -0
  72. package/dist/src/cli/presenter.js +105 -0
  73. package/dist/src/cli/prompt.js +30 -0
  74. package/dist/src/cli/tool-commands.js +77 -0
  75. package/dist/src/cli/update-command.js +14 -0
  76. package/dist/src/contracts/schema.js +4 -0
  77. package/dist/src/features/agent/creative-agent-adapter.js +36 -0
  78. package/dist/src/features/agent/creative-protocol.js +432 -0
  79. package/dist/src/features/agent/creative-stream.js +127 -0
  80. package/dist/src/features/agent/use-cases.js +150 -0
  81. package/dist/src/features/auth/access-policy.js +101 -0
  82. package/dist/src/features/auth/credential-store.js +62 -0
  83. package/dist/src/features/auth/sso-service.js +194 -0
  84. package/dist/src/features/auth/state.js +129 -0
  85. package/dist/src/features/auth/use-cases.js +136 -0
  86. package/dist/src/features/dam/asset-projection.js +278 -0
  87. package/dist/src/features/dam/dam-api-adapter.js +562 -0
  88. package/dist/src/features/dam/file-downloader.js +242 -0
  89. package/dist/src/features/dam/object-storage.js +193 -0
  90. package/dist/src/features/dam/operation-executor.js +72 -0
  91. package/dist/src/features/dam/registered-uploader.js +247 -0
  92. package/dist/src/features/dam/repository-catalog.js +127 -0
  93. package/dist/src/features/dam/storage-upload.js +141 -0
  94. package/dist/src/features/dam/transient-uploader.js +17 -0
  95. package/dist/src/features/dam/use-cases.js +470 -0
  96. package/dist/src/features/editor/bridge-client.js +109 -0
  97. package/dist/src/features/editor/bridge-process.js +222 -0
  98. package/dist/src/features/editor/bridge-server.js +337 -0
  99. package/dist/src/features/editor/protocol.js +1 -0
  100. package/dist/src/features/editor/public-url.js +36 -0
  101. package/dist/src/features/editor/session-state.js +78 -0
  102. package/dist/src/features/editor/session.js +207 -0
  103. package/dist/src/features/editor/use-cases.js +88 -0
  104. package/dist/src/features/org/org-service.js +76 -0
  105. package/dist/src/features/org/use-cases.js +156 -0
  106. package/dist/src/features/skill/bundled-skills.js +55 -0
  107. package/dist/src/features/skill/installer.js +271 -0
  108. package/dist/src/features/tool/catalog.js +83 -0
  109. package/dist/src/features/tool/dynamic-schema.js +128 -0
  110. package/dist/src/features/tool/mns-catalog-adapter.js +265 -0
  111. package/dist/src/features/tool/tool-api-adapter.js +352 -0
  112. package/dist/src/features/tool/use-cases.js +177 -0
  113. package/dist/src/features/update/latest-version.js +37 -0
  114. package/dist/src/features/update/update-notification.js +262 -0
  115. package/dist/src/features/update/update-service.js +183 -0
  116. package/dist/src/platform/json-input.js +67 -0
  117. package/dist/src/platform/local-json-file.js +59 -0
  118. package/dist/src/platform/open-browser.js +8 -0
  119. package/dist/src/platform/redact.js +80 -0
  120. package/dist/src/platform/remote-error-evidence.js +80 -0
  121. package/dist/src/platform/remote-protocol.js +10 -0
  122. package/dist/src/platform/safe-upload-file.js +146 -0
  123. package/dist/src/platform/signature.js +20 -0
  124. package/dist/src/platform/signed-http-transport.js +143 -0
  125. package/dist/src/platform/url-safety.js +100 -0
  126. package/dist/src/telemetry/invocation.js +156 -0
  127. package/dist/src/telemetry/sls-sink.js +31 -0
  128. package/package.json +54 -8
  129. package/skills/gd-cli/SKILL.md +15 -0
  130. package/skills/gd-cli/references/auth-org.md +9 -0
  131. package/skills/gd-cli/references/creation.md +115 -0
  132. package/skills/gd-cli/references/dam.md +52 -0
  133. package/skills/gd-cli/references/editor.md +254 -0
  134. package/skills/gd-cli/references/errors.md +13 -0
  135. package/skills/gd-cli/references/update.md +13 -0
  136. package/index.js +0 -3
@@ -0,0 +1,132 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.gaoding.com/operations/auth.status/output.schema.json",
4
+ "title": "AuthStatusResult",
5
+ "description": "本机稿定 CLI 登录、账号、组织和凭证状态。",
6
+ "oneOf": [
7
+ {
8
+ "type": "object",
9
+ "required": [
10
+ "logged_in",
11
+ "next_steps"
12
+ ],
13
+ "properties": {
14
+ "logged_in": {
15
+ "const": false,
16
+ "description": "本机没有登录凭证。"
17
+ },
18
+ "next_steps": {
19
+ "type": "array",
20
+ "description": "恢复可用状态的下一步命令。",
21
+ "items": {
22
+ "type": "string"
23
+ }
24
+ }
25
+ },
26
+ "additionalProperties": false
27
+ },
28
+ {
29
+ "type": "object",
30
+ "required": [
31
+ "logged_in",
32
+ "account",
33
+ "organization",
34
+ "credential",
35
+ "next_steps"
36
+ ],
37
+ "properties": {
38
+ "logged_in": {
39
+ "const": true,
40
+ "description": "本机存在格式有效的登录凭证。"
41
+ },
42
+ "account": {
43
+ "type": "object",
44
+ "required": [
45
+ "user_id",
46
+ "name"
47
+ ],
48
+ "properties": {
49
+ "user_id": {
50
+ "type": [
51
+ "string",
52
+ "null"
53
+ ],
54
+ "description": "当前用户 ID;本地未保存时为 null。"
55
+ },
56
+ "name": {
57
+ "type": [
58
+ "string",
59
+ "null"
60
+ ],
61
+ "description": "当前用户名称;本地未保存时为 null。"
62
+ }
63
+ },
64
+ "additionalProperties": false
65
+ },
66
+ "organization": {
67
+ "description": "本机当前选择的组织;尚未选择时为 null。",
68
+ "oneOf": [
69
+ {
70
+ "type": "null"
71
+ },
72
+ {
73
+ "type": "object",
74
+ "required": [
75
+ "id",
76
+ "name"
77
+ ],
78
+ "properties": {
79
+ "id": {
80
+ "type": "string",
81
+ "minLength": 1,
82
+ "description": "当前组织 ID。"
83
+ },
84
+ "name": {
85
+ "type": "string",
86
+ "minLength": 1,
87
+ "description": "当前组织名称。"
88
+ }
89
+ },
90
+ "additionalProperties": false
91
+ }
92
+ ]
93
+ },
94
+ "credential": {
95
+ "type": "object",
96
+ "required": [
97
+ "expires_at",
98
+ "valid",
99
+ "scope"
100
+ ],
101
+ "properties": {
102
+ "expires_at": {
103
+ "type": "string",
104
+ "format": "date-time",
105
+ "description": "凭证过期时间,ISO 8601。"
106
+ },
107
+ "valid": {
108
+ "type": "boolean",
109
+ "description": "凭证当前是否未过期。"
110
+ },
111
+ "scope": {
112
+ "type": "array",
113
+ "description": "服务端授予的权限范围。",
114
+ "items": {
115
+ "type": "string"
116
+ }
117
+ }
118
+ },
119
+ "additionalProperties": false
120
+ },
121
+ "next_steps": {
122
+ "type": "array",
123
+ "description": "恢复可用状态或选择组织的下一步命令。",
124
+ "items": {
125
+ "type": "string"
126
+ }
127
+ }
128
+ },
129
+ "additionalProperties": false
130
+ }
131
+ ]
132
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamCopyInput",
4
+ "description": "复制一个 DAM 素材或文件夹。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["entry_id", "kind", "targetFolderId"],
8
+ "properties": {
9
+ "entry_id": { "$ref": "#/$defs/nonblank" },
10
+ "kind": { "$ref": "#/$defs/kind" },
11
+ "repositoryId": { "$ref": "#/$defs/nonblank" },
12
+ "targetRepositoryId": { "$ref": "#/$defs/nonblank" },
13
+ "targetFolderId": { "$ref": "#/$defs/nonblank" }
14
+ },
15
+ "$defs": {
16
+ "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" },
17
+ "kind": { "type": "string", "enum": ["asset", "folder"] }
18
+ }
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamCopyResult",
4
+ "description": "复制后的 DAM 条目位置。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["source_entry_id", "kind", "repository_id", "folder_id"],
8
+ "properties": {
9
+ "source_entry_id": { "$ref": "#/$defs/nonblank" },
10
+ "kind": { "$ref": "#/$defs/kind" },
11
+ "repository_id": { "$ref": "#/$defs/nonblank" },
12
+ "folder_id": { "$ref": "#/$defs/nonblank" },
13
+ "copied_entry_id": { "$ref": "#/$defs/nonblank" }
14
+ },
15
+ "$defs": {
16
+ "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" },
17
+ "kind": { "type": "string", "enum": ["asset", "folder"] }
18
+ }
19
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamDeleteInput",
4
+ "description": "DAM 素材删除参数。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["asset_id"],
8
+ "properties": {
9
+ "asset_id": {
10
+ "type": "string",
11
+ "minLength": 1,
12
+ "pattern": "^(?![Hh][Tt][Tt][Pp][Ss]?://).*\\S.*$",
13
+ "description": "DAM 素材 ID;不接受 URL。"
14
+ },
15
+ "repositoryId": {
16
+ "type": "string",
17
+ "minLength": 1,
18
+ "pattern": ".*\\S.*",
19
+ "description": "所属资源库 ID。"
20
+ },
21
+ "permanent": { "type": "boolean", "description": "是否继续永久删除。" }
22
+ }
23
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamDeleteOutput",
4
+ "description": "DAM 素材删除成功后没有业务结果。",
5
+ "type": "null"
6
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamDownloadInput",
4
+ "description": "下载一个 DAM 素材。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["asset_id"],
8
+ "properties": {
9
+ "asset_id": { "$ref": "#/$defs/nonblank", "description": "单个素材 ID。" },
10
+ "repositoryId": { "$ref": "#/$defs/nonblank", "description": "资源库 ID。" },
11
+ "outputDir": { "$ref": "#/$defs/nonblank", "default": ".", "description": "输出目录。" }
12
+ },
13
+ "$defs": { "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" } }
14
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamDownloadResult",
4
+ "description": "一个 DAM 素材下载后的本地文件。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["asset_id", "files"],
8
+ "properties": {
9
+ "asset_id": { "$ref": "#/$defs/nonblank" },
10
+ "files": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/file" } }
11
+ },
12
+ "$defs": {
13
+ "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" },
14
+ "file": {
15
+ "type": "object",
16
+ "additionalProperties": false,
17
+ "required": ["path", "bytes", "sha256"],
18
+ "properties": {
19
+ "path": { "$ref": "#/$defs/nonblank" },
20
+ "bytes": { "type": "integer", "minimum": 0 },
21
+ "sha256": { "type": "string", "pattern": "^[a-fA-F0-9]{64}$" }
22
+ }
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamFolderListInput",
4
+ "description": "列出一个 DAM 资源库中的文件夹。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "repositoryId": { "$ref": "#/$defs/nonblank", "description": "资源库 ID。" },
9
+ "parentId": { "$ref": "#/$defs/nonblank", "default": "0", "description": "父文件夹 ID。" },
10
+ "query": { "$ref": "#/$defs/nonblank", "description": "文件夹标题关键词。" },
11
+ "page": { "type": "integer", "minimum": 1, "default": 1, "description": "页码。" },
12
+ "pageSize": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20, "description": "每页数量。" }
13
+ },
14
+ "$defs": { "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" } }
15
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamFolderListResult",
4
+ "description": "DAM 文件夹分页结果。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["repository_id", "parent_id", "page", "page_size", "total", "folders"],
8
+ "properties": {
9
+ "repository_id": { "$ref": "#/$defs/nonblank" },
10
+ "parent_id": { "$ref": "#/$defs/nonblank" },
11
+ "page": { "type": "integer", "minimum": 1 },
12
+ "page_size": { "type": "integer", "minimum": 1, "maximum": 100 },
13
+ "total": { "type": "integer", "minimum": 0 },
14
+ "folders": { "type": "array", "items": { "$ref": "#/$defs/folder" } }
15
+ },
16
+ "$defs": {
17
+ "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" },
18
+ "permission": { "type": "string", "enum": ["OWNER", "MANAGE", "EDIT", "USE", "READ"] },
19
+ "folder": {
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "required": ["folder_id", "title", "parent_id", "repository_id", "child_folder_count", "asset_count"],
23
+ "properties": {
24
+ "folder_id": { "$ref": "#/$defs/nonblank" },
25
+ "title": { "$ref": "#/$defs/nonblank" },
26
+ "parent_id": { "$ref": "#/$defs/nonblank" },
27
+ "repository_id": { "$ref": "#/$defs/nonblank" },
28
+ "permission_code": { "$ref": "#/$defs/permission" },
29
+ "child_folder_count": { "type": "integer", "minimum": 0 },
30
+ "asset_count": { "type": "integer", "minimum": 0 },
31
+ "path": { "$ref": "#/$defs/nonblank" },
32
+ "created_at": { "$ref": "#/$defs/nonblank" },
33
+ "updated_at": { "$ref": "#/$defs/nonblank" }
34
+ }
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamGetInput",
4
+ "description": "DAM 素材详情参数。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["asset_id"],
8
+ "properties": {
9
+ "asset_id": {
10
+ "type": "string",
11
+ "minLength": 1,
12
+ "pattern": "^(?![Hh][Tt][Tt][Pp][Ss]?://).*\\S.*$",
13
+ "description": "DAM 素材 ID;不接受 URL。"
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamAssetDetail",
4
+ "description": "DAM 素材完整信息。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["asset_id"],
8
+ "properties": {
9
+ "asset_id": { "$ref": "#/$defs/nonblank", "description": "素材 ID。" },
10
+ "title": { "$ref": "#/$defs/nonblank", "description": "素材标题。" },
11
+ "description": { "$ref": "#/$defs/nonblank", "description": "素材描述。" },
12
+ "format": { "$ref": "#/$defs/nonblank", "description": "文件格式。" },
13
+ "type": { "$ref": "#/$defs/assetType", "description": "素材类型。" },
14
+ "size": { "type": "integer", "minimum": 0, "description": "文件字节数。" },
15
+ "url": { "type": "string", "format": "uri", "description": "素材访问 URL。" },
16
+ "cover_url": { "type": "string", "format": "uri", "description": "封面 URL。" },
17
+ "width": { "type": "integer", "minimum": 0, "description": "像素宽度。" },
18
+ "height": { "type": "integer", "minimum": 0, "description": "像素高度。" },
19
+ "duration": { "type": "number", "minimum": 0, "description": "媒体时长,单位为秒。" },
20
+ "repository_id": { "$ref": "#/$defs/nonblank", "description": "资源库 ID。" },
21
+ "repository_name": { "$ref": "#/$defs/nonblank", "description": "资源库名称。" },
22
+ "folder_id": { "$ref": "#/$defs/nonblank", "description": "文件夹 ID。" },
23
+ "folder_name": { "$ref": "#/$defs/nonblank", "description": "文件夹名称。" },
24
+ "tag_ids": {
25
+ "type": "array",
26
+ "items": { "$ref": "#/$defs/stringOrNumber" },
27
+ "description": "标签 ID。"
28
+ },
29
+ "analysis_status": { "$ref": "#/$defs/stringOrNumber", "description": "分析状态。" },
30
+ "created_at": { "type": "string", "format": "date-time", "description": "创建时间。" },
31
+ "updated_at": { "type": "string", "format": "date-time", "description": "更新时间。" }
32
+ },
33
+ "$defs": {
34
+ "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" },
35
+ "assetType": {
36
+ "type": "string",
37
+ "enum": ["image", "video", "audio", "font", "template", "file"]
38
+ },
39
+ "stringOrNumber": {
40
+ "oneOf": [
41
+ { "$ref": "#/$defs/nonblank" },
42
+ { "type": "number" }
43
+ ]
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamListInput",
4
+ "description": "DAM 素材列表参数。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "not": {
8
+ "properties": { "repositoryId": true, "allRepositories": true },
9
+ "required": ["repositoryId", "allRepositories"]
10
+ },
11
+ "properties": {
12
+ "repositoryId": { "$ref": "#/$defs/nonblank", "description": "指定资源库 ID。" },
13
+ "allRepositories": { "type": "boolean", "description": "是否查询全部可访问资源库。" },
14
+ "folderId": { "$ref": "#/$defs/nonblank", "description": "指定文件夹 ID。" },
15
+ "includeChildFolder": { "type": "boolean", "description": "是否包含子文件夹。" },
16
+ "type": { "$ref": "#/$defs/assetType", "description": "素材类型。" },
17
+ "assetFormats": {
18
+ "type": "array",
19
+ "minItems": 1,
20
+ "items": { "$ref": "#/$defs/nonblank" },
21
+ "description": "文件格式筛选。"
22
+ },
23
+ "tagIds": {
24
+ "type": "array",
25
+ "minItems": 1,
26
+ "items": { "$ref": "#/$defs/nonblank" },
27
+ "description": "标签 ID 筛选。"
28
+ },
29
+ "pageSize": {
30
+ "type": "integer",
31
+ "minimum": 1,
32
+ "maximum": 100,
33
+ "description": "DAM 请求的分页大小。"
34
+ },
35
+ "cursor": { "$ref": "#/$defs/nonblank", "description": "分页游标。" }
36
+ },
37
+ "$defs": {
38
+ "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" },
39
+ "assetType": {
40
+ "type": "string",
41
+ "enum": ["image", "video", "audio", "font", "template", "file"]
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamListResult",
4
+ "description": "一批 DAM 素材概要;服务端实际返回数量可能大于请求的 page_size。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["repository_ids", "page_size", "total", "finish", "assets"],
8
+ "properties": {
9
+ "repository_ids": {
10
+ "type": "array",
11
+ "minItems": 1,
12
+ "items": { "$ref": "#/$defs/nonblank" },
13
+ "description": "本次查询的资源库 ID。"
14
+ },
15
+ "page_size": { "type": "integer", "minimum": 1, "maximum": 100, "description": "本次 DAM 请求的分页大小;实际 assets 数量可能大于该值。" },
16
+ "total": { "type": "integer", "minimum": 0, "description": "匹配素材总数。" },
17
+ "finish": { "type": "boolean", "description": "是否已到最后一页。" },
18
+ "next_cursor": { "$ref": "#/$defs/nonblank", "description": "下一页游标。" },
19
+ "assets": {
20
+ "type": "array",
21
+ "items": { "$ref": "#/$defs/assetSummary" },
22
+ "description": "服务端本批返回的全部素材概要,不按 page_size 在本地截断。"
23
+ }
24
+ },
25
+ "$defs": {
26
+ "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" },
27
+ "assetType": {
28
+ "type": "string",
29
+ "enum": ["image", "video", "audio", "font", "template", "file"]
30
+ },
31
+ "stringOrNumber": {
32
+ "oneOf": [
33
+ { "$ref": "#/$defs/nonblank" },
34
+ { "type": "number" }
35
+ ]
36
+ },
37
+ "assetSummary": {
38
+ "title": "DamAssetSummary",
39
+ "type": "object",
40
+ "additionalProperties": false,
41
+ "required": ["asset_id"],
42
+ "properties": {
43
+ "asset_id": { "$ref": "#/$defs/nonblank", "description": "素材 ID。" },
44
+ "title": { "$ref": "#/$defs/nonblank", "description": "素材标题。" },
45
+ "format": { "$ref": "#/$defs/nonblank", "description": "文件格式。" },
46
+ "type": { "$ref": "#/$defs/assetType", "description": "素材类型。" },
47
+ "size": { "type": "integer", "minimum": 0, "description": "文件字节数。" },
48
+ "url": { "type": "string", "format": "uri", "description": "素材访问 URL。" },
49
+ "cover_url": { "type": "string", "format": "uri", "description": "封面 URL。" },
50
+ "width": { "type": "integer", "minimum": 0, "description": "像素宽度。" },
51
+ "height": { "type": "integer", "minimum": 0, "description": "像素高度。" },
52
+ "repository_id": { "$ref": "#/$defs/nonblank", "description": "资源库 ID。" },
53
+ "folder_id": { "$ref": "#/$defs/nonblank", "description": "文件夹 ID。" },
54
+ "folder_name": { "$ref": "#/$defs/nonblank", "description": "文件夹名称。" },
55
+ "tags": {
56
+ "type": "array",
57
+ "items": { "$ref": "#/$defs/nonblank" },
58
+ "description": "标签名称。"
59
+ },
60
+ "tag_ids": {
61
+ "type": "array",
62
+ "items": { "$ref": "#/$defs/stringOrNumber" },
63
+ "description": "标签 ID。"
64
+ },
65
+ "analysis_status": { "$ref": "#/$defs/stringOrNumber", "description": "分析状态。" },
66
+ "created_at": { "type": "string", "format": "date-time", "description": "创建时间。" },
67
+ "updated_at": { "type": "string", "format": "date-time", "description": "更新时间。" }
68
+ }
69
+ }
70
+ }
71
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamMoveInput",
4
+ "description": "移动一个 DAM 素材或文件夹。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["entry_id", "kind", "targetFolderId"],
8
+ "properties": {
9
+ "entry_id": { "$ref": "#/$defs/nonblank" },
10
+ "kind": { "$ref": "#/$defs/kind" },
11
+ "repositoryId": { "$ref": "#/$defs/nonblank" },
12
+ "targetRepositoryId": { "$ref": "#/$defs/nonblank" },
13
+ "targetFolderId": { "$ref": "#/$defs/nonblank" }
14
+ },
15
+ "$defs": {
16
+ "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" },
17
+ "kind": { "type": "string", "enum": ["asset", "folder"] }
18
+ }
19
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamMoveResult",
4
+ "description": "移动后的 DAM 条目位置。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["entry_id", "kind", "repository_id", "folder_id"],
8
+ "properties": {
9
+ "entry_id": { "$ref": "#/$defs/nonblank" },
10
+ "kind": { "$ref": "#/$defs/kind" },
11
+ "repository_id": { "$ref": "#/$defs/nonblank" },
12
+ "folder_id": { "$ref": "#/$defs/nonblank" }
13
+ },
14
+ "$defs": {
15
+ "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" },
16
+ "kind": { "type": "string", "enum": ["asset", "folder"] }
17
+ }
18
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamRecycleListInput",
4
+ "description": "列出一个 DAM 资源库的回收站。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "repositoryId": { "$ref": "#/$defs/nonblank" },
9
+ "page": { "type": "integer", "minimum": 1, "default": 1 },
10
+ "pageSize": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 }
11
+ },
12
+ "$defs": { "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" } }
13
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamRecycleListResult",
4
+ "description": "DAM 回收站分页结果。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["repository_id", "page", "page_size", "total", "entries"],
8
+ "properties": {
9
+ "repository_id": { "$ref": "#/$defs/nonblank" },
10
+ "page": { "type": "integer", "minimum": 1 },
11
+ "page_size": { "type": "integer", "minimum": 1, "maximum": 100 },
12
+ "total": { "type": "integer", "minimum": 0 },
13
+ "entries": { "type": "array", "items": { "$ref": "#/$defs/entry" } }
14
+ },
15
+ "$defs": {
16
+ "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" },
17
+ "assetType": { "type": "string", "enum": ["image", "video", "audio", "font", "template", "file"] },
18
+ "entry": {
19
+ "type": "object",
20
+ "additionalProperties": false,
21
+ "required": ["entry_id", "kind", "title", "remaining_days"],
22
+ "properties": {
23
+ "entry_id": { "$ref": "#/$defs/nonblank" },
24
+ "kind": { "type": "string", "enum": ["asset", "folder"] },
25
+ "title": { "$ref": "#/$defs/nonblank" },
26
+ "remaining_days": { "type": "integer", "minimum": 0 },
27
+ "deleted_at": { "$ref": "#/$defs/nonblank" },
28
+ "type": { "$ref": "#/$defs/assetType" },
29
+ "format": { "$ref": "#/$defs/nonblank" },
30
+ "cover_url": { "type": "string", "format": "uri" }
31
+ }
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamRecycleRestoreInput",
4
+ "description": "恢复一个 DAM 回收站条目。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["entry_id", "kind"],
8
+ "properties": {
9
+ "entry_id": { "$ref": "#/$defs/nonblank" },
10
+ "kind": { "type": "string", "enum": ["asset", "folder"] },
11
+ "repositoryId": { "$ref": "#/$defs/nonblank" }
12
+ },
13
+ "$defs": { "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" } }
14
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamRecycleRestoreOutput",
4
+ "description": "DAM 回收站恢复成功后没有业务结果。",
5
+ "type": "null"
6
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamRenameInput",
4
+ "description": "重命名一个 DAM 素材或文件夹。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["entry_id", "kind", "title"],
8
+ "properties": {
9
+ "entry_id": { "$ref": "#/$defs/nonblank" },
10
+ "kind": { "$ref": "#/$defs/kind" },
11
+ "title": { "type": "string", "minLength": 1, "maxLength": 100, "pattern": ".*\\S.*" },
12
+ "repositoryId": { "$ref": "#/$defs/nonblank" }
13
+ },
14
+ "$defs": {
15
+ "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" },
16
+ "kind": { "type": "string", "enum": ["asset", "folder"] }
17
+ }
18
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamRenameResult",
4
+ "description": "重命名后的 DAM 条目。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["entry_id", "kind", "repository_id", "title"],
8
+ "properties": {
9
+ "entry_id": { "$ref": "#/$defs/nonblank" },
10
+ "kind": { "$ref": "#/$defs/kind" },
11
+ "repository_id": { "$ref": "#/$defs/nonblank" },
12
+ "title": { "type": "string", "minLength": 1, "maxLength": 100, "pattern": ".*\\S.*" }
13
+ },
14
+ "$defs": {
15
+ "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" },
16
+ "kind": { "type": "string", "enum": ["asset", "folder"] }
17
+ }
18
+ }