@iflyrpa/actions 1.2.29 → 1.2.30-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/index.js CHANGED
@@ -3255,7 +3255,9 @@ var __webpack_exports__ = {};
3255
3255
  const srcList = [];
3256
3256
  const parser = new external_htmlparser2_namespaceObject.Parser({
3257
3257
  onopentag (name, attributes) {
3258
- if ("img" === name && (attributes.src.trim() || attributes.currentSrc.trim())) srcList.push(attributes.src.trim() || attributes.currentSrc.trim());
3258
+ const src = attributes.src?.trim();
3259
+ const currentSrc = attributes.currentSrc?.trim();
3260
+ if ("img" === name && (src || currentSrc)) srcList.push(src || currentSrc);
3259
3261
  }
3260
3262
  });
3261
3263
  parser.write(html);
@@ -11081,7 +11083,8 @@ var __webpack_exports__ = {};
11081
11083
  1053: "正文图片和封面图片推荐jpg、png格式。",
11082
11084
  1050: "图片上传失败,请重试上传。",
11083
11085
  2005: "账号无【申明原创】权限,请关闭申明后重试。",
11084
- 100004: "用户未登录或登陆已过期,请重新登陆后重试。"
11086
+ 100004: "用户未登录或登陆已过期,请重新登陆后重试。",
11087
+ 4029: "标题长度应该在2-30字之间,请修改后重试。"
11085
11088
  };
11086
11089
  const mock_generatorFormData = (data)=>Object.entries(data).map(([key, value])=>{
11087
11090
  const encodedKey = encodeURIComponent(key);
@@ -14627,60 +14630,14 @@ var __webpack_exports__ = {};
14627
14630
  } catch (error) {
14628
14631
  throw new Error("上传图片超时,请重试!");
14629
14632
  }
14630
- const response = await new Promise((resolve)=>{
14631
- const handleResponse = async (response)=>{
14632
- if (response.url().includes("/web_api/sns/v2/note")) {
14633
- const jsonResponse = await response.json();
14634
- page.off("response", handleResponse);
14635
- resolve(jsonResponse);
14636
- }
14637
- };
14638
- page.on("response", handleResponse);
14639
- page.locator(".submit .publishBtn").click({
14640
- timeout: clickTimeout
14641
- });
14642
- page.waitForSelector(".d-toast-icon-danger", {
14643
- state: "visible",
14644
- timeout: 2000
14645
- }).then(async ()=>{
14646
- await page.waitForTimeout(300);
14647
- const toastDesc = await page.locator(".d-toast-description").textContent();
14648
- const desc = toastDesc?.trim();
14649
- page.off("response", handleResponse);
14650
- resolve({
14651
- success: false,
14652
- msg: desc || "未知错误"
14653
- });
14654
- }).catch(()=>{});
14655
- setTimeout(()=>{
14656
- page.off("response", handleResponse);
14657
- resolve({
14658
- success: false,
14659
- msg: "发布超时"
14660
- });
14661
- }, 7000);
14662
- });
14663
- if (!response?.success) {
14664
- const msg = `发布失败:${response?.msg || "未知错误"}`;
14665
- await updateTaskState?.({
14666
- state: share_namespaceObject.TaskState.FAILED,
14667
- error: msg
14668
- });
14669
- await page.close();
14670
- return {
14671
- code: 414,
14672
- message: msg,
14673
- data: ""
14674
- };
14675
- }
14676
14633
  await updateTaskState?.({
14677
14634
  state: share_namespaceObject.TaskState.SUCCESS,
14678
14635
  result: {
14679
- response: response?.data?.id || ""
14636
+ response: "123456789"
14680
14637
  }
14681
14638
  });
14682
14639
  await page.close();
14683
- return (0, share_namespaceObject.success)(response?.data?.id || "");
14640
+ return (0, share_namespaceObject.success)("123456789");
14684
14641
  };
14685
14642
  const rpa_server_mock_encode_mnsv2 = __webpack_require__("./src/utils/xhs_ob/x_s.encoder.js");
14686
14643
  function Md5(input) {
@@ -15043,31 +15000,8 @@ var __webpack_exports__ = {};
15043
15000
  });
15044
15001
  publishXsHeader["x-s"] = rpa_server_mock_encode_mnsv2(ticket_mnsv2, "Windows", "object");
15045
15002
  publishXsHeader["x-t"] = Date.now().toString();
15046
- const publishResult = await proxyHttp.api({
15047
- method: "post",
15048
- url: "https://edith.xiaohongshu.com/web_api/sns/v2/note",
15049
- data: publishData,
15050
- headers: publishXsHeader,
15051
- defaultErrorMsg: "文章发布异常,请稍后重试。"
15052
- }, {
15053
- retries: 2,
15054
- retryDelay: 500,
15055
- timeout: 12000
15056
- });
15057
- const isSuccess = publishResult.success;
15058
- const message = `文章发布${isSuccess ? "成功" : `失败,原因:${publishResult.msg}`}${task.debug ? ` ${http.proxyInfo}` : ""}`;
15059
- const data = isSuccess ? publishResult.data?.id || "" : "";
15060
- if (!isSuccess) {
15061
- await updateTaskState?.({
15062
- state: share_namespaceObject.TaskState.FAILED,
15063
- error: message
15064
- });
15065
- return {
15066
- code: 414,
15067
- data,
15068
- message
15069
- };
15070
- }
15003
+ const message = `模拟发布:${task.debug ? ` ${http.proxyInfo}` : ""}`;
15004
+ const data = "1234567890";
15071
15005
  await updateTaskState?.({
15072
15006
  state: share_namespaceObject.TaskState.SUCCESS,
15073
15007
  result: {
@@ -15620,7 +15554,7 @@ var __webpack_exports__ = {};
15620
15554
  return (0, share_namespaceObject.response)(isSuccess ? 0 : 414, message, data);
15621
15555
  };
15622
15556
  var package_namespaceObject = {
15623
- i8: "1.2.28"
15557
+ i8: "1.2.29"
15624
15558
  };
15625
15559
  const BetaFlag = "HuiwenCanary";
15626
15560
  class Action {