返回 AiToEarn
publish.types.ts
根目录 / project / aitoearn-web / src / store / plugin / types / publish.types.ts
1 /**
2 * 发布参数类型定义
3 */
4
5 /**
6 * 发布类型
7 */
8 export type PublishType = 'video' | 'image'
9
10 /**
11 * 可见性类型
12 */
13 export type VisibilityType = 'public' | 'private' | 'friends'
14
15 /**
16 * 小红书用户声明来源
17 * 1=虚拟演绎,仅供娱乐、2=笔记含AI合成内容、3=内容包含营销广告
18 */
19 export type XhsUserDeclarationOrigin = 1 | 2 | 3
20
21 /**
22 * 小红书用户声明绑定
23 */
24 export interface XhsUserDeclarationBind {
25 origin: XhsUserDeclarationOrigin
26 }
27
28 /**
29 * 视频号视频元信息
30 */
31 export interface WxSphVideoMetadata {
32 width: number
33 height: number
34 duration: number
35 size: number
36 }
37
38 /**
39 * 视频号地理位置
40 */
41 export interface WxSphPoiInfo {
42 latitude?: number
43 longitude?: number
44 poiCity?: string
45 poiName?: string
46 poiAddress?: string
47 poiId?: string
48 province?: string
49 region?: string
50 fullAddress?: string
51 poiCheckSum?: string
52 }
53
54 export interface WxSphEventInfo {
55 eventTopicId: string
56 eventName: string
57 eventCreatorNickname?: string
58 eventAttendCount?: number
59 }
60
61 /**
62 * 视频号平台配置
63 */
64 export interface WxSphPlatformConfig {
65 videoMetadata?: WxSphVideoMetadata
66 poiInfo?: WxSphPoiInfo
67 event?: WxSphEventInfo
68 extLink?: string
69 postFlag?: 0 | 1
70 }
71
72 /**
73 * 平台特定配置
74 */
75 export interface PlatformConfigOptions {
76 userDeclarationBind?: XhsUserDeclarationBind
77 wxSph?: WxSphPlatformConfig
78 [key: string]: unknown
79 }
80
81 /**
82 * 位置信息
83 */
84 export interface LocationInfo {
85 /** 位置ID */
86 id: string
87 /** 位置名称 */
88 name: string
89 /** 位置类型 */
90 poiType?: number
91 /** 详细地址 */
92 address?: string
93 /** 简短地址 */
94 simpleAddress?: string
95 /** 纬度 */
96 latitude?: number
97 /** 经度 */
98 longitude?: number
99 }
100
101 /**
102 * @用户信息
103 */
104 export interface MentionUserInfo {
105 /** 用户ID */
106 id: string
107 /** 用户昵称 */
108 nickname: string
109 }
110
111 /**
112 * 发布参数
113 */
114 export interface PublishParams {
115 /** 发布类型 */
116 type: PublishType
117
118 /** 账号ID(用于区分同一平台的多个账号) */
119 accountId?: string
120
121 /** 请求ID(用于进度回调匹配,由调用方生成) */
122 requestId?: string
123
124 /** 标题 */
125 title?: string
126
127 /** 描述/正文 */
128 desc?: string
129
130 /** 视频文件或URL(发布视频时必需) */
131 video?: File | string
132
133 /** 图片文件或URL数组(发布图文时必需) */
134 images?: (File | string)[]
135
136 /** 封面图片(视频发布时必需) */
137 cover?: File | string
138
139 /** 话题标签 */
140 topics?: string[]
141
142 /** 位置信息 */
143 location?: LocationInfo
144
145 /** 可见性 */
146 visibility?: VisibilityType
147
148 /** @的用户 */
149 mentionedUsers?: MentionUserInfo[]
150
151 /** 定时发布时间戳(毫秒) */
152 scheduledTime?: number
153
154 /** 平台特定配置 */
155 platformConfig?: PlatformConfigOptions
156 }
157
158 /**
159 * 参数验证结果
160 */
161 export interface ValidationResult {
162 /** 是否有效 */
163 valid: boolean
164 /** 错误信息 */
165 errors?: string[]
166 }
167
167 lines TYPESCRIPT