@iflyrpa/actions 4.0.9-beta.4 → 4.0.9-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/searchPublishInfo/index.d.ts +1 -1
- package/dist/bundle.js +77 -265
- package/dist/bundle.js.map +1 -1
- package/dist/index.d.ts +0 -14
- package/dist/index.js +77 -265
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +77 -265
- 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]="f52debe4-5003-5250-b1ab-d065564e54d5")}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,7 @@ var __webpack_exports__ = {};
|
|
|
12492
12492
|
var package_namespaceObject = {
|
|
12493
12493
|
i8: "0.1.2"
|
|
12494
12494
|
};
|
|
12495
|
-
var package_namespaceObject_0 = JSON.parse('{"i8":"4.0.9-beta.
|
|
12495
|
+
var package_namespaceObject_0 = JSON.parse('{"i8":"4.0.9-beta.5"}');
|
|
12496
12496
|
const external_node_fs_namespaceObject = require("node:fs");
|
|
12497
12497
|
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
12498
12498
|
const external_node_http_namespaceObject = require("node:http");
|
|
@@ -12938,7 +12938,7 @@ var __webpack_exports__ = {};
|
|
|
12938
12938
|
Number.MAX_VALUE
|
|
12939
12939
|
]
|
|
12940
12940
|
};
|
|
12941
|
-
function
|
|
12941
|
+
function pick(schema, mask) {
|
|
12942
12942
|
const currDef = schema._zod.def;
|
|
12943
12943
|
const def = mergeDefs(schema._zod.def, {
|
|
12944
12944
|
get shape () {
|
|
@@ -15792,7 +15792,7 @@ var __webpack_exports__ = {};
|
|
|
15792
15792
|
inst.extend = (incoming)=>extend(inst, incoming);
|
|
15793
15793
|
inst.safeExtend = (incoming)=>safeExtend(inst, incoming);
|
|
15794
15794
|
inst.merge = (other)=>dist_merge(inst, other);
|
|
15795
|
-
inst.pick = (mask)=>
|
|
15795
|
+
inst.pick = (mask)=>pick(inst, mask);
|
|
15796
15796
|
inst.omit = (mask)=>omit(inst, mask);
|
|
15797
15797
|
inst.partial = (...args)=>dist_partial(ZodOptional, inst, args[0]);
|
|
15798
15798
|
inst.required = (...args)=>required(ZodNonOptional, inst, args[0]);
|
|
@@ -27039,124 +27039,6 @@ var __webpack_exports__ = {};
|
|
|
27039
27039
|
axios.HttpStatusCode = helpers_HttpStatusCode;
|
|
27040
27040
|
axios.default = axios;
|
|
27041
27041
|
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
27042
|
var dist = __webpack_require__("../../node_modules/.pnpm/socks-proxy-agent@8.0.4/node_modules/socks-proxy-agent/dist/index.js");
|
|
27161
27043
|
const PROXY_CREDENTIALS = [
|
|
27162
27044
|
{
|
|
@@ -27259,20 +27141,9 @@ var __webpack_exports__ = {};
|
|
|
27259
27141
|
url: "https://fetdev.iflysec.com/ip-pool/pool/eip/proxy",
|
|
27260
27142
|
data: params
|
|
27261
27143
|
}).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
27144
|
throw {
|
|
27274
27145
|
code: 414,
|
|
27275
|
-
message:
|
|
27146
|
+
message: `请求代理失败:${err.message}`,
|
|
27276
27147
|
data: {}
|
|
27277
27148
|
};
|
|
27278
27149
|
});
|
|
@@ -27292,53 +27163,12 @@ var __webpack_exports__ = {};
|
|
|
27292
27163
|
} : null;
|
|
27293
27164
|
return proxyAgent;
|
|
27294
27165
|
}
|
|
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
27166
|
class Http {
|
|
27337
27167
|
static handleApiError(error) {
|
|
27338
27168
|
if (error && "object" == typeof error && "code" in error && "message" in error) return error;
|
|
27339
27169
|
return {
|
|
27340
27170
|
code: 500,
|
|
27341
|
-
message:
|
|
27171
|
+
message: error instanceof Error ? error.message : "未知错误",
|
|
27342
27172
|
data: error
|
|
27343
27173
|
};
|
|
27344
27174
|
}
|
|
@@ -27393,18 +27223,6 @@ var __webpack_exports__ = {};
|
|
|
27393
27223
|
const verifyDecision = error.response?.headers?.["x-tt-verify-passport-decision"];
|
|
27394
27224
|
if (verifyDecision) this.logger?.warn(`[403 验证决策] x-tt-verify-passport-decision: ${verifyDecision}`);
|
|
27395
27225
|
}
|
|
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
27226
|
if (error.response?.data) {
|
|
27409
27227
|
if ("object" == typeof error.response.data) {
|
|
27410
27228
|
const serverError = error.response.data;
|
|
@@ -27435,17 +27253,11 @@ var __webpack_exports__ = {};
|
|
|
27435
27253
|
_message = "DNS 查询超时,请稍后重试!";
|
|
27436
27254
|
break;
|
|
27437
27255
|
case "ERR_BAD_REQUEST":
|
|
27438
|
-
|
|
27439
|
-
|
|
27440
|
-
_message = status && HTTP_STATUS_MESSAGE[status] || `请求失败,状态码${status ?? "unknown"}!`;
|
|
27441
|
-
break;
|
|
27442
|
-
}
|
|
27256
|
+
_message = "请求出现错误,请检查请求参数!";
|
|
27257
|
+
break;
|
|
27443
27258
|
case "ERR_BAD_RESPONSE":
|
|
27444
|
-
{
|
|
27445
|
-
|
|
27446
|
-
_message = status && HTTP_STATUS_MESSAGE[status] || `服务器响应异常 (${status ?? "unknown"}),请稍后重试!`;
|
|
27447
|
-
break;
|
|
27448
|
-
}
|
|
27259
|
+
_message = `服务器响应异常 (${error.response?.status ?? "unknown"}),请稍后重试!`;
|
|
27260
|
+
break;
|
|
27449
27261
|
case "ERR_CANCELED":
|
|
27450
27262
|
errorResponse.code = 414;
|
|
27451
27263
|
_message = "请求连接超时,请稍候重试!";
|
|
@@ -27456,14 +27268,11 @@ var __webpack_exports__ = {};
|
|
|
27456
27268
|
}
|
|
27457
27269
|
break;
|
|
27458
27270
|
default:
|
|
27459
|
-
{
|
|
27460
|
-
|
|
27461
|
-
|
|
27462
|
-
|
|
27463
|
-
|
|
27464
|
-
_message = status && HTTP_STATUS_MESSAGE[status] || USER_MESSAGE.NETWORK_ERROR;
|
|
27465
|
-
break;
|
|
27466
|
-
}
|
|
27271
|
+
this.logger?.debug(`未处理的网络错误代码: ${error.code} ${error.message}`, {
|
|
27272
|
+
errorString: stringifyError(error)
|
|
27273
|
+
});
|
|
27274
|
+
_message = `网络错误: ${error.message}`;
|
|
27275
|
+
break;
|
|
27467
27276
|
}
|
|
27468
27277
|
}
|
|
27469
27278
|
if (error.code && !error.response?.data) errorResponse.message = _message || errorResponse.message;
|
|
@@ -27473,18 +27282,6 @@ var __webpack_exports__ = {};
|
|
|
27473
27282
|
errorResponse.message = message;
|
|
27474
27283
|
}
|
|
27475
27284
|
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
27285
|
throw errorResponse;
|
|
27489
27286
|
});
|
|
27490
27287
|
}
|
|
@@ -32908,7 +32705,7 @@ var __webpack_exports__ = {};
|
|
|
32908
32705
|
".png"
|
|
32909
32706
|
].includes(ext)) throw {
|
|
32910
32707
|
code: 414,
|
|
32911
|
-
message:
|
|
32708
|
+
message: "图片格式不支持,百家号仅支持 jpg、png 格式,请转换后重试。",
|
|
32912
32709
|
data: ""
|
|
32913
32710
|
};
|
|
32914
32711
|
const image = await downloadImage(url, external_node_path_default().join(tmpCachePath, fileName));
|
|
@@ -36744,7 +36541,7 @@ var __webpack_exports__ = {};
|
|
|
36744
36541
|
});
|
|
36745
36542
|
const qrData = qrCodeResponse?.data;
|
|
36746
36543
|
task.logger.info(`获取二维码响应: error_code=${qrData?.error_code}, message=${qrCodeResponse?.message}`);
|
|
36747
|
-
if (qrData?.error_code !== 0) return utils_response(414,
|
|
36544
|
+
if (qrData?.error_code !== 0) return utils_response(414, `获取二维码失败: error_code=${qrData?.error_code}`, "");
|
|
36748
36545
|
return utils_response(0, "获取二维码成功", {
|
|
36749
36546
|
qrcode: qrData.qrcode,
|
|
36750
36547
|
token: qrData.token,
|
|
@@ -36759,7 +36556,7 @@ var __webpack_exports__ = {};
|
|
|
36759
36556
|
} catch (err) {
|
|
36760
36557
|
const msg = err instanceof Error ? err.message : String(err);
|
|
36761
36558
|
task.logger.warn(`[douyinGetVerifyQrCode] 获取二维码失败: ${msg}`);
|
|
36762
|
-
return utils_response(500,
|
|
36559
|
+
return utils_response(500, `获取二维码失败: ${msg}`, "");
|
|
36763
36560
|
}
|
|
36764
36561
|
};
|
|
36765
36562
|
const DouyinGetWorkListParamsSchema = ActionCommonParamsSchema.extend({
|
|
@@ -39013,10 +38810,18 @@ var __webpack_exports__ = {};
|
|
|
39013
38810
|
});
|
|
39014
38811
|
} catch (error) {
|
|
39015
38812
|
const handledError = Http.handleApiError(error);
|
|
39016
|
-
const
|
|
39017
|
-
|
|
39018
|
-
|
|
39019
|
-
|
|
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));
|
|
39020
38825
|
await updateTaskState?.({
|
|
39021
38826
|
state: types_TaskState.FAILED,
|
|
39022
38827
|
error: message
|
|
@@ -40734,7 +40539,7 @@ var __webpack_exports__ = {};
|
|
|
40734
40539
|
}
|
|
40735
40540
|
const errMsg = error instanceof Error ? error.message : String(error);
|
|
40736
40541
|
_task.logger.error(`抖音账号数据获取失败: ${errMsg}`);
|
|
40737
|
-
return types_errorResponse(
|
|
40542
|
+
return types_errorResponse(errMsg || "抖音账号数据获取失败");
|
|
40738
40543
|
}
|
|
40739
40544
|
}
|
|
40740
40545
|
async function getShipinhaoData(_task, params) {
|
|
@@ -40865,7 +40670,7 @@ var __webpack_exports__ = {};
|
|
|
40865
40670
|
}
|
|
40866
40671
|
const errMsg = error instanceof Error ? error.message : String(error);
|
|
40867
40672
|
_task.logger.error(`视频号账号数据获取失败: ${errMsg}`);
|
|
40868
|
-
return types_errorResponse(
|
|
40673
|
+
return types_errorResponse(errMsg || "视频号账号数据获取失败");
|
|
40869
40674
|
}
|
|
40870
40675
|
}
|
|
40871
40676
|
async function getToutiaoData(_task, params) {
|
|
@@ -41306,9 +41111,7 @@ var __webpack_exports__ = {};
|
|
|
41306
41111
|
} : null
|
|
41307
41112
|
}, "百家号文章数据获取成功");
|
|
41308
41113
|
} catch (error) {
|
|
41309
|
-
|
|
41310
|
-
_task.logger.error(`百家号文章数据获取失败: ${errMsg}`);
|
|
41311
|
-
return searchPublishInfo_types_errorResponse(USER_MESSAGE.BJH_POST_FETCH_FAILED);
|
|
41114
|
+
return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "百家号文章数据获取失败");
|
|
41312
41115
|
}
|
|
41313
41116
|
}
|
|
41314
41117
|
async function handleDouyinData(_task, params) {
|
|
@@ -41403,9 +41206,7 @@ var __webpack_exports__ = {};
|
|
|
41403
41206
|
} : null
|
|
41404
41207
|
}, "抖音数据获取成功");
|
|
41405
41208
|
} catch (error) {
|
|
41406
|
-
|
|
41407
|
-
_task.logger.error(`抖音作品数据获取失败: ${errMsg}`);
|
|
41408
|
-
return searchPublishInfo_types_errorResponse(USER_MESSAGE.DOUYIN_POST_FETCH_FAILED);
|
|
41209
|
+
return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "抖音数据获取失败");
|
|
41409
41210
|
}
|
|
41410
41211
|
}
|
|
41411
41212
|
async function handleShipinhaoData(_task, params) {
|
|
@@ -41570,9 +41371,8 @@ var __webpack_exports__ = {};
|
|
|
41570
41371
|
}, "视频号数据获取成功");
|
|
41571
41372
|
} catch (error) {
|
|
41572
41373
|
const errMsg = error instanceof Error ? error.message : String(error);
|
|
41573
|
-
_task.logger.error(`视频号作品数据获取失败: ${errMsg}`);
|
|
41574
41374
|
if (errMsg.startsWith("AUTH_ERROR:")) return searchPublishInfo_types_errorResponse("视频号数据获取失败,请检查账号状态", 414);
|
|
41575
|
-
return searchPublishInfo_types_errorResponse(
|
|
41375
|
+
return searchPublishInfo_types_errorResponse(errMsg || "视频号数据获取失败");
|
|
41576
41376
|
}
|
|
41577
41377
|
}
|
|
41578
41378
|
async function handleToutiaoData(_task, params) {
|
|
@@ -41657,9 +41457,7 @@ var __webpack_exports__ = {};
|
|
|
41657
41457
|
} : null
|
|
41658
41458
|
}, "头条号文章文章获取成功");
|
|
41659
41459
|
} catch (error) {
|
|
41660
|
-
|
|
41661
|
-
_task.logger.error(`头条号文章数据获取失败: ${errMsg}`);
|
|
41662
|
-
return searchPublishInfo_types_errorResponse(USER_MESSAGE.TT_POST_FETCH_FAILED);
|
|
41460
|
+
return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "头条号文章数据获取失败");
|
|
41663
41461
|
}
|
|
41664
41462
|
}
|
|
41665
41463
|
const external_node_vm_namespaceObject = require("node:vm");
|
|
@@ -43880,7 +43678,7 @@ var __webpack_exports__ = {};
|
|
|
43880
43678
|
name: params.music.name,
|
|
43881
43679
|
artist: params.music.authorName,
|
|
43882
43680
|
mediaStreamingUrl: params.music.url,
|
|
43883
|
-
docType: params.music.raw.
|
|
43681
|
+
docType: 2 === params.music.raw.bgmSource ? 0 : 1
|
|
43884
43682
|
},
|
|
43885
43683
|
groupId: params.music.id,
|
|
43886
43684
|
hasBgm: 1,
|
|
@@ -44036,10 +43834,18 @@ var __webpack_exports__ = {};
|
|
|
44036
43834
|
});
|
|
44037
43835
|
} catch (error) {
|
|
44038
43836
|
const handledError = Http.handleApiError(error);
|
|
44039
|
-
const
|
|
44040
|
-
|
|
44041
|
-
|
|
44042
|
-
|
|
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));
|
|
44043
43849
|
await updateTaskState?.({
|
|
44044
43850
|
state: types_TaskState.FAILED,
|
|
44045
43851
|
error: message
|
|
@@ -44871,8 +44677,7 @@ var __webpack_exports__ = {};
|
|
|
44871
44677
|
imageBuffer = Buffer.from(await external_node_fs_default().promises.readFile(filePath));
|
|
44872
44678
|
}
|
|
44873
44679
|
} catch (err) {
|
|
44874
|
-
|
|
44875
|
-
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);
|
|
44876
44681
|
}
|
|
44877
44682
|
const md5 = (0, external_node_crypto_namespaceObject.createHash)("md5").update(imageBuffer).digest("hex");
|
|
44878
44683
|
const timestamp = Date.now().toString();
|
|
@@ -47383,10 +47188,18 @@ var __webpack_exports__ = {};
|
|
|
47383
47188
|
});
|
|
47384
47189
|
} catch (error) {
|
|
47385
47190
|
const handledError = Http.handleApiError(error);
|
|
47386
|
-
const
|
|
47387
|
-
|
|
47388
|
-
|
|
47389
|
-
|
|
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));
|
|
47390
47203
|
await updateTaskState?.({
|
|
47391
47204
|
state: types_TaskState.FAILED,
|
|
47392
47205
|
error: message
|
|
@@ -48854,7 +48667,6 @@ var __webpack_exports__ = {};
|
|
|
48854
48667
|
});
|
|
48855
48668
|
return success(data, message);
|
|
48856
48669
|
}
|
|
48857
|
-
task.logger.info(`[xiaohongshuPublish] publishData: ${JSON.stringify(publishData)} `);
|
|
48858
48670
|
let publishResult;
|
|
48859
48671
|
try {
|
|
48860
48672
|
publishResult = await proxyHttp.api({
|
|
@@ -48865,15 +48677,23 @@ var __webpack_exports__ = {};
|
|
|
48865
48677
|
defaultErrorMsg: "文章发布异常,请稍后重试。"
|
|
48866
48678
|
}, {
|
|
48867
48679
|
retries: 2,
|
|
48868
|
-
retryDelay:
|
|
48869
|
-
timeout:
|
|
48680
|
+
retryDelay: 500,
|
|
48681
|
+
timeout: 12000
|
|
48870
48682
|
});
|
|
48871
48683
|
} catch (error) {
|
|
48872
48684
|
const handledError = Http.handleApiError(error);
|
|
48873
|
-
const
|
|
48874
|
-
|
|
48875
|
-
|
|
48876
|
-
|
|
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));
|
|
48877
48697
|
await updateTaskState?.({
|
|
48878
48698
|
state: types_TaskState.FAILED,
|
|
48879
48699
|
error: message
|
|
@@ -50569,14 +50389,6 @@ var __webpack_exports__ = {};
|
|
|
50569
50389
|
this.task = task;
|
|
50570
50390
|
this.task.logger.info(`当前包版本:Share=>${package_namespaceObject.i8} Action=>${package_namespaceObject_0.i8}`);
|
|
50571
50391
|
}
|
|
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
50392
|
async bindTask(func, params) {
|
|
50581
50393
|
let responseData;
|
|
50582
50394
|
this.task.isBeta = this.task?.isFeatOn ? this.task?.isFeatOn(BetaFlag) : false;
|
|
@@ -50860,4 +50672,4 @@ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_targe
|
|
|
50860
50672
|
});
|
|
50861
50673
|
|
|
50862
50674
|
//# sourceMappingURL=bundle.js.map
|
|
50863
|
-
//# debugId=
|
|
50675
|
+
//# debugId=f52debe4-5003-5250-b1ab-d065564e54d5
|