@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.js
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]="04f2dfd7-5745-5f39-a5d4-d768976b230d")}catch(e){}}();
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
4
|
"./src/utils/XhsXsCommonEnc.js": function(module) {
|
|
5
5
|
var encrypt_lookup = [
|
|
@@ -4402,7 +4402,7 @@ var __webpack_exports__ = {};
|
|
|
4402
4402
|
});
|
|
4403
4403
|
const package_json_namespaceObject = require("@iflyrpa/share/package.json");
|
|
4404
4404
|
var package_json_default = /*#__PURE__*/ __webpack_require__.n(package_json_namespaceObject);
|
|
4405
|
-
var package_namespaceObject = JSON.parse('{"i8":"4.0.4-beta.
|
|
4405
|
+
var package_namespaceObject = JSON.parse('{"i8":"4.0.4-beta.4"}');
|
|
4406
4406
|
const share_namespaceObject = require("@iflyrpa/share");
|
|
4407
4407
|
const external_node_fs_namespaceObject = require("node:fs");
|
|
4408
4408
|
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
@@ -13799,7 +13799,7 @@ var __webpack_exports__ = {};
|
|
|
13799
13799
|
error: message,
|
|
13800
13800
|
result: {
|
|
13801
13801
|
...safeDecision,
|
|
13802
|
-
data:
|
|
13802
|
+
data: decision,
|
|
13803
13803
|
uploadedImgList: JSON.stringify(publishData.item.common.images)
|
|
13804
13804
|
}
|
|
13805
13805
|
};
|
|
@@ -15472,12 +15472,12 @@ var __webpack_exports__ = {};
|
|
|
15472
15472
|
const douyinData = {
|
|
15473
15473
|
fansNum,
|
|
15474
15474
|
favedNum,
|
|
15475
|
-
fansNumLastWeek: toNum(ov?.
|
|
15476
|
-
watchNumLastWeek: toNum(ov?.
|
|
15477
|
-
likeNumLastWeek: toNum(ov?.
|
|
15478
|
-
commentNumLastWeek: toNum(ov?.
|
|
15479
|
-
shareNumLastWeek: toNum(ov?.
|
|
15480
|
-
visitNumLastWeek: toNum(ov?.
|
|
15475
|
+
fansNumLastWeek: toNum(ov?.new_fans?.last_period_incr),
|
|
15476
|
+
watchNumLastWeek: toNum(ov?.play?.last_period_incr),
|
|
15477
|
+
likeNumLastWeek: toNum(ov?.digg?.last_period_incr),
|
|
15478
|
+
commentNumLastWeek: toNum(ov?.comment?.last_period_incr),
|
|
15479
|
+
shareNumLastWeek: toNum(ov?.share?.last_period_incr),
|
|
15480
|
+
visitNumLastWeek: toNum(ov?.profile?.last_period_incr)
|
|
15481
15481
|
};
|
|
15482
15482
|
return (0, share_namespaceObject.success)(douyinData, "抖音平台数据获取成功!");
|
|
15483
15483
|
} catch (error) {
|
|
@@ -16116,7 +16116,7 @@ var __webpack_exports__ = {};
|
|
|
16116
16116
|
}
|
|
16117
16117
|
async function handleShipinhaoData(_task, params) {
|
|
16118
16118
|
try {
|
|
16119
|
-
const { cookies, postType = "all", pageNum = 1, pageSize =
|
|
16119
|
+
const { cookies, postType = "all", pageNum = 1, pageSize = 10, showOriginalData = false } = params;
|
|
16120
16120
|
const aidCookie = cookies.find((it)=>"_aid" === it.name)?.value;
|
|
16121
16121
|
const aid = aidCookie || "9d3e0e9f-b842-498d-a273-4285d58df264";
|
|
16122
16122
|
const uinCookie = cookies.find((it)=>"uin" === it.name || "wxuin" === it.name)?.value || "0000000000";
|
|
@@ -16142,7 +16142,7 @@ var __webpack_exports__ = {};
|
|
|
16142
16142
|
];
|
|
16143
16143
|
const http = new Http(...args);
|
|
16144
16144
|
const finderIdCookie = cookies.find((it)=>"_log_finder_id" === it.name || "finder_id" === it.name)?.value || "";
|
|
16145
|
-
async function fetchPosts(currentPage, userpageType, pageUrl) {
|
|
16145
|
+
async function fetchPosts(currentPage, userpageType, pageUrl, rawKeyBuff = "") {
|
|
16146
16146
|
return await http.api({
|
|
16147
16147
|
method: "post",
|
|
16148
16148
|
url: "https://channels.weixin.qq.com/micro/content/cgi-bin/mmfinderassistant-bin/post/post_list",
|
|
@@ -16159,7 +16159,7 @@ var __webpack_exports__ = {};
|
|
|
16159
16159
|
timestamp: Date.now().toString(),
|
|
16160
16160
|
_log_finder_uin: "",
|
|
16161
16161
|
_log_finder_id: finderIdCookie,
|
|
16162
|
-
rawKeyBuff
|
|
16162
|
+
rawKeyBuff,
|
|
16163
16163
|
pluginSessionId: null,
|
|
16164
16164
|
scene: 7,
|
|
16165
16165
|
reqScene: 7
|
|
@@ -16170,6 +16170,37 @@ var __webpack_exports__ = {};
|
|
|
16170
16170
|
timeout: 5000
|
|
16171
16171
|
});
|
|
16172
16172
|
}
|
|
16173
|
+
async function fetchAllPosts(userpageType, pageUrl) {
|
|
16174
|
+
const allPosts = [];
|
|
16175
|
+
let currentPage = 1;
|
|
16176
|
+
let rawKeyBuff = "";
|
|
16177
|
+
let continueFlag = true;
|
|
16178
|
+
let totalCount = 0;
|
|
16179
|
+
while(continueFlag){
|
|
16180
|
+
const response = await fetchPosts(currentPage, userpageType, pageUrl, rawKeyBuff);
|
|
16181
|
+
if (response.errCode && AUTH_ERROR_CODES.includes(response.errCode)) throw new Error(`AUTH_ERROR:${response.errMsg || "登录已失效"}`);
|
|
16182
|
+
if (response.errCode) {
|
|
16183
|
+
_task.logger.warn(`视频号API错误:${response.errMsg} (${response.errCode})`);
|
|
16184
|
+
throw new Error(`视频号API错误:${response.errMsg} (${response.errCode})`);
|
|
16185
|
+
}
|
|
16186
|
+
if (1 === currentPage) totalCount = response.data?.totalCount ?? 0;
|
|
16187
|
+
const posts = response.data?.list || response.posts || response.post_list || [];
|
|
16188
|
+
allPosts.push(...posts);
|
|
16189
|
+
continueFlag = response.data?.continueFlag ?? false;
|
|
16190
|
+
rawKeyBuff = response.data?.lastBuff || "";
|
|
16191
|
+
_task.logger.info(`获取${11 === userpageType ? "视频" : "图文"}第${currentPage}页,本页${posts.length}条,累计${allPosts.length}条,continueFlag=${continueFlag}`);
|
|
16192
|
+
currentPage++;
|
|
16193
|
+
if (currentPage > 100) {
|
|
16194
|
+
_task.logger.warn("分页超过100页,停止请求");
|
|
16195
|
+
break;
|
|
16196
|
+
}
|
|
16197
|
+
}
|
|
16198
|
+
if (totalCount > 0 && allPosts.length !== totalCount) _task.logger.warn(`视频号分页可能不完整:期望${totalCount}条,实际${allPosts.length}条`);
|
|
16199
|
+
return {
|
|
16200
|
+
posts: allPosts,
|
|
16201
|
+
totalCount
|
|
16202
|
+
};
|
|
16203
|
+
}
|
|
16173
16204
|
const mapPost = (item, forcePostType)=>{
|
|
16174
16205
|
let imageUrl = "";
|
|
16175
16206
|
if (item.desc?.media?.[0]?.thumbUrl) imageUrl = item.desc.media[0].thumbUrl;
|
|
@@ -16205,21 +16236,14 @@ var __webpack_exports__ = {};
|
|
|
16205
16236
|
300331,
|
|
16206
16237
|
300332
|
|
16207
16238
|
];
|
|
16239
|
+
let combinedTotal = 0;
|
|
16208
16240
|
if (needVideo) try {
|
|
16209
16241
|
const videoPageUrl = "https://channels.weixin.qq.com/micro/content/post/list";
|
|
16210
|
-
const
|
|
16211
|
-
_task.logger.info(
|
|
16212
|
-
|
|
16213
|
-
|
|
16214
|
-
|
|
16215
|
-
throw new Error(`视频号API错误:${videoResponse.errMsg} (${videoResponse.errCode})`);
|
|
16216
|
-
}
|
|
16217
|
-
{
|
|
16218
|
-
const posts = videoResponse.data?.list || videoResponse.posts || videoResponse.post_list || [];
|
|
16219
|
-
const videoArticles = posts.filter((item)=>item.createTime || item.create_time).map((item)=>mapPost(item, "video"));
|
|
16220
|
-
allArticles.push(...videoArticles);
|
|
16221
|
-
_task.logger.info(`视频号视频获取成功,共${videoArticles.length}条`);
|
|
16222
|
-
}
|
|
16242
|
+
const { posts, totalCount } = await fetchAllPosts(11, videoPageUrl);
|
|
16243
|
+
_task.logger.info(`视频号视频获取响应:共${posts.length}条,totalCount=${totalCount}`);
|
|
16244
|
+
const videoArticles = posts.filter((item)=>item.createTime || item.create_time).map((item)=>mapPost(item, "video"));
|
|
16245
|
+
allArticles.push(...videoArticles);
|
|
16246
|
+
combinedTotal += totalCount || videoArticles.length;
|
|
16223
16247
|
} catch (error) {
|
|
16224
16248
|
const errMsg = error instanceof Error ? error.message : String(error);
|
|
16225
16249
|
if (errMsg.startsWith("AUTH_ERROR:")) throw error;
|
|
@@ -16227,30 +16251,26 @@ var __webpack_exports__ = {};
|
|
|
16227
16251
|
}
|
|
16228
16252
|
if (needArticle) try {
|
|
16229
16253
|
const articlePageUrl = "https://channels.weixin.qq.com/micro/content/post/finderNewLifePostList";
|
|
16230
|
-
const
|
|
16231
|
-
|
|
16232
|
-
|
|
16233
|
-
|
|
16234
|
-
|
|
16235
|
-
}
|
|
16236
|
-
{
|
|
16237
|
-
const posts = articleResponse.data?.list || articleResponse.posts || articleResponse.post_list || [];
|
|
16238
|
-
const articleArticles = posts.filter((item)=>item.createTime || item.create_time).map((item)=>mapPost(item, "article"));
|
|
16239
|
-
allArticles.push(...articleArticles);
|
|
16240
|
-
_task.logger.info(`视频号图文获取成功,共${articleArticles.length}条`);
|
|
16241
|
-
}
|
|
16254
|
+
const { posts, totalCount } = await fetchAllPosts(10, articlePageUrl);
|
|
16255
|
+
_task.logger.info(`视频号图文获取响应:共${posts.length}条,totalCount=${totalCount}`);
|
|
16256
|
+
const articleArticles = posts.filter((item)=>item.createTime || item.create_time).map((item)=>mapPost(item, "article"));
|
|
16257
|
+
allArticles.push(...articleArticles);
|
|
16258
|
+
combinedTotal += totalCount || articleArticles.length;
|
|
16242
16259
|
} catch (error) {
|
|
16243
16260
|
const errMsg = error instanceof Error ? error.message : String(error);
|
|
16244
16261
|
if (errMsg.startsWith("AUTH_ERROR:")) throw error;
|
|
16245
16262
|
_task.logger.warn(`获取视频号图文失败:${errMsg}`);
|
|
16246
16263
|
}
|
|
16247
16264
|
allArticles.sort((a, b)=>b.createTime - a.createTime);
|
|
16248
|
-
|
|
16265
|
+
const total = allArticles.length;
|
|
16266
|
+
const start = (pageNum - 1) * pageSize;
|
|
16267
|
+
const pageItems = allArticles.slice(start, start + pageSize);
|
|
16268
|
+
_task.logger.info(`视频号数据获取成功,合计${total}条,第${pageNum}页返回${pageItems.length}条`);
|
|
16249
16269
|
return (0, share_namespaceObject.success)({
|
|
16250
|
-
articleCell:
|
|
16270
|
+
articleCell: pageItems,
|
|
16251
16271
|
pagination: {
|
|
16252
|
-
total
|
|
16253
|
-
nextPage:
|
|
16272
|
+
total,
|
|
16273
|
+
nextPage: start + pageSize < total,
|
|
16254
16274
|
pageNum,
|
|
16255
16275
|
pageSize
|
|
16256
16276
|
}
|
|
@@ -25610,4 +25630,4 @@ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_targe
|
|
|
25610
25630
|
});
|
|
25611
25631
|
|
|
25612
25632
|
//# sourceMappingURL=index.js.map
|
|
25613
|
-
//# debugId=
|
|
25633
|
+
//# debugId=04f2dfd7-5745-5f39-a5d4-d768976b230d
|