@iflyrpa/actions 1.2.16-beta.3 → 1.2.16-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 +32 -27
- package/dist/bundle.js.map +1 -1
- package/dist/index.js +32 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -27
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1169,12 +1169,7 @@ var __webpack_exports__ = {};
|
|
|
1169
1169
|
}
|
|
1170
1170
|
constructor(config){
|
|
1171
1171
|
this.apiClient = external_axios_default().create({
|
|
1172
|
-
...config
|
|
1173
|
-
proxy: {
|
|
1174
|
-
host: "localhost",
|
|
1175
|
-
port: 9000,
|
|
1176
|
-
protocol: "http"
|
|
1177
|
-
}
|
|
1172
|
+
...config
|
|
1178
1173
|
});
|
|
1179
1174
|
}
|
|
1180
1175
|
addResponseInterceptor(findError) {
|
|
@@ -3019,7 +3014,7 @@ var __webpack_exports__ = {};
|
|
|
3019
3014
|
articleCell,
|
|
3020
3015
|
...onlySuccess ? {
|
|
3021
3016
|
pagination: {
|
|
3022
|
-
total: api_base_info_json.total_count
|
|
3017
|
+
total: api_base_info_json.total_count,
|
|
3023
3018
|
pageNum,
|
|
3024
3019
|
pageSize
|
|
3025
3020
|
}
|
|
@@ -4963,33 +4958,40 @@ var __webpack_exports__ = {};
|
|
|
4963
4958
|
}
|
|
4964
4959
|
});
|
|
4965
4960
|
let uploadInfos = [];
|
|
4966
|
-
coverIdInfo.data.uploadTempPermits.
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4961
|
+
coverIdInfo.data.uploadTempPermits.forEach((item)=>{
|
|
4962
|
+
item.fileIds.forEach((fileId)=>{
|
|
4963
|
+
uploadInfos.push({
|
|
4964
|
+
bucket: item.bucket || "",
|
|
4965
|
+
uploadAddr: item.uploadAddr || "",
|
|
4966
|
+
fileIds: fileId,
|
|
4967
|
+
token: item.token || ""
|
|
4968
|
+
});
|
|
4972
4969
|
});
|
|
4973
4970
|
});
|
|
4971
|
+
if (uploadInfos.length < params.banners.length) return {
|
|
4972
|
+
code: 200,
|
|
4973
|
+
message: "可用 OSS bucket 数量不足,无法上传所有图片!",
|
|
4974
|
+
data: ""
|
|
4975
|
+
};
|
|
4974
4976
|
if (0 === uploadInfos.length) return {
|
|
4975
4977
|
code: 200,
|
|
4976
4978
|
message: "图片上传失败,请稍后重试!",
|
|
4977
4979
|
data: ""
|
|
4978
4980
|
};
|
|
4979
|
-
const
|
|
4981
|
+
const availableBuckets = Array.from({
|
|
4982
|
+
length: uploadInfos.length
|
|
4983
|
+
}, (_, i)=>i);
|
|
4984
|
+
const uploadFile = async (url, index)=>{
|
|
4980
4985
|
const fileName = (0, share_namespaceObject.getFilenameFromUrl)(url);
|
|
4981
4986
|
const localUrl = await (0, share_namespaceObject.downloadImage)(url, external_node_path_default().join(tmpCachePath, fileName));
|
|
4982
4987
|
const fileBuffer = external_node_fs_default().readFileSync(localUrl);
|
|
4983
|
-
const
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
}
|
|
4991
|
-
const currentInfo = uploadInfos[uploadIndex];
|
|
4992
|
-
const ossFileId = currentInfo.fileIds[0];
|
|
4988
|
+
const MAX_RETRIES = uploadInfos.length;
|
|
4989
|
+
let attempt = 0;
|
|
4990
|
+
while(attempt < MAX_RETRIES){
|
|
4991
|
+
const ossBucketIndex = availableBuckets.shift();
|
|
4992
|
+
if (void 0 === ossBucketIndex) break;
|
|
4993
|
+
const currentInfo = uploadInfos[ossBucketIndex];
|
|
4994
|
+
const ossFileId = currentInfo.fileIds;
|
|
4993
4995
|
const ossToken = currentInfo.token;
|
|
4994
4996
|
const ossDomain = currentInfo.uploadAddr;
|
|
4995
4997
|
try {
|
|
@@ -5007,10 +5009,13 @@ var __webpack_exports__ = {};
|
|
|
5007
5009
|
ossToken
|
|
5008
5010
|
};
|
|
5009
5011
|
} catch (error) {
|
|
5010
|
-
|
|
5012
|
+
attempt++;
|
|
5011
5013
|
}
|
|
5014
|
+
}
|
|
5015
|
+
return {
|
|
5016
|
+
ossFileId: "",
|
|
5017
|
+
ossToken: ""
|
|
5012
5018
|
};
|
|
5013
|
-
return tryUpload(infoIndex);
|
|
5014
5019
|
};
|
|
5015
5020
|
const coverInfos = await Promise.all(params.banners.map((it, idx)=>uploadFile(it, idx)));
|
|
5016
5021
|
const invalidUpload = coverInfos.find((it)=>"" === it.ossToken || "" == it.ossFileId);
|
|
@@ -5355,7 +5360,7 @@ var __webpack_exports__ = {};
|
|
|
5355
5360
|
if ("mockApi" === params.actionType) return xiaohongshuPublish_mock_mockAction(task, params);
|
|
5356
5361
|
return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
|
|
5357
5362
|
};
|
|
5358
|
-
var package_namespaceObject = JSON.parse('{"i8":"1.2.16-beta.
|
|
5363
|
+
var package_namespaceObject = JSON.parse('{"i8":"1.2.16-beta.4"}');
|
|
5359
5364
|
class Action {
|
|
5360
5365
|
constructor(task){
|
|
5361
5366
|
this.task = task;
|