@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/bundle.js CHANGED
@@ -20940,7 +20940,9 @@ var __webpack_exports__ = {};
20940
20940
  const srcList = [];
20941
20941
  const parser = new Parser_Parser({
20942
20942
  onopentag (name, attributes) {
20943
- if ("img" === name && (attributes.src.trim() || attributes.currentSrc.trim())) srcList.push(attributes.src.trim() || attributes.currentSrc.trim());
20943
+ const src = attributes.src?.trim();
20944
+ const currentSrc = attributes.currentSrc?.trim();
20945
+ if ("img" === name && (src || currentSrc)) srcList.push(src || currentSrc);
20944
20946
  }
20945
20947
  });
20946
20948
  parser.write(html);
@@ -29729,7 +29731,8 @@ var __webpack_exports__ = {};
29729
29731
  1053: "正文图片和封面图片推荐jpg、png格式。",
29730
29732
  1050: "图片上传失败,请重试上传。",
29731
29733
  2005: "账号无【申明原创】权限,请关闭申明后重试。",
29732
- 100004: "用户未登录或登陆已过期,请重新登陆后重试。"
29734
+ 100004: "用户未登录或登陆已过期,请重新登陆后重试。",
29735
+ 4029: "标题长度应该在2-30字之间,请修改后重试。"
29733
29736
  };
29734
29737
  const mock_generatorFormData = (data)=>Object.entries(data).map(([key, value])=>{
29735
29738
  const encodedKey = encodeURIComponent(key);
@@ -33275,60 +33278,14 @@ var __webpack_exports__ = {};
33275
33278
  } catch (error) {
33276
33279
  throw new Error("上传图片超时,请重试!");
33277
33280
  }
33278
- const response = await new Promise((resolve)=>{
33279
- const handleResponse = async (response)=>{
33280
- if (response.url().includes("/web_api/sns/v2/note")) {
33281
- const jsonResponse = await response.json();
33282
- page.off("response", handleResponse);
33283
- resolve(jsonResponse);
33284
- }
33285
- };
33286
- page.on("response", handleResponse);
33287
- page.locator(".submit .publishBtn").click({
33288
- timeout: clickTimeout
33289
- });
33290
- page.waitForSelector(".d-toast-icon-danger", {
33291
- state: "visible",
33292
- timeout: 2000
33293
- }).then(async ()=>{
33294
- await page.waitForTimeout(300);
33295
- const toastDesc = await page.locator(".d-toast-description").textContent();
33296
- const desc = toastDesc?.trim();
33297
- page.off("response", handleResponse);
33298
- resolve({
33299
- success: false,
33300
- msg: desc || "未知错误"
33301
- });
33302
- }).catch(()=>{});
33303
- setTimeout(()=>{
33304
- page.off("response", handleResponse);
33305
- resolve({
33306
- success: false,
33307
- msg: "发布超时"
33308
- });
33309
- }, 7000);
33310
- });
33311
- if (!response?.success) {
33312
- const msg = `发布失败:${response?.msg || "未知错误"}`;
33313
- await updateTaskState?.({
33314
- state: types_TaskState.FAILED,
33315
- error: msg
33316
- });
33317
- await page.close();
33318
- return {
33319
- code: 414,
33320
- message: msg,
33321
- data: ""
33322
- };
33323
- }
33324
33281
  await updateTaskState?.({
33325
33282
  state: types_TaskState.SUCCESS,
33326
33283
  result: {
33327
- response: response?.data?.id || ""
33284
+ response: "123456789"
33328
33285
  }
33329
33286
  });
33330
33287
  await page.close();
33331
- return success(response?.data?.id || "");
33288
+ return success("123456789");
33332
33289
  };
33333
33290
  const rpa_server_mock_encode_mnsv2 = __webpack_require__("./src/utils/xhs_ob/x_s.encoder.js");
33334
33291
  function Md5(input) {
@@ -33691,31 +33648,8 @@ var __webpack_exports__ = {};
33691
33648
  });
33692
33649
  publishXsHeader["x-s"] = rpa_server_mock_encode_mnsv2(ticket_mnsv2, "Windows", "object");
33693
33650
  publishXsHeader["x-t"] = Date.now().toString();
33694
- const publishResult = await proxyHttp.api({
33695
- method: "post",
33696
- url: "https://edith.xiaohongshu.com/web_api/sns/v2/note",
33697
- data: publishData,
33698
- headers: publishXsHeader,
33699
- defaultErrorMsg: "文章发布异常,请稍后重试。"
33700
- }, {
33701
- retries: 2,
33702
- retryDelay: 500,
33703
- timeout: 12000
33704
- });
33705
- const isSuccess = publishResult.success;
33706
- const message = `文章发布${isSuccess ? "成功" : `失败,原因:${publishResult.msg}`}${task.debug ? ` ${http.proxyInfo}` : ""}`;
33707
- const data = isSuccess ? publishResult.data?.id || "" : "";
33708
- if (!isSuccess) {
33709
- await updateTaskState?.({
33710
- state: types_TaskState.FAILED,
33711
- error: message
33712
- });
33713
- return {
33714
- code: 414,
33715
- data,
33716
- message
33717
- };
33718
- }
33651
+ const message = `模拟发布:${task.debug ? ` ${http.proxyInfo}` : ""}`;
33652
+ const data = "1234567890";
33719
33653
  await updateTaskState?.({
33720
33654
  state: types_TaskState.SUCCESS,
33721
33655
  result: {
@@ -34268,7 +34202,7 @@ var __webpack_exports__ = {};
34268
34202
  return utils_response(isSuccess ? 0 : 414, message, data);
34269
34203
  };
34270
34204
  var package_namespaceObject = {
34271
- i8: "1.2.28"
34205
+ i8: "1.2.29"
34272
34206
  };
34273
34207
  const BetaFlag = "HuiwenCanary";
34274
34208
  class Action {