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

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/index.js CHANGED
@@ -3080,18 +3080,36 @@ var __webpack_exports__ = {};
3080
3080
  };
3081
3081
  return finalData;
3082
3082
  };
3083
- const rawArticlesInfo = await http.api({
3084
- method: "get",
3085
- url: 'https://mp.weixin.qq.com/cgi-bin/appmsgpublish',
3086
- params: {
3087
- sub: "list",
3088
- begin: (pageNum - 1) * pageSize,
3089
- count: pageSize,
3090
- token: token,
3091
- lang: "zh_CN"
3083
+ async function fetchArticles(begin, pageSize, token) {
3084
+ return http.api({
3085
+ method: "get",
3086
+ url: 'https://mp.weixin.qq.com/cgi-bin/appmsgpublish',
3087
+ params: {
3088
+ sub: "list",
3089
+ begin: begin,
3090
+ count: pageSize,
3091
+ token: token,
3092
+ lang: "zh_CN"
3093
+ }
3094
+ });
3095
+ }
3096
+ let size = pageSize > 20 ? 20 : pageSize;
3097
+ let rawArticlesInfo = await fetchArticles((pageNum - 1) * size, size, token);
3098
+ let articlesInfo = ParsePublishPage(rawArticlesInfo);
3099
+ if (!onlySuccess && pageSize > 20) {
3100
+ let totalFetched = articlesInfo.publish_list.length;
3101
+ let nextPage = pageNum + 1;
3102
+ while(totalFetched < pageSize){
3103
+ const remaining = pageSize - totalFetched;
3104
+ const currentPageSize = remaining > 20 ? 20 : remaining;
3105
+ let _rawArticlesInfo = await fetchArticles((nextPage - 1) * 20, currentPageSize, token);
3106
+ let parsed = ParsePublishPage(_rawArticlesInfo);
3107
+ articlesInfo.publish_list = articlesInfo.publish_list.concat(parsed.publish_list);
3108
+ totalFetched = articlesInfo.publish_list.length;
3109
+ if (parsed.publish_list.length < currentPageSize) break;
3110
+ nextPage++;
3092
3111
  }
3093
- });
3094
- const articlesInfo = ParsePublishPage(rawArticlesInfo);
3112
+ }
3095
3113
  const articleCell = articlesInfo?.publish_list.map((item)=>({
3096
3114
  title: item.publish_info.appmsg_info[0].title,
3097
3115
  imageUrl: item.publish_info.appmsg_info[0].cover,
@@ -5246,7 +5264,7 @@ var __webpack_exports__ = {};
5246
5264
  if ("mockApi" === params.actionType) return xiaohongshuPublish_mock_mockAction(task, params);
5247
5265
  return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
5248
5266
  };
5249
- var package_namespaceObject = JSON.parse('{"i8":"1.2.14-beta.3"}');
5267
+ var package_namespaceObject = JSON.parse('{"i8":"1.2.14-beta.5"}');
5250
5268
  class Action {
5251
5269
  constructor(task){
5252
5270
  this.task = task;