@iflyrpa/actions 4.0.8-beta.0 → 4.0.9-beta.0
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 +190 -16
- package/dist/bundle.js.map +1 -1
- package/dist/index.js +190 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +190 -16
- package/dist/index.mjs.map +1 -1
- package/dist/utils/feishuAlarm.d.ts +27 -0
- package/package.json +1 -1
|
@@ -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";
|
|
51
52
|
article: "article";
|
|
52
53
|
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]="c3fbb52e-5d33-5353-8489-fe175df23e81")}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.
|
|
12495
|
+
var package_namespaceObject_0 = JSON.parse('{"i8":"4.0.9-beta.0"}');
|
|
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 dist_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)=>dist_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,6 +27039,94 @@ var __webpack_exports__ = {};
|
|
|
27039
27039
|
axios.HttpStatusCode = helpers_HttpStatusCode;
|
|
27040
27040
|
axios.default = axios;
|
|
27041
27041
|
const lib_axios = axios;
|
|
27042
|
+
const RPA_ERROR_WEBHOOK_URL = "https://open.xfchat.iflytek.com/open-apis/bot/v2/hook/d202c0dc-5af5-40bc-83ed-abc677caa4a5";
|
|
27043
|
+
const ALARM_THROTTLE_MS = 60000;
|
|
27044
|
+
const lastSentAt = new Map();
|
|
27045
|
+
const postFeishuWebhook = (webhookUrl, payload)=>lib_axios.post(webhookUrl, payload, {
|
|
27046
|
+
headers: {
|
|
27047
|
+
"Content-Type": "application/json"
|
|
27048
|
+
},
|
|
27049
|
+
timeout: 10000
|
|
27050
|
+
});
|
|
27051
|
+
const buildFeishuPostMessage = (report)=>{
|
|
27052
|
+
const content = [
|
|
27053
|
+
[
|
|
27054
|
+
{
|
|
27055
|
+
tag: "text",
|
|
27056
|
+
text: `平台:${report.platform || "未知平台"}`
|
|
27057
|
+
}
|
|
27058
|
+
],
|
|
27059
|
+
[
|
|
27060
|
+
{
|
|
27061
|
+
tag: "text",
|
|
27062
|
+
text: `错误信息:${report.msg || "未知错误信息"}`
|
|
27063
|
+
}
|
|
27064
|
+
],
|
|
27065
|
+
[
|
|
27066
|
+
{
|
|
27067
|
+
tag: "text",
|
|
27068
|
+
text: `错误类型:${report.errorType || "未知错误类型"}`
|
|
27069
|
+
}
|
|
27070
|
+
],
|
|
27071
|
+
[
|
|
27072
|
+
{
|
|
27073
|
+
tag: "text",
|
|
27074
|
+
text: `阶段:${report.stage || "未知阶段"}`
|
|
27075
|
+
}
|
|
27076
|
+
],
|
|
27077
|
+
[
|
|
27078
|
+
{
|
|
27079
|
+
tag: "text",
|
|
27080
|
+
text: `等级:${report.level}`
|
|
27081
|
+
}
|
|
27082
|
+
],
|
|
27083
|
+
[
|
|
27084
|
+
{
|
|
27085
|
+
tag: "text",
|
|
27086
|
+
text: `来源:${report.source}`
|
|
27087
|
+
}
|
|
27088
|
+
]
|
|
27089
|
+
];
|
|
27090
|
+
if (void 0 !== report.code && null !== report.code) content.push([
|
|
27091
|
+
{
|
|
27092
|
+
tag: "text",
|
|
27093
|
+
text: `接口错误码:${report.code}`
|
|
27094
|
+
}
|
|
27095
|
+
]);
|
|
27096
|
+
if (report.url) content.push([
|
|
27097
|
+
{
|
|
27098
|
+
tag: "text",
|
|
27099
|
+
text: `地址:${report.url}`
|
|
27100
|
+
}
|
|
27101
|
+
]);
|
|
27102
|
+
if ("alarm" === report.level) content.push([
|
|
27103
|
+
{
|
|
27104
|
+
tag: "at",
|
|
27105
|
+
user_id: "all"
|
|
27106
|
+
}
|
|
27107
|
+
]);
|
|
27108
|
+
return {
|
|
27109
|
+
msg_type: "post",
|
|
27110
|
+
content: {
|
|
27111
|
+
post: {
|
|
27112
|
+
zh_cn: {
|
|
27113
|
+
title: report.title || "RPA异常",
|
|
27114
|
+
content
|
|
27115
|
+
}
|
|
27116
|
+
}
|
|
27117
|
+
}
|
|
27118
|
+
};
|
|
27119
|
+
};
|
|
27120
|
+
const reportFeishuAlarm = (report)=>{
|
|
27121
|
+
try {
|
|
27122
|
+
const key = `${report.platform}|${report.source}|${report.errorType}|${report.code ?? ""}`;
|
|
27123
|
+
const now = Date.now();
|
|
27124
|
+
const last = lastSentAt.get(key);
|
|
27125
|
+
if (last && now - last < ALARM_THROTTLE_MS) return;
|
|
27126
|
+
lastSentAt.set(key, now);
|
|
27127
|
+
postFeishuWebhook(RPA_ERROR_WEBHOOK_URL, buildFeishuPostMessage(report)).catch(()=>{});
|
|
27128
|
+
} catch {}
|
|
27129
|
+
};
|
|
27042
27130
|
var dist = __webpack_require__("../../node_modules/.pnpm/socks-proxy-agent@8.0.4/node_modules/socks-proxy-agent/dist/index.js");
|
|
27043
27131
|
const PROXY_CREDENTIALS = [
|
|
27044
27132
|
{
|
|
@@ -27141,6 +27229,17 @@ var __webpack_exports__ = {};
|
|
|
27141
27229
|
url: "https://fetdev.iflysec.com/ip-pool/pool/eip/proxy",
|
|
27142
27230
|
data: params
|
|
27143
27231
|
}).catch((err)=>{
|
|
27232
|
+
reportFeishuAlarm({
|
|
27233
|
+
level: "alarm",
|
|
27234
|
+
platform: "ip-pool",
|
|
27235
|
+
source: "proxy",
|
|
27236
|
+
stage: "POST /ip-pool/pool/eip/proxy",
|
|
27237
|
+
errorType: "PROXY_REQUEST_FAILED",
|
|
27238
|
+
code: err?.code,
|
|
27239
|
+
msg: `请求代理失败:${err.message},区域:${addr ?? "-"},AccountId:${accountId ?? "-"}`,
|
|
27240
|
+
url: "https://fetdev.iflysec.com/ip-pool/pool/eip/proxy",
|
|
27241
|
+
title: "代理异常"
|
|
27242
|
+
});
|
|
27144
27243
|
throw {
|
|
27145
27244
|
code: 414,
|
|
27146
27245
|
message: `请求代理失败:${err.message}`,
|
|
@@ -27163,6 +27262,47 @@ var __webpack_exports__ = {};
|
|
|
27163
27262
|
} : null;
|
|
27164
27263
|
return proxyAgent;
|
|
27165
27264
|
}
|
|
27265
|
+
const ALARM_STATUS = new Set([
|
|
27266
|
+
401,
|
|
27267
|
+
403,
|
|
27268
|
+
429,
|
|
27269
|
+
461,
|
|
27270
|
+
471
|
|
27271
|
+
]);
|
|
27272
|
+
const HTTP_STATUS_MESSAGE = {
|
|
27273
|
+
400: "请求参数错误,请检查参数格式是否正确!",
|
|
27274
|
+
401: "登录状态已失效,请重新登录后重试!",
|
|
27275
|
+
403: "没有访问权限,账号可能受限或签名已失效!",
|
|
27276
|
+
404: "请求的资源不存在,请检查接口地址!",
|
|
27277
|
+
405: "请求方法不被允许,请检查接口调用方式!",
|
|
27278
|
+
406: "服务端无法返回可接受的内容格式!",
|
|
27279
|
+
407: "代理需要身份验证,请检查代理配置!",
|
|
27280
|
+
408: "请求超时,请检查网络连接!",
|
|
27281
|
+
409: "请求冲突,资源状态已变更,请刷新后重试!",
|
|
27282
|
+
410: "请求的资源已被移除!",
|
|
27283
|
+
412: "请求前置条件不满足,请刷新后重试!",
|
|
27284
|
+
413: "提交内容过大,请压缩或分批后重试!",
|
|
27285
|
+
414: "请求地址过长,请检查参数!",
|
|
27286
|
+
415: "不支持的内容类型,请检查请求格式!",
|
|
27287
|
+
422: "请求内容校验失败,请检查参数内容!",
|
|
27288
|
+
423: "资源已被锁定,请稍后重试!",
|
|
27289
|
+
429: "请求过于频繁,请稍后重试!",
|
|
27290
|
+
431: "请求头过大,请清理 Cookie 后重试!",
|
|
27291
|
+
451: "内容不合规或因法律原因被拒绝!",
|
|
27292
|
+
461: "账号可能受限,请在网页上完成验证后重试!",
|
|
27293
|
+
471: "账号可能受限,请在网页上完成验证后重试!",
|
|
27294
|
+
500: "服务器内部错误,请稍后重试!",
|
|
27295
|
+
501: "服务端不支持该请求,请稍后重试!",
|
|
27296
|
+
502: "网关错误,请稍后重试!",
|
|
27297
|
+
503: "服务暂时不可用,请稍后重试!",
|
|
27298
|
+
504: "网关超时,请稍后重试!",
|
|
27299
|
+
507: "服务端存储空间不足,请稍后重试!",
|
|
27300
|
+
509: "服务带宽超限,请稍后重试!",
|
|
27301
|
+
520: "服务端返回未知错误,请稍后重试!",
|
|
27302
|
+
521: "源站拒绝连接,请稍后重试!",
|
|
27303
|
+
522: "源站连接超时,请稍后重试!",
|
|
27304
|
+
524: "源站响应超时,请稍后重试!"
|
|
27305
|
+
};
|
|
27166
27306
|
class Http {
|
|
27167
27307
|
static handleApiError(error) {
|
|
27168
27308
|
if (error && "object" == typeof error && "code" in error && "message" in error) return error;
|
|
@@ -27223,6 +27363,18 @@ var __webpack_exports__ = {};
|
|
|
27223
27363
|
const verifyDecision = error.response?.headers?.["x-tt-verify-passport-decision"];
|
|
27224
27364
|
if (verifyDecision) this.logger?.warn(`[403 验证决策] x-tt-verify-passport-decision: ${verifyDecision}`);
|
|
27225
27365
|
}
|
|
27366
|
+
if (error.response?.status === 461 || error.response?.status === 471) {
|
|
27367
|
+
const h = error.response?.headers ?? {};
|
|
27368
|
+
const pick = (name)=>h[name] ?? h[name.toLowerCase()];
|
|
27369
|
+
this.logger?.warn(`[${error.response.status} 风控验证] URL: ${error.config?.url} Verifytype: ${pick("Verifytype") ?? "-"} Verifyuuid: ${pick("Verifyuuid") ?? "-"} Verifybiz: ${pick("Verifybiz") ?? "-"}`);
|
|
27370
|
+
this.logger?.warn(`[${error.response.status} 响应头] ${JSON.stringify(h)}`);
|
|
27371
|
+
errorResponse.extra = {
|
|
27372
|
+
...errorResponse.extra,
|
|
27373
|
+
verifyType: pick("Verifytype"),
|
|
27374
|
+
verifyUuid: pick("Verifyuuid"),
|
|
27375
|
+
verifyBiz: pick("Verifybiz")
|
|
27376
|
+
};
|
|
27377
|
+
}
|
|
27226
27378
|
if (error.response?.data) {
|
|
27227
27379
|
if ("object" == typeof error.response.data) {
|
|
27228
27380
|
const serverError = error.response.data;
|
|
@@ -27253,11 +27405,17 @@ var __webpack_exports__ = {};
|
|
|
27253
27405
|
_message = "DNS 查询超时,请稍后重试!";
|
|
27254
27406
|
break;
|
|
27255
27407
|
case "ERR_BAD_REQUEST":
|
|
27256
|
-
|
|
27257
|
-
|
|
27408
|
+
{
|
|
27409
|
+
const status = error.response?.status;
|
|
27410
|
+
_message = status && HTTP_STATUS_MESSAGE[status] || `请求失败,状态码${status ?? "unknown"}!`;
|
|
27411
|
+
break;
|
|
27412
|
+
}
|
|
27258
27413
|
case "ERR_BAD_RESPONSE":
|
|
27259
|
-
|
|
27260
|
-
|
|
27414
|
+
{
|
|
27415
|
+
const status = error.response?.status;
|
|
27416
|
+
_message = status && HTTP_STATUS_MESSAGE[status] || `服务器响应异常 (${status ?? "unknown"}),请稍后重试!`;
|
|
27417
|
+
break;
|
|
27418
|
+
}
|
|
27261
27419
|
case "ERR_CANCELED":
|
|
27262
27420
|
errorResponse.code = 414;
|
|
27263
27421
|
_message = "请求连接超时,请稍候重试!";
|
|
@@ -27268,11 +27426,14 @@ var __webpack_exports__ = {};
|
|
|
27268
27426
|
}
|
|
27269
27427
|
break;
|
|
27270
27428
|
default:
|
|
27271
|
-
|
|
27272
|
-
|
|
27273
|
-
|
|
27274
|
-
|
|
27275
|
-
|
|
27429
|
+
{
|
|
27430
|
+
this.logger?.debug(`未处理的网络错误代码: ${error.code} ${error.message}`, {
|
|
27431
|
+
errorString: stringifyError(error)
|
|
27432
|
+
});
|
|
27433
|
+
const status = error.response?.status;
|
|
27434
|
+
_message = status && HTTP_STATUS_MESSAGE[status] || `网络错误: ${error.message} ${status}`;
|
|
27435
|
+
break;
|
|
27436
|
+
}
|
|
27276
27437
|
}
|
|
27277
27438
|
}
|
|
27278
27439
|
if (error.code && !error.response?.data) errorResponse.message = _message || errorResponse.message;
|
|
@@ -27282,6 +27443,18 @@ var __webpack_exports__ = {};
|
|
|
27282
27443
|
errorResponse.message = message;
|
|
27283
27444
|
}
|
|
27284
27445
|
if (error.message.includes("Proxy connection ended")) errorResponse.message = "所在区域代理连接超时,请更换区域或稍后重试!";
|
|
27446
|
+
const status = error.response?.status;
|
|
27447
|
+
reportFeishuAlarm({
|
|
27448
|
+
level: status && ALARM_STATUS.has(status) ? "alarm" : "warning",
|
|
27449
|
+
platform: this.platform || "unknown",
|
|
27450
|
+
source: "http",
|
|
27451
|
+
stage: `${(error.config?.method || "get").toUpperCase()} ${error.config?.url || "-"}`,
|
|
27452
|
+
errorType: status ? `HTTP_${status}` : error.code || "NETWORK_ERROR",
|
|
27453
|
+
code: errorResponse.code,
|
|
27454
|
+
msg: errorResponse.message,
|
|
27455
|
+
url: error.config?.url,
|
|
27456
|
+
title: "RPA接口异常"
|
|
27457
|
+
});
|
|
27285
27458
|
throw errorResponse;
|
|
27286
27459
|
});
|
|
27287
27460
|
}
|
|
@@ -48667,6 +48840,7 @@ var __webpack_exports__ = {};
|
|
|
48667
48840
|
});
|
|
48668
48841
|
return success(data, message);
|
|
48669
48842
|
}
|
|
48843
|
+
task.logger.info(`[xiaohongshuPublish] publishData: ${JSON.stringify(publishData)} `);
|
|
48670
48844
|
let publishResult;
|
|
48671
48845
|
try {
|
|
48672
48846
|
publishResult = await proxyHttp.api({
|
|
@@ -48677,8 +48851,8 @@ var __webpack_exports__ = {};
|
|
|
48677
48851
|
defaultErrorMsg: "文章发布异常,请稍后重试。"
|
|
48678
48852
|
}, {
|
|
48679
48853
|
retries: 2,
|
|
48680
|
-
retryDelay:
|
|
48681
|
-
timeout:
|
|
48854
|
+
retryDelay: 3000,
|
|
48855
|
+
timeout: 30000
|
|
48682
48856
|
});
|
|
48683
48857
|
} catch (error) {
|
|
48684
48858
|
const handledError = Http.handleApiError(error);
|
|
@@ -50672,4 +50846,4 @@ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_targe
|
|
|
50672
50846
|
});
|
|
50673
50847
|
|
|
50674
50848
|
//# sourceMappingURL=bundle.js.map
|
|
50675
|
-
//# debugId=
|
|
50849
|
+
//# debugId=c3fbb52e-5d33-5353-8489-fe175df23e81
|