@iflyrpa/actions 2.0.2 → 3.0.0-beta.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/dist/actions/baijiahaoLogin/rpa.d.ts +11 -0
- package/dist/actions/baijiahaoPublish/index.d.ts +4 -0
- package/dist/actions/common/sessionCheck/index.d.ts +4 -0
- package/dist/actions/douyinCheckVerifyQrCode/index.d.ts +84 -0
- package/dist/actions/douyinCreateCommentReply/schema.d.ts +4 -0
- package/dist/actions/douyinGetCollection/schema.d.ts +4 -0
- package/dist/actions/douyinGetCommentList/schema.d.ts +4 -0
- package/dist/actions/douyinGetCommentReplyList/schema.d.ts +4 -0
- package/dist/actions/douyinGetHot/schema.d.ts +4 -0
- package/dist/actions/douyinGetLocation/schema.d.ts +4 -0
- package/dist/actions/douyinGetMusic/schema.d.ts +4 -0
- package/dist/actions/douyinGetMusicByCategory/schema.d.ts +4 -0
- package/dist/actions/douyinGetMusicCategory/index.d.ts +4 -0
- package/dist/actions/douyinGetMusicCategory/schema.d.ts +4 -0
- package/dist/actions/douyinGetTopics/schema.d.ts +4 -0
- package/dist/actions/douyinGetVerifyQrCode/index.d.ts +66 -0
- package/dist/actions/douyinGetWorkList/schema.d.ts +4 -0
- package/dist/actions/douyinLogin/rpa.d.ts +13 -0
- package/dist/actions/douyinPublish/index.d.ts +18 -0
- package/dist/actions/douyinPublish/rpa-server.d.ts +2 -0
- package/dist/actions/getShipinhaoPostList/index.d.ts +1 -0
- package/dist/actions/searchAccountInfo/index.d.ts +4 -0
- package/dist/actions/searchPublishInfo/index.d.ts +4 -0
- package/dist/actions/shipinhaoCheckLinkValidate/schema.d.ts +4 -0
- package/dist/actions/shipinhaoGetLocation/schema.d.ts +4 -0
- package/dist/actions/shipinhaoGetMsg/index.d.ts +65 -0
- package/dist/actions/shipinhaoGetMsg/schema.d.ts +35 -0
- package/dist/actions/shipinhaoGetMsgImage/index.d.ts +25 -0
- package/dist/actions/shipinhaoLogin/rpa.d.ts +11 -0
- package/dist/actions/shipinhaoPublish/index.d.ts +4 -0
- package/dist/actions/shipinhaoSendMsg/index.d.ts +22 -0
- package/dist/actions/shipinhaoSendMsg/schema.d.ts +46 -0
- package/dist/actions/toutiaoLogin/rpa.d.ts +10 -0
- package/dist/actions/toutiaoPublish/index.d.ts +4 -0
- package/dist/actions/weixinLogin/rpa.d.ts +11 -0
- package/dist/actions/weixinPublish/index.d.ts +4 -0
- package/dist/actions/xiaohongshuLogin/rpa.d.ts +29 -0
- package/dist/actions/xiaohongshuPublish/index.d.ts +4 -0
- package/dist/actions/xiaohongshuWebSearch/index.d.ts +4 -0
- package/dist/bundle.js +5969 -2205
- package/dist/bundle.js.map +1 -1
- package/dist/index.d.ts +19 -0
- package/dist/index.js +5195 -1446
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5186 -1442
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.ts +5 -0
- package/dist/utils/douyin/imageUploader.d.ts +3 -3
- package/dist/utils/douyin/verify-parser.d.ts +73 -0
- package/dist/utils/xhs_ob_feed/index.d.ts +6 -0
- package/dist/utils/xhs_ob_feed/mnsvc2.d.ts +8 -0
- package/package.json +3 -1
- package/dist/utils/douyin/sessionDtrait.d.ts +0 -35
package/dist/types.d.ts
CHANGED
|
@@ -32,6 +32,10 @@ export declare const ActionCommonParamsSchema: z.ZodObject<{
|
|
|
32
32
|
httpOnly: z.ZodOptional<z.ZodBoolean>;
|
|
33
33
|
secure: z.ZodOptional<z.ZodBoolean>;
|
|
34
34
|
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
35
|
+
localStorage: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
36
|
+
key: z.ZodString;
|
|
37
|
+
value: z.ZodString;
|
|
38
|
+
}, z.core.$catchall<z.ZodUnknown>>>>;
|
|
35
39
|
extraParam: z.ZodOptional<z.ZodAny>;
|
|
36
40
|
actionType: z.ZodOptional<z.ZodEnum<{
|
|
37
41
|
mockApi: "mockApi";
|
|
@@ -156,3 +160,4 @@ export declare namespace Xiaohongshu {
|
|
|
156
160
|
}
|
|
157
161
|
export declare const errorResponse: (message: string, code?: number) => SearchAccountInfoResponse;
|
|
158
162
|
export declare const MockPublish = false;
|
|
163
|
+
export declare const DisabledReq = true;
|
|
@@ -9,7 +9,7 @@ interface UploadResult {
|
|
|
9
9
|
export declare class DouyinImageUploader {
|
|
10
10
|
private proxyHttp;
|
|
11
11
|
private headers;
|
|
12
|
-
private
|
|
12
|
+
private queryParams;
|
|
13
13
|
private tmpCachePath;
|
|
14
14
|
private authCache;
|
|
15
15
|
private authExpireTime;
|
|
@@ -18,7 +18,7 @@ export declare class DouyinImageUploader {
|
|
|
18
18
|
private readonly UPLOAD_DELAY;
|
|
19
19
|
private readonly UPLOAD_TIMEOUT;
|
|
20
20
|
private uploadAgent;
|
|
21
|
-
constructor(proxyHttp: Http, headers: Record<string, string>,
|
|
21
|
+
constructor(proxyHttp: Http, headers: Record<string, string>, queryParams: Record<string, string>, tmpCachePath: string, isHttps?: boolean);
|
|
22
22
|
/**
|
|
23
23
|
* 获取有效的上传凭证(带缓存)
|
|
24
24
|
*/
|
|
@@ -46,7 +46,7 @@ export declare class DouyinImageUploader {
|
|
|
46
46
|
/**
|
|
47
47
|
* 上传封面图(单张)
|
|
48
48
|
*/
|
|
49
|
-
uploadCover(coverUrl: string): Promise<
|
|
49
|
+
uploadCover(coverUrl: string): Promise<UploadResult>;
|
|
50
50
|
/**
|
|
51
51
|
* 安全删除文件
|
|
52
52
|
*/
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 抖音 x-tt-verify-passport-decision 解析器
|
|
3
|
+
* 修复版 - 正确处理 UTF-8 编码的中文字符
|
|
4
|
+
*/
|
|
5
|
+
export interface VerifyPassportDecision {
|
|
6
|
+
account_flow: "verify" | string;
|
|
7
|
+
biz_params: unknown;
|
|
8
|
+
common_params: CommonParams;
|
|
9
|
+
encrypt_uid: string;
|
|
10
|
+
event_params: EventParams;
|
|
11
|
+
extra_params: ExtraParams;
|
|
12
|
+
pack_verify_way: boolean;
|
|
13
|
+
schema: string;
|
|
14
|
+
url: string;
|
|
15
|
+
user_info: UserInfo;
|
|
16
|
+
verify_way_name_list: string;
|
|
17
|
+
}
|
|
18
|
+
export interface CommonParams {
|
|
19
|
+
copywriting: string;
|
|
20
|
+
copywriting_key: string;
|
|
21
|
+
gateway_abtest_group: string;
|
|
22
|
+
new_verify_flow: string;
|
|
23
|
+
}
|
|
24
|
+
export interface CopywritingContent {
|
|
25
|
+
title: string;
|
|
26
|
+
desc: string;
|
|
27
|
+
}
|
|
28
|
+
export interface EventParams {
|
|
29
|
+
log_id: string;
|
|
30
|
+
verify_reason: string;
|
|
31
|
+
verify_scene: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ExtraParams {
|
|
34
|
+
log_id: string;
|
|
35
|
+
}
|
|
36
|
+
export interface UserInfo {
|
|
37
|
+
avatar_url: string;
|
|
38
|
+
nickname: string;
|
|
39
|
+
mobile_info: string | null;
|
|
40
|
+
}
|
|
41
|
+
export interface ParsedCommonParams extends CommonParams {
|
|
42
|
+
parsed_copywriting: CopywritingContent;
|
|
43
|
+
}
|
|
44
|
+
export interface ParsedVerifyDecision {
|
|
45
|
+
account_flow: "verify" | string;
|
|
46
|
+
biz_params: unknown;
|
|
47
|
+
common_params: ParsedCommonParams;
|
|
48
|
+
encrypt_uid: string;
|
|
49
|
+
event_params: EventParams;
|
|
50
|
+
extra_params: ExtraParams;
|
|
51
|
+
pack_verify_way: boolean;
|
|
52
|
+
schema: string;
|
|
53
|
+
url: string;
|
|
54
|
+
user_info: UserInfo;
|
|
55
|
+
verify_way_name_list: string;
|
|
56
|
+
verify_ways: VerifyWay[];
|
|
57
|
+
verify_title: string;
|
|
58
|
+
verify_desc: string;
|
|
59
|
+
}
|
|
60
|
+
export type VerifyWay = "mobile_sms_verify" | "mobile_up_sms_verify" | "face_verify" | "idcard_verify" | "password_verify" | string;
|
|
61
|
+
/**
|
|
62
|
+
* 解析 x-tt-verify-passport-decision 响应头
|
|
63
|
+
* @param headerValue - 响应头的原始值
|
|
64
|
+
* @returns 解析后的结构化数据
|
|
65
|
+
*/
|
|
66
|
+
export declare function parseVerifyPassportDecision(headerValue: string | null | undefined): ParsedVerifyDecision | null;
|
|
67
|
+
export declare function needsVerification(decision: ParsedVerifyDecision | null): boolean;
|
|
68
|
+
export declare function getVerifyUrl(decision: ParsedVerifyDecision | null): string | null;
|
|
69
|
+
export declare function getAppSchema(decision: ParsedVerifyDecision | null): string | null;
|
|
70
|
+
export declare function getUserNickname(decision: ParsedVerifyDecision | null): string | null;
|
|
71
|
+
export declare function getVerifyPrompt(decision: ParsedVerifyDecision | null): CopywritingContent;
|
|
72
|
+
export declare function supportsVerifyWay(decision: ParsedVerifyDecision | null, way: VerifyWay): boolean;
|
|
73
|
+
export declare function getRecommendedVerifyWay(decision: ParsedVerifyDecision | null): VerifyWay | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare class Xhshow {
|
|
2
|
+
private stringifyCookies;
|
|
3
|
+
signHeadersGet(uri: string, cookieString: Record<string, any>, xsecAppid?: string, params?: Record<string, unknown> | null): Record<string, string>;
|
|
4
|
+
signHeadersPost(uri: string, cookieString: Record<string, any>, xsecAppid?: string, payload?: Record<string, unknown> | null): Record<string, string>;
|
|
5
|
+
}
|
|
6
|
+
export default Xhshow;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iflyrpa/actions",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-beta.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"author": "bijinfeng",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
+
"@types/ws": "^8.18.1",
|
|
13
14
|
"axios": "^1.7.8",
|
|
14
15
|
"dom-serializer": "^2.0.0",
|
|
15
16
|
"domhandler": "^5.0.3",
|
|
@@ -19,6 +20,7 @@
|
|
|
19
20
|
"mime-types": "^2.1.35",
|
|
20
21
|
"node-fetch": "^2.7.0",
|
|
21
22
|
"playwright-core": "^1.46.1",
|
|
23
|
+
"ws": "^8.18.3",
|
|
22
24
|
"@iflyrpa/share": "0.0.18"
|
|
23
25
|
},
|
|
24
26
|
"devDependencies": {
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* X-tt-session-dtrait 生成器
|
|
3
|
-
* 基于抖音 Web 端逆向分析实现
|
|
4
|
-
*
|
|
5
|
-
* 格式:d0_<RSA加密结果>_<AES-CBC加密结果>
|
|
6
|
-
* - d0: 固定前缀
|
|
7
|
-
* - r1 (RSA): 使用 centralRsaPub 公钥加密随机的 aesKey
|
|
8
|
-
* - r2 (AES-CBC): 使用 aesKey 加密包含 dtrait 的 JSON 数据
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* SessionDtrait 生成器配置
|
|
12
|
-
*/
|
|
13
|
-
interface SessionDtraitConfig {
|
|
14
|
-
centralRsaPub: string;
|
|
15
|
-
sdkVersion?: string;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* 生成 X-tt-session-dtrait
|
|
19
|
-
*
|
|
20
|
-
* @param path - 请求路径(如 /web/api/media/aweme/create_v2/)
|
|
21
|
-
* @param config - 配置对象
|
|
22
|
-
* @returns 生成的 dtrait 字符串
|
|
23
|
-
*/
|
|
24
|
-
export declare function generateSessionDtrait(path: string, config: SessionDtraitConfig): string;
|
|
25
|
-
/**
|
|
26
|
-
* 从抖音接口获取 RSA 公钥
|
|
27
|
-
* 公钥通常通过特定的接口或存储在 localStorage 中
|
|
28
|
-
*/
|
|
29
|
-
export declare function fetchCentralRsaPub(): Promise<string>;
|
|
30
|
-
/**
|
|
31
|
-
* 简化的 dtrait 生成(用于测试)
|
|
32
|
-
* 如果完整版不工作,可以先尝试此简化版验证流程
|
|
33
|
-
*/
|
|
34
|
-
export declare function generateSessionDtraitSimple(path: string, centralRsaPub: string): string;
|
|
35
|
-
export {};
|