@iflyrpa/actions 1.2.16-beta.4 → 1.2.16-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/bundle.js +44 -34
- package/dist/bundle.js.map +1 -1
- package/dist/index.js +44 -34
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +44 -34
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2963,7 +2963,7 @@ async function handleToutiaoData(params) {
|
|
|
2963
2963
|
articleCell,
|
|
2964
2964
|
...onlySuccess ? {
|
|
2965
2965
|
pagination: {
|
|
2966
|
-
total: api_base_info_json.total_count
|
|
2966
|
+
total: api_base_info_json.total_count,
|
|
2967
2967
|
pageNum,
|
|
2968
2968
|
pageSize
|
|
2969
2969
|
}
|
|
@@ -3072,19 +3072,6 @@ async function handleWeixinData(params) {
|
|
|
3072
3072
|
if (parsed.publish_list.length < currentPageSize) break;
|
|
3073
3073
|
nextPage++;
|
|
3074
3074
|
}
|
|
3075
|
-
articleCell = articlesInfo.publish_list.map((item)=>({
|
|
3076
|
-
title: item.publish_info.appmsg_info[0].title,
|
|
3077
|
-
imageUrl: item.publish_info.appmsg_info[0].cover,
|
|
3078
|
-
createTime: item.publish_info.appmsg_info[0].line_info.send_time,
|
|
3079
|
-
redirectUrl: item.publish_info.appmsg_info[0].content_url,
|
|
3080
|
-
readNum: item.publish_info.appmsg_info[0].read_num,
|
|
3081
|
-
likeNum: item.publish_info.appmsg_info[0].old_like_num,
|
|
3082
|
-
shareNum: item.publish_info.appmsg_info[0].share_num,
|
|
3083
|
-
recommendNum: item.publish_info.appmsg_info[0].like_num,
|
|
3084
|
-
...showOriginalData ? {
|
|
3085
|
-
originalData: item
|
|
3086
|
-
} : {}
|
|
3087
|
-
}));
|
|
3088
3075
|
}
|
|
3089
3076
|
let nextPage = false;
|
|
3090
3077
|
if (onlySuccess) {
|
|
@@ -3134,6 +3121,19 @@ async function handleWeixinData(params) {
|
|
|
3134
3121
|
}
|
|
3135
3122
|
}, "微信文章文章获取成功");
|
|
3136
3123
|
}
|
|
3124
|
+
articleCell = articlesInfo.publish_list.map((item)=>({
|
|
3125
|
+
title: item.publish_info.appmsg_info[0].title,
|
|
3126
|
+
imageUrl: item.publish_info.appmsg_info[0].cover,
|
|
3127
|
+
createTime: item.publish_info.appmsg_info[0].line_info.send_time,
|
|
3128
|
+
redirectUrl: item.publish_info.appmsg_info[0].content_url,
|
|
3129
|
+
readNum: item.publish_info.appmsg_info[0].read_num,
|
|
3130
|
+
likeNum: item.publish_info.appmsg_info[0].old_like_num,
|
|
3131
|
+
shareNum: item.publish_info.appmsg_info[0].share_num,
|
|
3132
|
+
recommendNum: item.publish_info.appmsg_info[0].like_num,
|
|
3133
|
+
...showOriginalData ? {
|
|
3134
|
+
originalData: item
|
|
3135
|
+
} : {}
|
|
3136
|
+
}));
|
|
3137
3137
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)({
|
|
3138
3138
|
articleCell
|
|
3139
3139
|
}, "微信文章文章获取成功");
|
|
@@ -4907,33 +4907,40 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
|
4907
4907
|
}
|
|
4908
4908
|
});
|
|
4909
4909
|
let uploadInfos = [];
|
|
4910
|
-
coverIdInfo.data.uploadTempPermits.
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4910
|
+
coverIdInfo.data.uploadTempPermits.forEach((item)=>{
|
|
4911
|
+
item.fileIds.forEach((fileId)=>{
|
|
4912
|
+
uploadInfos.push({
|
|
4913
|
+
bucket: item.bucket || "",
|
|
4914
|
+
uploadAddr: item.uploadAddr || "",
|
|
4915
|
+
fileIds: fileId,
|
|
4916
|
+
token: item.token || ""
|
|
4917
|
+
});
|
|
4916
4918
|
});
|
|
4917
4919
|
});
|
|
4920
|
+
if (uploadInfos.length < params.banners.length) return {
|
|
4921
|
+
code: 200,
|
|
4922
|
+
message: "可用 OSS bucket 数量不足,无法上传所有图片!",
|
|
4923
|
+
data: ""
|
|
4924
|
+
};
|
|
4918
4925
|
if (0 === uploadInfos.length) return {
|
|
4919
4926
|
code: 200,
|
|
4920
4927
|
message: "图片上传失败,请稍后重试!",
|
|
4921
4928
|
data: ""
|
|
4922
4929
|
};
|
|
4923
|
-
const
|
|
4930
|
+
const availableBuckets = Array.from({
|
|
4931
|
+
length: uploadInfos.length
|
|
4932
|
+
}, (_, i)=>i);
|
|
4933
|
+
const uploadFile = async (url, index)=>{
|
|
4924
4934
|
const fileName = (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.getFilenameFromUrl)(url);
|
|
4925
4935
|
const localUrl = await (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.downloadImage)(url, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(tmpCachePath, fileName));
|
|
4926
4936
|
const fileBuffer = __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].readFileSync(localUrl);
|
|
4927
|
-
const
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
}
|
|
4935
|
-
const currentInfo = uploadInfos[uploadIndex];
|
|
4936
|
-
const ossFileId = currentInfo.fileIds[0];
|
|
4937
|
+
const MAX_RETRIES = uploadInfos.length;
|
|
4938
|
+
let attempt = 0;
|
|
4939
|
+
while(attempt < MAX_RETRIES){
|
|
4940
|
+
const ossBucketIndex = availableBuckets.shift();
|
|
4941
|
+
if (void 0 === ossBucketIndex) break;
|
|
4942
|
+
const currentInfo = uploadInfos[ossBucketIndex];
|
|
4943
|
+
const ossFileId = currentInfo.fileIds;
|
|
4937
4944
|
const ossToken = currentInfo.token;
|
|
4938
4945
|
const ossDomain = currentInfo.uploadAddr;
|
|
4939
4946
|
try {
|
|
@@ -4951,10 +4958,13 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
|
4951
4958
|
ossToken
|
|
4952
4959
|
};
|
|
4953
4960
|
} catch (error) {
|
|
4954
|
-
|
|
4961
|
+
attempt++;
|
|
4955
4962
|
}
|
|
4963
|
+
}
|
|
4964
|
+
return {
|
|
4965
|
+
ossFileId: "",
|
|
4966
|
+
ossToken: ""
|
|
4956
4967
|
};
|
|
4957
|
-
return tryUpload(infoIndex);
|
|
4958
4968
|
};
|
|
4959
4969
|
const coverInfos = await Promise.all(params.banners.map((it, idx)=>uploadFile(it, idx)));
|
|
4960
4970
|
const invalidUpload = coverInfos.find((it)=>"" === it.ossToken || "" == it.ossFileId);
|
|
@@ -5299,7 +5309,7 @@ const xiaohongshuPublish = async (task, params)=>{
|
|
|
5299
5309
|
if ("mockApi" === params.actionType) return xiaohongshuPublish_mock_mockAction(task, params);
|
|
5300
5310
|
return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
|
|
5301
5311
|
};
|
|
5302
|
-
var package_namespaceObject = JSON.parse('{"i8":"1.2.16-beta.
|
|
5312
|
+
var package_namespaceObject = JSON.parse('{"i8":"1.2.16-beta.5"}');
|
|
5303
5313
|
class Action {
|
|
5304
5314
|
constructor(task){
|
|
5305
5315
|
this.task = task;
|