@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/index.mjs CHANGED
@@ -2047,8 +2047,7 @@ const errnoMap = {
2047
2047
  20040034: "封面图片推荐jpg、png格式,不支持gif格式。",
2048
2048
  20040124: "服务器异常,请稍后重试!",
2049
2049
  20040001: "当前用户未登录,请登陆后重试!",
2050
- 401100025: "该应用不支持此媒资类型",
2051
- 401100033: "图片宽高不满足要求"
2050
+ 401100025: "该应用不支持此媒资类型"
2052
2051
  };
2053
2052
  const mockAction = async (task, params)=>{
2054
2053
  const { baijiahaoSingleCover, baijiahaoMultCover, baijiahaoCoverType } = params.settingInfo;
@@ -2173,7 +2172,6 @@ const mockAction = async (task, params)=>{
2173
2172
  };
2174
2173
  const isDraft = "draft" === params.saveType;
2175
2174
  const saveUrl = isDraft ? "https://baijiahao.baidu.com/pcui/article/save?callback=bjhdraft" : "https://baijiahao.baidu.com/pcui/article/publish?callback=bjhpublish";
2176
- task._timerRecord['PrePublish'] = Date.now();
2177
2175
  const res = await http.api({
2178
2176
  method: "post",
2179
2177
  url: saveUrl,
@@ -2311,7 +2309,6 @@ const rpaAction = async (task, params)=>{
2311
2309
  }
2312
2310
  };
2313
2311
  page.on("response", handleResponse);
2314
- task._timerRecord['PrePublish'] = Date.now();
2315
2312
  const operatorContainer = page.locator(".editor-component-operator");
2316
2313
  if ("draft" === params.saveType) await operatorContainer.locator(".op-btn-outter-content").filter({
2317
2314
  hasText: "存草稿"
@@ -2874,7 +2871,6 @@ const mock_mockAction = async (task, params)=>{
2874
2871
  article_ad_type: getAddTypeValue(params.settingInfo.toutiaoAd),
2875
2872
  claim_exclusive: toutiaoExclusive ? toutiaoExclusive : toutiaoOriginal?.includes("exclusive") ? 1 : 0
2876
2873
  };
2877
- task._timerRecord['PrePublish'] = Date.now();
2878
2874
  const msToken = params.cookies.find((it)=>"msToken" === it.name)?.value;
2879
2875
  let publishOption = {};
2880
2876
  if (msToken) {
@@ -3119,7 +3115,6 @@ const rpa_rpaAction = async (task, params)=>{
3119
3115
  const confirmBtn = page.locator('div.byte-modal-footer button.byte-btn-primary:has-text("确定")');
3120
3116
  if (await confirmBtn.isVisible()) await confirmBtn.click();
3121
3117
  }
3122
- task._timerRecord['PrePublish'] = Date.now();
3123
3118
  if ("publish" === params.saveType) {
3124
3119
  await page.locator(".publish-footer button").filter({
3125
3120
  hasText: params.settingInfo.timer ? "定时发布" : "确认发布"
@@ -4552,7 +4547,6 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
4552
4547
  masssend_check: 1,
4553
4548
  is_masssend: 1
4554
4549
  };
4555
- task._timerRecord['PrePublish'] = Date.now();
4556
4550
  const { appMsgId } = await http.api({
4557
4551
  method: "post",
4558
4552
  url: "https://mp.weixin.qq.com/cgi-bin/operate_appmsg",
@@ -5211,7 +5205,6 @@ const weixinPublish_rpa_rpaAction = async (task, params)=>{
5211
5205
  await poperInstance.locator('.frm_radio_item label[for="not_recomment_0"]').click();
5212
5206
  }
5213
5207
  await page.waitForTimeout(1000);
5214
- task._timerRecord['PrePublish'] = Date.now();
5215
5208
  const articleId = await new Promise(async (resolve)=>{
5216
5209
  const handleResponse = async (response)=>{
5217
5210
  const url = response.url();
@@ -5743,7 +5736,6 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
5743
5736
  };
5744
5737
  }
5745
5738
  }
5746
- task._timerRecord['PrePublish'] = Date.now();
5747
5739
  const business_binds = {
5748
5740
  version: 1,
5749
5741
  bizType: "",
@@ -5971,7 +5963,6 @@ const xiaohongshuPublish_rpa_rpaAction = async (task, params)=>{
5971
5963
  hasText: "仅自己可见"
5972
5964
  }).click();
5973
5965
  }
5974
- task._timerRecord['PrePublish'] = Date.now();
5975
5966
  const releaseTimeInstance = page.locator("label").filter({
5976
5967
  hasText: params.isImmediatelyPublish ? "立即发布" : "定时发布"
5977
5968
  });
@@ -5997,31 +5988,21 @@ const xiaohongshuPublish = async (task, params)=>{
5997
5988
  return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
5998
5989
  };
5999
5990
  var package_namespaceObject = {
6000
- i8: "1.2.20"
5991
+ i8: "1.2.22"
6001
5992
  };
6002
- const BetaFlag = "HuiwenCanary";
6003
5993
  class Action {
6004
5994
  constructor(task){
6005
5995
  this.task = task;
6006
5996
  }
6007
5997
  async bindTask(func, params) {
6008
5998
  let responseData;
6009
- this.task.isBeta = this.task.isFeatOn(BetaFlag);
6010
- this.task._timerRecord = {
6011
- ActionStart: Date.now()
6012
- };
6013
5999
  if (this.task.setArticleId) this.task.setArticleId(params.articleId ?? "");
6014
- if (this.task.setSaveType) this.task.setSaveType(params.saveType ?? "");
6015
- if (void 0 !== this.task.isInitializedGB) this.task.setGbInitType(this.task.isInitializedGB);
6016
- if ("object" == typeof params) params.cookies = params?.cookies ?? [];
6000
+ if ("object" == typeof params && null !== params) params.cookies = params?.cookies ?? [];
6017
6001
  try {
6018
6002
  responseData = await func(this.task, params);
6019
6003
  } catch (error) {
6020
6004
  responseData = Http.handleApiError(error);
6021
- } finally{
6022
- this.task._timerRecord['ActionEnd'] = Date.now();
6023
6005
  }
6024
- if (this.task.isBeta && this.task.setTimeConsuming) this.task.setTimeConsuming(this.task._timerRecord);
6025
6006
  if (200 === responseData.code) this.task.logger.info(`${func.name} action params error`, responseData);
6026
6007
  else if (0 !== responseData.code) {
6027
6008
  this.task.logger.error(responseData.message || `${func.name} 执行失败`, stringifyError(responseData.data), responseData.extra);
@@ -6106,6 +6087,6 @@ class Action {
6106
6087
  }
6107
6088
  }
6108
6089
  var __webpack_exports__version = package_namespaceObject.i8;
6109
- export { Action, BetaFlag, __webpack_exports__version as version };
6090
+ export { Action, __webpack_exports__version as version };
6110
6091
 
6111
6092
  //# sourceMappingURL=index.mjs.map