@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/index.js CHANGED
@@ -3080,18 +3080,35 @@ 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 rawArticlesInfo = await fetchArticles(0, pageSize > 20 ? 20 : pageSize, token);
3097
+ let articlesInfo = ParsePublishPage(rawArticlesInfo);
3098
+ if (!onlySuccess && pageSize > 20) {
3099
+ let totalFetched = articlesInfo.publish_list.length;
3100
+ let nextPage = pageNum + 1;
3101
+ while(totalFetched < pageSize){
3102
+ const remaining = pageSize - totalFetched;
3103
+ const currentPageSize = remaining > 20 ? 20 : remaining;
3104
+ let _rawArticlesInfo = await fetchArticles((nextPage - 1) * 20, currentPageSize, token);
3105
+ let parsed = ParsePublishPage(_rawArticlesInfo);
3106
+ articlesInfo.publish_list = articlesInfo.publish_list.concat(parsed.publish_list);
3107
+ totalFetched = articlesInfo.publish_list.length;
3108
+ if (parsed.publish_list.length < currentPageSize) break;
3109
+ nextPage++;
3092
3110
  }
3093
- });
3094
- const articlesInfo = ParsePublishPage(rawArticlesInfo);
3111
+ }
3095
3112
  const articleCell = articlesInfo?.publish_list.map((item)=>({
3096
3113
  title: item.publish_info.appmsg_info[0].title,
3097
3114
  imageUrl: item.publish_info.appmsg_info[0].cover,
@@ -5246,7 +5263,7 @@ var __webpack_exports__ = {};
5246
5263
  if ("mockApi" === params.actionType) return xiaohongshuPublish_mock_mockAction(task, params);
5247
5264
  return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
5248
5265
  };
5249
- var package_namespaceObject = JSON.parse('{"i8":"1.2.14-beta.3"}');
5266
+ var package_namespaceObject = JSON.parse('{"i8":"1.2.14-beta.4"}');
5250
5267
  class Action {
5251
5268
  constructor(task){
5252
5269
  this.task = task;