@iflyrpa/actions 4.0.9-beta.4 → 4.0.9

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]="b0f81db0-8823-5f32-bb7c-d4b4fe6dea37")}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,124 +4352,8 @@ 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 {}
4355
+ var package_namespaceObject = {
4356
+ i8: "4.0.9"
4473
4357
  };
4474
4358
  const PROXY_CREDENTIALS = [
4475
4359
  {
@@ -4572,20 +4456,9 @@ async function ProxyAgent(task, addr, accountId, refresh) {
4572
4456
  url: "https://fetdev.iflysec.com/ip-pool/pool/eip/proxy",
4573
4457
  data: params
4574
4458
  }).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
4459
  throw {
4587
4460
  code: 414,
4588
- message: USER_MESSAGE.PROXY_UNAVAILABLE,
4461
+ message: `请求代理失败:${err.message}`,
4589
4462
  data: {}
4590
4463
  };
4591
4464
  });
@@ -4605,53 +4478,12 @@ async function ProxyAgent(task, addr, accountId, refresh) {
4605
4478
  } : null;
4606
4479
  return proxyAgent;
4607
4480
  }
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
4481
  class Http {
4650
4482
  static handleApiError(error) {
4651
4483
  if (error && "object" == typeof error && "code" in error && "message" in error) return error;
4652
4484
  return {
4653
4485
  code: 500,
4654
- message: USER_MESSAGE.SYSTEM_ERROR,
4486
+ message: error instanceof Error ? error.message : "未知错误",
4655
4487
  data: error
4656
4488
  };
4657
4489
  }
@@ -4706,18 +4538,6 @@ class Http {
4706
4538
  const verifyDecision = error.response?.headers?.["x-tt-verify-passport-decision"];
4707
4539
  if (verifyDecision) this.logger?.warn(`[403 验证决策] x-tt-verify-passport-decision: ${verifyDecision}`);
4708
4540
  }
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
4541
  if (error.response?.data) {
4722
4542
  if ("object" == typeof error.response.data) {
4723
4543
  const serverError = error.response.data;
@@ -4748,17 +4568,11 @@ class Http {
4748
4568
  _message = "DNS 查询超时,请稍后重试!";
4749
4569
  break;
4750
4570
  case "ERR_BAD_REQUEST":
4751
- {
4752
- const status = error.response?.status;
4753
- _message = status && HTTP_STATUS_MESSAGE[status] || `请求失败,状态码${status ?? "unknown"}!`;
4754
- break;
4755
- }
4571
+ _message = "请求出现错误,请检查请求参数!";
4572
+ break;
4756
4573
  case "ERR_BAD_RESPONSE":
4757
- {
4758
- const status = error.response?.status;
4759
- _message = status && HTTP_STATUS_MESSAGE[status] || `服务器响应异常 (${status ?? "unknown"}),请稍后重试!`;
4760
- break;
4761
- }
4574
+ _message = `服务器响应异常 (${error.response?.status ?? "unknown"}),请稍后重试!`;
4575
+ break;
4762
4576
  case "ERR_CANCELED":
4763
4577
  errorResponse.code = 414;
4764
4578
  _message = "请求连接超时,请稍候重试!";
@@ -4769,14 +4583,11 @@ class Http {
4769
4583
  }
4770
4584
  break;
4771
4585
  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
- }
4586
+ this.logger?.debug(`未处理的网络错误代码: ${error.code} ${error.message}`, {
4587
+ errorString: stringifyError(error)
4588
+ });
4589
+ _message = `网络错误: ${error.message}`;
4590
+ break;
4780
4591
  }
4781
4592
  }
4782
4593
  if (error.code && !error.response?.data) errorResponse.message = _message || errorResponse.message;
@@ -4786,18 +4597,6 @@ class Http {
4786
4597
  errorResponse.message = message;
4787
4598
  }
4788
4599
  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
4600
  throw errorResponse;
4802
4601
  });
4803
4602
  }
@@ -5565,7 +5364,7 @@ const NUMBER_FORMAT_RANGES = {
5565
5364
  Number.MAX_VALUE
5566
5365
  ]
5567
5366
  };
5568
- function util_pick(schema, mask) {
5367
+ function pick(schema, mask) {
5569
5368
  const currDef = schema._zod.def;
5570
5369
  const def = mergeDefs(schema._zod.def, {
5571
5370
  get shape () {
@@ -8546,7 +8345,7 @@ const ZodObject = /*@__PURE__*/ $constructor("ZodObject", (inst, def)=>{
8546
8345
  inst.extend = (incoming)=>extend(inst, incoming);
8547
8346
  inst.safeExtend = (incoming)=>safeExtend(inst, incoming);
8548
8347
  inst.merge = (other)=>merge(inst, other);
8549
- inst.pick = (mask)=>util_pick(inst, mask);
8348
+ inst.pick = (mask)=>pick(inst, mask);
8550
8349
  inst.omit = (mask)=>omit(inst, mask);
8551
8350
  inst.partial = (...args)=>partial(ZodOptional, inst, args[0]);
8552
8351
  inst.required = (...args)=>required(ZodNonOptional, inst, args[0]);
@@ -9251,7 +9050,7 @@ const mockAction = async (task, params)=>{
9251
9050
  ".png"
9252
9051
  ].includes(ext)) throw {
9253
9052
  code: 414,
9254
- message: `图片格式不支持:${fileName}。百家号仅支持 jpg、png 格式,请转换后重试。`,
9053
+ message: "图片格式不支持,百家号仅支持 jpg、png 格式,请转换后重试。",
9255
9054
  data: ""
9256
9055
  };
9257
9056
  const image = await (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.downloadImage)(url, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(tmpCachePath, fileName));
@@ -12535,7 +12334,7 @@ const douyinGetVerifyQrCode = async (task, params)=>{
12535
12334
  });
12536
12335
  const qrData = qrCodeResponse?.data;
12537
12336
  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, "");
12337
+ if (qrData?.error_code !== 0) return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, `获取二维码失败: error_code=${qrData?.error_code}`, "");
12539
12338
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(0, "获取二维码成功", {
12540
12339
  qrcode: qrData.qrcode,
12541
12340
  token: qrData.token,
@@ -12550,7 +12349,7 @@ const douyinGetVerifyQrCode = async (task, params)=>{
12550
12349
  } catch (err) {
12551
12350
  const msg = err instanceof Error ? err.message : String(err);
12552
12351
  task.logger.warn(`[douyinGetVerifyQrCode] 获取二维码失败: ${msg}`);
12553
- return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(500, USER_MESSAGE.QRCODE_FETCH_FAILED, "");
12352
+ return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(500, `获取二维码失败: ${msg}`, "");
12554
12353
  }
12555
12354
  };
12556
12355
  const DouyinGetWorkListParamsSchema = ActionCommonParamsSchema.extend({
@@ -13865,10 +13664,18 @@ const mock_mockAction = async (task, params)=>{
13865
13664
  });
13866
13665
  } catch (error) {
13867
13666
  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));
13667
+ const isProxyOrNetworkError = [
13668
+ 599,
13669
+ 500,
13670
+ 502,
13671
+ 503,
13672
+ 504
13673
+ ].includes(handledError.code);
13674
+ if (isProxyOrNetworkError) {
13675
+ const isProxyRequest = handledError.extra?.isProxyRequest === true;
13676
+ const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
13677
+ const message = `图文发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
13678
+ task.logger.error(`[douyinPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
13872
13679
  await updateTaskState?.({
13873
13680
  state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
13874
13681
  error: message
@@ -15586,7 +15393,7 @@ async function getDouyinData(_task, params) {
15586
15393
  }
15587
15394
  const errMsg = error instanceof Error ? error.message : String(error);
15588
15395
  _task.logger.error(`抖音账号数据获取失败: ${errMsg}`);
15589
- return types_errorResponse(USER_MESSAGE.DOUYIN_ACCOUNT_FETCH_FAILED);
15396
+ return types_errorResponse(errMsg || "抖音账号数据获取失败");
15590
15397
  }
15591
15398
  }
15592
15399
  async function getShipinhaoData(_task, params) {
@@ -15717,7 +15524,7 @@ async function getShipinhaoData(_task, params) {
15717
15524
  }
15718
15525
  const errMsg = error instanceof Error ? error.message : String(error);
15719
15526
  _task.logger.error(`视频号账号数据获取失败: ${errMsg}`);
15720
- return types_errorResponse(USER_MESSAGE.SHIPINHAO_ACCOUNT_FETCH_FAILED);
15527
+ return types_errorResponse(errMsg || "视频号账号数据获取失败");
15721
15528
  }
15722
15529
  }
15723
15530
  async function getToutiaoData(_task, params) {
@@ -16156,9 +15963,7 @@ async function handleBaijiahaoData(_task, params) {
16156
15963
  } : null
16157
15964
  }, "百家号文章数据获取成功");
16158
15965
  } 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);
15966
+ return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "百家号文章数据获取失败");
16162
15967
  }
16163
15968
  }
16164
15969
  async function handleDouyinData(_task, params) {
@@ -16253,9 +16058,7 @@ async function handleDouyinData(_task, params) {
16253
16058
  } : null
16254
16059
  }, "抖音数据获取成功");
16255
16060
  } 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);
16061
+ return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "抖音数据获取失败");
16259
16062
  }
16260
16063
  }
16261
16064
  async function handleShipinhaoData(_task, params) {
@@ -16420,9 +16223,8 @@ async function handleShipinhaoData(_task, params) {
16420
16223
  }, "视频号数据获取成功");
16421
16224
  } catch (error) {
16422
16225
  const errMsg = error instanceof Error ? error.message : String(error);
16423
- _task.logger.error(`视频号作品数据获取失败: ${errMsg}`);
16424
16226
  if (errMsg.startsWith("AUTH_ERROR:")) return searchPublishInfo_types_errorResponse("视频号数据获取失败,请检查账号状态", 414);
16425
- return searchPublishInfo_types_errorResponse(USER_MESSAGE.SHIPINHAO_POST_FETCH_FAILED);
16227
+ return searchPublishInfo_types_errorResponse(errMsg || "视频号数据获取失败");
16426
16228
  }
16427
16229
  }
16428
16230
  async function handleToutiaoData(_task, params) {
@@ -16507,9 +16309,7 @@ async function handleToutiaoData(_task, params) {
16507
16309
  } : null
16508
16310
  }, "头条号文章文章获取成功");
16509
16311
  } 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);
16312
+ return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "头条号文章数据获取失败");
16513
16313
  }
16514
16314
  }
16515
16315
  async function handleWeixinData(_task, params) {
@@ -18728,7 +18528,7 @@ async function publishDynamic(cookies, uin, fingerPrintDeviceId, aId, proxyHttp,
18728
18528
  name: params.music.name,
18729
18529
  artist: params.music.authorName,
18730
18530
  mediaStreamingUrl: params.music.url,
18731
- docType: params.music.raw.playableInfo.type
18531
+ docType: 2 === params.music.raw.bgmSource ? 0 : 1
18732
18532
  },
18733
18533
  groupId: params.music.id,
18734
18534
  hasBgm: 1,
@@ -18884,10 +18684,18 @@ const shipinhaoPublish_mock_mockAction = async (task, params)=>{
18884
18684
  });
18885
18685
  } catch (error) {
18886
18686
  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));
18687
+ const isProxyOrNetworkError = [
18688
+ 599,
18689
+ 500,
18690
+ 502,
18691
+ 503,
18692
+ 504
18693
+ ].includes(handledError.code);
18694
+ if (isProxyOrNetworkError) {
18695
+ const isProxyRequest = handledError.extra?.isProxyRequest === true;
18696
+ const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
18697
+ const message = `图文发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
18698
+ task.logger.error(`[shipinhaoPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
18891
18699
  await updateTaskState?.({
18892
18700
  state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
18893
18701
  error: message
@@ -19719,8 +19527,7 @@ const shipinhaoSendMsg = async (_task, params)=>{
19719
19527
  imageBuffer = Buffer.from(await __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].promises.readFile(filePath));
19720
19528
  }
19721
19529
  } 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);
19530
+ return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, `读取图片失败: ${err instanceof Error ? err.message : String(err)}`, void 0);
19724
19531
  }
19725
19532
  const md5 = (0, __WEBPACK_EXTERNAL_MODULE_node_crypto_9ba42079__.createHash)("md5").update(imageBuffer).digest("hex");
19726
19533
  const timestamp = Date.now().toString();
@@ -22231,10 +22038,18 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
22231
22038
  });
22232
22039
  } catch (error) {
22233
22040
  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));
22041
+ const isProxyOrNetworkError = [
22042
+ 599,
22043
+ 500,
22044
+ 502,
22045
+ 503,
22046
+ 504
22047
+ ].includes(handledError.code);
22048
+ if (isProxyOrNetworkError) {
22049
+ const isProxyRequest = handledError.extra?.isProxyRequest === true;
22050
+ const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
22051
+ const message = `文章发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
22052
+ task.logger.error(`[weixinPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
22238
22053
  await updateTaskState?.({
22239
22054
  state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
22240
22055
  error: message
@@ -23702,7 +23517,6 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
23702
23517
  });
23703
23518
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(data, message);
23704
23519
  }
23705
- task.logger.info(`[xiaohongshuPublish] publishData: ${JSON.stringify(publishData)} `);
23706
23520
  let publishResult;
23707
23521
  try {
23708
23522
  publishResult = await proxyHttp.api({
@@ -23713,15 +23527,23 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
23713
23527
  defaultErrorMsg: "文章发布异常,请稍后重试。"
23714
23528
  }, {
23715
23529
  retries: 2,
23716
- retryDelay: 3000,
23717
- timeout: 30000
23530
+ retryDelay: 500,
23531
+ timeout: 12000
23718
23532
  });
23719
23533
  } catch (error) {
23720
23534
  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));
23535
+ const isProxyOrNetworkError = [
23536
+ 599,
23537
+ 500,
23538
+ 502,
23539
+ 503,
23540
+ 504
23541
+ ].includes(handledError.code);
23542
+ if (isProxyOrNetworkError) {
23543
+ const isProxyRequest = handledError.extra?.isProxyRequest === true;
23544
+ const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
23545
+ const message = `文章发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
23546
+ task.logger.error(`[xiaohongshuPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
23725
23547
  await updateTaskState?.({
23726
23548
  state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
23727
23549
  error: message
@@ -25417,14 +25239,6 @@ class Action {
25417
25239
  this.task = task;
25418
25240
  this.task.logger.info(`当前包版本:Share=>${__WEBPACK_EXTERNAL_MODULE__iflyrpa_share_package_json_58ae5f06__["default"].version} Action=>${package_namespaceObject.i8}`);
25419
25241
  }
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
25242
  async bindTask(func, params) {
25429
25243
  let responseData;
25430
25244
  this.task.isBeta = this.task?.isFeatOn ? this.task?.isFeatOn(BetaFlag) : false;
@@ -25704,4 +25518,4 @@ var __webpack_exports__version = package_namespaceObject.i8;
25704
25518
  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
25519
 
25706
25520
  //# sourceMappingURL=index.mjs.map
25707
- //# debugId=645e51de-1b6f-5dc7-ae78-210cebee5639
25521
+ //# debugId=b0f81db0-8823-5f32-bb7c-d4b4fe6dea37