@iflyrpa/actions 4.1.0-beta.1 → 4.1.0-beta.3
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/bundle.js +44 -15
- package/dist/bundle.js.map +1 -1
- package/dist/index.js +44 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +44 -13
- package/dist/index.mjs.map +1 -1
- package/dist/utils/http.d.ts +11 -0
- package/package.json +2 -2
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]="3532fd89-5c5d-5aff-a05b-8f2891a043d0")}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";
|
|
@@ -12490,10 +12490,8 @@ var __webpack_exports__ = {};
|
|
|
12490
12490
|
navigator: ()=>_navigator,
|
|
12491
12491
|
origin: ()=>utils_origin
|
|
12492
12492
|
});
|
|
12493
|
-
var package_namespaceObject = {
|
|
12494
|
-
|
|
12495
|
-
};
|
|
12496
|
-
var package_namespaceObject_0 = JSON.parse('{"i8":"4.1.0-beta.1"}');
|
|
12493
|
+
var package_namespaceObject = JSON.parse('{"i8":"0.1.3-beta.1"}');
|
|
12494
|
+
var package_namespaceObject_0 = JSON.parse('{"i8":"4.1.0-beta.3"}');
|
|
12497
12495
|
const external_node_fs_namespaceObject = require("node:fs");
|
|
12498
12496
|
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
12499
12497
|
const external_node_http_namespaceObject = require("node:http");
|
|
@@ -12584,7 +12582,7 @@ var __webpack_exports__ = {};
|
|
|
12584
12582
|
fileStream.on("error", (err)=>{
|
|
12585
12583
|
reject({
|
|
12586
12584
|
code: 500,
|
|
12587
|
-
message:
|
|
12585
|
+
message: "图片写入失败,请检查磁盘空间"
|
|
12588
12586
|
});
|
|
12589
12587
|
});
|
|
12590
12588
|
} else {
|
|
@@ -27306,6 +27304,19 @@ var __webpack_exports__ = {};
|
|
|
27306
27304
|
461,
|
|
27307
27305
|
471
|
|
27308
27306
|
]);
|
|
27307
|
+
function isLocalAddress(url) {
|
|
27308
|
+
let hostname;
|
|
27309
|
+
try {
|
|
27310
|
+
hostname = new URL(url).hostname.toLowerCase();
|
|
27311
|
+
} catch {
|
|
27312
|
+
return false;
|
|
27313
|
+
}
|
|
27314
|
+
if ("localhost" === hostname || "::1" === hostname || "[::1]" === hostname) return true;
|
|
27315
|
+
if (hostname.endsWith(".localhost") || hostname.endsWith(".local")) return true;
|
|
27316
|
+
if (/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(hostname)) return true;
|
|
27317
|
+
if ("0.0.0.0" === hostname) return true;
|
|
27318
|
+
return false;
|
|
27319
|
+
}
|
|
27309
27320
|
const HTTP_STATUS_MESSAGE = {
|
|
27310
27321
|
400: "请求参数错误,请检查参数格式是否正确!",
|
|
27311
27322
|
401: "登录状态已失效,请重新登录后重试!",
|
|
@@ -27342,7 +27353,14 @@ var __webpack_exports__ = {};
|
|
|
27342
27353
|
};
|
|
27343
27354
|
class Http {
|
|
27344
27355
|
static handleApiError(error) {
|
|
27345
|
-
if (error && "object" == typeof error && "code" in error && "message" in error)
|
|
27356
|
+
if (error && "object" == typeof error && "code" in error && "message" in error) {
|
|
27357
|
+
const resp = error;
|
|
27358
|
+
if ("string" != typeof resp.message || !resp.message.trim()) return {
|
|
27359
|
+
...resp,
|
|
27360
|
+
message: USER_MESSAGE.SYSTEM_ERROR
|
|
27361
|
+
};
|
|
27362
|
+
return resp;
|
|
27363
|
+
}
|
|
27346
27364
|
return {
|
|
27347
27365
|
code: 500,
|
|
27348
27366
|
message: USER_MESSAGE.SYSTEM_ERROR,
|
|
@@ -27492,17 +27510,28 @@ var __webpack_exports__ = {};
|
|
|
27492
27510
|
const status = error.extra?.alarmStatus;
|
|
27493
27511
|
const axiosCode = error.extra?.alarmErrorCode;
|
|
27494
27512
|
const method = (config.method || "get").toUpperCase();
|
|
27495
|
-
const
|
|
27513
|
+
const baseURL = config.baseURL || this.apiClient.defaults.baseURL || "";
|
|
27514
|
+
const fullUrl = config.url ? /^https?:\/\//.test(config.url) ? config.url : `${baseURL.replace(/\/$/, "")}${config.url}` : baseURL;
|
|
27515
|
+
if (!fullUrl) {
|
|
27516
|
+
this.logger?.debug(`[告警跳过] 请求失败但无 URL,不上报: ${error.message}`);
|
|
27517
|
+
return;
|
|
27518
|
+
}
|
|
27519
|
+
if (isLocalAddress(fullUrl)) {
|
|
27520
|
+
this.logger?.debug(`[告警跳过] 本机地址不上报: ${fullUrl}`);
|
|
27521
|
+
return;
|
|
27522
|
+
}
|
|
27523
|
+
const rawMsg = "string" == typeof error.message && error.message.trim() ? error.message : "";
|
|
27524
|
+
const baseMsg = rawMsg || `请求失败(无错误文案,code=${error.code ?? "unknown"})`;
|
|
27496
27525
|
const retriedSuffix = attempts > 0 ? `(已重试${attempts}次仍失败)` : "";
|
|
27497
27526
|
reportFeishuAlarm({
|
|
27498
27527
|
level: status && ALARM_STATUS.has(status) ? "alarm" : "warning",
|
|
27499
|
-
platform:
|
|
27528
|
+
platform: "@iflyrpa/playwright",
|
|
27500
27529
|
source: "http",
|
|
27501
|
-
stage: `${method} ${
|
|
27530
|
+
stage: `${method} ${fullUrl}`,
|
|
27502
27531
|
errorType: status ? `HTTP_${status}` : axiosCode || "NETWORK_ERROR",
|
|
27503
27532
|
code: error.code,
|
|
27504
|
-
msg: `${
|
|
27505
|
-
url:
|
|
27533
|
+
msg: `${baseMsg}${retriedSuffix}`,
|
|
27534
|
+
url: fullUrl,
|
|
27506
27535
|
title: "RPA接口异常"
|
|
27507
27536
|
});
|
|
27508
27537
|
}
|
|
@@ -45898,8 +45927,8 @@ var __webpack_exports__ = {};
|
|
|
45898
45927
|
const resultCode = publishResult.data?.baseResp?.errcode ?? publishResult.errCode;
|
|
45899
45928
|
const resultMsg = publishResult.data?.baseResp?.errmsg ?? (0 === resultCode ? "发布成功" : `发布失败(errCode=${resultCode})`);
|
|
45900
45929
|
if (0 === resultCode) {
|
|
45901
|
-
const publishId = extractEncFileKey(
|
|
45902
|
-
if (!publishId) task.logger.error(`[shipinhaoPublishVideo] 封面 DownloadURL 中未解析到 encfilekey,关联 id 为空: ${
|
|
45930
|
+
const publishId = extractEncFileKey(verticalCoverUpload.downloadUrl);
|
|
45931
|
+
if (!publishId) task.logger.error(`[shipinhaoPublishVideo] 封面 DownloadURL 中未解析到 encfilekey,关联 id 为空: ${verticalCoverUpload.downloadUrl}`);
|
|
45903
45932
|
await updateTaskState?.({
|
|
45904
45933
|
state: types_TaskState.SUCCESS,
|
|
45905
45934
|
result: {
|
|
@@ -52522,4 +52551,4 @@ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_targe
|
|
|
52522
52551
|
});
|
|
52523
52552
|
|
|
52524
52553
|
//# sourceMappingURL=bundle.js.map
|
|
52525
|
-
//# debugId=
|
|
52554
|
+
//# debugId=3532fd89-5c5d-5aff-a05b-8f2891a043d0
|