@iflyrpa/actions 4.0.9-beta.4 → 4.0.9-beta.5

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
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="645e51de-1b6f-5dc7-ae78-210cebee5639")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8d0d46fe-3677-557b-887b-a9582ff0704b")}catch(e){}}();
3
3
  import * as __WEBPACK_EXTERNAL_MODULE_crypto__ from "crypto";
4
4
  import * as __WEBPACK_EXTERNAL_MODULE_fs__ from "fs";
5
5
  import * as __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_package_json_58ae5f06__ from "@iflyrpa/share/package.json";
@@ -4352,125 +4352,7 @@ function __webpack_require__(moduleId) {
4352
4352
  return module;
4353
4353
  };
4354
4354
  })();
4355
- var package_namespaceObject = JSON.parse('{"i8":"4.0.9-beta.4"}');
4356
- const USER_MESSAGE = {
4357
- PROXY_UNAVAILABLE: "代理暂时不可用,请稍后重试或使用本地IP",
4358
- NETWORK_ERROR: "网络异常,请稍后重试",
4359
- SYSTEM_ERROR: "系统异常,请稍后重试或联系客服",
4360
- PUBLISH_NETWORK: "发布失败,网络不稳定,请稍后重试",
4361
- DOUYIN_ACCOUNT_FETCH_FAILED: "抖音数据获取失败,请稍后重试",
4362
- SHIPINHAO_ACCOUNT_FETCH_FAILED: "视频号数据获取失败,请稍后重试",
4363
- DOUYIN_POST_FETCH_FAILED: "抖音作品数据获取失败,请稍后重试",
4364
- SHIPINHAO_POST_FETCH_FAILED: "视频号作品数据获取失败,请稍后重试",
4365
- BJH_POST_FETCH_FAILED: "百家号作品数据获取失败,请稍后重试",
4366
- TT_POST_FETCH_FAILED: "头条号作品数据获取失败,请稍后重试",
4367
- QRCODE_FETCH_FAILED: "认证二维码获取失败,请稍后重试",
4368
- IMAGE_UPLOAD_FAILED: "图片上传失败,请稍后重试或联系客服"
4369
- };
4370
- const NETWORK_CODES = [
4371
- 500,
4372
- 502,
4373
- 503,
4374
- 504
4375
- ];
4376
- function classifyPublishError(handledError) {
4377
- const { code } = handledError;
4378
- const isProxyRequest = handledError.extra?.isProxyRequest === true;
4379
- if (!NETWORK_CODES.includes(code) && 599 !== code) return null;
4380
- const category = 599 === code || isProxyRequest ? "代理错误" : "网络错误";
4381
- return {
4382
- category,
4383
- userMessage: USER_MESSAGE.PUBLISH_NETWORK
4384
- };
4385
- }
4386
- const RPA_ERROR_WEBHOOK_URL = "https://open.xfchat.iflytek.com/open-apis/bot/v2/hook/d202c0dc-5af5-40bc-83ed-abc677caa4a5";
4387
- const ALARM_THROTTLE_MS = 60000;
4388
- const lastSentAt = new Map();
4389
- const postFeishuWebhook = (webhookUrl, payload)=>__WEBPACK_EXTERNAL_MODULE_axios__["default"].post(webhookUrl, payload, {
4390
- headers: {
4391
- "Content-Type": "application/json"
4392
- },
4393
- timeout: 10000
4394
- });
4395
- const buildFeishuPostMessage = (report)=>{
4396
- const content = [
4397
- [
4398
- {
4399
- tag: "text",
4400
- text: `平台:${report.platform || "未知平台"}`
4401
- }
4402
- ],
4403
- [
4404
- {
4405
- tag: "text",
4406
- text: `错误信息:${report.msg || "未知错误信息"}`
4407
- }
4408
- ],
4409
- [
4410
- {
4411
- tag: "text",
4412
- text: `错误类型:${report.errorType || "未知错误类型"}`
4413
- }
4414
- ],
4415
- [
4416
- {
4417
- tag: "text",
4418
- text: `阶段:${report.stage || "未知阶段"}`
4419
- }
4420
- ],
4421
- [
4422
- {
4423
- tag: "text",
4424
- text: `等级:${report.level}`
4425
- }
4426
- ],
4427
- [
4428
- {
4429
- tag: "text",
4430
- text: `来源:${report.source}`
4431
- }
4432
- ]
4433
- ];
4434
- if (void 0 !== report.code && null !== report.code) content.push([
4435
- {
4436
- tag: "text",
4437
- text: `接口错误码:${report.code}`
4438
- }
4439
- ]);
4440
- if (report.url) content.push([
4441
- {
4442
- tag: "text",
4443
- text: `地址:${report.url}`
4444
- }
4445
- ]);
4446
- if ("alarm" === report.level) content.push([
4447
- {
4448
- tag: "at",
4449
- user_id: "all"
4450
- }
4451
- ]);
4452
- return {
4453
- msg_type: "post",
4454
- content: {
4455
- post: {
4456
- zh_cn: {
4457
- title: report.title || "RPA异常",
4458
- content
4459
- }
4460
- }
4461
- }
4462
- };
4463
- };
4464
- const reportFeishuAlarm = (report)=>{
4465
- try {
4466
- const key = `${report.platform}|${report.source}|${report.errorType}|${report.code ?? ""}`;
4467
- const now = Date.now();
4468
- const last = lastSentAt.get(key);
4469
- if (last && now - last < ALARM_THROTTLE_MS) return;
4470
- lastSentAt.set(key, now);
4471
- postFeishuWebhook(RPA_ERROR_WEBHOOK_URL, buildFeishuPostMessage(report)).catch(()=>{});
4472
- } catch {}
4473
- };
4355
+ var package_namespaceObject = JSON.parse('{"i8":"4.0.9-beta.5"}');
4474
4356
  const PROXY_CREDENTIALS = [
4475
4357
  {
4476
4358
  ip: "47.110.131.129",
@@ -4572,20 +4454,9 @@ async function ProxyAgent(task, addr, accountId, refresh) {
4572
4454
  url: "https://fetdev.iflysec.com/ip-pool/pool/eip/proxy",
4573
4455
  data: params
4574
4456
  }).catch((err)=>{
4575
- reportFeishuAlarm({
4576
- level: "alarm",
4577
- platform: "ip-pool",
4578
- source: "proxy",
4579
- stage: "POST /ip-pool/pool/eip/proxy",
4580
- errorType: "PROXY_REQUEST_FAILED",
4581
- code: err?.code,
4582
- msg: `请求代理失败:${err.message},区域:${addr ?? "-"},AccountId:${accountId ?? "-"}`,
4583
- url: "https://fetdev.iflysec.com/ip-pool/pool/eip/proxy",
4584
- title: "代理异常"
4585
- });
4586
4457
  throw {
4587
4458
  code: 414,
4588
- message: USER_MESSAGE.PROXY_UNAVAILABLE,
4459
+ message: `请求代理失败:${err.message}`,
4589
4460
  data: {}
4590
4461
  };
4591
4462
  });
@@ -4605,53 +4476,12 @@ async function ProxyAgent(task, addr, accountId, refresh) {
4605
4476
  } : null;
4606
4477
  return proxyAgent;
4607
4478
  }
4608
- const ALARM_STATUS = new Set([
4609
- 401,
4610
- 403,
4611
- 429,
4612
- 461,
4613
- 471
4614
- ]);
4615
- const HTTP_STATUS_MESSAGE = {
4616
- 400: "请求参数错误,请检查参数格式是否正确!",
4617
- 401: "登录状态已失效,请重新登录后重试!",
4618
- 403: "没有访问权限,账号可能受限或签名已失效!",
4619
- 404: "请求的资源不存在,请检查接口地址!",
4620
- 405: "请求方法不被允许,请检查接口调用方式!",
4621
- 406: "服务端无法返回可接受的内容格式!",
4622
- 407: "代理需要身份验证,请检查代理配置!",
4623
- 408: "请求超时,请检查网络连接!",
4624
- 409: "请求冲突,资源状态已变更,请刷新后重试!",
4625
- 410: "请求的资源已被移除!",
4626
- 412: "请求前置条件不满足,请刷新后重试!",
4627
- 413: "提交内容过大,请压缩或分批后重试!",
4628
- 414: "请求地址过长,请检查参数!",
4629
- 415: "不支持的内容类型,请检查请求格式!",
4630
- 422: "请求内容校验失败,请检查参数内容!",
4631
- 423: "资源已被锁定,请稍后重试!",
4632
- 429: "请求过于频繁,请稍后重试!",
4633
- 431: "请求头过大,请清理 Cookie 后重试!",
4634
- 451: "内容不合规或因法律原因被拒绝!",
4635
- 461: "账号可能受限,请在网页上完成验证后重试!",
4636
- 471: "账号可能受限,请在网页上完成验证后重试!",
4637
- 500: "服务器内部错误,请稍后重试!",
4638
- 501: "服务端不支持该请求,请稍后重试!",
4639
- 502: "网关错误,请稍后重试!",
4640
- 503: "服务暂时不可用,请稍后重试!",
4641
- 504: "网关超时,请稍后重试!",
4642
- 507: "服务端存储空间不足,请稍后重试!",
4643
- 509: "服务带宽超限,请稍后重试!",
4644
- 520: "服务端返回未知错误,请稍后重试!",
4645
- 521: "源站拒绝连接,请稍后重试!",
4646
- 522: "源站连接超时,请稍后重试!",
4647
- 524: "源站响应超时,请稍后重试!"
4648
- };
4649
4479
  class Http {
4650
4480
  static handleApiError(error) {
4651
4481
  if (error && "object" == typeof error && "code" in error && "message" in error) return error;
4652
4482
  return {
4653
4483
  code: 500,
4654
- message: USER_MESSAGE.SYSTEM_ERROR,
4484
+ message: error instanceof Error ? error.message : "未知错误",
4655
4485
  data: error
4656
4486
  };
4657
4487
  }
@@ -4706,18 +4536,6 @@ class Http {
4706
4536
  const verifyDecision = error.response?.headers?.["x-tt-verify-passport-decision"];
4707
4537
  if (verifyDecision) this.logger?.warn(`[403 验证决策] x-tt-verify-passport-decision: ${verifyDecision}`);
4708
4538
  }
4709
- if (error.response?.status === 461 || error.response?.status === 471) {
4710
- const h = error.response?.headers ?? {};
4711
- const pick = (name)=>h[name] ?? h[name.toLowerCase()];
4712
- this.logger?.warn(`[${error.response.status} 风控验证] URL: ${error.config?.url} Verifytype: ${pick("Verifytype") ?? "-"} Verifyuuid: ${pick("Verifyuuid") ?? "-"} Verifybiz: ${pick("Verifybiz") ?? "-"}`);
4713
- this.logger?.warn(`[${error.response.status} 响应头] ${JSON.stringify(h)}`);
4714
- errorResponse.extra = {
4715
- ...errorResponse.extra,
4716
- verifyType: pick("Verifytype"),
4717
- verifyUuid: pick("Verifyuuid"),
4718
- verifyBiz: pick("Verifybiz")
4719
- };
4720
- }
4721
4539
  if (error.response?.data) {
4722
4540
  if ("object" == typeof error.response.data) {
4723
4541
  const serverError = error.response.data;
@@ -4748,17 +4566,11 @@ class Http {
4748
4566
  _message = "DNS 查询超时,请稍后重试!";
4749
4567
  break;
4750
4568
  case "ERR_BAD_REQUEST":
4751
- {
4752
- const status = error.response?.status;
4753
- _message = status && HTTP_STATUS_MESSAGE[status] || `请求失败,状态码${status ?? "unknown"}!`;
4754
- break;
4755
- }
4569
+ _message = "请求出现错误,请检查请求参数!";
4570
+ break;
4756
4571
  case "ERR_BAD_RESPONSE":
4757
- {
4758
- const status = error.response?.status;
4759
- _message = status && HTTP_STATUS_MESSAGE[status] || `服务器响应异常 (${status ?? "unknown"}),请稍后重试!`;
4760
- break;
4761
- }
4572
+ _message = `服务器响应异常 (${error.response?.status ?? "unknown"}),请稍后重试!`;
4573
+ break;
4762
4574
  case "ERR_CANCELED":
4763
4575
  errorResponse.code = 414;
4764
4576
  _message = "请求连接超时,请稍候重试!";
@@ -4769,14 +4581,11 @@ class Http {
4769
4581
  }
4770
4582
  break;
4771
4583
  default:
4772
- {
4773
- this.logger?.debug(`未处理的网络错误代码: ${error.code} ${error.message}`, {
4774
- errorString: stringifyError(error)
4775
- });
4776
- const status = error.response?.status;
4777
- _message = status && HTTP_STATUS_MESSAGE[status] || USER_MESSAGE.NETWORK_ERROR;
4778
- break;
4779
- }
4584
+ this.logger?.debug(`未处理的网络错误代码: ${error.code} ${error.message}`, {
4585
+ errorString: stringifyError(error)
4586
+ });
4587
+ _message = `网络错误: ${error.message}`;
4588
+ break;
4780
4589
  }
4781
4590
  }
4782
4591
  if (error.code && !error.response?.data) errorResponse.message = _message || errorResponse.message;
@@ -4786,18 +4595,6 @@ class Http {
4786
4595
  errorResponse.message = message;
4787
4596
  }
4788
4597
  if (error.message.includes("Proxy connection ended")) errorResponse.message = "所在区域代理连接超时,请更换区域或稍后重试!";
4789
- const status = error.response?.status;
4790
- reportFeishuAlarm({
4791
- level: status && ALARM_STATUS.has(status) ? "alarm" : "warning",
4792
- platform: this.platform || "unknown",
4793
- source: "http",
4794
- stage: `${(error.config?.method || "get").toUpperCase()} ${error.config?.url || "-"}`,
4795
- errorType: status ? `HTTP_${status}` : error.code || "NETWORK_ERROR",
4796
- code: errorResponse.code,
4797
- msg: errorResponse.message,
4798
- url: error.config?.url,
4799
- title: "RPA接口异常"
4800
- });
4801
4598
  throw errorResponse;
4802
4599
  });
4803
4600
  }
@@ -5565,7 +5362,7 @@ const NUMBER_FORMAT_RANGES = {
5565
5362
  Number.MAX_VALUE
5566
5363
  ]
5567
5364
  };
5568
- function util_pick(schema, mask) {
5365
+ function pick(schema, mask) {
5569
5366
  const currDef = schema._zod.def;
5570
5367
  const def = mergeDefs(schema._zod.def, {
5571
5368
  get shape () {
@@ -8546,7 +8343,7 @@ const ZodObject = /*@__PURE__*/ $constructor("ZodObject", (inst, def)=>{
8546
8343
  inst.extend = (incoming)=>extend(inst, incoming);
8547
8344
  inst.safeExtend = (incoming)=>safeExtend(inst, incoming);
8548
8345
  inst.merge = (other)=>merge(inst, other);
8549
- inst.pick = (mask)=>util_pick(inst, mask);
8346
+ inst.pick = (mask)=>pick(inst, mask);
8550
8347
  inst.omit = (mask)=>omit(inst, mask);
8551
8348
  inst.partial = (...args)=>partial(ZodOptional, inst, args[0]);
8552
8349
  inst.required = (...args)=>required(ZodNonOptional, inst, args[0]);
@@ -9251,7 +9048,7 @@ const mockAction = async (task, params)=>{
9251
9048
  ".png"
9252
9049
  ].includes(ext)) throw {
9253
9050
  code: 414,
9254
- message: `图片格式不支持:${fileName}。百家号仅支持 jpg、png 格式,请转换后重试。`,
9051
+ message: "图片格式不支持,百家号仅支持 jpg、png 格式,请转换后重试。",
9255
9052
  data: ""
9256
9053
  };
9257
9054
  const image = await (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.downloadImage)(url, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(tmpCachePath, fileName));
@@ -12535,7 +12332,7 @@ const douyinGetVerifyQrCode = async (task, params)=>{
12535
12332
  });
12536
12333
  const qrData = qrCodeResponse?.data;
12537
12334
  task.logger.info(`获取二维码响应: error_code=${qrData?.error_code}, message=${qrCodeResponse?.message}`);
12538
- if (qrData?.error_code !== 0) return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, USER_MESSAGE.QRCODE_FETCH_FAILED, "");
12335
+ if (qrData?.error_code !== 0) return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, `获取二维码失败: error_code=${qrData?.error_code}`, "");
12539
12336
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(0, "获取二维码成功", {
12540
12337
  qrcode: qrData.qrcode,
12541
12338
  token: qrData.token,
@@ -12550,7 +12347,7 @@ const douyinGetVerifyQrCode = async (task, params)=>{
12550
12347
  } catch (err) {
12551
12348
  const msg = err instanceof Error ? err.message : String(err);
12552
12349
  task.logger.warn(`[douyinGetVerifyQrCode] 获取二维码失败: ${msg}`);
12553
- return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(500, USER_MESSAGE.QRCODE_FETCH_FAILED, "");
12350
+ return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(500, `获取二维码失败: ${msg}`, "");
12554
12351
  }
12555
12352
  };
12556
12353
  const DouyinGetWorkListParamsSchema = ActionCommonParamsSchema.extend({
@@ -13865,10 +13662,18 @@ const mock_mockAction = async (task, params)=>{
13865
13662
  });
13866
13663
  } catch (error) {
13867
13664
  const handledError = Http.handleApiError(error);
13868
- const classified = classifyPublishError(handledError);
13869
- if (classified) {
13870
- const message = `${classified.userMessage}${task.debug ? ` ${http.proxyInfo}` : ""}`;
13871
- task.logger.error(`[douyinPublish] ${classified.category},直接返回: ${handledError.message} (code=${handledError.code})`, stringifyError(handledError));
13665
+ const isProxyOrNetworkError = [
13666
+ 599,
13667
+ 500,
13668
+ 502,
13669
+ 503,
13670
+ 504
13671
+ ].includes(handledError.code);
13672
+ if (isProxyOrNetworkError) {
13673
+ const isProxyRequest = handledError.extra?.isProxyRequest === true;
13674
+ const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
13675
+ const message = `图文发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
13676
+ task.logger.error(`[douyinPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
13872
13677
  await updateTaskState?.({
13873
13678
  state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
13874
13679
  error: message
@@ -15586,7 +15391,7 @@ async function getDouyinData(_task, params) {
15586
15391
  }
15587
15392
  const errMsg = error instanceof Error ? error.message : String(error);
15588
15393
  _task.logger.error(`抖音账号数据获取失败: ${errMsg}`);
15589
- return types_errorResponse(USER_MESSAGE.DOUYIN_ACCOUNT_FETCH_FAILED);
15394
+ return types_errorResponse(errMsg || "抖音账号数据获取失败");
15590
15395
  }
15591
15396
  }
15592
15397
  async function getShipinhaoData(_task, params) {
@@ -15717,7 +15522,7 @@ async function getShipinhaoData(_task, params) {
15717
15522
  }
15718
15523
  const errMsg = error instanceof Error ? error.message : String(error);
15719
15524
  _task.logger.error(`视频号账号数据获取失败: ${errMsg}`);
15720
- return types_errorResponse(USER_MESSAGE.SHIPINHAO_ACCOUNT_FETCH_FAILED);
15525
+ return types_errorResponse(errMsg || "视频号账号数据获取失败");
15721
15526
  }
15722
15527
  }
15723
15528
  async function getToutiaoData(_task, params) {
@@ -16156,9 +15961,7 @@ async function handleBaijiahaoData(_task, params) {
16156
15961
  } : null
16157
15962
  }, "百家号文章数据获取成功");
16158
15963
  } catch (error) {
16159
- const errMsg = error instanceof Error ? error.message : String(error);
16160
- _task.logger.error(`百家号文章数据获取失败: ${errMsg}`);
16161
- return searchPublishInfo_types_errorResponse(USER_MESSAGE.BJH_POST_FETCH_FAILED);
15964
+ return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "百家号文章数据获取失败");
16162
15965
  }
16163
15966
  }
16164
15967
  async function handleDouyinData(_task, params) {
@@ -16253,9 +16056,7 @@ async function handleDouyinData(_task, params) {
16253
16056
  } : null
16254
16057
  }, "抖音数据获取成功");
16255
16058
  } catch (error) {
16256
- const errMsg = error instanceof Error ? error.message : String(error);
16257
- _task.logger.error(`抖音作品数据获取失败: ${errMsg}`);
16258
- return searchPublishInfo_types_errorResponse(USER_MESSAGE.DOUYIN_POST_FETCH_FAILED);
16059
+ return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "抖音数据获取失败");
16259
16060
  }
16260
16061
  }
16261
16062
  async function handleShipinhaoData(_task, params) {
@@ -16420,9 +16221,8 @@ async function handleShipinhaoData(_task, params) {
16420
16221
  }, "视频号数据获取成功");
16421
16222
  } catch (error) {
16422
16223
  const errMsg = error instanceof Error ? error.message : String(error);
16423
- _task.logger.error(`视频号作品数据获取失败: ${errMsg}`);
16424
16224
  if (errMsg.startsWith("AUTH_ERROR:")) return searchPublishInfo_types_errorResponse("视频号数据获取失败,请检查账号状态", 414);
16425
- return searchPublishInfo_types_errorResponse(USER_MESSAGE.SHIPINHAO_POST_FETCH_FAILED);
16225
+ return searchPublishInfo_types_errorResponse(errMsg || "视频号数据获取失败");
16426
16226
  }
16427
16227
  }
16428
16228
  async function handleToutiaoData(_task, params) {
@@ -16507,9 +16307,7 @@ async function handleToutiaoData(_task, params) {
16507
16307
  } : null
16508
16308
  }, "头条号文章文章获取成功");
16509
16309
  } catch (error) {
16510
- const errMsg = error instanceof Error ? error.message : String(error);
16511
- _task.logger.error(`头条号文章数据获取失败: ${errMsg}`);
16512
- return searchPublishInfo_types_errorResponse(USER_MESSAGE.TT_POST_FETCH_FAILED);
16310
+ return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "头条号文章数据获取失败");
16513
16311
  }
16514
16312
  }
16515
16313
  async function handleWeixinData(_task, params) {
@@ -18728,7 +18526,7 @@ async function publishDynamic(cookies, uin, fingerPrintDeviceId, aId, proxyHttp,
18728
18526
  name: params.music.name,
18729
18527
  artist: params.music.authorName,
18730
18528
  mediaStreamingUrl: params.music.url,
18731
- docType: params.music.raw.playableInfo.type
18529
+ docType: 2 === params.music.raw.bgmSource ? 0 : 1
18732
18530
  },
18733
18531
  groupId: params.music.id,
18734
18532
  hasBgm: 1,
@@ -18884,10 +18682,18 @@ const shipinhaoPublish_mock_mockAction = async (task, params)=>{
18884
18682
  });
18885
18683
  } catch (error) {
18886
18684
  const handledError = Http.handleApiError(error);
18887
- const classified = classifyPublishError(handledError);
18888
- if (classified) {
18889
- const message = `${classified.userMessage}${task.debug ? ` ${http.proxyInfo}` : ""}`;
18890
- task.logger.error(`[shipinhaoPublish] ${classified.category},直接返回: ${handledError.message} (code=${handledError.code})`, stringifyError(handledError));
18685
+ const isProxyOrNetworkError = [
18686
+ 599,
18687
+ 500,
18688
+ 502,
18689
+ 503,
18690
+ 504
18691
+ ].includes(handledError.code);
18692
+ if (isProxyOrNetworkError) {
18693
+ const isProxyRequest = handledError.extra?.isProxyRequest === true;
18694
+ const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
18695
+ const message = `图文发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
18696
+ task.logger.error(`[shipinhaoPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
18891
18697
  await updateTaskState?.({
18892
18698
  state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
18893
18699
  error: message
@@ -19719,8 +19525,7 @@ const shipinhaoSendMsg = async (_task, params)=>{
19719
19525
  imageBuffer = Buffer.from(await __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].promises.readFile(filePath));
19720
19526
  }
19721
19527
  } catch (err) {
19722
- _task.logger.error(`读取图片失败: ${err instanceof Error ? err.message : String(err)}`);
19723
- return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, USER_MESSAGE.IMAGE_UPLOAD_FAILED, void 0);
19528
+ return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, `读取图片失败: ${err instanceof Error ? err.message : String(err)}`, void 0);
19724
19529
  }
19725
19530
  const md5 = (0, __WEBPACK_EXTERNAL_MODULE_node_crypto_9ba42079__.createHash)("md5").update(imageBuffer).digest("hex");
19726
19531
  const timestamp = Date.now().toString();
@@ -22231,10 +22036,18 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
22231
22036
  });
22232
22037
  } catch (error) {
22233
22038
  const handledError = Http.handleApiError(error);
22234
- const classified = classifyPublishError(handledError);
22235
- if (classified) {
22236
- const message = `${classified.userMessage}${task.debug ? ` ${http.proxyInfo}` : ""}`;
22237
- task.logger.error(`[weixinPublish] ${classified.category},直接返回: ${handledError.message} (code=${handledError.code})`, stringifyError(handledError));
22039
+ const isProxyOrNetworkError = [
22040
+ 599,
22041
+ 500,
22042
+ 502,
22043
+ 503,
22044
+ 504
22045
+ ].includes(handledError.code);
22046
+ if (isProxyOrNetworkError) {
22047
+ const isProxyRequest = handledError.extra?.isProxyRequest === true;
22048
+ const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
22049
+ const message = `文章发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
22050
+ task.logger.error(`[weixinPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
22238
22051
  await updateTaskState?.({
22239
22052
  state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
22240
22053
  error: message
@@ -23702,7 +23515,6 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
23702
23515
  });
23703
23516
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(data, message);
23704
23517
  }
23705
- task.logger.info(`[xiaohongshuPublish] publishData: ${JSON.stringify(publishData)} `);
23706
23518
  let publishResult;
23707
23519
  try {
23708
23520
  publishResult = await proxyHttp.api({
@@ -23713,15 +23525,23 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
23713
23525
  defaultErrorMsg: "文章发布异常,请稍后重试。"
23714
23526
  }, {
23715
23527
  retries: 2,
23716
- retryDelay: 3000,
23717
- timeout: 30000
23528
+ retryDelay: 500,
23529
+ timeout: 12000
23718
23530
  });
23719
23531
  } catch (error) {
23720
23532
  const handledError = Http.handleApiError(error);
23721
- const classified = classifyPublishError(handledError);
23722
- if (classified) {
23723
- const message = `${classified.userMessage}${task.debug ? ` ${http.proxyInfo}` : ""}`;
23724
- task.logger.error(`[xiaohongshuPublish] ${classified.category},直接返回: ${handledError.message} (code=${handledError.code})`, stringifyError(handledError));
23533
+ const isProxyOrNetworkError = [
23534
+ 599,
23535
+ 500,
23536
+ 502,
23537
+ 503,
23538
+ 504
23539
+ ].includes(handledError.code);
23540
+ if (isProxyOrNetworkError) {
23541
+ const isProxyRequest = handledError.extra?.isProxyRequest === true;
23542
+ const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
23543
+ const message = `文章发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
23544
+ task.logger.error(`[xiaohongshuPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
23725
23545
  await updateTaskState?.({
23726
23546
  state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
23727
23547
  error: message
@@ -25417,14 +25237,6 @@ class Action {
25417
25237
  this.task = task;
25418
25238
  this.task.logger.info(`当前包版本:Share=>${__WEBPACK_EXTERNAL_MODULE__iflyrpa_share_package_json_58ae5f06__["default"].version} Action=>${package_namespaceObject.i8}`);
25419
25239
  }
25420
- getActionVersionMarker() {
25421
- return {
25422
- version: package_namespaceObject.i8,
25423
- shareVersion: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_package_json_58ae5f06__["default"].version,
25424
- marker: `Action_${package_namespaceObject.i8}_${__WEBPACK_EXTERNAL_MODULE__iflyrpa_share_package_json_58ae5f06__["default"].version}`,
25425
- timestamp: new Date().toLocaleString()
25426
- };
25427
- }
25428
25240
  async bindTask(func, params) {
25429
25241
  let responseData;
25430
25242
  this.task.isBeta = this.task?.isFeatOn ? this.task?.isFeatOn(BetaFlag) : false;
@@ -25704,4 +25516,4 @@ var __webpack_exports__version = package_namespaceObject.i8;
25704
25516
  export { Action, ActionCommonParamsSchema, BaijiahaoPublishParamsSchema, BetaFlag, CollectionDetailSchema, ConfigDataSchema, DouyinCheckVerifyQrCodeParamsSchema, DouyinCreateCommentReplyParamsSchema, DouyinGetCollectionParamsSchema, DouyinGetCommentListParamsSchema, DouyinGetCommentReplyListParamsSchema, DouyinGetHotParamsSchema, DouyinGetLocationParamsSchema, DouyinGetMusicByCategoryParamsSchema, DouyinGetMusicCategoryParamsSchema, DouyinGetMusicParamsSchema, DouyinGetTopicsParamsSchema, DouyinGetVerifyQrCodeParamsSchema, DouyinGetWorkListParamsSchema, DouyinPublishParamsSchema, FetchArticlesDataSchema, FetchArticlesParamsSchema, Http, ProxyAgent, SearchAccountInfoParamsSchema, SessionCheckResultSchema, ShipinhaoCheckLinkValidateParamsSchema, ShipinhaoGetLocationParamsSchema, ShipinhaoGetMsgParamsSchema, ShipinhaoPublishParamsSchema, ShipinhaoSendMsgParamsSchema, ToutiaoPublishParamsSchema, UnreadCountSchema, WeixinPublishParamsSchema, WxBjhSessionParamsSchema, XhsWebSearchParamsSchema, XiaohongshuPublishParamsSchema, bjhConfigDataSchema, douyinConfigDataSchema, getFileState, reportLogger, rpaAction_Server_Mock, shipinhaoConfigDataSchema, ttConfigDataSchema, wxConfigDataSchema, xhsConfigDataSchema, __webpack_exports__version as version };
25705
25517
 
25706
25518
  //# sourceMappingURL=index.mjs.map
25707
- //# debugId=645e51de-1b6f-5dc7-ae78-210cebee5639
25519
+ //# debugId=8d0d46fe-3677-557b-887b-a9582ff0704b