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