@yixiaoermail/cli 3.2.33 → 3.2.35
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/checksums.txt +6 -6
- package/package.json +1 -1
- package/references/cli/command-reference.md +3 -2
- package/references/domains/install-and-sync.md +0 -6
- package/references/domains/publish.md +1 -0
- package/references/get-goods.md +6 -3
- package/references/get-locations.md +48 -48
- package/references/get-publish-categories.md +1 -0
- package/references/platforms/article/zhihu.md +6 -2
- package/references/platforms/imageText/douyin.md +128 -113
- package/references/platforms/imageText/index.md +2 -0
- package/references/platforms/imageText/instagram.md +14 -0
- package/references/platforms/imageText/shipinhao.md +133 -115
- package/references/platforms/imageText/weixingongzhonghao.md +13 -1
- package/references/platforms/imageText/xiaohongshu.md +2 -0
- package/references/platforms/video/baijiahao.md +136 -130
- package/references/platforms/video/qiehao.md +3 -2
- package/references/platforms/video/xiaohongshu.md +2 -0
- package/references/platforms/xiaohongshu-components.md +9 -0
- package/references/topic-tags.md +1 -1
- package/references/yixiaoer-shared.md +0 -1
- package/schemas/platforms/baijiahao.video.schema.json +247 -229
- package/schemas/platforms/douyin.imageText.schema.json +344 -301
- package/schemas/platforms/instagram.imageText.schema.json +9 -0
- package/schemas/platforms/shipinhao.imageText.schema.json +42 -0
- package/schemas/platforms/weixin.account.imageText.schema.json +2 -1
- package/schemas/platforms/xhs.imageText.schema.json +242 -0
- package/schemas/platforms/xiaohongshu.video.schema.json +216 -0
- package/schemas/platforms/zhihu.article.schema.json +15 -1
- package/skills/yixiaoer/SKILL.md +101 -100
- package/skills/yixiaoer/references/cli/command-reference.md +3 -2
- package/skills/yixiaoer/references/domains/install-and-sync.md +0 -6
- package/skills/yixiaoer/references/domains/publish.md +1 -0
- package/skills/yixiaoer/references/get-goods.md +6 -3
- package/skills/yixiaoer/references/get-locations.md +48 -48
- package/skills/yixiaoer/references/get-publish-categories.md +1 -0
- package/skills/yixiaoer/references/platforms/article/zhihu.md +6 -2
- package/skills/yixiaoer/references/platforms/imageText/douyin.md +128 -113
- package/skills/yixiaoer/references/platforms/imageText/index.md +2 -0
- package/skills/yixiaoer/references/platforms/imageText/instagram.md +14 -0
- package/skills/yixiaoer/references/platforms/imageText/shipinhao.md +133 -115
- package/skills/yixiaoer/references/platforms/imageText/weixingongzhonghao.md +13 -1
- package/skills/yixiaoer/references/platforms/imageText/xiaohongshu.md +2 -0
- package/skills/yixiaoer/references/platforms/video/baijiahao.md +136 -130
- package/skills/yixiaoer/references/platforms/video/qiehao.md +3 -2
- package/skills/yixiaoer/references/platforms/video/xiaohongshu.md +2 -0
- package/skills/yixiaoer/references/platforms/xiaohongshu-components.md +9 -0
- package/skills/yixiaoer/references/topic-tags.md +1 -1
- package/skills/yixiaoer/references/yixiaoer-shared.md +0 -1
|
@@ -1,113 +1,128 @@
|
|
|
1
|
-
# 抖音图文发布参数 (Douyin Image-Text)
|
|
2
|
-
|
|
3
|
-
> [!IMPORTANT]
|
|
4
|
-
> **前提条件 (Prerequisite)**:
|
|
5
|
-
> 在使用本平台的特定参数之前,你 **必须** 已经阅读并理解了 [图文发布首页 (Index)](./index.md) 中定义的 Payload 根结构。本页仅描述 `contentPublishForm` 内部的平台差异化字段。
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
## 触发场景 (Trigger)
|
|
9
|
-
- **意图辨析**:用户指定在“Douyin”平台发布图文动态时触发。
|
|
10
|
-
- **典型提示词**:
|
|
11
|
-
- “发几张图到Douyin”
|
|
12
|
-
- “同步这条动态到Douyin”
|
|
13
|
-
|
|
14
|
-
## 执行逻辑 (Logic Flow)
|
|
15
|
-
1. **资源校验**:确保所有图片均已上传并获得 Key。
|
|
16
|
-
2. **参数装配**:填充描述及图片列表至 `contentPublishForm`。
|
|
17
|
-
3. **指令执行**:先执行 `yxer validate <platform> <type> <payload.json>`,再执行 `yxer publish <type> <platform> <payload.json> [--publish-channel local --client-id <clientId>]`。
|
|
18
|
-
|
|
19
|
-
> [!TIP]
|
|
20
|
-
> 抖音图文如涉及话题,请先读取 [`../../topic-tags.md`](../../topic-tags.md)。如果要使用 `<topic>`,Agent 必须直接写入最终 `description` HTML。
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
本平台图文发布通过 `contentPublishForm` 承载以下参数。
|
|
24
|
-
|
|
25
|
-
## 1. contentPublishForm 参数定义
|
|
26
|
-
|
|
27
|
-
| 字段名 | 类型 | 必填 | 说明 | 默认值 |
|
|
28
|
-
| :--- | :--- | :--- | :--- | :--- |
|
|
29
|
-
| `formType` | `string` | **是** | 固定值: `task` | `task` |
|
|
30
|
-
| `title` | `string` | 否 | 标题 (最多 20 字) | - |
|
|
31
|
-
| `description` | `string` | 否 | 图文描述,支持 HTML (`<p>`, `<topic>`)。最多 30 字符。 | - |
|
|
32
|
-
| `declaration` | `number` | 否 | 创作声明:`0`-不声明,`3`-内容由 AI 生成,`4`-可能引人不适,`5`-虚构演绎,`6`-危险行为,`7`-个人观点,`8`-含营销推广信息。AI 声明使用 `3`。 | `0` |
|
|
33
|
-
| `images` | `Array` | **是** | 图片数组 (`OldImage[]`) | - |
|
|
34
|
-
| `location` | `Object` | 否 | 地址信息 (`PlatformDataItem`) | - |
|
|
35
|
-
| `music` | `Object` | 否 | 音乐信息 (`MusicItem`) | - |
|
|
36
|
-
| `
|
|
37
|
-
| `
|
|
38
|
-
| `
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
|
55
|
-
|
|
|
56
|
-
| `
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
65
|
-
| `
|
|
66
|
-
| `
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
| `
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
1
|
+
# 抖音图文发布参数 (Douyin Image-Text)
|
|
2
|
+
|
|
3
|
+
> [!IMPORTANT]
|
|
4
|
+
> **前提条件 (Prerequisite)**:
|
|
5
|
+
> 在使用本平台的特定参数之前,你 **必须** 已经阅读并理解了 [图文发布首页 (Index)](./index.md) 中定义的 Payload 根结构。本页仅描述 `contentPublishForm` 内部的平台差异化字段。
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## 触发场景 (Trigger)
|
|
9
|
+
- **意图辨析**:用户指定在“Douyin”平台发布图文动态时触发。
|
|
10
|
+
- **典型提示词**:
|
|
11
|
+
- “发几张图到Douyin”
|
|
12
|
+
- “同步这条动态到Douyin”
|
|
13
|
+
|
|
14
|
+
## 执行逻辑 (Logic Flow)
|
|
15
|
+
1. **资源校验**:确保所有图片均已上传并获得 Key。
|
|
16
|
+
2. **参数装配**:填充描述及图片列表至 `contentPublishForm`。
|
|
17
|
+
3. **指令执行**:先执行 `yxer validate <platform> <type> <payload.json>`,再执行 `yxer publish <type> <platform> <payload.json> [--publish-channel local --client-id <clientId>]`。
|
|
18
|
+
|
|
19
|
+
> [!TIP]
|
|
20
|
+
> 抖音图文如涉及话题,请先读取 [`../../topic-tags.md`](../../topic-tags.md)。如果要使用 `<topic>`,Agent 必须直接写入最终 `description` HTML。
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
本平台图文发布通过 `contentPublishForm` 承载以下参数。
|
|
24
|
+
|
|
25
|
+
## 1. contentPublishForm 参数定义
|
|
26
|
+
|
|
27
|
+
| 字段名 | 类型 | 必填 | 说明 | 默认值 |
|
|
28
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
29
|
+
| `formType` | `string` | **是** | 固定值: `task` | `task` |
|
|
30
|
+
| `title` | `string` | 否 | 标题 (最多 20 字) | - |
|
|
31
|
+
| `description` | `string` | 否 | 图文描述,支持 HTML (`<p>`, `<topic>`)。最多 30 字符。 | - |
|
|
32
|
+
| `declaration` | `number` | 否 | 创作声明:`0`-不声明,`3`-内容由 AI 生成,`4`-可能引人不适,`5`-虚构演绎,`6`-危险行为,`7`-个人观点,`8`-含营销推广信息。AI 声明使用 `3`。 | `0` |
|
|
33
|
+
| `images` | `Array` | **是** | 图片数组 (`OldImage[]`) | - |
|
|
34
|
+
| `location` | `Object` | 否 | 地址信息 (`PlatformDataItem`) | - |
|
|
35
|
+
| `music` | `Object` | 否 | 音乐信息 (`MusicItem`) | - |
|
|
36
|
+
| `game` | `Object` | 否 | “游戏手柄”标签关联的游戏对象,必须来自目标账号的 `yxer query games` 结果 | - |
|
|
37
|
+
| `tagType` | `string` | 否 | 标签类型;使用游戏组件时设为 `游戏手柄` | - |
|
|
38
|
+
| `scheduledTime` | `number` | 否 | 定时发布时间 (13 位 Unix 时间戳,单位: 毫秒) | - |
|
|
39
|
+
| `collection` | `Object` | 否 | 合集信息 (`Category`) | - |
|
|
40
|
+
| `sub_collection` | `Object` | 否 | 合集选集信息 (`Category`) | - |
|
|
41
|
+
|
|
42
|
+
## 2. 复杂对象结构说明
|
|
43
|
+
|
|
44
|
+
### OldImage
|
|
45
|
+
| 字段名 | 类型 | 必填 | 说明 |
|
|
46
|
+
| :--- | :--- | :--- | :--- |
|
|
47
|
+
| `width` | `number` | **是** | 图片宽度 |
|
|
48
|
+
| `height` | `number` | **是** | 图片高度 |
|
|
49
|
+
| `size` | `number` | **是** | 文件大小 (Bytes) |
|
|
50
|
+
| `key` | `string` | **是** | 资源 Key (通过上传接口获取) |
|
|
51
|
+
| `format` | `string` | **是** | 文件格式 (e.g., `jpg`, `png`) |
|
|
52
|
+
|
|
53
|
+
### Category (用于合集等)
|
|
54
|
+
| 字段名 | 类型 | 必填 | 说明 |
|
|
55
|
+
| :--- | :--- | :--- | :--- |
|
|
56
|
+
| `yixiaoerId` | `string` | **是** | 蚁小二内部 ID |
|
|
57
|
+
| `yixiaoerName` | `string` | **是** | 显示名称 |
|
|
58
|
+
| `raw` | `object` | 否 | 平台原始数据。如果在获取时该字段存在,发布表单中必须携带并完整透传 |
|
|
59
|
+
|
|
60
|
+
### MusicItem (音乐)
|
|
61
|
+
| 字段名 | 类型 | 必填 | 说明 |
|
|
62
|
+
| :--- | :--- | :--- | :--- |
|
|
63
|
+
| `yixiaoerId` | `string` | 是 | 蚁小二端统一音乐 ID |
|
|
64
|
+
| `yixiaoerName` | `string` | 是 | 歌曲名称 |
|
|
65
|
+
| `duration` | `number` | 是 | 音乐时长(秒) |
|
|
66
|
+
| `playUrl` | `string` | 是 | 试听/播放链接 |
|
|
67
|
+
| `artist` | `string` | 否 | 歌手/作者名 |
|
|
68
|
+
| `raw` | `object` | 否 | 平台原始数据。如果在音乐列表获取时该字段存在,发布表单中必须携带并完整透传 |
|
|
69
|
+
|
|
70
|
+
### PlatformDataItem (基础结构)
|
|
71
|
+
| 字段名 | 类型 | 必填 | 说明 |
|
|
72
|
+
| :--- | :--- | :--- | :--- |
|
|
73
|
+
| `yixiaoerId` | `string` | 是 | 统一 ID |
|
|
74
|
+
| `yixiaoerName` | `string` | 是 | 显示名称 |
|
|
75
|
+
| `raw` | `object` | 是 | 平台原始数据。如果在获取时该字段存在,发布表单中必须携带并完整透传 |
|
|
76
|
+
|
|
77
|
+
### 游戏手柄
|
|
78
|
+
|
|
79
|
+
先按目标账号查询游戏,再使用 `game` 动态字段选择查询结果中的完整对象;同时设置 `tagType` 为 `游戏手柄`。不要手写游戏 ID 或裁剪查询对象:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
yxer query games <account_id> [--query 关键词] --json
|
|
83
|
+
yxer publish form choose publish-form.json game --value-file games.json --id <yixiaoerId> --source-command "yxer query games <account_id> --json"
|
|
84
|
+
yxer publish form set publish-form.json publishArgs.accountForms[0].contentPublishForm.tagType --value '"游戏手柄"'
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`choose` 写入的游戏对象必须保留查询结果中的 `yixiaoerId`、`yixiaoerName`、`yixiaoerImageUrl` 及其他字段。客户端 `GameResponseItem.raw` 是可选字符串;查询结果包含时原样透传,不要转换成对象。`tagType=游戏手柄` 时必须提供 `game`;设置 `game` 时也必须设置 `tagType`。
|
|
88
|
+
如果查询命令带了 `--query`,`--source-command` 中也要逐字写入实际使用的关键词参数。
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
## 3. Payload 完整示例
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"action": "publish",
|
|
97
|
+
"publishType": "imageText",
|
|
98
|
+
"platforms": ["抖音"],
|
|
99
|
+
"publishArgs": {
|
|
100
|
+
"accountForms": [
|
|
101
|
+
{
|
|
102
|
+
"platformAccountId": "DY_ACC_ID",
|
|
103
|
+
"contentPublishForm": {
|
|
104
|
+
"formType": "task",
|
|
105
|
+
"title": "抖音图文标题",
|
|
106
|
+
"description": "<p>内容描述 <topic text='合拍' raw='{\"id\":\"xxx\",\"name\":\"合拍\"}'>#合拍</topic></p>",
|
|
107
|
+
"declaration": 3,
|
|
108
|
+
"images": [
|
|
109
|
+
{ "key": "img_1", "size": 1024, "width": 1080, "height": 1440, "format": "jpg" },
|
|
110
|
+
{ "key": "img_2", "size": 1024, "width": 1080, "height": 1440, "format": "jpg" }
|
|
111
|
+
],
|
|
112
|
+
"location": { "yixiaoerId": "loc_123", "yixiaoerName": "某商位", "raw": {} }
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## 相关接口
|
|
121
|
+
|
|
122
|
+
| 目标字段 | 对应 Action | 文档参考 |
|
|
123
|
+
| :--- | :--- | :--- |
|
|
124
|
+
| `location` | `locations` | [获取位置信息](../../get-locations.md) |
|
|
125
|
+
| `collection` | `collections` | [获取合集列表](../../get-collections.md) |
|
|
126
|
+
| `music` | `music` | [获取背景音乐](../../get-music.md) |
|
|
127
|
+
| `tags` | `challenges` | [获取话题/挑战](../../get-challenges.md) |
|
|
128
|
+
| `images.key` | `upload` | [资源上传](../../upload-resource.md) |
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Instagram 图文发布
|
|
2
|
+
|
|
3
|
+
先运行 `yxer prepare Instagram imageText`,从 `yxer accounts list Instagram --status 1 --json` 选择账号。逐张执行 `yxer upload <文件或URL> --platform Instagram --usage image`。支持 JPEG、PNG、WebP、BMP,非 JPEG 转为白底 JPEG。单张最多 8 MB,宽高比为 4:5 至 1.91:1。
|
|
4
|
+
|
|
5
|
+
每个账号的 `publishArgs.accountForms[].images` 按发布顺序填写上传结果的 key、format、size、width、height。支持 1–20 张,轮播可能按首图比例裁剪。可选纯文本正文放在 `contentPublishForm.description`,最多 2200 字符。
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
yxer validate Instagram imageText payload.json
|
|
9
|
+
yxer publish imageText Instagram payload.json --dry-run
|
|
10
|
+
yxer publish imageText Instagram payload.json
|
|
11
|
+
yxer query details <taskSetId> --json
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
本机发布在验参、预览和正式提交时均加 `--publish-channel local --client-id <clientId>`。任务 ID 表示提交成功,实际发帖结果以任务详情为准。提交结果不明时先执行 `yxer query records --limit 10 --json` 核实。
|
|
@@ -1,116 +1,134 @@
|
|
|
1
|
-
# 视频号图文发布参数 (Shipinhao Image-Text)
|
|
2
|
-
|
|
3
|
-
> [!IMPORTANT]
|
|
4
|
-
> **前提条件 (Prerequisite)**:
|
|
5
|
-
> 在使用本平台的特定参数之前,你 **必须** 已经阅读并理解了 [图文发布首页 (Index)](./index.md) 中定义的 Payload 根结构。本页仅描述 `contentPublishForm` 内部的平台差异化字段。
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
## 触发场景 (Trigger)
|
|
9
|
-
- **意图辨析**:用户指定在“视频号 / 微信视频号 / shipinhao”平台发布图文动态时触发。
|
|
10
|
-
- **典型提示词**:
|
|
11
|
-
- “发几张图到视频号”
|
|
12
|
-
- “同步这条动态到微信视频号”
|
|
13
|
-
- “用 shipinhao 发图文”
|
|
14
|
-
|
|
15
|
-
## 执行逻辑 (Logic Flow)
|
|
16
|
-
1. **资源校验**:确保所有图片均已上传并获得 Key。
|
|
17
|
-
2. **参数装配**:填充描述及图片列表至 `contentPublishForm`;无需外部传入 `cover` / `coverKey`,CLI 会默认使用首图作为内部封面。
|
|
18
|
-
3. **指令执行**:先执行 `yxer validate <platform> <type> <payload.json>`,再执行 `yxer publish <type> <platform> <payload.json> [--publish-channel local --client-id <clientId>]`。
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
本平台图文发布通过 `contentPublishForm` 承载以下参数。
|
|
22
|
-
|
|
23
|
-
## 1. contentPublishForm 参数定义
|
|
24
|
-
|
|
25
|
-
| 字段名 | 类型 | 必填 | 说明 | 默认值 |
|
|
26
|
-
| :--- | :--- | :--- | :--- | :--- |
|
|
27
|
-
| `formType` | `string` | **是** | 固定值: `task` | `task` |
|
|
28
|
-
| `title` | `string` | 否 | 标题 | - |
|
|
29
|
-
| `description` | `string` | 否 | 图文描述,支持 HTML (`<p>`, `<topic>`)。最多 1000 字符。 | - |
|
|
30
|
-
| `images` | `Array` | **是** | 图片数组 (`OldImage[]`),1-18 张 | - |
|
|
31
|
-
| `location` | `Object` | 否 | 位置对象 (`PlatformDataItem`) | - |
|
|
32
|
-
| `music` | `Object` | 否 | 音乐对象 (`MusicItem`) | - |
|
|
33
|
-
| `
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
| `
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
| `
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
|
71
|
-
|
|
|
72
|
-
| `
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
|
76
|
-
|
|
|
77
|
-
| `
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
1
|
+
# 视频号图文发布参数 (Shipinhao Image-Text)
|
|
2
|
+
|
|
3
|
+
> [!IMPORTANT]
|
|
4
|
+
> **前提条件 (Prerequisite)**:
|
|
5
|
+
> 在使用本平台的特定参数之前,你 **必须** 已经阅读并理解了 [图文发布首页 (Index)](./index.md) 中定义的 Payload 根结构。本页仅描述 `contentPublishForm` 内部的平台差异化字段。
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## 触发场景 (Trigger)
|
|
9
|
+
- **意图辨析**:用户指定在“视频号 / 微信视频号 / shipinhao”平台发布图文动态时触发。
|
|
10
|
+
- **典型提示词**:
|
|
11
|
+
- “发几张图到视频号”
|
|
12
|
+
- “同步这条动态到微信视频号”
|
|
13
|
+
- “用 shipinhao 发图文”
|
|
14
|
+
|
|
15
|
+
## 执行逻辑 (Logic Flow)
|
|
16
|
+
1. **资源校验**:确保所有图片均已上传并获得 Key。
|
|
17
|
+
2. **参数装配**:填充描述及图片列表至 `contentPublishForm`;无需外部传入 `cover` / `coverKey`,CLI 会默认使用首图作为内部封面。
|
|
18
|
+
3. **指令执行**:先执行 `yxer validate <platform> <type> <payload.json>`,再执行 `yxer publish <type> <platform> <payload.json> [--publish-channel local --client-id <clientId>]`。
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
本平台图文发布通过 `contentPublishForm` 承载以下参数。
|
|
22
|
+
|
|
23
|
+
## 1. contentPublishForm 参数定义
|
|
24
|
+
|
|
25
|
+
| 字段名 | 类型 | 必填 | 说明 | 默认值 |
|
|
26
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
27
|
+
| `formType` | `string` | **是** | 固定值: `task` | `task` |
|
|
28
|
+
| `title` | `string` | 否 | 标题 | - |
|
|
29
|
+
| `description` | `string` | 否 | 图文描述,支持 HTML (`<p>`, `<topic>`)。最多 1000 字符。 | - |
|
|
30
|
+
| `images` | `Array` | **是** | 图片数组 (`OldImage[]`),1-18 张 | - |
|
|
31
|
+
| `location` | `Object` | 否 | 位置对象 (`PlatformDataItem`) | - |
|
|
32
|
+
| `music` | `Object` | 否 | 音乐对象 (`MusicItem`) | - |
|
|
33
|
+
| `shopping_cart` | `object` | 否 | 关联单个商品:使用 `yxer query goods` 返回的完整 `GoodListItemResponse`,不包装为数组 | - |
|
|
34
|
+
| `scheduledTime` | `number` | 否 | 定时发布时间 (13 位 Unix 时间戳,单位: 毫秒) | - |
|
|
35
|
+
| `collection` | `Object` | 否 | 合集信息,使用 `Collection` 结构 | - |
|
|
36
|
+
| `declaration` | `number` | 否 | 创作声明:0-无需标注,1-含AI生成内容,2-营销广告,3-虚构剧情,7-转载,8-个人观点 | 0 |
|
|
37
|
+
| `pubType` | `number` | **是** | 发布类型: 0-平台草稿, 1-直接发布 | 1 |
|
|
38
|
+
|
|
39
|
+
含 AI 生成内容时,请设置 `contentPublishForm.declaration` 为 `1`。
|
|
40
|
+
|
|
41
|
+
### 商品关联
|
|
42
|
+
|
|
43
|
+
客户端图文契约包含可选的 `shopping_cart?: GoodListItemResponse`,CLI 现已接受相同字段。先查询目标账号的商品,再通过 `publish form choose` 选择一个完整商品对象;不要包装成数组或裁剪查询字段:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
yxer query goods <account_id> --json
|
|
47
|
+
yxer publish form choose <session.json> shopping_cart --value-file <query.json> --id <商品yixiaoerId> --source-command "yxer query goods <account_id> --json"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`shopping_cart` 路径为 `publishArgs.accountForms[].contentPublishForm.shopping_cart`。选择商品时,查询账号必须与表单中的目标账号一致。
|
|
51
|
+
|
|
52
|
+
## 1.1 封面派生规则
|
|
53
|
+
|
|
54
|
+
视频号图文没有单独的外部封面参数。只需提供 `contentPublishForm.images`;CLI 会在内部默认使用 `images[0]` 派生 `cover` / `coverKey`,不要在 payload 中额外手写封面字段。
|
|
55
|
+
|
|
56
|
+
## 2. 复杂对象结构说明
|
|
57
|
+
|
|
58
|
+
### OldImage
|
|
59
|
+
| 字段名 | 类型 | 必填 | 说明 |
|
|
60
|
+
| :--- | :--- | :--- | :--- |
|
|
61
|
+
| `width` | `number` | **是** | 图片宽度 |
|
|
62
|
+
| `height` | `number` | **是** | 图片高度 |
|
|
63
|
+
| `size` | `number` | **是** | 文件大小 (Bytes) |
|
|
64
|
+
| `key` | `string` | **是** | 资源 Key (通过上传接口获取) |
|
|
65
|
+
| `format` | `string` | **是** | 文件格式 (e.g., `jpg`, `png`) |
|
|
66
|
+
|
|
67
|
+
### PlatformDataItem (基础结构)
|
|
68
|
+
| 字段名 | 类型 | 必填 | 说明 |
|
|
69
|
+
| :--- | :--- | :--- | :--- |
|
|
70
|
+
| `yixiaoerId` | `string` | 是 | 统一 ID |
|
|
71
|
+
| `yixiaoerName` | `string` | 是 | 显示名称 |
|
|
72
|
+
| `raw` | `object` | 是 | 平台原始数据 |
|
|
73
|
+
|
|
74
|
+
### Collection
|
|
75
|
+
| 字段名 | 类型 | 必填 | 说明 |
|
|
76
|
+
| :--- | :--- | :--- | :--- |
|
|
77
|
+
| `yixiaoerId` | `string` | 是 | 合集 ID |
|
|
78
|
+
| `yixiaoerName` | `string` | 是 | 合集名称 |
|
|
79
|
+
| `raw` | `object` | 否 | 平台原始数据 |
|
|
80
|
+
|
|
81
|
+
### MusicItem (音乐)
|
|
82
|
+
| 字段名 | 类型 | 必填 | 说明 |
|
|
83
|
+
| :--- | :--- | :--- | :--- |
|
|
84
|
+
| `yixiaoerId` | `string` | 是 | 蚁小二端统一音乐 ID |
|
|
85
|
+
| `yixiaoerName` | `string` | 是 | 歌曲名称 |
|
|
86
|
+
| `duration` | `number` | 是 | 音乐时长(秒) |
|
|
87
|
+
| `playUrl` | `string` | 是 | 试听/播放链接 |
|
|
88
|
+
| `artist` | `string` | 否 | 歌手/作者名 |
|
|
89
|
+
| `raw` | `object` | 否 | 平台原始数据。如果在音乐列表获取时该字段存在,发布表单中必须携带并完整透传 |
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
## 3. Payload 完整示例
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"action": "publish",
|
|
98
|
+
"publishType": "imageText",
|
|
99
|
+
"platforms": ["视频号"],
|
|
100
|
+
"publishArgs": {
|
|
101
|
+
"accountForms": [
|
|
102
|
+
{
|
|
103
|
+
"platformAccountId": "SPH_ACC_ID",
|
|
104
|
+
"contentPublishForm": {
|
|
105
|
+
"formType": "task",
|
|
106
|
+
"title": "视频号动态标题",
|
|
107
|
+
"description": "<p>视频号图文内容 <topic text='微信' raw='{\"id\":\"xxx\",\"name\":\"微信\"}'>#微信</topic></p>",
|
|
108
|
+
"shopping_cart": {
|
|
109
|
+
"yixiaoerId": "goods_001",
|
|
110
|
+
"yixiaoerName": "示例商品",
|
|
111
|
+
"price": 1990
|
|
112
|
+
},
|
|
113
|
+
"declaration": 1,
|
|
114
|
+
"pubType": 0,
|
|
115
|
+
"images": [
|
|
116
|
+
{ "key": "img_sph_01", "size": 1024, "width": 1080, "height": 1440, "format": "jpg" }
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## 相关接口
|
|
126
|
+
|
|
127
|
+
| 目标字段 | 对应 Action | 文档参考 |
|
|
128
|
+
| :--- | :--- | :--- |
|
|
129
|
+
| `location` | `locations` | [获取位置信息](../../get-locations.md) |
|
|
130
|
+
| `collection` | `collections` | [获取合集列表](../../get-collections.md) |
|
|
131
|
+
| `music` | `music` | [获取背景音乐](../../get-music.md) |
|
|
132
|
+
| `shopping_cart` | `goods` | [获取商品列表](../../get-goods.md) |
|
|
133
|
+
| `tags` | `challenges` | [获取话题/挑战](../../get-challenges.md) |
|
|
116
134
|
| `images.key` | `upload` | [资源上传](../../upload-resource.md) |
|
|
@@ -26,9 +26,21 @@
|
|
|
26
26
|
| --- | --- | --- | --- | --- |
|
|
27
27
|
| `formType` | string | 否 | 内容表单类型,固定为 `task` | `task` |
|
|
28
28
|
| `title` | string | 否 | 图文标题,最多 20 个 Unicode 字符 | - |
|
|
29
|
-
| `desc` | string | 否 | 图文正文/描述,支持 HTML | - |
|
|
29
|
+
| `desc` | string | 否 | 图文正文/描述,支持 HTML 和自定义话题,普通 `#话题` 自动转换为 `<topic>` HTML | - |
|
|
30
30
|
| `images` | array | 是 | 写在 `accountForms[].images` 的已上传图片对象数组,可多选;至少 1 张 | - |
|
|
31
31
|
|
|
32
|
+
## 描述话题
|
|
33
|
+
|
|
34
|
+
与 Web 端描述编辑器一致,话题直接写在 `publishArgs.accountForms[].contentPublishForm.desc` 中。公众号使用自定义话题,无需查询话题,也不要新增 `topics` 数组。
|
|
35
|
+
|
|
36
|
+
推荐写入 Web 相同的 HTML,保留话题在描述中的位置:
|
|
37
|
+
|
|
38
|
+
```html
|
|
39
|
+
<p>春日记录 <topic text="生活">#生活</topic> <topic text="摄影">#摄影</topic></p>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
也可填写 `春日记录 #生活 #摄影`,CLI 在 validate / dry-run / 发布准备阶段将普通话题转换为 `<topic>` HTML。已有 `<topic>` HTML 保持原样;使用表单会话时,通过 `publish form set` 写入上述 `desc` 路径。不要填到 `description` 或只填 payload 根级 `desc`,根级字段不能替代账号描述。
|
|
43
|
+
|
|
32
44
|
## 账号级发布设置
|
|
33
45
|
|
|
34
46
|
以下字段填写在 `publishArgs.accountForms[].contentPublishForm`。`statement` 必须直接传数值,网关会将其转换为下游的 `{ "type": 值 }`。
|
|
@@ -100,3 +100,5 @@
|
|
|
100
100
|
| `tags/topic`| `challenges` | [获取话题/挑战](../../get-challenges.md) |
|
|
101
101
|
| `description.friend` | `friends` | [获取小红书用户/艾特对象](../../get-friends.md) |
|
|
102
102
|
| `images.key`| `upload` | [资源上传](../../upload-resource.md) |
|
|
103
|
+
|
|
104
|
+
[小红书发布组件用法](../xiaohongshu-components.md)
|