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