@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  /*! For license information please see bundle.js.LICENSE.txt */
2
2
 
3
- !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]="029aefb0-580d-5097-84ee-1a7045670fcb")}catch(e){}}();
3
+ !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]="23789fb9-5e79-5f5c-bdf9-9ec950534422")}catch(e){}}();
4
4
  var __webpack_modules__ = {
5
5
  "../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js": function(__unused_webpack_module, exports1, __webpack_require__) {
6
6
  "use strict";
@@ -12492,7 +12492,7 @@ var __webpack_exports__ = {};
12492
12492
  var package_namespaceObject = {
12493
12493
  i8: "0.1.2"
12494
12494
  };
12495
- var package_namespaceObject_0 = JSON.parse('{"i8":"4.0.4-beta.3"}');
12495
+ var package_namespaceObject_0 = JSON.parse('{"i8":"4.0.4-beta.4"}');
12496
12496
  const external_node_fs_namespaceObject = require("node:fs");
12497
12497
  var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
12498
12498
  const external_node_http_namespaceObject = require("node:http");
@@ -38870,7 +38870,7 @@ var __webpack_exports__ = {};
38870
38870
  error: message,
38871
38871
  result: {
38872
38872
  ...safeDecision,
38873
- data: safeDecision,
38873
+ data: decision,
38874
38874
  uploadedImgList: JSON.stringify(publishData.item.common.images)
38875
38875
  }
38876
38876
  };
@@ -40543,12 +40543,12 @@ var __webpack_exports__ = {};
40543
40543
  const douyinData = {
40544
40544
  fansNum,
40545
40545
  favedNum,
40546
- fansNumLastWeek: toNum(ov?.fans_incr?.current_count),
40547
- watchNumLastWeek: toNum(ov?.play_count?.current_count),
40548
- likeNumLastWeek: toNum(ov?.like_count?.current_count),
40549
- commentNumLastWeek: toNum(ov?.comment_count?.current_count),
40550
- shareNumLastWeek: toNum(ov?.share_count?.current_count),
40551
- visitNumLastWeek: toNum(ov?.profile_visit?.current_count)
40546
+ fansNumLastWeek: toNum(ov?.new_fans?.last_period_incr),
40547
+ watchNumLastWeek: toNum(ov?.play?.last_period_incr),
40548
+ likeNumLastWeek: toNum(ov?.digg?.last_period_incr),
40549
+ commentNumLastWeek: toNum(ov?.comment?.last_period_incr),
40550
+ shareNumLastWeek: toNum(ov?.share?.last_period_incr),
40551
+ visitNumLastWeek: toNum(ov?.profile?.last_period_incr)
40552
40552
  };
40553
40553
  return success(douyinData, "抖音平台数据获取成功!");
40554
40554
  } catch (error) {
@@ -41187,7 +41187,7 @@ var __webpack_exports__ = {};
41187
41187
  }
41188
41188
  async function handleShipinhaoData(_task, params) {
41189
41189
  try {
41190
- const { cookies, postType = "all", pageNum = 1, pageSize = 20, showOriginalData = false } = params;
41190
+ const { cookies, postType = "all", pageNum = 1, pageSize = 10, showOriginalData = false } = params;
41191
41191
  const aidCookie = cookies.find((it)=>"_aid" === it.name)?.value;
41192
41192
  const aid = aidCookie || "9d3e0e9f-b842-498d-a273-4285d58df264";
41193
41193
  const uinCookie = cookies.find((it)=>"uin" === it.name || "wxuin" === it.name)?.value || "0000000000";
@@ -41213,7 +41213,7 @@ var __webpack_exports__ = {};
41213
41213
  ];
41214
41214
  const http = new Http(...args);
41215
41215
  const finderIdCookie = cookies.find((it)=>"_log_finder_id" === it.name || "finder_id" === it.name)?.value || "";
41216
- async function fetchPosts(currentPage, userpageType, pageUrl) {
41216
+ async function fetchPosts(currentPage, userpageType, pageUrl, rawKeyBuff = "") {
41217
41217
  return await http.api({
41218
41218
  method: "post",
41219
41219
  url: "https://channels.weixin.qq.com/micro/content/cgi-bin/mmfinderassistant-bin/post/post_list",
@@ -41230,7 +41230,7 @@ var __webpack_exports__ = {};
41230
41230
  timestamp: Date.now().toString(),
41231
41231
  _log_finder_uin: "",
41232
41232
  _log_finder_id: finderIdCookie,
41233
- rawKeyBuff: "",
41233
+ rawKeyBuff,
41234
41234
  pluginSessionId: null,
41235
41235
  scene: 7,
41236
41236
  reqScene: 7
@@ -41241,6 +41241,37 @@ var __webpack_exports__ = {};
41241
41241
  timeout: 5000
41242
41242
  });
41243
41243
  }
41244
+ async function fetchAllPosts(userpageType, pageUrl) {
41245
+ const allPosts = [];
41246
+ let currentPage = 1;
41247
+ let rawKeyBuff = "";
41248
+ let continueFlag = true;
41249
+ let totalCount = 0;
41250
+ while(continueFlag){
41251
+ const response = await fetchPosts(currentPage, userpageType, pageUrl, rawKeyBuff);
41252
+ if (response.errCode && AUTH_ERROR_CODES.includes(response.errCode)) throw new Error(`AUTH_ERROR:${response.errMsg || "登录已失效"}`);
41253
+ if (response.errCode) {
41254
+ _task.logger.warn(`视频号API错误:${response.errMsg} (${response.errCode})`);
41255
+ throw new Error(`视频号API错误:${response.errMsg} (${response.errCode})`);
41256
+ }
41257
+ if (1 === currentPage) totalCount = response.data?.totalCount ?? 0;
41258
+ const posts = response.data?.list || response.posts || response.post_list || [];
41259
+ allPosts.push(...posts);
41260
+ continueFlag = response.data?.continueFlag ?? false;
41261
+ rawKeyBuff = response.data?.lastBuff || "";
41262
+ _task.logger.info(`获取${11 === userpageType ? "视频" : "图文"}第${currentPage}页,本页${posts.length}条,累计${allPosts.length}条,continueFlag=${continueFlag}`);
41263
+ currentPage++;
41264
+ if (currentPage > 100) {
41265
+ _task.logger.warn("分页超过100页,停止请求");
41266
+ break;
41267
+ }
41268
+ }
41269
+ if (totalCount > 0 && allPosts.length !== totalCount) _task.logger.warn(`视频号分页可能不完整:期望${totalCount}条,实际${allPosts.length}条`);
41270
+ return {
41271
+ posts: allPosts,
41272
+ totalCount
41273
+ };
41274
+ }
41244
41275
  const mapPost = (item, forcePostType)=>{
41245
41276
  let imageUrl = "";
41246
41277
  if (item.desc?.media?.[0]?.thumbUrl) imageUrl = item.desc.media[0].thumbUrl;
@@ -41276,21 +41307,14 @@ var __webpack_exports__ = {};
41276
41307
  300331,
41277
41308
  300332
41278
41309
  ];
41310
+ let combinedTotal = 0;
41279
41311
  if (needVideo) try {
41280
41312
  const videoPageUrl = "https://channels.weixin.qq.com/micro/content/post/list";
41281
- const videoResponse = await fetchPosts(pageNum, 11, videoPageUrl);
41282
- _task.logger.info(`视频号视频获取响应:${JSON.stringify(videoResponse)}`);
41283
- if (videoResponse.errCode && AUTH_ERROR_CODES.includes(videoResponse.errCode)) throw new Error(`AUTH_ERROR:${videoResponse.errMsg || "登录已失效"}`);
41284
- if (videoResponse.errCode) {
41285
- _task.logger.warn(`视频号API错误:${videoResponse.errMsg} (${videoResponse.errCode})`);
41286
- throw new Error(`视频号API错误:${videoResponse.errMsg} (${videoResponse.errCode})`);
41287
- }
41288
- {
41289
- const posts = videoResponse.data?.list || videoResponse.posts || videoResponse.post_list || [];
41290
- const videoArticles = posts.filter((item)=>item.createTime || item.create_time).map((item)=>mapPost(item, "video"));
41291
- allArticles.push(...videoArticles);
41292
- _task.logger.info(`视频号视频获取成功,共${videoArticles.length}条`);
41293
- }
41313
+ const { posts, totalCount } = await fetchAllPosts(11, videoPageUrl);
41314
+ _task.logger.info(`视频号视频获取响应:共${posts.length}条,totalCount=${totalCount}`);
41315
+ const videoArticles = posts.filter((item)=>item.createTime || item.create_time).map((item)=>mapPost(item, "video"));
41316
+ allArticles.push(...videoArticles);
41317
+ combinedTotal += totalCount || videoArticles.length;
41294
41318
  } catch (error) {
41295
41319
  const errMsg = error instanceof Error ? error.message : String(error);
41296
41320
  if (errMsg.startsWith("AUTH_ERROR:")) throw error;
@@ -41298,30 +41322,26 @@ var __webpack_exports__ = {};
41298
41322
  }
41299
41323
  if (needArticle) try {
41300
41324
  const articlePageUrl = "https://channels.weixin.qq.com/micro/content/post/finderNewLifePostList";
41301
- const articleResponse = await fetchPosts(pageNum, 10, articlePageUrl);
41302
- if (articleResponse.errCode && AUTH_ERROR_CODES.includes(articleResponse.errCode)) throw new Error(`AUTH_ERROR:${articleResponse.errMsg || "登录已失效"}`);
41303
- if (articleResponse.errCode) {
41304
- _task.logger.warn(`视频号图文API错误:${articleResponse.errMsg} (${articleResponse.errCode})`);
41305
- throw new Error(`视频号图文API错误:${articleResponse.errMsg} (${articleResponse.errCode})`);
41306
- }
41307
- {
41308
- const posts = articleResponse.data?.list || articleResponse.posts || articleResponse.post_list || [];
41309
- const articleArticles = posts.filter((item)=>item.createTime || item.create_time).map((item)=>mapPost(item, "article"));
41310
- allArticles.push(...articleArticles);
41311
- _task.logger.info(`视频号图文获取成功,共${articleArticles.length}条`);
41312
- }
41325
+ const { posts, totalCount } = await fetchAllPosts(10, articlePageUrl);
41326
+ _task.logger.info(`视频号图文获取响应:共${posts.length}条,totalCount=${totalCount}`);
41327
+ const articleArticles = posts.filter((item)=>item.createTime || item.create_time).map((item)=>mapPost(item, "article"));
41328
+ allArticles.push(...articleArticles);
41329
+ combinedTotal += totalCount || articleArticles.length;
41313
41330
  } catch (error) {
41314
41331
  const errMsg = error instanceof Error ? error.message : String(error);
41315
41332
  if (errMsg.startsWith("AUTH_ERROR:")) throw error;
41316
41333
  _task.logger.warn(`获取视频号图文失败:${errMsg}`);
41317
41334
  }
41318
41335
  allArticles.sort((a, b)=>b.createTime - a.createTime);
41319
- _task.logger.info(`视频号数据获取成功,${JSON.stringify(allArticles)}`);
41336
+ const total = allArticles.length;
41337
+ const start = (pageNum - 1) * pageSize;
41338
+ const pageItems = allArticles.slice(start, start + pageSize);
41339
+ _task.logger.info(`视频号数据获取成功,合计${total}条,第${pageNum}页返回${pageItems.length}条`);
41320
41340
  return success({
41321
- articleCell: allArticles,
41341
+ articleCell: pageItems,
41322
41342
  pagination: {
41323
- total: allArticles.length,
41324
- nextPage: false,
41343
+ total,
41344
+ nextPage: start + pageSize < total,
41325
41345
  pageNum,
41326
41346
  pageSize
41327
41347
  }
@@ -50681,4 +50701,4 @@ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_targe
50681
50701
  });
50682
50702
 
50683
50703
  //# sourceMappingURL=bundle.js.map
50684
- //# debugId=029aefb0-580d-5097-84ee-1a7045670fcb
50704
+ //# debugId=23789fb9-5e79-5f5c-bdf9-9ec950534422