@iflyrpa/actions 1.2.21 → 1.2.23
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 +3 -23
- package/dist/bundle.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +3 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -23
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.ts +0 -1
- package/package.json +2 -2
package/dist/bundle.js
CHANGED
|
@@ -3673,7 +3673,6 @@ var __webpack_exports__ = {};
|
|
|
3673
3673
|
__webpack_require__.r(__webpack_exports__);
|
|
3674
3674
|
__webpack_require__.d(__webpack_exports__, {
|
|
3675
3675
|
version: ()=>package_namespaceObject.i8,
|
|
3676
|
-
BetaFlag: ()=>BetaFlag,
|
|
3677
3676
|
Action: ()=>Action
|
|
3678
3677
|
});
|
|
3679
3678
|
var common_utils_namespaceObject = {};
|
|
@@ -14982,8 +14981,7 @@ var __webpack_exports__ = {};
|
|
|
14982
14981
|
20040034: "封面图片推荐jpg、png格式,不支持gif格式。",
|
|
14983
14982
|
20040124: "服务器异常,请稍后重试!",
|
|
14984
14983
|
20040001: "当前用户未登录,请登陆后重试!",
|
|
14985
|
-
401100025: "该应用不支持此媒资类型"
|
|
14986
|
-
401100033: "图片宽高不满足要求"
|
|
14984
|
+
401100025: "该应用不支持此媒资类型"
|
|
14987
14985
|
};
|
|
14988
14986
|
const mockAction = async (task, params)=>{
|
|
14989
14987
|
const { baijiahaoSingleCover, baijiahaoMultCover, baijiahaoCoverType } = params.settingInfo;
|
|
@@ -15108,7 +15106,6 @@ var __webpack_exports__ = {};
|
|
|
15108
15106
|
};
|
|
15109
15107
|
const isDraft = "draft" === params.saveType;
|
|
15110
15108
|
const saveUrl = isDraft ? "https://baijiahao.baidu.com/pcui/article/save?callback=bjhdraft" : "https://baijiahao.baidu.com/pcui/article/publish?callback=bjhpublish";
|
|
15111
|
-
task._timerRecord['PrePublish'] = Date.now();
|
|
15112
15109
|
const res = await http.api({
|
|
15113
15110
|
method: "post",
|
|
15114
15111
|
url: saveUrl,
|
|
@@ -15246,7 +15243,6 @@ var __webpack_exports__ = {};
|
|
|
15246
15243
|
}
|
|
15247
15244
|
};
|
|
15248
15245
|
page.on("response", handleResponse);
|
|
15249
|
-
task._timerRecord['PrePublish'] = Date.now();
|
|
15250
15246
|
const operatorContainer = page.locator(".editor-component-operator");
|
|
15251
15247
|
if ("draft" === params.saveType) await operatorContainer.locator(".op-btn-outter-content").filter({
|
|
15252
15248
|
hasText: "存草稿"
|
|
@@ -15812,7 +15808,6 @@ var __webpack_exports__ = {};
|
|
|
15812
15808
|
article_ad_type: getAddTypeValue(params.settingInfo.toutiaoAd),
|
|
15813
15809
|
claim_exclusive: toutiaoExclusive ? toutiaoExclusive : toutiaoOriginal?.includes("exclusive") ? 1 : 0
|
|
15814
15810
|
};
|
|
15815
|
-
task._timerRecord['PrePublish'] = Date.now();
|
|
15816
15811
|
const msToken = params.cookies.find((it)=>"msToken" === it.name)?.value;
|
|
15817
15812
|
let publishOption = {};
|
|
15818
15813
|
if (msToken) {
|
|
@@ -16057,7 +16052,6 @@ var __webpack_exports__ = {};
|
|
|
16057
16052
|
const confirmBtn = page.locator('div.byte-modal-footer button.byte-btn-primary:has-text("确定")');
|
|
16058
16053
|
if (await confirmBtn.isVisible()) await confirmBtn.click();
|
|
16059
16054
|
}
|
|
16060
|
-
task._timerRecord['PrePublish'] = Date.now();
|
|
16061
16055
|
if ("publish" === params.saveType) {
|
|
16062
16056
|
await page.locator(".publish-footer button").filter({
|
|
16063
16057
|
hasText: params.settingInfo.timer ? "定时发布" : "确认发布"
|
|
@@ -17490,7 +17484,6 @@ var __webpack_exports__ = {};
|
|
|
17490
17484
|
masssend_check: 1,
|
|
17491
17485
|
is_masssend: 1
|
|
17492
17486
|
};
|
|
17493
|
-
task._timerRecord['PrePublish'] = Date.now();
|
|
17494
17487
|
const { appMsgId } = await http.api({
|
|
17495
17488
|
method: "post",
|
|
17496
17489
|
url: "https://mp.weixin.qq.com/cgi-bin/operate_appmsg",
|
|
@@ -18149,7 +18142,6 @@ var __webpack_exports__ = {};
|
|
|
18149
18142
|
await poperInstance.locator('.frm_radio_item label[for="not_recomment_0"]').click();
|
|
18150
18143
|
}
|
|
18151
18144
|
await page.waitForTimeout(1000);
|
|
18152
|
-
task._timerRecord['PrePublish'] = Date.now();
|
|
18153
18145
|
const articleId = await new Promise(async (resolve)=>{
|
|
18154
18146
|
const handleResponse = async (response)=>{
|
|
18155
18147
|
const url = response.url();
|
|
@@ -18681,7 +18673,6 @@ var __webpack_exports__ = {};
|
|
|
18681
18673
|
};
|
|
18682
18674
|
}
|
|
18683
18675
|
}
|
|
18684
|
-
task._timerRecord['PrePublish'] = Date.now();
|
|
18685
18676
|
const business_binds = {
|
|
18686
18677
|
version: 1,
|
|
18687
18678
|
bizType: "",
|
|
@@ -18909,7 +18900,6 @@ var __webpack_exports__ = {};
|
|
|
18909
18900
|
hasText: "仅自己可见"
|
|
18910
18901
|
}).click();
|
|
18911
18902
|
}
|
|
18912
|
-
task._timerRecord['PrePublish'] = Date.now();
|
|
18913
18903
|
const releaseTimeInstance = page.locator("label").filter({
|
|
18914
18904
|
hasText: params.isImmediatelyPublish ? "立即发布" : "定时发布"
|
|
18915
18905
|
});
|
|
@@ -18935,31 +18925,21 @@ var __webpack_exports__ = {};
|
|
|
18935
18925
|
return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
|
|
18936
18926
|
};
|
|
18937
18927
|
var package_namespaceObject = {
|
|
18938
|
-
i8: "1.2.
|
|
18928
|
+
i8: "1.2.22"
|
|
18939
18929
|
};
|
|
18940
|
-
const BetaFlag = "HuiwenCanary";
|
|
18941
18930
|
class Action {
|
|
18942
18931
|
constructor(task){
|
|
18943
18932
|
this.task = task;
|
|
18944
18933
|
}
|
|
18945
18934
|
async bindTask(func, params) {
|
|
18946
18935
|
let responseData;
|
|
18947
|
-
this.task.isBeta = this.task.isFeatOn(BetaFlag);
|
|
18948
|
-
this.task._timerRecord = {
|
|
18949
|
-
ActionStart: Date.now()
|
|
18950
|
-
};
|
|
18951
18936
|
if (this.task.setArticleId) this.task.setArticleId(params.articleId ?? "");
|
|
18952
|
-
if (
|
|
18953
|
-
if (void 0 !== this.task.isInitializedGB) this.task.setGbInitType(this.task.isInitializedGB);
|
|
18954
|
-
if ("object" == typeof params) params.cookies = params?.cookies ?? [];
|
|
18937
|
+
if ("object" == typeof params && null !== params) params.cookies = params?.cookies ?? [];
|
|
18955
18938
|
try {
|
|
18956
18939
|
responseData = await func(this.task, params);
|
|
18957
18940
|
} catch (error) {
|
|
18958
18941
|
responseData = Http.handleApiError(error);
|
|
18959
|
-
} finally{
|
|
18960
|
-
this.task._timerRecord['ActionEnd'] = Date.now();
|
|
18961
18942
|
}
|
|
18962
|
-
if (this.task.isBeta && this.task.setTimeConsuming) this.task.setTimeConsuming(this.task._timerRecord);
|
|
18963
18943
|
if (200 === responseData.code) this.task.logger.info(`${func.name} action params error`, responseData);
|
|
18964
18944
|
else if (0 !== responseData.code) {
|
|
18965
18945
|
this.task.logger.error(responseData.message || `${func.name} 执行失败`, stringifyError(responseData.data), responseData.extra);
|