@iflyrpa/actions 1.2.14-beta.4 → 1.2.14-beta.5

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
@@ -15955,18 +15955,35 @@ var __webpack_exports__ = {};
15955
15955
  };
15956
15956
  return finalData;
15957
15957
  };
15958
- const rawArticlesInfo = await http.api({
15959
- method: "get",
15960
- url: 'https://mp.weixin.qq.com/cgi-bin/appmsgpublish',
15961
- params: {
15962
- sub: "list",
15963
- begin: (pageNum - 1) * pageSize,
15964
- count: pageSize,
15965
- token: token,
15966
- lang: "zh_CN"
15958
+ async function fetchArticles(begin, pageSize, token) {
15959
+ return http.api({
15960
+ method: "get",
15961
+ url: 'https://mp.weixin.qq.com/cgi-bin/appmsgpublish',
15962
+ params: {
15963
+ sub: "list",
15964
+ begin: begin,
15965
+ count: pageSize,
15966
+ token: token,
15967
+ lang: "zh_CN"
15968
+ }
15969
+ });
15970
+ }
15971
+ let rawArticlesInfo = await fetchArticles(0, pageSize > 20 ? 20 : pageSize, token);
15972
+ let articlesInfo = ParsePublishPage(rawArticlesInfo);
15973
+ if (!onlySuccess && pageSize > 20) {
15974
+ let totalFetched = articlesInfo.publish_list.length;
15975
+ let nextPage = pageNum + 1;
15976
+ while(totalFetched < pageSize){
15977
+ const remaining = pageSize - totalFetched;
15978
+ const currentPageSize = remaining > 20 ? 20 : remaining;
15979
+ let _rawArticlesInfo = await fetchArticles((nextPage - 1) * 20, currentPageSize, token);
15980
+ let parsed = ParsePublishPage(_rawArticlesInfo);
15981
+ articlesInfo.publish_list = articlesInfo.publish_list.concat(parsed.publish_list);
15982
+ totalFetched = articlesInfo.publish_list.length;
15983
+ if (parsed.publish_list.length < currentPageSize) break;
15984
+ nextPage++;
15967
15985
  }
15968
- });
15969
- const articlesInfo = ParsePublishPage(rawArticlesInfo);
15986
+ }
15970
15987
  const articleCell = articlesInfo?.publish_list.map((item)=>({
15971
15988
  title: item.publish_info.appmsg_info[0].title,
15972
15989
  imageUrl: item.publish_info.appmsg_info[0].cover,
@@ -18121,7 +18138,7 @@ var __webpack_exports__ = {};
18121
18138
  if ("mockApi" === params.actionType) return xiaohongshuPublish_mock_mockAction(task, params);
18122
18139
  return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
18123
18140
  };
18124
- var package_namespaceObject = JSON.parse('{"i8":"1.2.14-beta.3"}');
18141
+ var package_namespaceObject = JSON.parse('{"i8":"1.2.14-beta.4"}');
18125
18142
  class Action {
18126
18143
  constructor(task){
18127
18144
  this.task = task;