gaoding-cli 1.0.0-alpha.10

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 (107) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +38 -0
  3. package/contracts/operations/agent.send/input.schema.json +354 -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.delete/input.schema.json +23 -0
  8. package/contracts/operations/dam.delete/output.schema.json +6 -0
  9. package/contracts/operations/dam.get/input.schema.json +16 -0
  10. package/contracts/operations/dam.get/output.schema.json +46 -0
  11. package/contracts/operations/dam.list/input.schema.json +44 -0
  12. package/contracts/operations/dam.list/output.schema.json +71 -0
  13. package/contracts/operations/dam.search/input.schema.json +46 -0
  14. package/contracts/operations/dam.search/output.schema.json +71 -0
  15. package/contracts/operations/dam.upload/input.schema.json +31 -0
  16. package/contracts/operations/dam.upload/output.schema.json +46 -0
  17. package/contracts/operations/editor.apply/input.schema.json +134 -0
  18. package/contracts/operations/editor.apply/output.schema.json +15 -0
  19. package/contracts/operations/editor.connect/input.schema.json +15 -0
  20. package/contracts/operations/editor.connect/output.schema.json +17 -0
  21. package/contracts/operations/editor.disconnect/input.schema.json +8 -0
  22. package/contracts/operations/editor.disconnect/output.schema.json +14 -0
  23. package/contracts/operations/editor.save/input.schema.json +8 -0
  24. package/contracts/operations/editor.save/output.schema.json +23 -0
  25. package/contracts/operations/editor.screenshot/input.schema.json +8 -0
  26. package/contracts/operations/editor.screenshot/output.schema.json +16 -0
  27. package/contracts/operations/editor.snapshot/input.schema.json +8 -0
  28. package/contracts/operations/editor.snapshot/output.schema.json +113 -0
  29. package/contracts/operations/model.get/input.schema.json +18 -0
  30. package/contracts/operations/model.get/output.schema.json +190 -0
  31. package/contracts/operations/model.list/input.schema.json +15 -0
  32. package/contracts/operations/model.list/output.schema.json +111 -0
  33. package/contracts/operations/org.current/input.schema.json +7 -0
  34. package/contracts/operations/org.current/output.schema.json +49 -0
  35. package/contracts/operations/org.list/input.schema.json +7 -0
  36. package/contracts/operations/org.list/output.schema.json +71 -0
  37. package/contracts/operations/tool.call/input.schema.json +35 -0
  38. package/contracts/operations/tool.call/output.schema.json +129 -0
  39. package/contracts/operations/tool.list/input.schema.json +7 -0
  40. package/contracts/operations/tool.list/output.schema.json +45 -0
  41. package/dist/bin/gd-cli.js +38 -0
  42. package/dist/bin/postinstall.js +42 -0
  43. package/dist/src/bootstrap/create-cli.js +55 -0
  44. package/dist/src/bootstrap/create-runtime.js +222 -0
  45. package/dist/src/bootstrap/validators.js +118 -0
  46. package/dist/src/cli/action-binding.js +63 -0
  47. package/dist/src/cli/agent-commands.js +39 -0
  48. package/dist/src/cli/auth-commands.js +47 -0
  49. package/dist/src/cli/dam-commands.js +207 -0
  50. package/dist/src/cli/editor-commands.js +73 -0
  51. package/dist/src/cli/errors.js +90 -0
  52. package/dist/src/cli/model-commands.js +47 -0
  53. package/dist/src/cli/org-commands.js +52 -0
  54. package/dist/src/cli/presenter.js +80 -0
  55. package/dist/src/cli/prompt.js +30 -0
  56. package/dist/src/cli/tool-commands.js +65 -0
  57. package/dist/src/cli/update-command.js +12 -0
  58. package/dist/src/contracts/schema.js +4 -0
  59. package/dist/src/features/agent/creative-agent-adapter.js +31 -0
  60. package/dist/src/features/agent/creative-protocol.js +324 -0
  61. package/dist/src/features/agent/creative-stream.js +127 -0
  62. package/dist/src/features/agent/use-cases.js +113 -0
  63. package/dist/src/features/auth/access-policy.js +101 -0
  64. package/dist/src/features/auth/credential-store.js +62 -0
  65. package/dist/src/features/auth/sso-service.js +179 -0
  66. package/dist/src/features/auth/state.js +129 -0
  67. package/dist/src/features/auth/use-cases.js +106 -0
  68. package/dist/src/features/dam/asset-projection.js +270 -0
  69. package/dist/src/features/dam/dam-api-adapter.js +206 -0
  70. package/dist/src/features/dam/object-storage.js +191 -0
  71. package/dist/src/features/dam/registered-uploader.js +224 -0
  72. package/dist/src/features/dam/storage-upload.js +141 -0
  73. package/dist/src/features/dam/transient-uploader.js +17 -0
  74. package/dist/src/features/dam/use-cases.js +151 -0
  75. package/dist/src/features/editor/bridge-client.js +96 -0
  76. package/dist/src/features/editor/bridge-process.js +222 -0
  77. package/dist/src/features/editor/bridge-server.js +311 -0
  78. package/dist/src/features/editor/protocol.js +1 -0
  79. package/dist/src/features/editor/session-state.js +78 -0
  80. package/dist/src/features/editor/session.js +193 -0
  81. package/dist/src/features/editor/use-cases.js +61 -0
  82. package/dist/src/features/org/org-service.js +76 -0
  83. package/dist/src/features/org/use-cases.js +140 -0
  84. package/dist/src/features/skill/bundled-skills.js +55 -0
  85. package/dist/src/features/skill/installer.js +265 -0
  86. package/dist/src/features/tool/catalog.js +79 -0
  87. package/dist/src/features/tool/dynamic-schema.js +96 -0
  88. package/dist/src/features/tool/mns-catalog-adapter.js +262 -0
  89. package/dist/src/features/tool/tool-api-adapter.js +200 -0
  90. package/dist/src/features/tool/use-cases.js +126 -0
  91. package/dist/src/features/update/update-service.js +194 -0
  92. package/dist/src/platform/json-input.js +64 -0
  93. package/dist/src/platform/local-json-file.js +59 -0
  94. package/dist/src/platform/open-browser.js +8 -0
  95. package/dist/src/platform/redact.js +80 -0
  96. package/dist/src/platform/safe-upload-file.js +146 -0
  97. package/dist/src/platform/signature.js +19 -0
  98. package/dist/src/platform/signed-http-transport.js +109 -0
  99. package/dist/src/platform/url-safety.js +100 -0
  100. package/package.json +56 -0
  101. package/skills/gd-cli/SKILL.md +15 -0
  102. package/skills/gd-cli/references/auth-org.md +9 -0
  103. package/skills/gd-cli/references/creation.md +38 -0
  104. package/skills/gd-cli/references/dam.md +20 -0
  105. package/skills/gd-cli/references/editor.md +12 -0
  106. package/skills/gd-cli/references/errors.md +10 -0
  107. package/skills/gd-cli/references/update.md +11 -0
@@ -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,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,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 素材概要。",
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 请求的分页大小。" },
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": "素材概要。"
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,46 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamSearchInput",
4
+ "description": "DAM 素材搜索参数。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["query"],
8
+ "not": {
9
+ "properties": { "repositoryId": true, "allRepositories": true },
10
+ "required": ["repositoryId", "allRepositories"]
11
+ },
12
+ "properties": {
13
+ "query": { "$ref": "#/$defs/nonblank", "description": "搜索关键词。" },
14
+ "repositoryId": { "$ref": "#/$defs/nonblank", "description": "指定资源库 ID。" },
15
+ "allRepositories": { "type": "boolean", "description": "是否查询全部可访问资源库。" },
16
+ "folderId": { "$ref": "#/$defs/nonblank", "description": "指定文件夹 ID。" },
17
+ "includeChildFolder": { "type": "boolean", "description": "是否包含子文件夹。" },
18
+ "type": { "$ref": "#/$defs/assetType", "description": "素材类型。" },
19
+ "assetFormats": {
20
+ "type": "array",
21
+ "minItems": 1,
22
+ "items": { "$ref": "#/$defs/nonblank" },
23
+ "description": "文件格式筛选。"
24
+ },
25
+ "tagIds": {
26
+ "type": "array",
27
+ "minItems": 1,
28
+ "items": { "$ref": "#/$defs/nonblank" },
29
+ "description": "标签 ID 筛选。"
30
+ },
31
+ "pageSize": {
32
+ "type": "integer",
33
+ "minimum": 1,
34
+ "maximum": 100,
35
+ "description": "DAM 请求的分页大小。"
36
+ },
37
+ "cursor": { "$ref": "#/$defs/nonblank", "description": "分页游标。" }
38
+ },
39
+ "$defs": {
40
+ "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" },
41
+ "assetType": {
42
+ "type": "string",
43
+ "enum": ["image", "video", "audio", "font", "template", "file"]
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamSearchResult",
4
+ "description": "一页 DAM 素材搜索结果。",
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 请求的分页大小。" },
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": "素材概要。"
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,31 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamUploadInput",
4
+ "description": "DAM 素材上传参数。",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["file"],
8
+ "properties": {
9
+ "file": { "$ref": "#/$defs/nonblank", "description": "本地文件路径。" },
10
+ "repositoryId": { "$ref": "#/$defs/nonblank", "description": "目标资源库 ID。" },
11
+ "title": { "$ref": "#/$defs/nonblank", "description": "素材标题。" },
12
+ "folderId": { "$ref": "#/$defs/nonblank", "description": "目标文件夹 ID。" },
13
+ "tagIds": {
14
+ "type": "array",
15
+ "minItems": 1,
16
+ "items": { "$ref": "#/$defs/nonblank" },
17
+ "description": "素材标签 ID。"
18
+ },
19
+ "allowSensitivePath": {
20
+ "type": "boolean",
21
+ "description": "是否明确允许受保护路径。"
22
+ },
23
+ "waitAnalysis": {
24
+ "type": "boolean",
25
+ "description": "是否等待素材分析结束。"
26
+ }
27
+ },
28
+ "$defs": {
29
+ "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" }
30
+ }
31
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DamUploadOutput",
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
+ }