@iflyrpa/actions 1.2.3 → 1.2.5-beta.0
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 +13 -5
- package/dist/bundle.js.map +1 -1
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -1
package/dist/index.js
CHANGED
|
@@ -281,7 +281,8 @@ const errnoMap = {
|
|
|
281
281
|
20040033: "封面图片推荐 jpg、png格式,宽高在372×284-5000×5000 范围内。",
|
|
282
282
|
2004005714: "网络环境异常,请检查网络后重试发布。",
|
|
283
283
|
401100032: "异常,请检查图片(如:格式、版权、合规性等)。",
|
|
284
|
-
20040034: "封面图片推荐jpg、png格式,不支持gif格式。"
|
|
284
|
+
20040034: "封面图片推荐jpg、png格式,不支持gif格式。",
|
|
285
|
+
20040124: "服务器异常,请稍后重试!"
|
|
285
286
|
};
|
|
286
287
|
const mockAction = async (task, params)=>{
|
|
287
288
|
const { baijiahaoSingleCover, baijiahaoMultCover, baijiahaoCoverType } = params.settingInfo;
|
|
@@ -2082,7 +2083,9 @@ class XsEncrypt {
|
|
|
2082
2083
|
this.iv = external_node_buffer_namespaceObject.Buffer.from("4uzjr7mbsibcaldp", "utf8");
|
|
2083
2084
|
}
|
|
2084
2085
|
}
|
|
2085
|
-
const xiaohongshuPublish_mock_errnoMap = {
|
|
2086
|
+
const xiaohongshuPublish_mock_errnoMap = {
|
|
2087
|
+
903: "账户已登出,需重新登陆重试!"
|
|
2088
|
+
};
|
|
2086
2089
|
const xsEncrypt = new XsEncrypt();
|
|
2087
2090
|
const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
2088
2091
|
const tmpCachePath = task.getTmpPath();
|
|
@@ -2126,6 +2129,11 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
|
2126
2129
|
});
|
|
2127
2130
|
const coverIds = coverIdInfo.data.uploadTempPermits[0].fileIds;
|
|
2128
2131
|
const ossToken = coverIdInfo.data.uploadTempPermits[0].token;
|
|
2132
|
+
if (!coverIds || !ossToken) return {
|
|
2133
|
+
code: 200,
|
|
2134
|
+
message: "图片上传失败,请稍后重试!",
|
|
2135
|
+
data: ""
|
|
2136
|
+
};
|
|
2129
2137
|
const uploadFile = async (url, index)=>{
|
|
2130
2138
|
const fileName = (0, share_namespaceObject.getFilenameFromUrl)(url);
|
|
2131
2139
|
const localUrl = await (0, share_namespaceObject.downloadImage)(url, external_node_path_default().join(tmpCachePath, fileName));
|
|
@@ -2244,7 +2252,7 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
|
2244
2252
|
},
|
|
2245
2253
|
defaultErrorMsg: "文章发布异常,请稍后重试。"
|
|
2246
2254
|
});
|
|
2247
|
-
return (0, share_namespaceObject.success)(publishResult.data
|
|
2255
|
+
return (0, share_namespaceObject.success)(publishResult.data?.id);
|
|
2248
2256
|
};
|
|
2249
2257
|
const rpa_xsEncrypt = new XsEncrypt();
|
|
2250
2258
|
const xiaohongshuPublish_rpa_rpaAction = async (task, params)=>{
|
|
@@ -2350,7 +2358,7 @@ const xiaohongshuPublish_rpa_rpaAction = async (task, params)=>{
|
|
|
2350
2358
|
};
|
|
2351
2359
|
}
|
|
2352
2360
|
await page.locator("#content-area .menu-container .publish-video a").click();
|
|
2353
|
-
await page.locator(
|
|
2361
|
+
await page.locator('.creator-container .header .creator-tab:not([style*="-9999px"]) .title').filter({
|
|
2354
2362
|
hasText: /^上传图文$/
|
|
2355
2363
|
}).click();
|
|
2356
2364
|
const images = await Promise.all(params.banners.map((url)=>{
|
|
@@ -2453,7 +2461,7 @@ const xiaohongshuPublish = async (task, params)=>{
|
|
|
2453
2461
|
return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
|
|
2454
2462
|
};
|
|
2455
2463
|
var package_namespaceObject = {
|
|
2456
|
-
i8: "1.2.
|
|
2464
|
+
i8: "1.2.4"
|
|
2457
2465
|
};
|
|
2458
2466
|
class Action {
|
|
2459
2467
|
constructor(task){
|