@iflyrpa/actions 4.1.0-beta.2 → 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 +27 -6
- package/dist/bundle.js.map +1 -1
- package/dist/index.js +28 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -7
- 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,8 +12490,8 @@ var __webpack_exports__ = {};
|
|
|
12490
12490
|
navigator: ()=>_navigator,
|
|
12491
12491
|
origin: ()=>utils_origin
|
|
12492
12492
|
});
|
|
12493
|
-
var package_namespaceObject = JSON.parse('{"i8":"0.1.3-beta.
|
|
12494
|
-
var package_namespaceObject_0 = JSON.parse('{"i8":"4.1.0-beta.
|
|
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"}');
|
|
12495
12495
|
const external_node_fs_namespaceObject = require("node:fs");
|
|
12496
12496
|
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
12497
12497
|
const external_node_http_namespaceObject = require("node:http");
|
|
@@ -27304,6 +27304,19 @@ var __webpack_exports__ = {};
|
|
|
27304
27304
|
461,
|
|
27305
27305
|
471
|
|
27306
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
|
+
}
|
|
27307
27320
|
const HTTP_STATUS_MESSAGE = {
|
|
27308
27321
|
400: "请求参数错误,请检查参数格式是否正确!",
|
|
27309
27322
|
401: "登录状态已失效,请重新登录后重试!",
|
|
@@ -27498,7 +27511,15 @@ var __webpack_exports__ = {};
|
|
|
27498
27511
|
const axiosCode = error.extra?.alarmErrorCode;
|
|
27499
27512
|
const method = (config.method || "get").toUpperCase();
|
|
27500
27513
|
const baseURL = config.baseURL || this.apiClient.defaults.baseURL || "";
|
|
27501
|
-
const fullUrl = config.url ? /^https?:\/\//.test(config.url) ? config.url : `${baseURL.replace(/\/$/, "")}${config.url}` : 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
|
+
}
|
|
27502
27523
|
const rawMsg = "string" == typeof error.message && error.message.trim() ? error.message : "";
|
|
27503
27524
|
const baseMsg = rawMsg || `请求失败(无错误文案,code=${error.code ?? "unknown"})`;
|
|
27504
27525
|
const retriedSuffix = attempts > 0 ? `(已重试${attempts}次仍失败)` : "";
|
|
@@ -27510,7 +27531,7 @@ var __webpack_exports__ = {};
|
|
|
27510
27531
|
errorType: status ? `HTTP_${status}` : axiosCode || "NETWORK_ERROR",
|
|
27511
27532
|
code: error.code,
|
|
27512
27533
|
msg: `${baseMsg}${retriedSuffix}`,
|
|
27513
|
-
url:
|
|
27534
|
+
url: fullUrl,
|
|
27514
27535
|
title: "RPA接口异常"
|
|
27515
27536
|
});
|
|
27516
27537
|
}
|
|
@@ -52530,4 +52551,4 @@ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_targe
|
|
|
52530
52551
|
});
|
|
52531
52552
|
|
|
52532
52553
|
//# sourceMappingURL=bundle.js.map
|
|
52533
|
-
//# debugId=
|
|
52554
|
+
//# debugId=3532fd89-5c5d-5aff-a05b-8f2891a043d0
|