@iflyrpa/actions 4.0.4-beta.3 → 4.0.4-beta.4
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/bundle.js +62 -42
- package/dist/bundle.js.map +1 -1
- package/dist/index.js +62 -42
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +62 -42
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="83bb856e-4161-51e9-bcc6-bc0ff84cc5f0")}catch(e){}}();
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE_crypto__ from "crypto";
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE_fs__ from "fs";
|
|
5
5
|
import * as __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_package_json_58ae5f06__ from "@iflyrpa/share/package.json";
|
|
@@ -4352,7 +4352,7 @@ function __webpack_require__(moduleId) {
|
|
|
4352
4352
|
return module;
|
|
4353
4353
|
};
|
|
4354
4354
|
})();
|
|
4355
|
-
var package_namespaceObject = JSON.parse('{"i8":"4.0.4-beta.
|
|
4355
|
+
var package_namespaceObject = JSON.parse('{"i8":"4.0.4-beta.4"}');
|
|
4356
4356
|
const PROXY_CREDENTIALS = [
|
|
4357
4357
|
{
|
|
4358
4358
|
ip: "47.110.131.129",
|
|
@@ -13722,7 +13722,7 @@ const mock_mockAction = async (task, params)=>{
|
|
|
13722
13722
|
error: message,
|
|
13723
13723
|
result: {
|
|
13724
13724
|
...safeDecision,
|
|
13725
|
-
data:
|
|
13725
|
+
data: decision,
|
|
13726
13726
|
uploadedImgList: JSON.stringify(publishData.item.common.images)
|
|
13727
13727
|
}
|
|
13728
13728
|
};
|
|
@@ -15395,12 +15395,12 @@ async function getDouyinData(_task, params) {
|
|
|
15395
15395
|
const douyinData = {
|
|
15396
15396
|
fansNum,
|
|
15397
15397
|
favedNum,
|
|
15398
|
-
fansNumLastWeek: toNum(ov?.
|
|
15399
|
-
watchNumLastWeek: toNum(ov?.
|
|
15400
|
-
likeNumLastWeek: toNum(ov?.
|
|
15401
|
-
commentNumLastWeek: toNum(ov?.
|
|
15402
|
-
shareNumLastWeek: toNum(ov?.
|
|
15403
|
-
visitNumLastWeek: toNum(ov?.
|
|
15398
|
+
fansNumLastWeek: toNum(ov?.new_fans?.last_period_incr),
|
|
15399
|
+
watchNumLastWeek: toNum(ov?.play?.last_period_incr),
|
|
15400
|
+
likeNumLastWeek: toNum(ov?.digg?.last_period_incr),
|
|
15401
|
+
commentNumLastWeek: toNum(ov?.comment?.last_period_incr),
|
|
15402
|
+
shareNumLastWeek: toNum(ov?.share?.last_period_incr),
|
|
15403
|
+
visitNumLastWeek: toNum(ov?.profile?.last_period_incr)
|
|
15404
15404
|
};
|
|
15405
15405
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(douyinData, "抖音平台数据获取成功!");
|
|
15406
15406
|
} catch (error) {
|
|
@@ -16037,7 +16037,7 @@ async function handleDouyinData(_task, params) {
|
|
|
16037
16037
|
}
|
|
16038
16038
|
async function handleShipinhaoData(_task, params) {
|
|
16039
16039
|
try {
|
|
16040
|
-
const { cookies, postType = "all", pageNum = 1, pageSize =
|
|
16040
|
+
const { cookies, postType = "all", pageNum = 1, pageSize = 10, showOriginalData = false } = params;
|
|
16041
16041
|
const aidCookie = cookies.find((it)=>"_aid" === it.name)?.value;
|
|
16042
16042
|
const aid = aidCookie || "9d3e0e9f-b842-498d-a273-4285d58df264";
|
|
16043
16043
|
const uinCookie = cookies.find((it)=>"uin" === it.name || "wxuin" === it.name)?.value || "0000000000";
|
|
@@ -16063,7 +16063,7 @@ async function handleShipinhaoData(_task, params) {
|
|
|
16063
16063
|
];
|
|
16064
16064
|
const http = new Http(...args);
|
|
16065
16065
|
const finderIdCookie = cookies.find((it)=>"_log_finder_id" === it.name || "finder_id" === it.name)?.value || "";
|
|
16066
|
-
async function fetchPosts(currentPage, userpageType, pageUrl) {
|
|
16066
|
+
async function fetchPosts(currentPage, userpageType, pageUrl, rawKeyBuff = "") {
|
|
16067
16067
|
return await http.api({
|
|
16068
16068
|
method: "post",
|
|
16069
16069
|
url: "https://channels.weixin.qq.com/micro/content/cgi-bin/mmfinderassistant-bin/post/post_list",
|
|
@@ -16080,7 +16080,7 @@ async function handleShipinhaoData(_task, params) {
|
|
|
16080
16080
|
timestamp: Date.now().toString(),
|
|
16081
16081
|
_log_finder_uin: "",
|
|
16082
16082
|
_log_finder_id: finderIdCookie,
|
|
16083
|
-
rawKeyBuff
|
|
16083
|
+
rawKeyBuff,
|
|
16084
16084
|
pluginSessionId: null,
|
|
16085
16085
|
scene: 7,
|
|
16086
16086
|
reqScene: 7
|
|
@@ -16091,6 +16091,37 @@ async function handleShipinhaoData(_task, params) {
|
|
|
16091
16091
|
timeout: 5000
|
|
16092
16092
|
});
|
|
16093
16093
|
}
|
|
16094
|
+
async function fetchAllPosts(userpageType, pageUrl) {
|
|
16095
|
+
const allPosts = [];
|
|
16096
|
+
let currentPage = 1;
|
|
16097
|
+
let rawKeyBuff = "";
|
|
16098
|
+
let continueFlag = true;
|
|
16099
|
+
let totalCount = 0;
|
|
16100
|
+
while(continueFlag){
|
|
16101
|
+
const response = await fetchPosts(currentPage, userpageType, pageUrl, rawKeyBuff);
|
|
16102
|
+
if (response.errCode && AUTH_ERROR_CODES.includes(response.errCode)) throw new Error(`AUTH_ERROR:${response.errMsg || "登录已失效"}`);
|
|
16103
|
+
if (response.errCode) {
|
|
16104
|
+
_task.logger.warn(`视频号API错误:${response.errMsg} (${response.errCode})`);
|
|
16105
|
+
throw new Error(`视频号API错误:${response.errMsg} (${response.errCode})`);
|
|
16106
|
+
}
|
|
16107
|
+
if (1 === currentPage) totalCount = response.data?.totalCount ?? 0;
|
|
16108
|
+
const posts = response.data?.list || response.posts || response.post_list || [];
|
|
16109
|
+
allPosts.push(...posts);
|
|
16110
|
+
continueFlag = response.data?.continueFlag ?? false;
|
|
16111
|
+
rawKeyBuff = response.data?.lastBuff || "";
|
|
16112
|
+
_task.logger.info(`获取${11 === userpageType ? "视频" : "图文"}第${currentPage}页,本页${posts.length}条,累计${allPosts.length}条,continueFlag=${continueFlag}`);
|
|
16113
|
+
currentPage++;
|
|
16114
|
+
if (currentPage > 100) {
|
|
16115
|
+
_task.logger.warn("分页超过100页,停止请求");
|
|
16116
|
+
break;
|
|
16117
|
+
}
|
|
16118
|
+
}
|
|
16119
|
+
if (totalCount > 0 && allPosts.length !== totalCount) _task.logger.warn(`视频号分页可能不完整:期望${totalCount}条,实际${allPosts.length}条`);
|
|
16120
|
+
return {
|
|
16121
|
+
posts: allPosts,
|
|
16122
|
+
totalCount
|
|
16123
|
+
};
|
|
16124
|
+
}
|
|
16094
16125
|
const mapPost = (item, forcePostType)=>{
|
|
16095
16126
|
let imageUrl = "";
|
|
16096
16127
|
if (item.desc?.media?.[0]?.thumbUrl) imageUrl = item.desc.media[0].thumbUrl;
|
|
@@ -16126,21 +16157,14 @@ async function handleShipinhaoData(_task, params) {
|
|
|
16126
16157
|
300331,
|
|
16127
16158
|
300332
|
|
16128
16159
|
];
|
|
16160
|
+
let combinedTotal = 0;
|
|
16129
16161
|
if (needVideo) try {
|
|
16130
16162
|
const videoPageUrl = "https://channels.weixin.qq.com/micro/content/post/list";
|
|
16131
|
-
const
|
|
16132
|
-
_task.logger.info(
|
|
16133
|
-
|
|
16134
|
-
|
|
16135
|
-
|
|
16136
|
-
throw new Error(`视频号API错误:${videoResponse.errMsg} (${videoResponse.errCode})`);
|
|
16137
|
-
}
|
|
16138
|
-
{
|
|
16139
|
-
const posts = videoResponse.data?.list || videoResponse.posts || videoResponse.post_list || [];
|
|
16140
|
-
const videoArticles = posts.filter((item)=>item.createTime || item.create_time).map((item)=>mapPost(item, "video"));
|
|
16141
|
-
allArticles.push(...videoArticles);
|
|
16142
|
-
_task.logger.info(`视频号视频获取成功,共${videoArticles.length}条`);
|
|
16143
|
-
}
|
|
16163
|
+
const { posts, totalCount } = await fetchAllPosts(11, videoPageUrl);
|
|
16164
|
+
_task.logger.info(`视频号视频获取响应:共${posts.length}条,totalCount=${totalCount}`);
|
|
16165
|
+
const videoArticles = posts.filter((item)=>item.createTime || item.create_time).map((item)=>mapPost(item, "video"));
|
|
16166
|
+
allArticles.push(...videoArticles);
|
|
16167
|
+
combinedTotal += totalCount || videoArticles.length;
|
|
16144
16168
|
} catch (error) {
|
|
16145
16169
|
const errMsg = error instanceof Error ? error.message : String(error);
|
|
16146
16170
|
if (errMsg.startsWith("AUTH_ERROR:")) throw error;
|
|
@@ -16148,30 +16172,26 @@ async function handleShipinhaoData(_task, params) {
|
|
|
16148
16172
|
}
|
|
16149
16173
|
if (needArticle) try {
|
|
16150
16174
|
const articlePageUrl = "https://channels.weixin.qq.com/micro/content/post/finderNewLifePostList";
|
|
16151
|
-
const
|
|
16152
|
-
|
|
16153
|
-
|
|
16154
|
-
|
|
16155
|
-
|
|
16156
|
-
}
|
|
16157
|
-
{
|
|
16158
|
-
const posts = articleResponse.data?.list || articleResponse.posts || articleResponse.post_list || [];
|
|
16159
|
-
const articleArticles = posts.filter((item)=>item.createTime || item.create_time).map((item)=>mapPost(item, "article"));
|
|
16160
|
-
allArticles.push(...articleArticles);
|
|
16161
|
-
_task.logger.info(`视频号图文获取成功,共${articleArticles.length}条`);
|
|
16162
|
-
}
|
|
16175
|
+
const { posts, totalCount } = await fetchAllPosts(10, articlePageUrl);
|
|
16176
|
+
_task.logger.info(`视频号图文获取响应:共${posts.length}条,totalCount=${totalCount}`);
|
|
16177
|
+
const articleArticles = posts.filter((item)=>item.createTime || item.create_time).map((item)=>mapPost(item, "article"));
|
|
16178
|
+
allArticles.push(...articleArticles);
|
|
16179
|
+
combinedTotal += totalCount || articleArticles.length;
|
|
16163
16180
|
} catch (error) {
|
|
16164
16181
|
const errMsg = error instanceof Error ? error.message : String(error);
|
|
16165
16182
|
if (errMsg.startsWith("AUTH_ERROR:")) throw error;
|
|
16166
16183
|
_task.logger.warn(`获取视频号图文失败:${errMsg}`);
|
|
16167
16184
|
}
|
|
16168
16185
|
allArticles.sort((a, b)=>b.createTime - a.createTime);
|
|
16169
|
-
|
|
16186
|
+
const total = allArticles.length;
|
|
16187
|
+
const start = (pageNum - 1) * pageSize;
|
|
16188
|
+
const pageItems = allArticles.slice(start, start + pageSize);
|
|
16189
|
+
_task.logger.info(`视频号数据获取成功,合计${total}条,第${pageNum}页返回${pageItems.length}条`);
|
|
16170
16190
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)({
|
|
16171
|
-
articleCell:
|
|
16191
|
+
articleCell: pageItems,
|
|
16172
16192
|
pagination: {
|
|
16173
|
-
total
|
|
16174
|
-
nextPage:
|
|
16193
|
+
total,
|
|
16194
|
+
nextPage: start + pageSize < total,
|
|
16175
16195
|
pageNum,
|
|
16176
16196
|
pageSize
|
|
16177
16197
|
}
|
|
@@ -25525,4 +25545,4 @@ var __webpack_exports__version = package_namespaceObject.i8;
|
|
|
25525
25545
|
export { Action, ActionCommonParamsSchema, BaijiahaoPublishParamsSchema, BetaFlag, CollectionDetailSchema, ConfigDataSchema, DouyinCheckVerifyQrCodeParamsSchema, DouyinCreateCommentReplyParamsSchema, DouyinGetCollectionParamsSchema, DouyinGetCommentListParamsSchema, DouyinGetCommentReplyListParamsSchema, DouyinGetHotParamsSchema, DouyinGetLocationParamsSchema, DouyinGetMusicByCategoryParamsSchema, DouyinGetMusicCategoryParamsSchema, DouyinGetMusicParamsSchema, DouyinGetTopicsParamsSchema, DouyinGetVerifyQrCodeParamsSchema, DouyinGetWorkListParamsSchema, DouyinPublishParamsSchema, FetchArticlesDataSchema, FetchArticlesParamsSchema, Http, ProxyAgent, SearchAccountInfoParamsSchema, SessionCheckResultSchema, ShipinhaoCheckLinkValidateParamsSchema, ShipinhaoGetLocationParamsSchema, ShipinhaoGetMsgParamsSchema, ShipinhaoPublishParamsSchema, ShipinhaoSendMsgParamsSchema, ToutiaoPublishParamsSchema, UnreadCountSchema, WeixinPublishParamsSchema, WxBjhSessionParamsSchema, XhsWebSearchParamsSchema, XiaohongshuPublishParamsSchema, bjhConfigDataSchema, douyinConfigDataSchema, getFileState, reportLogger, rpaAction_Server_Mock, shipinhaoConfigDataSchema, ttConfigDataSchema, wxConfigDataSchema, xhsConfigDataSchema, __webpack_exports__version as version };
|
|
25526
25546
|
|
|
25527
25547
|
//# sourceMappingURL=index.mjs.map
|
|
25528
|
-
//# debugId=
|
|
25548
|
+
//# debugId=83bb856e-4161-51e9-bcc6-bc0ff84cc5f0
|