@yixiaoermail/cli 3.1.0 → 3.1.2
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/bin/ensure-executable.js +25 -0
- package/bin/postinstall.js +18 -0
- package/bin/resolve-binary.js +36 -0
- package/bin/yxer.js +8 -17
- package/dist/yxer-darwin-amd64 +0 -0
- package/dist/yxer-darwin-arm64 +0 -0
- package/dist/yxer-linux-amd64 +0 -0
- package/dist/yxer-linux-arm64 +0 -0
- package/dist/yxer-windows-amd64.exe +0 -0
- package/dist/yxer-windows-arm64.exe +0 -0
- package/package.json +7 -1
- package/references/cli/command-reference.md +234 -0
- package/references/cli/skill-install.md +76 -0
- package/references/legacy/capabilities.md +32 -0
- package/references/platforms/index.md +20 -0
- package/references/workflows/account-selection.md +38 -0
- package/references/workflows/common-rules.md +257 -0
- package/references/workflows/draft-workflow.md +44 -0
- package/references/workflows/local-vs-cloud.md +50 -0
- package/references/workflows/material-workflow.md +43 -0
- package/references/workflows/payload-sourcing.md +70 -0
- package/references/workflows/publish-article.md +66 -0
- package/references/workflows/publish-imageText.md +62 -0
- package/references/workflows/publish-troubleshooting.md +50 -0
- package/references/workflows/publish-video.md +63 -0
- package/schemas/account.schema.json +19 -0
- package/schemas/platforms/acfun.article.schema.json +117 -0
- package/schemas/platforms/acfun.video.schema.json +139 -0
- package/schemas/platforms/aiqiyi.article.schema.json +29 -0
- package/schemas/platforms/aiqiyi.video.schema.json +154 -0
- package/schemas/platforms/baijiahao.article.schema.json +160 -0
- package/schemas/platforms/baijiahao.imageText.schema.json +110 -0
- package/schemas/platforms/baijiahao.video.schema.json +179 -0
- package/schemas/platforms/bilibili.article.schema.json +109 -0
- package/schemas/platforms/bilibili.video.schema.json +175 -0
- package/schemas/platforms/chejiahao.article.schema.json +108 -0
- package/schemas/platforms/chejiahao.video.schema.json +111 -0
- package/schemas/platforms/csdn.article.schema.json +106 -0
- package/schemas/platforms/dayuhao.article.schema.json +106 -0
- package/schemas/platforms/dayuhao.video.schema.json +153 -0
- package/schemas/platforms/dewu.video.schema.json +134 -0
- package/schemas/platforms/douban.article.schema.json +48 -0
- package/schemas/platforms/douyin.article.schema.json +318 -0
- package/schemas/platforms/douyin.imageText.schema.json +217 -0
- package/schemas/platforms/douyin.video.schema.json +744 -0
- package/schemas/platforms/duoduoshipin.video.schema.json +108 -0
- package/schemas/platforms/fengwang.video.schema.json +135 -0
- package/schemas/platforms/jianshu.article.schema.json +33 -0
- package/schemas/platforms/kuaichuanhao.article.schema.json +83 -0
- package/schemas/platforms/kuaishou.imageText.schema.json +170 -0
- package/schemas/platforms/kuaishou.video.schema.json +240 -0
- package/schemas/platforms/meipai.video.schema.json +123 -0
- package/schemas/platforms/meiyou.video.schema.json +96 -0
- package/schemas/platforms/pipixia.video.schema.json +94 -0
- package/schemas/platforms/qiehao.article.schema.json +89 -0
- package/schemas/platforms/qiehao.video.schema.json +147 -0
- package/schemas/platforms/shipinhao.imageText.schema.json +138 -0
- package/schemas/platforms/shipinhao.video.schema.json +236 -0
- package/schemas/platforms/souhuhao.article.schema.json +73 -0
- package/schemas/platforms/souhuhao.video.schema.json +171 -0
- package/schemas/platforms/souhushipin.video.schema.json +115 -0
- package/schemas/platforms/tengxunshipin.video.schema.json +114 -0
- package/schemas/platforms/toutiaohao.article.schema.json +165 -0
- package/schemas/platforms/toutiaohao.imageText.schema.json +83 -0
- package/schemas/platforms/toutiaohao.video.schema.json +134 -0
- package/schemas/platforms/wangyihao.article.schema.json +85 -0
- package/schemas/platforms/wangyihao.video.schema.json +151 -0
- package/schemas/platforms/weishi.video.schema.json +101 -0
- package/schemas/platforms/weixin.account.article.schema.json +148 -0
- package/schemas/platforms/xhs.imageText.schema.json +119 -0
- package/schemas/platforms/xiaohongshu.video.schema.json +224 -0
- package/schemas/platforms/xiaohongshushop.video.schema.json +141 -0
- package/schemas/platforms/xinlang.article.schema.json +69 -0
- package/schemas/platforms/xinlang.imageText.schema.json +85 -0
- package/schemas/platforms/xinlang.video.schema.json +151 -0
- package/schemas/platforms/xueqiuhao.article.schema.json +84 -0
- package/schemas/platforms/yichehao.article.schema.json +140 -0
- package/schemas/platforms/yichehao.video.schema.json +101 -0
- package/schemas/platforms/yidianhao.article.schema.json +77 -0
- package/schemas/platforms/yidianhao.video.schema.json +152 -0
- package/schemas/platforms/zhihu.article.schema.json +104 -0
- package/schemas/platforms/zhihu.imageText.schema.json +61 -0
- package/schemas/platforms/zhihu.video.schema.json +144 -0
- package/schemas/publish.schema.json +26 -0
- package/skills/yixiaoer/SKILL.md +1 -1
- package/skills/yixiaoer/plugin.json +1 -1
- package/skills/yixiaoer/references/platforms/article/toutiaohao.md +28 -28
- package/skills/yixiaoer/references/platforms/imageText/baijiahao.md +41 -30
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "知乎文章发布表单 (Zhihu Article)",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"required": [
|
|
5
|
+
"formType",
|
|
6
|
+
"title",
|
|
7
|
+
"content",
|
|
8
|
+
"pubType"
|
|
9
|
+
],
|
|
10
|
+
"properties": {
|
|
11
|
+
"formType": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"const": "task"
|
|
14
|
+
},
|
|
15
|
+
"title": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"minLength": 9,
|
|
18
|
+
"maxLength": 100
|
|
19
|
+
},
|
|
20
|
+
"content": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"minLength": 9,
|
|
23
|
+
"maxLength": 10000
|
|
24
|
+
},
|
|
25
|
+
"covers": {
|
|
26
|
+
"type": "array",
|
|
27
|
+
"maxItems": 20,
|
|
28
|
+
"items": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"required": [
|
|
31
|
+
"key",
|
|
32
|
+
"size",
|
|
33
|
+
"width",
|
|
34
|
+
"height"
|
|
35
|
+
],
|
|
36
|
+
"properties": {
|
|
37
|
+
"key": {
|
|
38
|
+
"type": "string"
|
|
39
|
+
},
|
|
40
|
+
"size": {
|
|
41
|
+
"type": "integer",
|
|
42
|
+
"minimum": 1
|
|
43
|
+
},
|
|
44
|
+
"width": {
|
|
45
|
+
"type": "integer",
|
|
46
|
+
"minimum": 1
|
|
47
|
+
},
|
|
48
|
+
"height": {
|
|
49
|
+
"type": "integer",
|
|
50
|
+
"minimum": 1
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"topics": {
|
|
56
|
+
"type": "array",
|
|
57
|
+
"maxItems": 3,
|
|
58
|
+
"items": {
|
|
59
|
+
"type": "object",
|
|
60
|
+
"required": [
|
|
61
|
+
"yixiaoerId",
|
|
62
|
+
"yixiaoerName",
|
|
63
|
+
"raw"
|
|
64
|
+
],
|
|
65
|
+
"properties": {
|
|
66
|
+
"yixiaoerId": {
|
|
67
|
+
"type": "string"
|
|
68
|
+
},
|
|
69
|
+
"yixiaoerName": {
|
|
70
|
+
"type": "string"
|
|
71
|
+
},
|
|
72
|
+
"raw": {
|
|
73
|
+
"type": "object"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"declaration": {
|
|
79
|
+
"type": "number",
|
|
80
|
+
"enum": [
|
|
81
|
+
0,
|
|
82
|
+
1,
|
|
83
|
+
2,
|
|
84
|
+
3,
|
|
85
|
+
4,
|
|
86
|
+
5
|
|
87
|
+
],
|
|
88
|
+
"default": 0
|
|
89
|
+
},
|
|
90
|
+
"pubType": {
|
|
91
|
+
"type": "number",
|
|
92
|
+
"enum": [
|
|
93
|
+
0,
|
|
94
|
+
1
|
|
95
|
+
],
|
|
96
|
+
"default": 1
|
|
97
|
+
},
|
|
98
|
+
"scheduledTime": {
|
|
99
|
+
"type": "number",
|
|
100
|
+
"minimum": 0
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"additionalProperties": false
|
|
104
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Zhihu Image-Text Publish Form (Strict Standards)",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"required": [
|
|
5
|
+
"formType",
|
|
6
|
+
"description"
|
|
7
|
+
],
|
|
8
|
+
"properties": {
|
|
9
|
+
"formType": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"const": "task"
|
|
12
|
+
},
|
|
13
|
+
"title": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"maxLength": 50
|
|
16
|
+
},
|
|
17
|
+
"description": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"minLength": 2
|
|
20
|
+
},
|
|
21
|
+
"images": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"maxItems": 9,
|
|
24
|
+
"items": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"required": [
|
|
27
|
+
"key",
|
|
28
|
+
"size",
|
|
29
|
+
"width",
|
|
30
|
+
"height",
|
|
31
|
+
"format"
|
|
32
|
+
],
|
|
33
|
+
"properties": {
|
|
34
|
+
"key": {
|
|
35
|
+
"type": "string"
|
|
36
|
+
},
|
|
37
|
+
"size": {
|
|
38
|
+
"type": "integer"
|
|
39
|
+
},
|
|
40
|
+
"width": {
|
|
41
|
+
"type": "integer"
|
|
42
|
+
},
|
|
43
|
+
"height": {
|
|
44
|
+
"type": "integer"
|
|
45
|
+
},
|
|
46
|
+
"format": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"enum": [
|
|
49
|
+
"jpg",
|
|
50
|
+
"jpeg",
|
|
51
|
+
"png",
|
|
52
|
+
"gif",
|
|
53
|
+
"webp"
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"additionalProperties": false
|
|
61
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "知乎视频发布表单 (Zhihu Video)",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"required": [
|
|
5
|
+
"formType",
|
|
6
|
+
"description",
|
|
7
|
+
"category",
|
|
8
|
+
"createType",
|
|
9
|
+
"pubType"
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"formType": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"const": "task"
|
|
15
|
+
},
|
|
16
|
+
"title": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"minLength": 1,
|
|
19
|
+
"maxLength": 50
|
|
20
|
+
},
|
|
21
|
+
"description": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"minLength": 1,
|
|
24
|
+
"maxLength": 500
|
|
25
|
+
},
|
|
26
|
+
"category": {
|
|
27
|
+
"type": "array",
|
|
28
|
+
"minItems": 1,
|
|
29
|
+
"items": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"required": [
|
|
32
|
+
"yixiaoerId",
|
|
33
|
+
"yixiaoerName",
|
|
34
|
+
"raw"
|
|
35
|
+
],
|
|
36
|
+
"properties": {
|
|
37
|
+
"yixiaoerId": {
|
|
38
|
+
"type": "string"
|
|
39
|
+
},
|
|
40
|
+
"yixiaoerName": {
|
|
41
|
+
"type": "string"
|
|
42
|
+
},
|
|
43
|
+
"raw": {
|
|
44
|
+
"type": "object"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"createType": {
|
|
50
|
+
"type": "number",
|
|
51
|
+
"enum": [
|
|
52
|
+
1,
|
|
53
|
+
2
|
|
54
|
+
],
|
|
55
|
+
"default": 1
|
|
56
|
+
},
|
|
57
|
+
"pubType": {
|
|
58
|
+
"type": "number",
|
|
59
|
+
"enum": [
|
|
60
|
+
0,
|
|
61
|
+
1
|
|
62
|
+
],
|
|
63
|
+
"default": 1
|
|
64
|
+
},
|
|
65
|
+
"declaration": {
|
|
66
|
+
"type": "number",
|
|
67
|
+
"enum": [
|
|
68
|
+
0,
|
|
69
|
+
2
|
|
70
|
+
],
|
|
71
|
+
"default": 0
|
|
72
|
+
},
|
|
73
|
+
"video": {
|
|
74
|
+
"type": "object",
|
|
75
|
+
"required": [
|
|
76
|
+
"key",
|
|
77
|
+
"size",
|
|
78
|
+
"width",
|
|
79
|
+
"height"
|
|
80
|
+
],
|
|
81
|
+
"properties": {
|
|
82
|
+
"key": {
|
|
83
|
+
"type": "string"
|
|
84
|
+
},
|
|
85
|
+
"size": {
|
|
86
|
+
"type": "integer",
|
|
87
|
+
"minimum": 1
|
|
88
|
+
},
|
|
89
|
+
"width": {
|
|
90
|
+
"type": "integer",
|
|
91
|
+
"minimum": 1
|
|
92
|
+
},
|
|
93
|
+
"height": {
|
|
94
|
+
"type": "integer",
|
|
95
|
+
"minimum": 1
|
|
96
|
+
},
|
|
97
|
+
"duration": {
|
|
98
|
+
"type": "number",
|
|
99
|
+
"minimum": 1
|
|
100
|
+
},
|
|
101
|
+
"format": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"enum": [
|
|
104
|
+
"mp4",
|
|
105
|
+
"mov",
|
|
106
|
+
"flv",
|
|
107
|
+
"avi"
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"cover": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"required": [
|
|
115
|
+
"key",
|
|
116
|
+
"size",
|
|
117
|
+
"width",
|
|
118
|
+
"height"
|
|
119
|
+
],
|
|
120
|
+
"properties": {
|
|
121
|
+
"key": {
|
|
122
|
+
"type": "string"
|
|
123
|
+
},
|
|
124
|
+
"size": {
|
|
125
|
+
"type": "integer"
|
|
126
|
+
},
|
|
127
|
+
"width": {
|
|
128
|
+
"type": "integer"
|
|
129
|
+
},
|
|
130
|
+
"height": {
|
|
131
|
+
"type": "integer"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"coverKey": {
|
|
136
|
+
"type": "string"
|
|
137
|
+
},
|
|
138
|
+
"scheduledTime": {
|
|
139
|
+
"type": "number",
|
|
140
|
+
"minimum": 0
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"additionalProperties": false
|
|
144
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "YiXiaoEr Publish Schema Root",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"required": [
|
|
5
|
+
"formType"
|
|
6
|
+
],
|
|
7
|
+
"properties": {
|
|
8
|
+
"formType": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"const": "task"
|
|
11
|
+
},
|
|
12
|
+
"title": {
|
|
13
|
+
"type": "string"
|
|
14
|
+
},
|
|
15
|
+
"description": {
|
|
16
|
+
"type": "string"
|
|
17
|
+
},
|
|
18
|
+
"desc": {
|
|
19
|
+
"type": "string"
|
|
20
|
+
},
|
|
21
|
+
"content": {
|
|
22
|
+
"type": "string"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"additionalProperties": true
|
|
26
|
+
}
|
package/skills/yixiaoer/SKILL.md
CHANGED
|
@@ -4,20 +4,20 @@
|
|
|
4
4
|
> **前提条件 (Prerequisite)**:
|
|
5
5
|
> 在使用本平台的特定参数之前,你 **必须** 已经阅读并理解了 [文章发布首页 (Index)](./index.md) 中定义的 Payload 根结构。本页仅描述 `contentPublishForm` 内部的平台差异化字段。
|
|
6
6
|
|
|
7
|
-
## 触发场景 (Trigger)
|
|
8
|
-
- **意图辨析**:用户指定在“今日头条 (头条号)”发布长文章或新闻资讯,且需要配置如“广告收益 (Advertisement)”、“头条首发”、“地点挂载”或“创作者申明”等头条特有商业与分发逻辑时。
|
|
9
|
-
- **典型提示词**:
|
|
10
|
-
- “发一篇今日头条的文章,开启广告收益模式”
|
|
11
|
-
- “头条文章发布,声明是我的原创首发内容”
|
|
12
|
-
- “在头条文章里加上我所在的物理位置”
|
|
13
|
-
- “帮我同步这个图文到头条号并存为草稿”
|
|
7
|
+
## 触发场景 (Trigger)
|
|
8
|
+
- **意图辨析**:用户指定在“今日头条 (头条号)”发布长文章或新闻资讯,且需要配置如“广告收益 (Advertisement)”、“头条首发”、“地点挂载”或“创作者申明”等头条特有商业与分发逻辑时。
|
|
9
|
+
- **典型提示词**:
|
|
10
|
+
- “发一篇今日头条的文章,开启广告收益模式”
|
|
11
|
+
- “头条文章发布,声明是我的原创首发内容”
|
|
12
|
+
- “在头条文章里加上我所在的物理位置”
|
|
13
|
+
- “帮我同步这个图文到头条号并存为草稿”
|
|
14
14
|
|
|
15
|
-
## 执行逻辑 (Logic Flow)
|
|
16
|
-
1. **封面适配**:头条号对封面 (`covers`) 数量有严格要求(1 张或 3 张)。
|
|
17
|
-
2. **位置检索**:若需精准挂载位置,调用 `locations` 接口获取 DTO。
|
|
18
|
-
3. **收益装配**:根据意图注入 `advertisement: 3`(赚取收益)或 `2`(不投放广告)。
|
|
19
|
-
4. **参数装配**:构造 `accountForms[i].contentPublishForm`。
|
|
20
|
-
5. **指令执行**:先执行 `yxer validate <platform> <type> <payload.json>`,再执行 `yxer publish <type> <platform> <payload.json> [clientId]`。
|
|
15
|
+
## 执行逻辑 (Logic Flow)
|
|
16
|
+
1. **封面适配**:头条号对封面 (`covers`) 数量有严格要求(1 张或 3 张)。
|
|
17
|
+
2. **位置检索**:若需精准挂载位置,调用 `locations` 接口获取 DTO。
|
|
18
|
+
3. **收益装配**:根据意图注入 `advertisement: 3`(赚取收益)或 `2`(不投放广告)。
|
|
19
|
+
4. **参数装配**:构造 `accountForms[i].contentPublishForm`。
|
|
20
|
+
5. **指令执行**:先执行 `yxer validate <platform> <type> <payload.json>`,再执行 `yxer publish <type> <platform> <payload.json> [clientId]`。
|
|
21
21
|
|
|
22
22
|
## 1. contentPublishForm 参数定义
|
|
23
23
|
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
| `title` | `string` | **是** | 文章标题 (1-50 字符) | - |
|
|
28
28
|
| `content` | `string` | **是** | 文章内容 (HTML 字符串,最多 50000 字符) | - |
|
|
29
29
|
| `covers` | `Array` | **是** | 文章封面列表 (`OldCover[]`, 1-9 张) | - |
|
|
30
|
-
| `isFirst` | `boolean` | 否 | 是否头条首发 | `false` |
|
|
31
|
-
| `location` | `Object` | 否 | 位置对象 (`PlatformDataItem`) | - |
|
|
32
|
-
| `scheduledTime` | `number` | 否 | 定时发布时间 (13 位 Unix 时间戳,单位: 毫秒) | - |
|
|
33
|
-
| `advertisement` | `number` | 否 | 广告投放收益: 2-无收益, 3-投放广告赚收益 | `3` |
|
|
34
|
-
| `declaration`| `number` | 否 | 创作类型 1:自行拍摄 2:取自站外 3:AI生成 6:虚构演绎 7:投资观点 8:健康医疗 | - |
|
|
35
|
-
| `pubType` | `number` | **是** | 发布类型: 0-草稿, 1-直接发布 | 1 |
|
|
30
|
+
| `isFirst` | `boolean` | 否 | 是否头条首发 | `false` |
|
|
31
|
+
| `location` | `Object` | 否 | 位置对象 (`PlatformDataItem`) | - |
|
|
32
|
+
| `scheduledTime` | `number` | 否 | 定时发布时间 (13 位 Unix 时间戳,单位: 毫秒) | - |
|
|
33
|
+
| `advertisement` | `number` | 否 | 广告投放收益: 2-无收益, 3-投放广告赚收益 | `3` |
|
|
34
|
+
| `declaration`| `number` | 否 | 创作类型 1:自行拍摄 2:取自站外 3:AI生成 6:虚构演绎 7:投资观点 8:健康医疗 | - |
|
|
35
|
+
| `pubType` | `number` | **是** | 发布类型: 0-草稿, 1-直接发布 | 1 |
|
|
36
36
|
|
|
37
37
|
## 2. Payload 完整示例
|
|
38
38
|
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"covers": [
|
|
53
53
|
{ "key": "cover_key_001", "width": 800, "height": 600, "size": 150000 }
|
|
54
54
|
],
|
|
55
|
-
"advertisement": 3,
|
|
56
|
-
"isFirst": true,
|
|
57
|
-
"pubType": 1
|
|
58
|
-
}
|
|
59
|
-
}
|
|
55
|
+
"advertisement": 3,
|
|
56
|
+
"isFirst": true,
|
|
57
|
+
"pubType": 1
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
60
|
]
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -67,12 +67,12 @@
|
|
|
67
67
|
### 3.1 OldCover
|
|
68
68
|
包含 `key`, `size`, `width`, `height`。
|
|
69
69
|
|
|
70
|
-
### 3.2 PlatformDataItem (位置信息)
|
|
71
|
-
包含 `yixiaoerId`, `yixiaoerName`, `raw` (必须完整透传)。
|
|
70
|
+
### 3.2 PlatformDataItem (位置信息)
|
|
71
|
+
包含 `yixiaoerId`, `yixiaoerName`, `raw` (必须完整透传)。
|
|
72
72
|
|
|
73
73
|
## 相关接口
|
|
74
74
|
|
|
75
75
|
| 目标字段 | 对应 Action | 文档参考 |
|
|
76
76
|
| :--- | :--- | :--- |
|
|
77
|
-
| `location` | `locations` | [获取位置信息](../../get-locations.md) |
|
|
78
|
-
| `covers.key`| `upload` | [资源上传](../../upload-resource.md) |
|
|
77
|
+
| `location` | `locations` | [获取位置信息](../../get-locations.md) |
|
|
78
|
+
| `covers.key`| `upload` | [资源上传](../../upload-resource.md) |
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
- “同步这条动态到Baijiahao”
|
|
13
13
|
|
|
14
14
|
## 执行逻辑 (Logic Flow)
|
|
15
|
-
1. **资源校验**:确保所有图片均已上传并获得 Key。
|
|
16
|
-
2.
|
|
15
|
+
1. **资源校验**:确保所有图片均已上传并获得 Key。
|
|
16
|
+
2. **参数装配**:图文内容使用 `contentPublishForm.images` 传图;账号层仍需同步提供 `cover` 和 `coverKey`。
|
|
17
17
|
3. **指令执行**:先执行 `yxer validate <platform> <type> <payload.json>`,再执行 `yxer publish <type> <platform> <payload.json> [clientId]`。
|
|
18
18
|
|
|
19
19
|
本平台图文发布通过 `contentPublishForm` 承载以下参数。
|
|
@@ -25,21 +25,22 @@
|
|
|
25
25
|
| `formType` | `string` | **是** | 固定值: `task` | `task` |
|
|
26
26
|
| `title` | `string` | **是** | 标题 (1-20 字符) | - |
|
|
27
27
|
| `description` | `string` | **是** | 图文描述,支持 HTML (`<p>`, `<topic>`)。 (1-1000 字符) | - |
|
|
28
|
-
| `
|
|
29
|
-
| `pubType` | `number` | **是** | 发布类型: 0-草稿, 1-直接发布 | - |
|
|
30
|
-
| `declaration` | `number` | **是** | 创作声明: 0-不声明, 1-内容由 AI 生成 | - |
|
|
31
|
-
| `location` | `Object` | 否 | 位置信息 (`PlatformDataItem`) | - |
|
|
32
|
-
| `scheduledTime` | `number` | 否 | 定时发布时间 (13 位 Unix 时间戳,单位: 毫秒) | - |
|
|
28
|
+
| `images` | `Array` | **是** | 图片数组 (`OldImage[]`, 至少 1 张) | - |
|
|
29
|
+
| `pubType` | `number` | **是** | 发布类型: 0-草稿, 1-直接发布 | - |
|
|
30
|
+
| `declaration` | `number` | **是** | 创作声明: 0-不声明, 1-内容由 AI 生成 | - |
|
|
31
|
+
| `location` | `Object` | 否 | 位置信息 (`PlatformDataItem`) | - |
|
|
32
|
+
| `scheduledTime` | `number` | 否 | 定时发布时间 (13 位 Unix 时间戳,单位: 毫秒) | - |
|
|
33
33
|
|
|
34
34
|
## 2. 复杂对象结构说明
|
|
35
35
|
|
|
36
|
-
### 复杂对象:
|
|
37
|
-
| 字段名 | 类型 | 必填 | 说明 | 默认值 |
|
|
38
|
-
| :--- | :--- | :--- | :--- | :--- |
|
|
39
|
-
| `width` | `number` | **是** | 图片宽度 | - |
|
|
40
|
-
| `height` | `number` | **是** | 图片高度 | - |
|
|
41
|
-
| `size` | `number` | **是** | 文件大小 (Bytes) | - |
|
|
42
|
-
| `key` | `string` | **是** | 资源 Key (通过上传接口获取) | - |
|
|
36
|
+
### 复杂对象:OldImage
|
|
37
|
+
| 字段名 | 类型 | 必填 | 说明 | 默认值 |
|
|
38
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
39
|
+
| `width` | `number` | **是** | 图片宽度 | - |
|
|
40
|
+
| `height` | `number` | **是** | 图片高度 | - |
|
|
41
|
+
| `size` | `number` | **是** | 文件大小 (Bytes) | - |
|
|
42
|
+
| `key` | `string` | **是** | 资源 Key (通过上传接口获取) | - |
|
|
43
|
+
| `format` | `string` | 否 | 文件格式 (`jpg/png/webp` 等) | - |
|
|
43
44
|
|
|
44
45
|
### 复杂对象:PlatformDataItem
|
|
45
46
|
| 字段名 | 类型 | 必填 | 说明 | 默认值 |
|
|
@@ -63,21 +64,31 @@
|
|
|
63
64
|
"platforms": ["百家号"],
|
|
64
65
|
"publishArgs": {
|
|
65
66
|
"accountForms": [
|
|
66
|
-
{
|
|
67
|
-
"platformAccountId": "acc_bjh_it_001",
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
|
|
67
|
+
{
|
|
68
|
+
"platformAccountId": "acc_bjh_it_001",
|
|
69
|
+
"cover": {
|
|
70
|
+
"key": "img_key_123",
|
|
71
|
+
"size": 102400,
|
|
72
|
+
"width": 800,
|
|
73
|
+
"height": 600
|
|
74
|
+
},
|
|
75
|
+
"coverKey": "img_key_123",
|
|
76
|
+
"contentPublishForm": {
|
|
77
|
+
"formType": "task",
|
|
78
|
+
"title": "百家号图文标题",
|
|
79
|
+
"description": "<p>内容摘要 <topic text='科技' raw='{\"yixiaoerId\":\"123\",\"yixiaoerName\":\"科技\",\"raw\":{\"id\":\"xxx\",\"topic\":\"科技\"}}'>#科技</topic></p>",
|
|
80
|
+
"images": [
|
|
81
|
+
{
|
|
82
|
+
"key": "img_key_123",
|
|
83
|
+
"size": 102400,
|
|
84
|
+
"width": 800,
|
|
85
|
+
"height": 600,
|
|
86
|
+
"format": "jpg"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"pubType": 1,
|
|
90
|
+
"declaration": 0
|
|
91
|
+
}
|
|
81
92
|
}
|
|
82
93
|
]
|
|
83
94
|
}
|
|
@@ -88,4 +99,4 @@
|
|
|
88
99
|
|
|
89
100
|
| 目标数据 | 对应 Action | 相关文档 |
|
|
90
101
|
| :--- | :--- | :--- |
|
|
91
|
-
| `images.key` | `upload` | [资源上传](../../upload-resource.md) |
|
|
102
|
+
| `images.key` / `coverKey` | `upload` | [资源上传](../../upload-resource.md) |
|