@gaoding/cli 2.0.0 → 2.1.1
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.
- package/README.md +5 -0
- package/contracts/operations/agent.send/input.schema.json +8 -84
- package/contracts/operations/agent.send/output.schema.json +6 -6
- package/contracts/operations/credits.get/input.schema.json +9 -0
- package/contracts/operations/credits.get/output.schema.json +107 -0
- package/contracts/operations/credits.usage.get/input.schema.json +18 -0
- package/contracts/operations/credits.usage.get/output.schema.json +53 -0
- package/contracts/operations/credits.usage.list/input.schema.json +32 -0
- package/contracts/operations/credits.usage.list/output.schema.json +144 -0
- package/contracts/operations/dam.folder.list/input.schema.json +1 -1
- package/contracts/operations/dam.folder.list/output.schema.json +1 -1
- package/contracts/operations/dam.list/input.schema.json +2 -5
- package/contracts/operations/dam.list/output.schema.json +1 -1
- package/contracts/operations/dam.search/input.schema.json +2 -5
- package/contracts/operations/dam.search/output.schema.json +1 -1
- package/contracts/operations/model.get/output.schema.json +6 -5
- package/contracts/operations/model.list/output.schema.json +5 -4
- package/contracts/operations/task.get/output.schema.json +22 -11
- package/contracts/operations/tool.call/models/image-edit-smart.schema.json +7 -5
- package/contracts/operations/tool.call/models/image-edit-standard.schema.json +6 -4
- package/contracts/operations/tool.call/models/image-enhance-smart.schema.json +5 -3
- package/contracts/operations/tool.call/models/image-enhance-standard.schema.json +3 -2
- package/contracts/operations/tool.call/models/image-expand-smart.schema.json +16 -10
- package/contracts/operations/tool.call/models/image-expand-standard.schema.json +13 -8
- package/contracts/operations/tool.call/models/image-layers-layout.schema.json +3 -2
- package/contracts/operations/tool.call/models/image-layers-smart.schema.json +3 -4
- package/contracts/operations/tool.call/models/image-matting-smart.schema.json +6 -4
- package/contracts/operations/tool.call/models/image-matting-standard.schema.json +3 -2
- package/contracts/operations/tool.call/models/image-ocr.schema.json +3 -2
- package/contracts/operations/tool.call/models/image-remove-smart.schema.json +6 -4
- package/contracts/operations/tool.call/models/image-remove-standard.schema.json +4 -3
- package/contracts/operations/tool.call/models/image-text-edit.schema.json +5 -3
- package/contracts/operations/tool.call/models/image-vectorize.schema.json +3 -2
- package/contracts/operations/tool.call/models/video-edit-smart.schema.json +6 -6
- package/contracts/operations/tool.call/models/video-enhance-smart.schema.json +7 -4
- package/contracts/operations/tool.call/models/video-enhance-standard.schema.json +5 -3
- package/contracts/operations/tool.call/ocr-payload.schema.json +4 -5
- package/contracts/operations/tool.call/output.schema.json +9 -8
- package/dist/bin/postinstall.js +22 -6
- package/dist/bin/task-worker.js +2 -2
- package/dist/src/bootstrap/create-cli.js +31 -15
- package/dist/src/bootstrap/create-runtime.js +103 -30
- package/dist/src/bootstrap/run-task-worker.js +6 -2
- package/dist/src/bootstrap/validators.js +4 -1
- package/dist/src/cli/action-binding.js +17 -50
- package/dist/src/cli/agent-commands.js +11 -11
- package/dist/src/cli/auth-commands.js +2 -1
- package/dist/src/cli/creation-help.js +9 -0
- package/dist/src/cli/credits-command.js +127 -16
- package/dist/src/cli/dam-commands.js +10 -14
- package/dist/src/cli/editor-commands.js +7 -5
- package/dist/src/cli/errors.js +81 -22
- package/dist/src/cli/host-input.js +64 -5
- package/dist/src/cli/model-commands.js +9 -3
- package/dist/src/cli/observed-errors.js +7 -3
- package/dist/src/cli/org-commands.js +3 -1
- package/dist/src/cli/presenter.js +4 -0
- package/dist/src/cli/task-commands.js +6 -2
- package/dist/src/cli/tool-commands.js +12 -11
- package/dist/src/cli/update-command.js +24 -1
- package/dist/src/features/agent/creative-agent-adapter.js +6 -2
- package/dist/src/features/agent/creative-protocol.js +8 -29
- package/dist/src/features/agent/resource-authorizer.js +25 -17
- package/dist/src/features/agent/result-reader.js +31 -14
- package/dist/src/features/agent/use-cases.js +6 -31
- package/dist/src/features/credits/amount.js +51 -0
- package/dist/src/features/credits/response.js +11 -0
- package/dist/src/features/credits/use-cases.js +200 -30
- package/dist/src/features/dam/asset-projection.js +3 -6
- package/dist/src/features/dam/dam-api-adapter.js +30 -15
- package/dist/src/features/dam/repository-catalog.js +30 -21
- package/dist/src/features/dam/use-cases.js +12 -7
- package/dist/src/features/editor/bridge-client.js +0 -2
- package/dist/src/features/editor/public-url.js +1 -36
- package/dist/src/features/editor/session.js +3 -2
- package/dist/src/features/editor/use-cases.js +27 -2
- package/dist/src/features/org/org-service.js +10 -1
- package/dist/src/features/org/use-cases.js +18 -4
- package/dist/src/features/task/process-owner.js +54 -0
- package/dist/src/features/task/store.js +37 -10
- package/dist/src/features/task/task-background.js +5 -2
- package/dist/src/features/task/use-cases.js +184 -84
- package/dist/src/features/tool/argument-paths.js +14 -0
- package/dist/src/features/tool/canvas-copy.js +28 -15
- package/dist/src/features/tool/canvas-matting.js +123 -0
- package/dist/src/features/tool/canvas-media.js +100 -52
- package/dist/src/features/tool/canvas-models.js +66 -33
- package/dist/src/features/tool/canvas-pricing.js +12 -0
- package/dist/src/features/tool/canvas-recovery.js +13 -30
- package/dist/src/features/tool/canvas-results.js +79 -87
- package/dist/src/features/tool/canvas-tool-adapter.js +134 -157
- package/dist/src/features/tool/canvas-video.js +44 -37
- package/dist/src/features/tool/dynamic-schema.js +39 -40
- package/dist/src/features/tool/ffprobe-executable.js +21 -0
- package/dist/src/features/tool/mns-catalog-adapter.js +61 -24
- package/dist/src/features/tool/resource-authorizer.js +11 -3
- package/dist/src/features/tool/tool-api-adapter.js +73 -82
- package/dist/src/features/tool/tool-errors.js +25 -0
- package/dist/src/features/tool/tool-output.js +15 -0
- package/dist/src/features/tool/use-cases.js +74 -98
- package/dist/src/features/update/check-schema.js +17 -0
- package/dist/src/features/update/host-receipt.js +30 -0
- package/dist/src/features/update/notice-output.js +30 -0
- package/dist/src/features/update/update-lock.js +80 -0
- package/dist/src/features/update/update-notification.js +129 -240
- package/dist/src/features/update/update-service.js +95 -21
- package/dist/src/platform/media-type.js +46 -0
- package/dist/src/platform/public-url.js +35 -0
- package/dist/src/platform/remote-error-evidence.js +33 -6
- package/dist/src/platform/resource-auth-key.js +35 -1
- package/dist/src/platform/safe-upload-file.js +36 -41
- package/dist/src/platform/signature.js +3 -1
- package/dist/src/platform/signed-http-transport.js +14 -6
- package/dist/src/platform/url-safety.js +6 -1
- package/dist/src/platform/webm-header.js +41 -0
- package/dist/src/telemetry/command-route.js +38 -0
- package/dist/src/telemetry/command-routes.json +1 -0
- package/dist/src/telemetry/failure-summary.js +1 -1
- package/dist/src/telemetry/invocation.js +1 -2
- package/dist/src/telemetry/process-errors.js +17 -33
- package/dist/src/telemetry/sanitize.js +19 -4
- package/dist/src/telemetry/sls-sink.js +8 -0
- package/package.json +4 -4
- package/skills/gd-cli/SKILL.md +19 -5
- package/skills/gd-cli/references/agent.md +9 -4
- package/skills/gd-cli/references/creation.md +3 -1
- package/skills/gd-cli/references/editor.md +7 -5
- package/skills/gd-cli/references/errors.md +19 -8
- package/skills/gd-cli/references/matting.md +3 -5
- package/skills/gd-cli/references/media-tools.md +10 -4
- package/skills/gd-cli/references/tool.md +9 -15
- package/skills/gd-cli/references/update.md +6 -0
package/README.md
CHANGED
|
@@ -30,6 +30,9 @@ gd-cli tool list
|
|
|
30
30
|
gd-cli model list --tool <tool>
|
|
31
31
|
gd-cli model get <model>
|
|
32
32
|
gd-cli editor apply --schema
|
|
33
|
+
gd-cli credits --json
|
|
34
|
+
gd-cli credits usage list --help
|
|
35
|
+
gd-cli credits usage get --schema
|
|
33
36
|
```
|
|
34
37
|
|
|
35
38
|
选定 Model 后,以 `model get` 返回的 `parameters` 与 `usageDescription` 构造实际输入;其中 `cost` 是当前上架 SKU 的稿豆价格区间,不表示某次调用的实际扣费。`tool call <tool> --schema` 只给出整个 Tool 的参数并集。运行 `gd-cli --help` 查看当前命令;运行任一命令的 `--help` 查看参数。`editor apply --schema` 无需登录或连接编辑器,输出当前版本的 Action 输入契约;与执行模式 `--input` 互斥。
|
|
@@ -38,6 +41,8 @@ CLI 最多每小时检查一次 npm `latest`,发现新版本后每天最多在
|
|
|
38
41
|
|
|
39
42
|
发布只由仓库受保护 `main` 的 CI 执行:先发布并验证 `candidate` 与精确版本安装,再提升 `latest` 并验证默认安装。版本与 dist-tag 不由本地手工修改。
|
|
40
43
|
|
|
44
|
+
`credits` 读取当前身份和组织的余额;`credits usage list` 查询一页消费、归还、回收与过期记录,`credits usage get <record-id>` 读取来源拆分。三个命令的 `--schema` 无需登录,输出本地输入与输出 Schema。流水默认当前 UTC 月份;翻页沿用返回区间和 `nextCursor`,不把本页数量当作完整消费合计。
|
|
45
|
+
|
|
41
46
|
## License
|
|
42
47
|
|
|
43
48
|
MIT
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"title": "AgentSendInput",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "发送一次业务策划或持续创作消息;先读 agent send --help 了解本轮回复、续聊与任务取回。",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"additionalProperties": false,
|
|
7
7
|
"required": [
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"type": "string",
|
|
26
26
|
"minLength": 1,
|
|
27
27
|
"pattern": ".*\\S.*",
|
|
28
|
-
"description": "
|
|
28
|
+
"description": "首次省略;继续同一创作(包括回答补充/确认)时原样使用上一轮 message.contextId,不使用 taskId。"
|
|
29
29
|
},
|
|
30
30
|
"parts": {
|
|
31
31
|
"type": "array",
|
|
@@ -79,30 +79,6 @@
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
|
-
{
|
|
83
|
-
"properties": {
|
|
84
|
-
"parts": {
|
|
85
|
-
"type": "array",
|
|
86
|
-
"contains": {
|
|
87
|
-
"$ref": "#/$defs/FirstFramePart"
|
|
88
|
-
},
|
|
89
|
-
"minContains": 0,
|
|
90
|
-
"maxContains": 1
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"properties": {
|
|
96
|
-
"parts": {
|
|
97
|
-
"type": "array",
|
|
98
|
-
"contains": {
|
|
99
|
-
"$ref": "#/$defs/LastFramePart"
|
|
100
|
-
},
|
|
101
|
-
"minContains": 0,
|
|
102
|
-
"maxContains": 1
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
82
|
{
|
|
107
83
|
"if": {
|
|
108
84
|
"properties": {
|
|
@@ -179,7 +155,7 @@
|
|
|
179
155
|
"format": "uri",
|
|
180
156
|
"minLength": 1,
|
|
181
157
|
"pattern": ".*\\S.*",
|
|
182
|
-
"description": "HTTP(S)
|
|
158
|
+
"description": "HTTP(S) 素材 URL,或 CLI 使用的标准本地 file URI。用 Python Path(path).resolve().as_uri() / Node.js pathToFileURL(path).href 从真实路径生成,转义中文、空格和 #;已有 HTTP(S) URL 原样使用。"
|
|
183
159
|
},
|
|
184
160
|
"mediaType": {
|
|
185
161
|
"type": "string",
|
|
@@ -200,12 +176,12 @@
|
|
|
200
176
|
"properties": {
|
|
201
177
|
"role": {
|
|
202
178
|
"type": "string",
|
|
203
|
-
"
|
|
179
|
+
"examples": [
|
|
204
180
|
"reference",
|
|
205
181
|
"first_frame",
|
|
206
182
|
"last_frame"
|
|
207
183
|
],
|
|
208
|
-
"description": "
|
|
184
|
+
"description": "素材角色;常用 reference、first_frame、last_frame,省略按 reference 处理。其他服务角色按所给字符串传递。"
|
|
209
185
|
}
|
|
210
186
|
}
|
|
211
187
|
}
|
|
@@ -254,18 +230,18 @@
|
|
|
254
230
|
"questionMessageId",
|
|
255
231
|
"answers"
|
|
256
232
|
],
|
|
257
|
-
"description": "
|
|
233
|
+
"description": "回答上一轮 Agent 的结构化补充/确认问题;该 Part 必须是 parts 唯一一项,同时沿用 message.contextId。普通文本续聊用 TextPart。",
|
|
258
234
|
"properties": {
|
|
259
235
|
"questionMessageId": {
|
|
260
236
|
"type": "string",
|
|
261
237
|
"minLength": 1,
|
|
262
238
|
"pattern": ".*\\S.*",
|
|
263
|
-
"description": "
|
|
239
|
+
"description": "上一轮返回的 message.messageId 原值;不是 taskId 或 contextId。"
|
|
264
240
|
},
|
|
265
241
|
"answers": {
|
|
266
242
|
"type": "array",
|
|
267
243
|
"minItems": 1,
|
|
268
|
-
"description": "
|
|
244
|
+
"description": "保留上一轮 questions 中的 question 原文,values 使用用户选择或自由回答,不擅自替用户作答。",
|
|
269
245
|
"items": {
|
|
270
246
|
"type": "object",
|
|
271
247
|
"additionalProperties": false,
|
|
@@ -296,58 +272,6 @@
|
|
|
296
272
|
}
|
|
297
273
|
}
|
|
298
274
|
}
|
|
299
|
-
},
|
|
300
|
-
"FirstFramePart": {
|
|
301
|
-
"allOf": [
|
|
302
|
-
{
|
|
303
|
-
"$ref": "#/$defs/InputAssetPart"
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
"type": "object",
|
|
307
|
-
"properties": {
|
|
308
|
-
"metadata": {
|
|
309
|
-
"type": "object",
|
|
310
|
-
"properties": {
|
|
311
|
-
"role": {
|
|
312
|
-
"const": "first_frame"
|
|
313
|
-
}
|
|
314
|
-
},
|
|
315
|
-
"required": [
|
|
316
|
-
"role"
|
|
317
|
-
]
|
|
318
|
-
}
|
|
319
|
-
},
|
|
320
|
-
"required": [
|
|
321
|
-
"metadata"
|
|
322
|
-
]
|
|
323
|
-
}
|
|
324
|
-
]
|
|
325
|
-
},
|
|
326
|
-
"LastFramePart": {
|
|
327
|
-
"allOf": [
|
|
328
|
-
{
|
|
329
|
-
"$ref": "#/$defs/InputAssetPart"
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
"type": "object",
|
|
333
|
-
"properties": {
|
|
334
|
-
"metadata": {
|
|
335
|
-
"type": "object",
|
|
336
|
-
"properties": {
|
|
337
|
-
"role": {
|
|
338
|
-
"const": "last_frame"
|
|
339
|
-
}
|
|
340
|
-
},
|
|
341
|
-
"required": [
|
|
342
|
-
"role"
|
|
343
|
-
]
|
|
344
|
-
}
|
|
345
|
-
},
|
|
346
|
-
"required": [
|
|
347
|
-
"metadata"
|
|
348
|
-
]
|
|
349
|
-
}
|
|
350
|
-
]
|
|
351
275
|
}
|
|
352
276
|
}
|
|
353
277
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"title": "AgentSendOutput",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "本轮 Agent 的完整回复及实际消耗;回复可能是文本、资源或补充/确认问题,不保证本轮已有成品。",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"additionalProperties": false,
|
|
7
7
|
"required": [
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"properties": {
|
|
12
12
|
"message": {
|
|
13
13
|
"$ref": "#/$defs/AgentMessage",
|
|
14
|
-
"description": "
|
|
14
|
+
"description": "本轮已完成的回复;读取 parts 后决定交付实际资源、转述文本或向用户提问。"
|
|
15
15
|
},
|
|
16
16
|
"usage": {
|
|
17
17
|
"$ref": "#/$defs/AgentUsage",
|
|
18
|
-
"description": "
|
|
18
|
+
"description": "本轮服务已确认的实扣合计;若命令提示计费记录不完整,此数仅是已知部分,请以对应账单为准。"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"$defs": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"properties": {
|
|
49
49
|
"cost": {
|
|
50
50
|
"$ref": "#/$defs/ActualCost",
|
|
51
|
-
"description": "
|
|
51
|
+
"description": "本轮有有效实扣记录的金额合计;若命令提示计费不完整,以账单为准,不能据此推断免费。"
|
|
52
52
|
},
|
|
53
53
|
"items": {
|
|
54
54
|
"type": "array",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"parts": {
|
|
100
100
|
"type": "array",
|
|
101
101
|
"minItems": 1,
|
|
102
|
-
"description": "
|
|
102
|
+
"description": "本轮文本、资源或有效问题;按实际内容交付,不能把计划或确认文本说成图片/视频已生成。续聊沿用 contextId,结构化答复使用 messageId。",
|
|
103
103
|
"items": {
|
|
104
104
|
"$ref": "#/$defs/AgentPart"
|
|
105
105
|
}
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
"format": "uri",
|
|
182
182
|
"minLength": 1,
|
|
183
183
|
"pattern": ".*\\S.*",
|
|
184
|
-
"description": "
|
|
184
|
+
"description": "生成素材的完整访问 URL。交付时原样保留查询参数,不截断、拼接或按诊断日志脱敏规则删除授权参数。"
|
|
185
185
|
},
|
|
186
186
|
"mediaType": {
|
|
187
187
|
"type": "string",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.gaoding.com/operations/credits.get/input.schema.json",
|
|
4
|
+
"title": "CreditsGetInput",
|
|
5
|
+
"description": "查询当前身份及组织上下文的余额,无业务参数。",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {}
|
|
9
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.gaoding.com/operations/credits.get/output.schema.json",
|
|
4
|
+
"title": "CreditsResult",
|
|
5
|
+
"description": "当前身份及组织上下文的权益概览;保留池余额与成员周期限额的区别。",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"credits"
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"credits": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"additionalProperties": false,
|
|
15
|
+
"required": [
|
|
16
|
+
"unit",
|
|
17
|
+
"total",
|
|
18
|
+
"used",
|
|
19
|
+
"pending",
|
|
20
|
+
"available"
|
|
21
|
+
],
|
|
22
|
+
"properties": {
|
|
23
|
+
"unit": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"enum": [
|
|
26
|
+
"gaodou",
|
|
27
|
+
"credit"
|
|
28
|
+
],
|
|
29
|
+
"description": "产品配置决定的计量单位;稿豆或 insMind credit,不代表货币。"
|
|
30
|
+
},
|
|
31
|
+
"total": {
|
|
32
|
+
"type": "number",
|
|
33
|
+
"minimum": 0,
|
|
34
|
+
"maximum": 9007199254740991,
|
|
35
|
+
"description": "该权益行的 total;不等同于终身累计充值。"
|
|
36
|
+
},
|
|
37
|
+
"used": {
|
|
38
|
+
"type": "number",
|
|
39
|
+
"minimum": 0,
|
|
40
|
+
"maximum": 9007199254740991,
|
|
41
|
+
"description": "与该权益行总量配对的已用量;不等同于所选日期消费合计。"
|
|
42
|
+
},
|
|
43
|
+
"pending": {
|
|
44
|
+
"type": "number",
|
|
45
|
+
"minimum": 0,
|
|
46
|
+
"maximum": 9007199254740991,
|
|
47
|
+
"description": "服务端 wait 的数值;含义由服务端定义,不承诺待生效或冻结。"
|
|
48
|
+
},
|
|
49
|
+
"available": {
|
|
50
|
+
"type": "number",
|
|
51
|
+
"minimum": 0,
|
|
52
|
+
"maximum": 9007199254740991,
|
|
53
|
+
"description": "max(0,total-used);不扣除 wait,不代表成员限额内可用量。"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"balances": {
|
|
58
|
+
"type": "array",
|
|
59
|
+
"description": "多行概览或存在成员限额时返回完整权益行;不按 identifier 去重。",
|
|
60
|
+
"items": {
|
|
61
|
+
"type": "object",
|
|
62
|
+
"additionalProperties": false,
|
|
63
|
+
"required": [
|
|
64
|
+
"total",
|
|
65
|
+
"used",
|
|
66
|
+
"pending",
|
|
67
|
+
"available"
|
|
68
|
+
],
|
|
69
|
+
"properties": {
|
|
70
|
+
"identifier": {
|
|
71
|
+
"type": "string"
|
|
72
|
+
},
|
|
73
|
+
"total": {
|
|
74
|
+
"type": "number",
|
|
75
|
+
"minimum": 0,
|
|
76
|
+
"maximum": 9007199254740991,
|
|
77
|
+
"description": "该权益行的 total;不等同于终身累计充值。"
|
|
78
|
+
},
|
|
79
|
+
"used": {
|
|
80
|
+
"type": "number",
|
|
81
|
+
"minimum": 0,
|
|
82
|
+
"maximum": 9007199254740991,
|
|
83
|
+
"description": "与该权益行总量配对的已用量;不等同于所选日期消费合计。"
|
|
84
|
+
},
|
|
85
|
+
"pending": {
|
|
86
|
+
"type": "number",
|
|
87
|
+
"minimum": 0,
|
|
88
|
+
"maximum": 9007199254740991,
|
|
89
|
+
"description": "服务端 wait 的数值;含义由服务端定义,不承诺待生效或冻结。"
|
|
90
|
+
},
|
|
91
|
+
"available": {
|
|
92
|
+
"type": "number",
|
|
93
|
+
"minimum": 0,
|
|
94
|
+
"maximum": 9007199254740991,
|
|
95
|
+
"description": "max(0,total-used);不扣除 wait,不代表成员限额内可用量。"
|
|
96
|
+
},
|
|
97
|
+
"memberPeriodLimit": {
|
|
98
|
+
"type": "number",
|
|
99
|
+
"minimum": 0,
|
|
100
|
+
"maximum": 9007199254740991,
|
|
101
|
+
"description": "服务端成员周期限额,0 是有效限额;不以它覆盖权益池余额。"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.gaoding.com/operations/credits.usage.get/input.schema.json",
|
|
4
|
+
"title": "CreditsUsageGetInput",
|
|
5
|
+
"description": "按列表返回的记录 ID 查询来源拆分。",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"id"
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"id": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"minLength": 1,
|
|
15
|
+
"pattern": ".*\\S.*"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.gaoding.com/operations/credits.usage.get/output.schema.json",
|
|
4
|
+
"title": "CreditsUsageGetResult",
|
|
5
|
+
"description": "服务端提供的单条记录来源拆分;空数组不表示该记录数量为零。",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"id",
|
|
10
|
+
"unit",
|
|
11
|
+
"breakdown"
|
|
12
|
+
],
|
|
13
|
+
"properties": {
|
|
14
|
+
"id": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"minLength": 1,
|
|
17
|
+
"pattern": ".*\\S.*"
|
|
18
|
+
},
|
|
19
|
+
"unit": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"enum": [
|
|
22
|
+
"gaodou",
|
|
23
|
+
"credit"
|
|
24
|
+
],
|
|
25
|
+
"description": "产品配置决定的计量单位;稿豆或 insMind credit,不代表货币。"
|
|
26
|
+
},
|
|
27
|
+
"breakdown": {
|
|
28
|
+
"type": "array",
|
|
29
|
+
"items": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"additionalProperties": false,
|
|
32
|
+
"required": [
|
|
33
|
+
"amount"
|
|
34
|
+
],
|
|
35
|
+
"properties": {
|
|
36
|
+
"amount": {
|
|
37
|
+
"type": "number",
|
|
38
|
+
"minimum": 0,
|
|
39
|
+
"maximum": 9007199254740991
|
|
40
|
+
},
|
|
41
|
+
"usageType": {
|
|
42
|
+
"type": "number",
|
|
43
|
+
"description": "服务端 usage_type;1 为消费、2 为归还,其他值保留不推断方向。"
|
|
44
|
+
},
|
|
45
|
+
"sourceType": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"description": "服务端权益来源类型;保留未知值。"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.gaoding.com/operations/credits.usage.list/input.schema.json",
|
|
4
|
+
"title": "CreditsUsageListInput",
|
|
5
|
+
"description": "按含端点的时间区间读取一页服务端变动流水;默认 UTC 本月,20 条。",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"from": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"format": "date-time",
|
|
12
|
+
"description": "含起始时刻;ISO 8601 时间戳,必须含 Z 或时区偏移。省略为当前 UTC 月首。"
|
|
13
|
+
},
|
|
14
|
+
"to": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"format": "date-time",
|
|
17
|
+
"description": "含结束时刻;ISO 8601 时间戳,必须含 Z 或时区偏移。省略为当前 UTC 月末。"
|
|
18
|
+
},
|
|
19
|
+
"limit": {
|
|
20
|
+
"type": "integer",
|
|
21
|
+
"minimum": 1,
|
|
22
|
+
"default": 20,
|
|
23
|
+
"description": "每页条数;不在 CLI 声明未经确认的服务端最大值。"
|
|
24
|
+
},
|
|
25
|
+
"cursor": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"minLength": 1,
|
|
28
|
+
"pattern": ".*\\S.*",
|
|
29
|
+
"description": "上一页 nextCursor,原样传递;翻页时保持相同时间区间。"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.gaoding.com/operations/credits.usage.list/output.schema.json",
|
|
4
|
+
"title": "CreditsUsageListResult",
|
|
5
|
+
"description": "带实际 UTC 区间和继续游标的一页变动流水。",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"unit",
|
|
10
|
+
"range",
|
|
11
|
+
"items",
|
|
12
|
+
"hasMore",
|
|
13
|
+
"nextCursor"
|
|
14
|
+
],
|
|
15
|
+
"properties": {
|
|
16
|
+
"unit": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"enum": [
|
|
19
|
+
"gaodou",
|
|
20
|
+
"credit"
|
|
21
|
+
],
|
|
22
|
+
"description": "产品配置决定的计量单位;稿豆或 insMind credit,不代表货币。"
|
|
23
|
+
},
|
|
24
|
+
"range": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"additionalProperties": false,
|
|
27
|
+
"required": [
|
|
28
|
+
"from",
|
|
29
|
+
"to"
|
|
30
|
+
],
|
|
31
|
+
"properties": {
|
|
32
|
+
"from": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"format": "date-time"
|
|
35
|
+
},
|
|
36
|
+
"to": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"format": "date-time"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"items": {
|
|
43
|
+
"type": "array",
|
|
44
|
+
"items": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": [
|
|
48
|
+
"id",
|
|
49
|
+
"changeType",
|
|
50
|
+
"amount",
|
|
51
|
+
"recordedAt"
|
|
52
|
+
],
|
|
53
|
+
"properties": {
|
|
54
|
+
"id": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"minLength": 1,
|
|
57
|
+
"pattern": ".*\\S.*"
|
|
58
|
+
},
|
|
59
|
+
"changeType": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"minLength": 1,
|
|
62
|
+
"pattern": ".*\\S.*",
|
|
63
|
+
"description": "服务端变动类型。CONSUME 消费、RESTORE 归还、RECYCLE 回收、EXPIRE 过期;其他值保留,不假设方向。"
|
|
64
|
+
},
|
|
65
|
+
"amount": {
|
|
66
|
+
"type": "number",
|
|
67
|
+
"minimum": 0,
|
|
68
|
+
"maximum": 9007199254740991,
|
|
69
|
+
"description": "该条变动的无符号数量,不是所有类型均属于消费。"
|
|
70
|
+
},
|
|
71
|
+
"recordedAt": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"format": "date-time"
|
|
74
|
+
},
|
|
75
|
+
"recordMode": {
|
|
76
|
+
"type": "string"
|
|
77
|
+
},
|
|
78
|
+
"description": {
|
|
79
|
+
"type": "string"
|
|
80
|
+
},
|
|
81
|
+
"scene": {
|
|
82
|
+
"type": "number"
|
|
83
|
+
},
|
|
84
|
+
"referenceId": {
|
|
85
|
+
"type": "string"
|
|
86
|
+
},
|
|
87
|
+
"user": {
|
|
88
|
+
"type": "object",
|
|
89
|
+
"additionalProperties": false,
|
|
90
|
+
"properties": {
|
|
91
|
+
"id": {
|
|
92
|
+
"type": "string"
|
|
93
|
+
},
|
|
94
|
+
"name": {
|
|
95
|
+
"type": "string"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"description": "本页记录,不代表区间完整账本,不提供推测的总数或总消费。"
|
|
102
|
+
},
|
|
103
|
+
"hasMore": {
|
|
104
|
+
"type": "boolean"
|
|
105
|
+
},
|
|
106
|
+
"nextCursor": {
|
|
107
|
+
"type": [
|
|
108
|
+
"string",
|
|
109
|
+
"null"
|
|
110
|
+
],
|
|
111
|
+
"description": "后续页的 opaque cursor;无后续页时为 null。"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"allOf": [
|
|
115
|
+
{
|
|
116
|
+
"if": {
|
|
117
|
+
"properties": {
|
|
118
|
+
"hasMore": {
|
|
119
|
+
"const": true
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"required": [
|
|
123
|
+
"hasMore"
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
"then": {
|
|
127
|
+
"properties": {
|
|
128
|
+
"nextCursor": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"minLength": 1,
|
|
131
|
+
"pattern": ".*\\S.*"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"else": {
|
|
136
|
+
"properties": {
|
|
137
|
+
"nextCursor": {
|
|
138
|
+
"type": "null"
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"parentId": { "$ref": "#/$defs/nonblank", "default": "0", "description": "父文件夹 ID。" },
|
|
10
10
|
"query": { "$ref": "#/$defs/nonblank", "description": "文件夹标题关键词。" },
|
|
11
11
|
"page": { "type": "integer", "minimum": 1, "default": 1, "description": "页码。" },
|
|
12
|
-
"pageSize": { "type": "integer", "minimum": 1, "
|
|
12
|
+
"pageSize": { "type": "integer", "minimum": 1, "default": 20, "description": "每页数量。" }
|
|
13
13
|
},
|
|
14
14
|
"$defs": { "nonblank": { "type": "string", "minLength": 1, "pattern": ".*\\S.*" } }
|
|
15
15
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"repository_id": { "$ref": "#/$defs/nonblank" },
|
|
10
10
|
"parent_id": { "$ref": "#/$defs/nonblank" },
|
|
11
11
|
"page": { "type": "integer", "minimum": 1 },
|
|
12
|
-
"page_size": { "type": "integer", "minimum": 1
|
|
12
|
+
"page_size": { "type": "integer", "minimum": 1 },
|
|
13
13
|
"total": { "type": "integer", "minimum": 0 },
|
|
14
14
|
"folders": { "type": "array", "items": { "$ref": "#/$defs/folder" } }
|
|
15
15
|
},
|
|
@@ -16,20 +16,17 @@
|
|
|
16
16
|
"type": { "$ref": "#/$defs/assetType", "description": "素材类型。" },
|
|
17
17
|
"assetFormats": {
|
|
18
18
|
"type": "array",
|
|
19
|
-
"
|
|
20
|
-
"items": { "$ref": "#/$defs/nonblank" },
|
|
19
|
+
"items": { "type": "string" },
|
|
21
20
|
"description": "文件格式筛选。"
|
|
22
21
|
},
|
|
23
22
|
"tagIds": {
|
|
24
23
|
"type": "array",
|
|
25
|
-
"
|
|
26
|
-
"items": { "$ref": "#/$defs/nonblank" },
|
|
24
|
+
"items": { "type": "string" },
|
|
27
25
|
"description": "标签 ID 筛选。"
|
|
28
26
|
},
|
|
29
27
|
"pageSize": {
|
|
30
28
|
"type": "integer",
|
|
31
29
|
"minimum": 1,
|
|
32
|
-
"maximum": 100,
|
|
33
30
|
"description": "DAM 请求的分页大小。"
|
|
34
31
|
},
|
|
35
32
|
"cursor": { "$ref": "#/$defs/nonblank", "description": "分页游标。" }
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"items": { "$ref": "#/$defs/nonblank" },
|
|
13
13
|
"description": "本次查询的资源库 ID。"
|
|
14
14
|
},
|
|
15
|
-
"page_size": { "type": "integer", "minimum": 1, "
|
|
15
|
+
"page_size": { "type": "integer", "minimum": 1, "description": "本次 DAM 请求的分页大小;实际 assets 数量可能大于该值。" },
|
|
16
16
|
"total": { "type": "integer", "minimum": 0, "description": "匹配素材总数。" },
|
|
17
17
|
"finish": { "type": "boolean", "description": "是否已到最后一页。" },
|
|
18
18
|
"next_cursor": { "$ref": "#/$defs/nonblank", "description": "下一页游标。" },
|
|
@@ -18,20 +18,17 @@
|
|
|
18
18
|
"type": { "$ref": "#/$defs/assetType", "description": "素材类型。" },
|
|
19
19
|
"assetFormats": {
|
|
20
20
|
"type": "array",
|
|
21
|
-
"
|
|
22
|
-
"items": { "$ref": "#/$defs/nonblank" },
|
|
21
|
+
"items": { "type": "string" },
|
|
23
22
|
"description": "文件格式筛选。"
|
|
24
23
|
},
|
|
25
24
|
"tagIds": {
|
|
26
25
|
"type": "array",
|
|
27
|
-
"
|
|
28
|
-
"items": { "$ref": "#/$defs/nonblank" },
|
|
26
|
+
"items": { "type": "string" },
|
|
29
27
|
"description": "标签 ID 筛选。"
|
|
30
28
|
},
|
|
31
29
|
"pageSize": {
|
|
32
30
|
"type": "integer",
|
|
33
31
|
"minimum": 1,
|
|
34
|
-
"maximum": 100,
|
|
35
32
|
"description": "DAM 请求的分页大小。"
|
|
36
33
|
},
|
|
37
34
|
"cursor": { "$ref": "#/$defs/nonblank", "description": "分页游标。" }
|