@iflyrpa/actions 2.0.0-beta.7 → 2.0.0

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.
@@ -0,0 +1,19 @@
1
+ import { type CommonAction } from "@iflyrpa/share";
2
+ import type { ActiomCommonParams } from "../../types";
3
+ export interface CreateShipinhaoCommentParams extends ActiomCommonParams {
4
+ content: string;
5
+ exportId: string;
6
+ rootCommentId?: string;
7
+ replyCommentId?: string;
8
+ }
9
+ export interface CreateCommentResponse {
10
+ errCode: number;
11
+ errMsg: string;
12
+ data?: {
13
+ commentId: string;
14
+ createTime: number;
15
+ success: boolean;
16
+ };
17
+ }
18
+ export type CreateCommentAction = CommonAction<CreateShipinhaoCommentParams, CreateCommentResponse["data"]>;
19
+ export declare const createShipinhaoComment: CreateCommentAction;
@@ -0,0 +1,16 @@
1
+ import { type CommonAction } from "@iflyrpa/share";
2
+ import { z } from "zod";
3
+ import { DouyinCreateCommentReplyParamsSchema } from "./schema";
4
+ export type DouyinCreateCommentReplyParams = z.infer<typeof DouyinCreateCommentReplyParamsSchema>;
5
+ export { DouyinCreateCommentReplyParamsSchema } from "./schema";
6
+ export interface DouyinCreateCommentReplyResponse {
7
+ status_code: number;
8
+ status_msg: string;
9
+ comment?: {
10
+ cid: string;
11
+ text: string;
12
+ create_time: number;
13
+ };
14
+ }
15
+ export type DouyinCreateCommentReplyAction = CommonAction<DouyinCreateCommentReplyParams, DouyinCreateCommentReplyResponse>;
16
+ export declare const douyinCreateCommentReply: DouyinCreateCommentReplyAction;
@@ -0,0 +1,35 @@
1
+ import { z } from "zod";
2
+ export declare const DouyinCreateCommentReplyParamsSchema: z.ZodObject<{
3
+ id: z.ZodOptional<z.ZodString>;
4
+ userAgent: z.ZodOptional<z.ZodString>;
5
+ viewport: z.ZodNullable<z.ZodOptional<z.ZodObject<{
6
+ width: z.ZodNumber;
7
+ height: z.ZodNumber;
8
+ }, z.core.$strip>>>;
9
+ url: z.ZodOptional<z.ZodString>;
10
+ cookies: z.ZodArray<z.ZodObject<{
11
+ name: z.ZodString;
12
+ value: z.ZodString;
13
+ domain: z.ZodOptional<z.ZodString>;
14
+ path: z.ZodOptional<z.ZodString>;
15
+ expires: z.ZodOptional<z.ZodNumber>;
16
+ httpOnly: z.ZodOptional<z.ZodBoolean>;
17
+ secure: z.ZodOptional<z.ZodBoolean>;
18
+ }, z.core.$catchall<z.ZodUnknown>>>;
19
+ extraParam: z.ZodOptional<z.ZodAny>;
20
+ actionType: z.ZodOptional<z.ZodEnum<{
21
+ mockApi: "mockApi";
22
+ rpa: "rpa";
23
+ server: "server";
24
+ }>>;
25
+ accountId: z.ZodOptional<z.ZodNumber>;
26
+ proxyLoc: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
+ localIP: z.ZodOptional<z.ZodString>;
28
+ huiwenToken: z.ZodOptional<z.ZodString>;
29
+ articleId: z.ZodOptional<z.ZodString>;
30
+ saveType: z.ZodOptional<z.ZodString>;
31
+ itemId: z.ZodString;
32
+ commentId: z.ZodString;
33
+ text: z.ZodString;
34
+ }, z.core.$strip>;
35
+ export type DouyinCreateCommentReplyParams = z.infer<typeof DouyinCreateCommentReplyParamsSchema>;
@@ -0,0 +1,32 @@
1
+ import { type CommonAction } from "@iflyrpa/share";
2
+ import { z } from "zod";
3
+ import { DouyinGetCommentListParamsSchema } from "./schema";
4
+ export type DouyinGetCommentListParams = z.infer<typeof DouyinGetCommentListParamsSchema>;
5
+ export { DouyinGetCommentListParamsSchema } from "./schema";
6
+ export interface CommentUser {
7
+ uid: string;
8
+ nickname: string;
9
+ avatar_thumb?: {
10
+ url_list: string[];
11
+ };
12
+ }
13
+ export interface CommentItem {
14
+ cid: string;
15
+ text: string;
16
+ create_time: number;
17
+ digg_count: number;
18
+ reply_comment_total: number;
19
+ user: CommentUser;
20
+ reply_to_reply_id?: string;
21
+ }
22
+ export interface DouyinCommentListResponse {
23
+ status_code: number;
24
+ status_msg: string;
25
+ comment_info_list?: CommentItem[];
26
+ has_more?: boolean;
27
+ cursor?: number;
28
+ total_count?: number;
29
+ has_vcd_filter?: number;
30
+ }
31
+ export type DouyinGetCommentListAction = CommonAction<DouyinGetCommentListParams, DouyinCommentListResponse>;
32
+ export declare const douyinGetCommentList: DouyinGetCommentListAction;
@@ -0,0 +1,35 @@
1
+ import { z } from "zod";
2
+ export declare const DouyinGetCommentListParamsSchema: z.ZodObject<{
3
+ id: z.ZodOptional<z.ZodString>;
4
+ userAgent: z.ZodOptional<z.ZodString>;
5
+ viewport: z.ZodNullable<z.ZodOptional<z.ZodObject<{
6
+ width: z.ZodNumber;
7
+ height: z.ZodNumber;
8
+ }, z.core.$strip>>>;
9
+ url: z.ZodOptional<z.ZodString>;
10
+ cookies: z.ZodArray<z.ZodObject<{
11
+ name: z.ZodString;
12
+ value: z.ZodString;
13
+ domain: z.ZodOptional<z.ZodString>;
14
+ path: z.ZodOptional<z.ZodString>;
15
+ expires: z.ZodOptional<z.ZodNumber>;
16
+ httpOnly: z.ZodOptional<z.ZodBoolean>;
17
+ secure: z.ZodOptional<z.ZodBoolean>;
18
+ }, z.core.$catchall<z.ZodUnknown>>>;
19
+ extraParam: z.ZodOptional<z.ZodAny>;
20
+ actionType: z.ZodOptional<z.ZodEnum<{
21
+ mockApi: "mockApi";
22
+ rpa: "rpa";
23
+ server: "server";
24
+ }>>;
25
+ accountId: z.ZodOptional<z.ZodNumber>;
26
+ proxyLoc: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
+ localIP: z.ZodOptional<z.ZodString>;
28
+ huiwenToken: z.ZodOptional<z.ZodString>;
29
+ articleId: z.ZodOptional<z.ZodString>;
30
+ saveType: z.ZodOptional<z.ZodString>;
31
+ cursor: z.ZodOptional<z.ZodNumber>;
32
+ count: z.ZodOptional<z.ZodNumber>;
33
+ itemId: z.ZodString;
34
+ }, z.core.$strip>;
35
+ export type DouyinGetCommentListParams = z.infer<typeof DouyinGetCommentListParamsSchema>;
@@ -0,0 +1,31 @@
1
+ import { type CommonAction } from "@iflyrpa/share";
2
+ import { z } from "zod";
3
+ import { DouyinGetCommentReplyListParamsSchema } from "./schema";
4
+ export type DouyinGetCommentReplyListParams = z.infer<typeof DouyinGetCommentReplyListParamsSchema>;
5
+ export { DouyinGetCommentReplyListParamsSchema } from "./schema";
6
+ export interface ReplyUser {
7
+ uid: string;
8
+ nickname: string;
9
+ avatar_thumb?: {
10
+ url_list: string[];
11
+ };
12
+ }
13
+ export interface ReplyItem {
14
+ cid: string;
15
+ text: string;
16
+ create_time: number;
17
+ digg_count: number;
18
+ user: ReplyUser;
19
+ reply_to_userid?: string;
20
+ reply_to_username?: string;
21
+ }
22
+ export interface DouyinCommentReplyListResponse {
23
+ status_code: number;
24
+ status_msg: string;
25
+ reply_comment_list?: ReplyItem[];
26
+ has_more?: boolean;
27
+ cursor?: number;
28
+ total_count?: number;
29
+ }
30
+ export type DouyinGetCommentReplyListAction = CommonAction<DouyinGetCommentReplyListParams, DouyinCommentReplyListResponse>;
31
+ export declare const douyinGetCommentReplyList: DouyinGetCommentReplyListAction;
@@ -0,0 +1,35 @@
1
+ import { z } from "zod";
2
+ export declare const DouyinGetCommentReplyListParamsSchema: z.ZodObject<{
3
+ id: z.ZodOptional<z.ZodString>;
4
+ userAgent: z.ZodOptional<z.ZodString>;
5
+ viewport: z.ZodNullable<z.ZodOptional<z.ZodObject<{
6
+ width: z.ZodNumber;
7
+ height: z.ZodNumber;
8
+ }, z.core.$strip>>>;
9
+ url: z.ZodOptional<z.ZodString>;
10
+ cookies: z.ZodArray<z.ZodObject<{
11
+ name: z.ZodString;
12
+ value: z.ZodString;
13
+ domain: z.ZodOptional<z.ZodString>;
14
+ path: z.ZodOptional<z.ZodString>;
15
+ expires: z.ZodOptional<z.ZodNumber>;
16
+ httpOnly: z.ZodOptional<z.ZodBoolean>;
17
+ secure: z.ZodOptional<z.ZodBoolean>;
18
+ }, z.core.$catchall<z.ZodUnknown>>>;
19
+ extraParam: z.ZodOptional<z.ZodAny>;
20
+ actionType: z.ZodOptional<z.ZodEnum<{
21
+ mockApi: "mockApi";
22
+ rpa: "rpa";
23
+ server: "server";
24
+ }>>;
25
+ accountId: z.ZodOptional<z.ZodNumber>;
26
+ proxyLoc: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
+ localIP: z.ZodOptional<z.ZodString>;
28
+ huiwenToken: z.ZodOptional<z.ZodString>;
29
+ articleId: z.ZodOptional<z.ZodString>;
30
+ saveType: z.ZodOptional<z.ZodString>;
31
+ commentId: z.ZodString;
32
+ cursor: z.ZodOptional<z.ZodNumber>;
33
+ count: z.ZodOptional<z.ZodNumber>;
34
+ }, z.core.$strip>;
35
+ export type DouyinGetCommentReplyListParams = z.infer<typeof DouyinGetCommentReplyListParamsSchema>;
@@ -0,0 +1,39 @@
1
+ import { type CommonAction } from "@iflyrpa/share";
2
+ import { z } from "zod";
3
+ import { DouyinGetWorkListParamsSchema } from "./schema";
4
+ export type DouyinGetWorkListParams = z.infer<typeof DouyinGetWorkListParamsSchema>;
5
+ export { DouyinGetWorkListParamsSchema } from "./schema";
6
+ export interface WorkItem {
7
+ aweme_id: string;
8
+ desc: string;
9
+ create_time: number;
10
+ statistics: {
11
+ digg_count: number;
12
+ comment_count: number;
13
+ share_count: number;
14
+ play_count: number;
15
+ };
16
+ video?: {
17
+ cover: {
18
+ url_list: string[];
19
+ };
20
+ play_addr: {
21
+ url_list: string[];
22
+ };
23
+ duration: number;
24
+ };
25
+ }
26
+ export interface DouyinWorkListResponse {
27
+ status_code: number;
28
+ status_msg: string;
29
+ aweme_list?: WorkItem[];
30
+ has_more?: boolean;
31
+ cursor?: number;
32
+ }
33
+ export type DouyinGetWorkListAction = CommonAction<DouyinGetWorkListParams, {
34
+ works: WorkItem[];
35
+ has_more: boolean;
36
+ cursor: number;
37
+ total: number;
38
+ }>;
39
+ export declare const douyinGetWorkList: DouyinGetWorkListAction;
@@ -0,0 +1,34 @@
1
+ import { z } from "zod";
2
+ export declare const DouyinGetWorkListParamsSchema: z.ZodObject<{
3
+ id: z.ZodOptional<z.ZodString>;
4
+ userAgent: z.ZodOptional<z.ZodString>;
5
+ viewport: z.ZodNullable<z.ZodOptional<z.ZodObject<{
6
+ width: z.ZodNumber;
7
+ height: z.ZodNumber;
8
+ }, z.core.$strip>>>;
9
+ url: z.ZodOptional<z.ZodString>;
10
+ cookies: z.ZodArray<z.ZodObject<{
11
+ name: z.ZodString;
12
+ value: z.ZodString;
13
+ domain: z.ZodOptional<z.ZodString>;
14
+ path: z.ZodOptional<z.ZodString>;
15
+ expires: z.ZodOptional<z.ZodNumber>;
16
+ httpOnly: z.ZodOptional<z.ZodBoolean>;
17
+ secure: z.ZodOptional<z.ZodBoolean>;
18
+ }, z.core.$catchall<z.ZodUnknown>>>;
19
+ extraParam: z.ZodOptional<z.ZodAny>;
20
+ actionType: z.ZodOptional<z.ZodEnum<{
21
+ mockApi: "mockApi";
22
+ rpa: "rpa";
23
+ server: "server";
24
+ }>>;
25
+ accountId: z.ZodOptional<z.ZodNumber>;
26
+ proxyLoc: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
+ localIP: z.ZodOptional<z.ZodString>;
28
+ huiwenToken: z.ZodOptional<z.ZodString>;
29
+ articleId: z.ZodOptional<z.ZodString>;
30
+ saveType: z.ZodOptional<z.ZodString>;
31
+ cursor: z.ZodOptional<z.ZodNumber>;
32
+ count: z.ZodOptional<z.ZodNumber>;
33
+ }, z.core.$strip>;
34
+ export type DouyinGetWorkListParams = z.infer<typeof DouyinGetWorkListParamsSchema>;
@@ -42,8 +42,11 @@ export declare const DouyinPublishParamsSchema: z.ZodObject<{
42
42
  mix: z.ZodOptional<z.ZodObject<{
43
43
  mix_id: z.ZodString;
44
44
  mix_order: z.ZodNumber;
45
+ mix_name: z.ZodOptional<z.ZodString>;
45
46
  }, z.core.$strip>>;
46
47
  musicId: z.ZodOptional<z.ZodString>;
48
+ musicName: z.ZodOptional<z.ZodString>;
49
+ musicAuthor: z.ZodOptional<z.ZodString>;
47
50
  musicDuration: z.ZodOptional<z.ZodNumber>;
48
51
  challengeIds: z.ZodOptional<z.ZodString>;
49
52
  hotSentence: z.ZodOptional<z.ZodString>;
@@ -17,7 +17,7 @@ export interface BgmListResponse {
17
17
  };
18
18
  }
19
19
  export interface BgmDetail {
20
- listenItem: any;
20
+ listenItem: unknown;
21
21
  }
22
22
  export type GetBgmAction = CommonAction<GetShipinhaoBgmParams, BgmListResponse["data"]>;
23
23
  export declare const getShipinhaoBgm: GetBgmAction;
@@ -7,6 +7,10 @@ export interface ShipinhaoCheckLinkValidateResponse {
7
7
  errCode: number;
8
8
  errMsg: string;
9
9
  data?: {
10
+ baseResp: {
11
+ errcode: number;
12
+ errmsg: string;
13
+ };
10
14
  title?: string;
11
15
  };
12
16
  }
@@ -16,16 +16,28 @@ export interface Location {
16
16
  source: number;
17
17
  poiCheckSum: string;
18
18
  }
19
+ export interface Address {
20
+ city: string;
21
+ country: string;
22
+ countryCode: string;
23
+ latitude: number;
24
+ longitude: number;
25
+ poiCheckSum: string;
26
+ province: string;
27
+ region: string;
28
+ }
19
29
  export interface ShipinhaoLocationResponse {
20
30
  errCode: number;
21
31
  errMsg: string;
22
32
  data?: {
23
33
  list?: Location[];
34
+ address?: Address;
24
35
  total?: number;
25
36
  };
26
37
  }
27
38
  export type ShipinhaoGetLocationAction = CommonAction<ShipinhaoGetLocationParams, {
28
39
  locations: Location[];
29
40
  total: number;
41
+ address?: Address | undefined;
30
42
  }>;
31
43
  export declare const shipinhaoGetLocation: ShipinhaoGetLocationAction;
@@ -33,19 +33,14 @@ export declare const ShipinhaoPublishParamsSchema: z.ZodObject<{
33
33
  topic: z.ZodOptional<z.ZodArray<z.ZodString>>;
34
34
  address: z.ZodOptional<z.ZodObject<{
35
35
  poi_id: z.ZodString;
36
- name: z.ZodString;
37
- address: z.ZodString;
36
+ name: z.ZodOptional<z.ZodString>;
37
+ address: z.ZodOptional<z.ZodString>;
38
38
  latitude: z.ZodNumber;
39
39
  longitude: z.ZodNumber;
40
40
  city_name: z.ZodString;
41
- poi_type: z.ZodNumber;
42
- type: z.ZodString;
43
41
  }, z.core.$strip>>;
44
42
  link: z.ZodOptional<z.ZodObject<{
45
- urlType: z.ZodEnum<{
46
- 1: "1";
47
- 2: "2";
48
- }>;
43
+ urlType: z.ZodNumber;
49
44
  link: z.ZodString;
50
45
  title: z.ZodString;
51
46
  }, z.core.$strip>>;
@@ -0,0 +1,2 @@
1
+ import type { PublishAction } from "./index";
2
+ export declare const rpaAction_Server: PublishAction;
@@ -1,2 +1,6 @@
1
1
  import type { PublishAction } from "./index";
2
+ /**
3
+ * 视频号发布 - RPA 方式
4
+ * 通过浏览器自动化实现视频号内容发布
5
+ */
2
6
  export declare const rpaAction: PublishAction;
@@ -0,0 +1,102 @@
1
+ /**
2
+ * 视频号分片上传配置
3
+ */
4
+ interface UploadConfig {
5
+ chunkSize?: number;
6
+ concurrentLimit?: number;
7
+ singleFileSize?: number;
8
+ }
9
+ /**
10
+ * 上传进度回调
11
+ */
12
+ type ProgressCallback = (progress: {
13
+ uploadedChunks: number;
14
+ totalChunks: number;
15
+ percent: number;
16
+ speed?: number;
17
+ }) => void;
18
+ /**
19
+ * 视频号分片上传器
20
+ * 参考前端代码逻辑实现
21
+ */
22
+ export declare class VideoChannelUploader {
23
+ private chunkSize;
24
+ private concurrentLimit;
25
+ private singleFileSize;
26
+ private uploadTaskId;
27
+ private partInfo;
28
+ private md5;
29
+ private chunkCount;
30
+ private uploadedChunks;
31
+ private startTime;
32
+ private uploadSpeed;
33
+ private speedRecords;
34
+ private speedInterval?;
35
+ constructor(config?: UploadConfig);
36
+ /**
37
+ * 计算 Buffer MD5(前 5MB)
38
+ */
39
+ private calculateMd5;
40
+ /**
41
+ * 计算分片 MD5(完整分片)
42
+ */
43
+ private calculateChunkMd5;
44
+ /**
45
+ * 生成 UUID
46
+ */
47
+ private generateUUID;
48
+ /**
49
+ * 获取图片尺寸
50
+ */
51
+ private getImageSize;
52
+ /**
53
+ * 读取文件为 Buffer
54
+ */
55
+ private readFile;
56
+ /**
57
+ * 获取上传认证参数(UploadID)
58
+ */
59
+ private getUploadId;
60
+ /**
61
+ * 上传单个分片
62
+ */
63
+ private uploadChunk;
64
+ /**
65
+ * 确认分片上传(用于断点续传检查)
66
+ */
67
+ private confirmChunks;
68
+ /**
69
+ * 完成上传
70
+ */
71
+ private completeUpload;
72
+ /**
73
+ * 并发控制执行器
74
+ */
75
+ private asyncPool;
76
+ /**
77
+ * 开始上传(核心方法)
78
+ */
79
+ upload(imagePath: string, uin: number, authKey: string, options?: {
80
+ onProgress?: ProgressCallback;
81
+ transFlag?: string;
82
+ }): Promise<{
83
+ downloadUrl: string;
84
+ width: number;
85
+ height: number;
86
+ fileSize: number;
87
+ md5: string;
88
+ }>;
89
+ /**
90
+ * 更新进度
91
+ */
92
+ private updateProgress;
93
+ /**
94
+ * 启动速度监控
95
+ */
96
+ private startSpeedWatch;
97
+ /**
98
+ * 停止速度监控
99
+ */
100
+ private stopSpeedWatch;
101
+ }
102
+ export {};