@iflyrpa/actions 1.2.16-beta.1 → 1.2.16-beta.3

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
@@ -2823,16 +2823,17 @@ var __webpack_exports__ = {};
2823
2823
  }
2824
2824
  })
2825
2825
  ]);
2826
+ const isReday = void 0 !== totalData.data.statistic.data.yesterday_read_count;
2826
2827
  const ttData = {
2827
2828
  fansNum: Number(totalData.data.statistic.data.total_subscribe_count),
2828
2829
  fansNumYesterday: void 0 !== totalData.data.statistic.data.yesterday_fans ? Number(totalData.data.statistic.data.yesterday_fans) : null,
2829
2830
  readNum: Number(totalData.data.statistic.data.total_read_play_count),
2830
2831
  incomeNum: totalData.data.statistic.data.total_income,
2831
2832
  incomeNumYesterday: totalData.data.statistic.data.is_yesterday_income_ready ? totalData.data.statistic.data.yesterday_income : null,
2832
- showNumYesterday: contentDataYesterday.author_stat.consume_data.impression_count,
2833
- readNumYesterday: contentDataYesterday.author_stat.consume_data.go_detail_count,
2834
- likeNumYesterday: contentDataYesterday.author_stat.interaction_data.digg_count,
2835
- commentNumYesterday: contentDataYesterday.author_stat.interaction_data.comment_count
2833
+ showNumYesterday: isReday ? contentDataYesterday.author_stat.consume_data.impression_count : null,
2834
+ readNumYesterday: isReday ? contentDataYesterday.author_stat.consume_data.go_detail_count : null,
2835
+ likeNumYesterday: isReday ? contentDataYesterday.author_stat.interaction_data.digg_count : null,
2836
+ commentNumYesterday: isReday ? contentDataYesterday.author_stat.interaction_data.comment_count : null
2836
2837
  };
2837
2838
  return (0, share_namespaceObject.success)(ttData, "头条号粉丝数据获取成功!");
2838
2839
  } catch (error) {
@@ -3030,7 +3031,7 @@ var __webpack_exports__ = {};
3030
3031
  }
3031
3032
  async function handleWeixinData(params) {
3032
3033
  try {
3033
- const { cookies, token, pageNum = 1, pageSize = 10, showOriginalData = false, onlySuccess = false } = params;
3034
+ const { cookies, token, pageNum = 1, pageSize = 10, showOriginalData = false, onlySuccess = false, cursor, lastPage } = params;
3034
3035
  if (!token) return {
3035
3036
  code: 200,
3036
3037
  message: "缺少token",
@@ -3109,9 +3110,11 @@ var __webpack_exports__ = {};
3109
3110
  }
3110
3111
  });
3111
3112
  }
3112
- let size = pageSize > 20 ? 20 : pageSize;
3113
- let rawArticlesInfo = await fetchArticles((pageNum - 1) * size, size, token);
3113
+ let size = onlySuccess ? 10 : pageSize > 20 ? 20 : pageSize;
3114
+ let begin = (lastPage ?? pageNum) - 1;
3115
+ let rawArticlesInfo = await fetchArticles(begin * size, size, token);
3114
3116
  let articlesInfo = ParsePublishPage(rawArticlesInfo);
3117
+ let articleCell = [];
3115
3118
  if (!onlySuccess && pageSize > 20) {
3116
3119
  let totalFetched = articlesInfo.publish_list.length;
3117
3120
  let nextPage = pageNum + 1;
@@ -3125,29 +3128,70 @@ var __webpack_exports__ = {};
3125
3128
  if (parsed.publish_list.length < currentPageSize) break;
3126
3129
  nextPage++;
3127
3130
  }
3131
+ articleCell = articlesInfo.publish_list.map((item)=>({
3132
+ title: item.publish_info.appmsg_info[0].title,
3133
+ imageUrl: item.publish_info.appmsg_info[0].cover,
3134
+ createTime: item.publish_info.appmsg_info[0].line_info.send_time,
3135
+ redirectUrl: item.publish_info.appmsg_info[0].content_url,
3136
+ readNum: item.publish_info.appmsg_info[0].read_num,
3137
+ likeNum: item.publish_info.appmsg_info[0].old_like_num,
3138
+ shareNum: item.publish_info.appmsg_info[0].share_num,
3139
+ recommendNum: item.publish_info.appmsg_info[0].like_num,
3140
+ ...showOriginalData ? {
3141
+ originalData: item
3142
+ } : {}
3143
+ }));
3128
3144
  }
3129
- const articleCell = articlesInfo?.publish_list.map((item)=>({
3130
- title: item.publish_info.appmsg_info[0].title,
3131
- imageUrl: item.publish_info.appmsg_info[0].cover,
3132
- createTime: item.publish_info.appmsg_info[0].line_info.send_time,
3133
- redirectUrl: item.publish_info.appmsg_info[0].content_url,
3134
- readNum: item.publish_info.appmsg_info[0].read_num,
3135
- likeNum: item.publish_info.appmsg_info[0].old_like_num,
3136
- shareNum: item.publish_info.appmsg_info[0].share_num,
3137
- recommendNum: item.publish_info.appmsg_info[0].like_num,
3138
- ...showOriginalData ? {
3139
- originalData: item
3140
- } : {}
3141
- }));
3142
- return (0, share_namespaceObject.success)({
3143
- articleCell,
3144
- ...onlySuccess ? {
3145
+ let nextPage = false;
3146
+ if (onlySuccess) {
3147
+ let filteredList = articlesInfo.publish_list.filter((item)=>-1 == item.publish_info.appmsg_info[0].content_url.indexOf("tempkey")).map((item)=>item.publish_info);
3148
+ if (cursor) {
3149
+ const cursorIndex = filteredList.findIndex((item)=>item.msgid === cursor);
3150
+ if (-1 !== cursorIndex) filteredList = filteredList.slice(cursorIndex + 1);
3151
+ }
3152
+ let totalFetched = filteredList.length;
3153
+ while(totalFetched < pageSize && begin * size < articlesInfo.total_count){
3154
+ begin += 1;
3155
+ let nextRawArticlesInfo = await fetchArticles(begin * size, size, token);
3156
+ let nextArticlesInfo = ParsePublishPage(nextRawArticlesInfo);
3157
+ const newFiltered = nextArticlesInfo.publish_list.filter((item)=>-1 == item.publish_info.appmsg_info[0].content_url.indexOf("tempkey")).map((item)=>item.publish_info);
3158
+ filteredList = filteredList.concat(newFiltered);
3159
+ totalFetched = filteredList.length;
3160
+ }
3161
+ filteredList = filteredList.slice(0, pageSize);
3162
+ totalFetched = filteredList.length;
3163
+ if (totalFetched >= pageSize && begin * size < articlesInfo.total_count) {
3164
+ let nextRawArticlesInfo = await fetchArticles((begin + 1) * size, size, token);
3165
+ let nextArticlesInfo = ParsePublishPage(nextRawArticlesInfo);
3166
+ nextPage = nextArticlesInfo.publish_list.length > 0 && nextArticlesInfo.publish_list.some((item)=>-1 == item.publish_info.appmsg_info[0].content_url.indexOf("tempkey"));
3167
+ }
3168
+ const lastMsgId = filteredList.length > 0 ? filteredList[filteredList.length - 1].msgid : void 0;
3169
+ articleCell = filteredList.map((item)=>({
3170
+ title: item.appmsg_info[0].title,
3171
+ imageUrl: item.appmsg_info[0].cover,
3172
+ createTime: item.appmsg_info[0].line_info.send_time,
3173
+ redirectUrl: item.appmsg_info[0].content_url,
3174
+ readNum: item.appmsg_info[0].read_num,
3175
+ likeNum: item.appmsg_info[0].old_like_num,
3176
+ shareNum: item.appmsg_info[0].share_num,
3177
+ recommendNum: item.appmsg_info[0].like_num,
3178
+ ...showOriginalData ? {
3179
+ originalData: item
3180
+ } : {}
3181
+ }));
3182
+ return (0, share_namespaceObject.success)({
3183
+ articleCell,
3145
3184
  pagination: {
3146
- total: articlesInfo?.total_count,
3185
+ nextPage,
3147
3186
  pageNum,
3148
- pageSize
3187
+ pageSize,
3188
+ lastPage: begin + 1,
3189
+ cursor: lastMsgId
3149
3190
  }
3150
- } : null
3191
+ }, "微信文章文章获取成功");
3192
+ }
3193
+ return (0, share_namespaceObject.success)({
3194
+ articleCell
3151
3195
  }, "微信文章文章获取成功");
3152
3196
  } catch (error) {
3153
3197
  return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "微信文章数据获取失败");
@@ -3204,11 +3248,11 @@ var __webpack_exports__ = {};
3204
3248
  imageUrl: JSON.parse(item.cover_images)[0].src,
3205
3249
  createTime: Math.floor(new Date(item.publish_at.replace(/-/g, "/")).getTime() / 1000),
3206
3250
  redirectUrl: item.url,
3207
- recommendNum: item.rec_amount,
3251
+ recommendNum: item.rec_amount | item.forward_num,
3208
3252
  collectNum: item.collection_amount,
3209
- readNum: item.read_amount,
3210
- likeNum: item.like_amount,
3211
- commentNum: item.comment_amount,
3253
+ readNum: item.read_amount | item.read_num,
3254
+ likeNum: item.like_amount | item.praise_num,
3255
+ commentNum: item.comment_amount | item.comment_num,
3212
3256
  shareNum: item.share_amount,
3213
3257
  ...showOriginalData ? {
3214
3258
  originalData: item
@@ -5311,7 +5355,7 @@ var __webpack_exports__ = {};
5311
5355
  if ("mockApi" === params.actionType) return xiaohongshuPublish_mock_mockAction(task, params);
5312
5356
  return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
5313
5357
  };
5314
- var package_namespaceObject = JSON.parse('{"i8":"1.2.16-beta.0"}');
5358
+ var package_namespaceObject = JSON.parse('{"i8":"1.2.16-beta.2"}');
5315
5359
  class Action {
5316
5360
  constructor(task){
5317
5361
  this.task = task;