@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.
@@ -48,9 +48,9 @@ export declare const FetchArticlesParamsSchema: z.ZodObject<{
48
48
  status: z.ZodOptional<z.ZodNumber>;
49
49
  includeAccount: z.ZodOptional<z.ZodBoolean>;
50
50
  postType: z.ZodOptional<z.ZodEnum<{
51
- all: "all";
52
51
  article: "article";
53
52
  video: "video";
53
+ all: "all";
54
54
  }>>;
55
55
  }, z.core.$strip>;
56
56
  export type FetchArticlesParams = z.infer<typeof FetchArticlesParamsSchema>;
package/dist/bundle.js CHANGED
@@ -1,4 +1,6 @@
1
1
  /*! For license information please see bundle.js.LICENSE.txt */
2
+
3
+ !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]="f52debe4-5003-5250-b1ab-d065564e54d5")}catch(e){}}();
2
4
  var __webpack_modules__ = {
3
5
  "../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js": function(__unused_webpack_module, exports1, __webpack_require__) {
4
6
  "use strict";
@@ -12490,7 +12492,7 @@ var __webpack_exports__ = {};
12490
12492
  var package_namespaceObject = {
12491
12493
  i8: "0.1.2"
12492
12494
  };
12493
- var package_namespaceObject_0 = JSON.parse('{"i8":"4.0.9-beta.3"}');
12495
+ var package_namespaceObject_0 = JSON.parse('{"i8":"4.0.9-beta.5"}');
12494
12496
  const external_node_fs_namespaceObject = require("node:fs");
12495
12497
  var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
12496
12498
  const external_node_http_namespaceObject = require("node:http");
@@ -12936,7 +12938,7 @@ var __webpack_exports__ = {};
12936
12938
  Number.MAX_VALUE
12937
12939
  ]
12938
12940
  };
12939
- function dist_pick(schema, mask) {
12941
+ function pick(schema, mask) {
12940
12942
  const currDef = schema._zod.def;
12941
12943
  const def = mergeDefs(schema._zod.def, {
12942
12944
  get shape () {
@@ -15790,7 +15792,7 @@ var __webpack_exports__ = {};
15790
15792
  inst.extend = (incoming)=>extend(inst, incoming);
15791
15793
  inst.safeExtend = (incoming)=>safeExtend(inst, incoming);
15792
15794
  inst.merge = (other)=>dist_merge(inst, other);
15793
- inst.pick = (mask)=>dist_pick(inst, mask);
15795
+ inst.pick = (mask)=>pick(inst, mask);
15794
15796
  inst.omit = (mask)=>omit(inst, mask);
15795
15797
  inst.partial = (...args)=>dist_partial(ZodOptional, inst, args[0]);
15796
15798
  inst.required = (...args)=>required(ZodNonOptional, inst, args[0]);
@@ -27037,124 +27039,6 @@ var __webpack_exports__ = {};
27037
27039
  axios.HttpStatusCode = helpers_HttpStatusCode;
27038
27040
  axios.default = axios;
27039
27041
  const lib_axios = axios;
27040
- const USER_MESSAGE = {
27041
- PROXY_UNAVAILABLE: "代理暂时不可用,请稍后重试或使用本地IP",
27042
- NETWORK_ERROR: "网络异常,请稍后重试",
27043
- SYSTEM_ERROR: "系统异常,请稍后重试或联系客服",
27044
- PUBLISH_NETWORK: "发布失败,网络不稳定,请稍后重试",
27045
- DOUYIN_ACCOUNT_FETCH_FAILED: "抖音数据获取失败,请稍后重试",
27046
- SHIPINHAO_ACCOUNT_FETCH_FAILED: "视频号数据获取失败,请稍后重试",
27047
- DOUYIN_POST_FETCH_FAILED: "抖音作品数据获取失败,请稍后重试",
27048
- SHIPINHAO_POST_FETCH_FAILED: "视频号作品数据获取失败,请稍后重试",
27049
- BJH_POST_FETCH_FAILED: "百家号作品数据获取失败,请稍后重试",
27050
- TT_POST_FETCH_FAILED: "头条号作品数据获取失败,请稍后重试",
27051
- QRCODE_FETCH_FAILED: "认证二维码获取失败,请稍后重试",
27052
- IMAGE_UPLOAD_FAILED: "图片上传失败,请稍后重试或联系客服"
27053
- };
27054
- const NETWORK_CODES = [
27055
- 500,
27056
- 502,
27057
- 503,
27058
- 504
27059
- ];
27060
- function classifyPublishError(handledError) {
27061
- const { code } = handledError;
27062
- const isProxyRequest = handledError.extra?.isProxyRequest === true;
27063
- if (!NETWORK_CODES.includes(code) && 599 !== code) return null;
27064
- const category = 599 === code || isProxyRequest ? "代理错误" : "网络错误";
27065
- return {
27066
- category,
27067
- userMessage: USER_MESSAGE.PUBLISH_NETWORK
27068
- };
27069
- }
27070
- const RPA_ERROR_WEBHOOK_URL = "https://open.xfchat.iflytek.com/open-apis/bot/v2/hook/d202c0dc-5af5-40bc-83ed-abc677caa4a5";
27071
- const ALARM_THROTTLE_MS = 60000;
27072
- const lastSentAt = new Map();
27073
- const postFeishuWebhook = (webhookUrl, payload)=>lib_axios.post(webhookUrl, payload, {
27074
- headers: {
27075
- "Content-Type": "application/json"
27076
- },
27077
- timeout: 10000
27078
- });
27079
- const buildFeishuPostMessage = (report)=>{
27080
- const content = [
27081
- [
27082
- {
27083
- tag: "text",
27084
- text: `平台:${report.platform || "未知平台"}`
27085
- }
27086
- ],
27087
- [
27088
- {
27089
- tag: "text",
27090
- text: `错误信息:${report.msg || "未知错误信息"}`
27091
- }
27092
- ],
27093
- [
27094
- {
27095
- tag: "text",
27096
- text: `错误类型:${report.errorType || "未知错误类型"}`
27097
- }
27098
- ],
27099
- [
27100
- {
27101
- tag: "text",
27102
- text: `阶段:${report.stage || "未知阶段"}`
27103
- }
27104
- ],
27105
- [
27106
- {
27107
- tag: "text",
27108
- text: `等级:${report.level}`
27109
- }
27110
- ],
27111
- [
27112
- {
27113
- tag: "text",
27114
- text: `来源:${report.source}`
27115
- }
27116
- ]
27117
- ];
27118
- if (void 0 !== report.code && null !== report.code) content.push([
27119
- {
27120
- tag: "text",
27121
- text: `接口错误码:${report.code}`
27122
- }
27123
- ]);
27124
- if (report.url) content.push([
27125
- {
27126
- tag: "text",
27127
- text: `地址:${report.url}`
27128
- }
27129
- ]);
27130
- if ("alarm" === report.level) content.push([
27131
- {
27132
- tag: "at",
27133
- user_id: "all"
27134
- }
27135
- ]);
27136
- return {
27137
- msg_type: "post",
27138
- content: {
27139
- post: {
27140
- zh_cn: {
27141
- title: report.title || "RPA异常",
27142
- content
27143
- }
27144
- }
27145
- }
27146
- };
27147
- };
27148
- const reportFeishuAlarm = (report)=>{
27149
- try {
27150
- const key = `${report.platform}|${report.source}|${report.errorType}|${report.code ?? ""}`;
27151
- const now = Date.now();
27152
- const last = lastSentAt.get(key);
27153
- if (last && now - last < ALARM_THROTTLE_MS) return;
27154
- lastSentAt.set(key, now);
27155
- postFeishuWebhook(RPA_ERROR_WEBHOOK_URL, buildFeishuPostMessage(report)).catch(()=>{});
27156
- } catch {}
27157
- };
27158
27042
  var dist = __webpack_require__("../../node_modules/.pnpm/socks-proxy-agent@8.0.4/node_modules/socks-proxy-agent/dist/index.js");
27159
27043
  const PROXY_CREDENTIALS = [
27160
27044
  {
@@ -27257,20 +27141,9 @@ var __webpack_exports__ = {};
27257
27141
  url: "https://fetdev.iflysec.com/ip-pool/pool/eip/proxy",
27258
27142
  data: params
27259
27143
  }).catch((err)=>{
27260
- reportFeishuAlarm({
27261
- level: "alarm",
27262
- platform: "ip-pool",
27263
- source: "proxy",
27264
- stage: "POST /ip-pool/pool/eip/proxy",
27265
- errorType: "PROXY_REQUEST_FAILED",
27266
- code: err?.code,
27267
- msg: `请求代理失败:${err.message},区域:${addr ?? "-"},AccountId:${accountId ?? "-"}`,
27268
- url: "https://fetdev.iflysec.com/ip-pool/pool/eip/proxy",
27269
- title: "代理异常"
27270
- });
27271
27144
  throw {
27272
27145
  code: 414,
27273
- message: USER_MESSAGE.PROXY_UNAVAILABLE,
27146
+ message: `请求代理失败:${err.message}`,
27274
27147
  data: {}
27275
27148
  };
27276
27149
  });
@@ -27290,53 +27163,12 @@ var __webpack_exports__ = {};
27290
27163
  } : null;
27291
27164
  return proxyAgent;
27292
27165
  }
27293
- const ALARM_STATUS = new Set([
27294
- 401,
27295
- 403,
27296
- 429,
27297
- 461,
27298
- 471
27299
- ]);
27300
- const HTTP_STATUS_MESSAGE = {
27301
- 400: "请求参数错误,请检查参数格式是否正确!",
27302
- 401: "登录状态已失效,请重新登录后重试!",
27303
- 403: "没有访问权限,账号可能受限或签名已失效!",
27304
- 404: "请求的资源不存在,请检查接口地址!",
27305
- 405: "请求方法不被允许,请检查接口调用方式!",
27306
- 406: "服务端无法返回可接受的内容格式!",
27307
- 407: "代理需要身份验证,请检查代理配置!",
27308
- 408: "请求超时,请检查网络连接!",
27309
- 409: "请求冲突,资源状态已变更,请刷新后重试!",
27310
- 410: "请求的资源已被移除!",
27311
- 412: "请求前置条件不满足,请刷新后重试!",
27312
- 413: "提交内容过大,请压缩或分批后重试!",
27313
- 414: "请求地址过长,请检查参数!",
27314
- 415: "不支持的内容类型,请检查请求格式!",
27315
- 422: "请求内容校验失败,请检查参数内容!",
27316
- 423: "资源已被锁定,请稍后重试!",
27317
- 429: "请求过于频繁,请稍后重试!",
27318
- 431: "请求头过大,请清理 Cookie 后重试!",
27319
- 451: "内容不合规或因法律原因被拒绝!",
27320
- 461: "账号可能受限,请在网页上完成验证后重试!",
27321
- 471: "账号可能受限,请在网页上完成验证后重试!",
27322
- 500: "服务器内部错误,请稍后重试!",
27323
- 501: "服务端不支持该请求,请稍后重试!",
27324
- 502: "网关错误,请稍后重试!",
27325
- 503: "服务暂时不可用,请稍后重试!",
27326
- 504: "网关超时,请稍后重试!",
27327
- 507: "服务端存储空间不足,请稍后重试!",
27328
- 509: "服务带宽超限,请稍后重试!",
27329
- 520: "服务端返回未知错误,请稍后重试!",
27330
- 521: "源站拒绝连接,请稍后重试!",
27331
- 522: "源站连接超时,请稍后重试!",
27332
- 524: "源站响应超时,请稍后重试!"
27333
- };
27334
27166
  class Http {
27335
27167
  static handleApiError(error) {
27336
27168
  if (error && "object" == typeof error && "code" in error && "message" in error) return error;
27337
27169
  return {
27338
27170
  code: 500,
27339
- message: USER_MESSAGE.SYSTEM_ERROR,
27171
+ message: error instanceof Error ? error.message : "未知错误",
27340
27172
  data: error
27341
27173
  };
27342
27174
  }
@@ -27391,18 +27223,6 @@ var __webpack_exports__ = {};
27391
27223
  const verifyDecision = error.response?.headers?.["x-tt-verify-passport-decision"];
27392
27224
  if (verifyDecision) this.logger?.warn(`[403 验证决策] x-tt-verify-passport-decision: ${verifyDecision}`);
27393
27225
  }
27394
- if (error.response?.status === 461 || error.response?.status === 471) {
27395
- const h = error.response?.headers ?? {};
27396
- const pick = (name)=>h[name] ?? h[name.toLowerCase()];
27397
- this.logger?.warn(`[${error.response.status} 风控验证] URL: ${error.config?.url} Verifytype: ${pick("Verifytype") ?? "-"} Verifyuuid: ${pick("Verifyuuid") ?? "-"} Verifybiz: ${pick("Verifybiz") ?? "-"}`);
27398
- this.logger?.warn(`[${error.response.status} 响应头] ${JSON.stringify(h)}`);
27399
- errorResponse.extra = {
27400
- ...errorResponse.extra,
27401
- verifyType: pick("Verifytype"),
27402
- verifyUuid: pick("Verifyuuid"),
27403
- verifyBiz: pick("Verifybiz")
27404
- };
27405
- }
27406
27226
  if (error.response?.data) {
27407
27227
  if ("object" == typeof error.response.data) {
27408
27228
  const serverError = error.response.data;
@@ -27433,17 +27253,11 @@ var __webpack_exports__ = {};
27433
27253
  _message = "DNS 查询超时,请稍后重试!";
27434
27254
  break;
27435
27255
  case "ERR_BAD_REQUEST":
27436
- {
27437
- const status = error.response?.status;
27438
- _message = status && HTTP_STATUS_MESSAGE[status] || `请求失败,状态码${status ?? "unknown"}!`;
27439
- break;
27440
- }
27256
+ _message = "请求出现错误,请检查请求参数!";
27257
+ break;
27441
27258
  case "ERR_BAD_RESPONSE":
27442
- {
27443
- const status = error.response?.status;
27444
- _message = status && HTTP_STATUS_MESSAGE[status] || `服务器响应异常 (${status ?? "unknown"}),请稍后重试!`;
27445
- break;
27446
- }
27259
+ _message = `服务器响应异常 (${error.response?.status ?? "unknown"}),请稍后重试!`;
27260
+ break;
27447
27261
  case "ERR_CANCELED":
27448
27262
  errorResponse.code = 414;
27449
27263
  _message = "请求连接超时,请稍候重试!";
@@ -27454,14 +27268,11 @@ var __webpack_exports__ = {};
27454
27268
  }
27455
27269
  break;
27456
27270
  default:
27457
- {
27458
- this.logger?.debug(`未处理的网络错误代码: ${error.code} ${error.message}`, {
27459
- errorString: stringifyError(error)
27460
- });
27461
- const status = error.response?.status;
27462
- _message = status && HTTP_STATUS_MESSAGE[status] || USER_MESSAGE.NETWORK_ERROR;
27463
- break;
27464
- }
27271
+ this.logger?.debug(`未处理的网络错误代码: ${error.code} ${error.message}`, {
27272
+ errorString: stringifyError(error)
27273
+ });
27274
+ _message = `网络错误: ${error.message}`;
27275
+ break;
27465
27276
  }
27466
27277
  }
27467
27278
  if (error.code && !error.response?.data) errorResponse.message = _message || errorResponse.message;
@@ -27471,18 +27282,6 @@ var __webpack_exports__ = {};
27471
27282
  errorResponse.message = message;
27472
27283
  }
27473
27284
  if (error.message.includes("Proxy connection ended")) errorResponse.message = "所在区域代理连接超时,请更换区域或稍后重试!";
27474
- const status = error.response?.status;
27475
- reportFeishuAlarm({
27476
- level: status && ALARM_STATUS.has(status) ? "alarm" : "warning",
27477
- platform: this.platform || "unknown",
27478
- source: "http",
27479
- stage: `${(error.config?.method || "get").toUpperCase()} ${error.config?.url || "-"}`,
27480
- errorType: status ? `HTTP_${status}` : error.code || "NETWORK_ERROR",
27481
- code: errorResponse.code,
27482
- msg: errorResponse.message,
27483
- url: error.config?.url,
27484
- title: "RPA接口异常"
27485
- });
27486
27285
  throw errorResponse;
27487
27286
  });
27488
27287
  }
@@ -32906,7 +32705,7 @@ var __webpack_exports__ = {};
32906
32705
  ".png"
32907
32706
  ].includes(ext)) throw {
32908
32707
  code: 414,
32909
- message: `图片格式不支持:${fileName}。百家号仅支持 jpg、png 格式,请转换后重试。`,
32708
+ message: "图片格式不支持,百家号仅支持 jpg、png 格式,请转换后重试。",
32910
32709
  data: ""
32911
32710
  };
32912
32711
  const image = await downloadImage(url, external_node_path_default().join(tmpCachePath, fileName));
@@ -36742,7 +36541,7 @@ var __webpack_exports__ = {};
36742
36541
  });
36743
36542
  const qrData = qrCodeResponse?.data;
36744
36543
  task.logger.info(`获取二维码响应: error_code=${qrData?.error_code}, message=${qrCodeResponse?.message}`);
36745
- if (qrData?.error_code !== 0) return utils_response(414, USER_MESSAGE.QRCODE_FETCH_FAILED, "");
36544
+ if (qrData?.error_code !== 0) return utils_response(414, `获取二维码失败: error_code=${qrData?.error_code}`, "");
36746
36545
  return utils_response(0, "获取二维码成功", {
36747
36546
  qrcode: qrData.qrcode,
36748
36547
  token: qrData.token,
@@ -36757,7 +36556,7 @@ var __webpack_exports__ = {};
36757
36556
  } catch (err) {
36758
36557
  const msg = err instanceof Error ? err.message : String(err);
36759
36558
  task.logger.warn(`[douyinGetVerifyQrCode] 获取二维码失败: ${msg}`);
36760
- return utils_response(500, USER_MESSAGE.QRCODE_FETCH_FAILED, "");
36559
+ return utils_response(500, `获取二维码失败: ${msg}`, "");
36761
36560
  }
36762
36561
  };
36763
36562
  const DouyinGetWorkListParamsSchema = ActionCommonParamsSchema.extend({
@@ -39011,10 +38810,18 @@ var __webpack_exports__ = {};
39011
38810
  });
39012
38811
  } catch (error) {
39013
38812
  const handledError = Http.handleApiError(error);
39014
- const classified = classifyPublishError(handledError);
39015
- if (classified) {
39016
- const message = `${classified.userMessage}${task.debug ? ` ${http.proxyInfo}` : ""}`;
39017
- task.logger.error(`[douyinPublish] ${classified.category},直接返回: ${handledError.message} (code=${handledError.code})`, stringifyError(handledError));
38813
+ const isProxyOrNetworkError = [
38814
+ 599,
38815
+ 500,
38816
+ 502,
38817
+ 503,
38818
+ 504
38819
+ ].includes(handledError.code);
38820
+ if (isProxyOrNetworkError) {
38821
+ const isProxyRequest = handledError.extra?.isProxyRequest === true;
38822
+ const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
38823
+ const message = `图文发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
38824
+ task.logger.error(`[douyinPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
39018
38825
  await updateTaskState?.({
39019
38826
  state: types_TaskState.FAILED,
39020
38827
  error: message
@@ -40732,7 +40539,7 @@ var __webpack_exports__ = {};
40732
40539
  }
40733
40540
  const errMsg = error instanceof Error ? error.message : String(error);
40734
40541
  _task.logger.error(`抖音账号数据获取失败: ${errMsg}`);
40735
- return types_errorResponse(USER_MESSAGE.DOUYIN_ACCOUNT_FETCH_FAILED);
40542
+ return types_errorResponse(errMsg || "抖音账号数据获取失败");
40736
40543
  }
40737
40544
  }
40738
40545
  async function getShipinhaoData(_task, params) {
@@ -40863,7 +40670,7 @@ var __webpack_exports__ = {};
40863
40670
  }
40864
40671
  const errMsg = error instanceof Error ? error.message : String(error);
40865
40672
  _task.logger.error(`视频号账号数据获取失败: ${errMsg}`);
40866
- return types_errorResponse(USER_MESSAGE.SHIPINHAO_ACCOUNT_FETCH_FAILED);
40673
+ return types_errorResponse(errMsg || "视频号账号数据获取失败");
40867
40674
  }
40868
40675
  }
40869
40676
  async function getToutiaoData(_task, params) {
@@ -41304,9 +41111,7 @@ var __webpack_exports__ = {};
41304
41111
  } : null
41305
41112
  }, "百家号文章数据获取成功");
41306
41113
  } catch (error) {
41307
- const errMsg = error instanceof Error ? error.message : String(error);
41308
- _task.logger.error(`百家号文章数据获取失败: ${errMsg}`);
41309
- return searchPublishInfo_types_errorResponse(USER_MESSAGE.BJH_POST_FETCH_FAILED);
41114
+ return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "百家号文章数据获取失败");
41310
41115
  }
41311
41116
  }
41312
41117
  async function handleDouyinData(_task, params) {
@@ -41401,9 +41206,7 @@ var __webpack_exports__ = {};
41401
41206
  } : null
41402
41207
  }, "抖音数据获取成功");
41403
41208
  } catch (error) {
41404
- const errMsg = error instanceof Error ? error.message : String(error);
41405
- _task.logger.error(`抖音作品数据获取失败: ${errMsg}`);
41406
- return searchPublishInfo_types_errorResponse(USER_MESSAGE.DOUYIN_POST_FETCH_FAILED);
41209
+ return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "抖音数据获取失败");
41407
41210
  }
41408
41211
  }
41409
41212
  async function handleShipinhaoData(_task, params) {
@@ -41568,9 +41371,8 @@ var __webpack_exports__ = {};
41568
41371
  }, "视频号数据获取成功");
41569
41372
  } catch (error) {
41570
41373
  const errMsg = error instanceof Error ? error.message : String(error);
41571
- _task.logger.error(`视频号作品数据获取失败: ${errMsg}`);
41572
41374
  if (errMsg.startsWith("AUTH_ERROR:")) return searchPublishInfo_types_errorResponse("视频号数据获取失败,请检查账号状态", 414);
41573
- return searchPublishInfo_types_errorResponse(USER_MESSAGE.SHIPINHAO_POST_FETCH_FAILED);
41375
+ return searchPublishInfo_types_errorResponse(errMsg || "视频号数据获取失败");
41574
41376
  }
41575
41377
  }
41576
41378
  async function handleToutiaoData(_task, params) {
@@ -41655,9 +41457,7 @@ var __webpack_exports__ = {};
41655
41457
  } : null
41656
41458
  }, "头条号文章文章获取成功");
41657
41459
  } catch (error) {
41658
- const errMsg = error instanceof Error ? error.message : String(error);
41659
- _task.logger.error(`头条号文章数据获取失败: ${errMsg}`);
41660
- return searchPublishInfo_types_errorResponse(USER_MESSAGE.TT_POST_FETCH_FAILED);
41460
+ return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "头条号文章数据获取失败");
41661
41461
  }
41662
41462
  }
41663
41463
  const external_node_vm_namespaceObject = require("node:vm");
@@ -43878,7 +43678,7 @@ var __webpack_exports__ = {};
43878
43678
  name: params.music.name,
43879
43679
  artist: params.music.authorName,
43880
43680
  mediaStreamingUrl: params.music.url,
43881
- docType: params.music.raw.playableInfo.type
43681
+ docType: 2 === params.music.raw.bgmSource ? 0 : 1
43882
43682
  },
43883
43683
  groupId: params.music.id,
43884
43684
  hasBgm: 1,
@@ -44034,10 +43834,18 @@ var __webpack_exports__ = {};
44034
43834
  });
44035
43835
  } catch (error) {
44036
43836
  const handledError = Http.handleApiError(error);
44037
- const classified = classifyPublishError(handledError);
44038
- if (classified) {
44039
- const message = `${classified.userMessage}${task.debug ? ` ${http.proxyInfo}` : ""}`;
44040
- task.logger.error(`[shipinhaoPublish] ${classified.category},直接返回: ${handledError.message} (code=${handledError.code})`, stringifyError(handledError));
43837
+ const isProxyOrNetworkError = [
43838
+ 599,
43839
+ 500,
43840
+ 502,
43841
+ 503,
43842
+ 504
43843
+ ].includes(handledError.code);
43844
+ if (isProxyOrNetworkError) {
43845
+ const isProxyRequest = handledError.extra?.isProxyRequest === true;
43846
+ const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
43847
+ const message = `图文发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
43848
+ task.logger.error(`[shipinhaoPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
44041
43849
  await updateTaskState?.({
44042
43850
  state: types_TaskState.FAILED,
44043
43851
  error: message
@@ -44869,8 +44677,7 @@ var __webpack_exports__ = {};
44869
44677
  imageBuffer = Buffer.from(await external_node_fs_default().promises.readFile(filePath));
44870
44678
  }
44871
44679
  } catch (err) {
44872
- _task.logger.error(`读取图片失败: ${err instanceof Error ? err.message : String(err)}`);
44873
- return utils_response(414, USER_MESSAGE.IMAGE_UPLOAD_FAILED, void 0);
44680
+ return utils_response(414, `读取图片失败: ${err instanceof Error ? err.message : String(err)}`, void 0);
44874
44681
  }
44875
44682
  const md5 = (0, external_node_crypto_namespaceObject.createHash)("md5").update(imageBuffer).digest("hex");
44876
44683
  const timestamp = Date.now().toString();
@@ -47381,10 +47188,18 @@ var __webpack_exports__ = {};
47381
47188
  });
47382
47189
  } catch (error) {
47383
47190
  const handledError = Http.handleApiError(error);
47384
- const classified = classifyPublishError(handledError);
47385
- if (classified) {
47386
- const message = `${classified.userMessage}${task.debug ? ` ${http.proxyInfo}` : ""}`;
47387
- task.logger.error(`[weixinPublish] ${classified.category},直接返回: ${handledError.message} (code=${handledError.code})`, stringifyError(handledError));
47191
+ const isProxyOrNetworkError = [
47192
+ 599,
47193
+ 500,
47194
+ 502,
47195
+ 503,
47196
+ 504
47197
+ ].includes(handledError.code);
47198
+ if (isProxyOrNetworkError) {
47199
+ const isProxyRequest = handledError.extra?.isProxyRequest === true;
47200
+ const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
47201
+ const message = `文章发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
47202
+ task.logger.error(`[weixinPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
47388
47203
  await updateTaskState?.({
47389
47204
  state: types_TaskState.FAILED,
47390
47205
  error: message
@@ -48852,7 +48667,6 @@ var __webpack_exports__ = {};
48852
48667
  });
48853
48668
  return success(data, message);
48854
48669
  }
48855
- task.logger.info(`[xiaohongshuPublish] publishData: ${JSON.stringify(publishData)} `);
48856
48670
  let publishResult;
48857
48671
  try {
48858
48672
  publishResult = await proxyHttp.api({
@@ -48863,15 +48677,23 @@ var __webpack_exports__ = {};
48863
48677
  defaultErrorMsg: "文章发布异常,请稍后重试。"
48864
48678
  }, {
48865
48679
  retries: 2,
48866
- retryDelay: 3000,
48867
- timeout: 30000
48680
+ retryDelay: 500,
48681
+ timeout: 12000
48868
48682
  });
48869
48683
  } catch (error) {
48870
48684
  const handledError = Http.handleApiError(error);
48871
- const classified = classifyPublishError(handledError);
48872
- if (classified) {
48873
- const message = `${classified.userMessage}${task.debug ? ` ${http.proxyInfo}` : ""}`;
48874
- task.logger.error(`[xiaohongshuPublish] ${classified.category},直接返回: ${handledError.message} (code=${handledError.code})`, stringifyError(handledError));
48685
+ const isProxyOrNetworkError = [
48686
+ 599,
48687
+ 500,
48688
+ 502,
48689
+ 503,
48690
+ 504
48691
+ ].includes(handledError.code);
48692
+ if (isProxyOrNetworkError) {
48693
+ const isProxyRequest = handledError.extra?.isProxyRequest === true;
48694
+ const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
48695
+ const message = `文章发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
48696
+ task.logger.error(`[xiaohongshuPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
48875
48697
  await updateTaskState?.({
48876
48698
  state: types_TaskState.FAILED,
48877
48699
  error: message
@@ -50567,14 +50389,6 @@ var __webpack_exports__ = {};
50567
50389
  this.task = task;
50568
50390
  this.task.logger.info(`当前包版本:Share=>${package_namespaceObject.i8} Action=>${package_namespaceObject_0.i8}`);
50569
50391
  }
50570
- getActionVersionMarker() {
50571
- return {
50572
- version: package_namespaceObject_0.i8,
50573
- shareVersion: package_namespaceObject.i8,
50574
- marker: `Action_${package_namespaceObject_0.i8}_${package_namespaceObject.i8}`,
50575
- timestamp: new Date().toLocaleString()
50576
- };
50577
- }
50578
50392
  async bindTask(func, params) {
50579
50393
  let responseData;
50580
50394
  this.task.isBeta = this.task?.isFeatOn ? this.task?.isFeatOn(BetaFlag) : false;
@@ -50857,4 +50671,5 @@ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_targe
50857
50671
  value: true
50858
50672
  });
50859
50673
 
50860
- //# sourceMappingURL=bundle.js.map
50674
+ //# sourceMappingURL=bundle.js.map
50675
+ //# debugId=f52debe4-5003-5250-b1ab-d065564e54d5