@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/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- !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]="47f14957-3de9-5f22-92f5-89210082b96d")}catch(e){}}();
2
+ !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]="d182299f-1883-507d-b046-2e397746a037")}catch(e){}}();
3
3
  import * as __WEBPACK_EXTERNAL_MODULE_crypto__ from "crypto";
4
4
  import * as __WEBPACK_EXTERNAL_MODULE_fs__ from "fs";
5
5
  import * as __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_package_json_58ae5f06__ from "@iflyrpa/share/package.json";
@@ -4352,7 +4352,7 @@ function __webpack_require__(moduleId) {
4352
4352
  return module;
4353
4353
  };
4354
4354
  })();
4355
- var package_namespaceObject = JSON.parse('{"i8":"4.1.0-beta.2"}');
4355
+ var package_namespaceObject = JSON.parse('{"i8":"4.1.0-beta.3"}');
4356
4356
  const USER_MESSAGE = {
4357
4357
  PROXY_UNAVAILABLE: "代理暂时不可用,请稍后重试或使用本地IP",
4358
4358
  NETWORK_ERROR: "网络异常,请稍后重试",
@@ -4618,6 +4618,19 @@ const ALARM_STATUS = new Set([
4618
4618
  461,
4619
4619
  471
4620
4620
  ]);
4621
+ function isLocalAddress(url) {
4622
+ let hostname;
4623
+ try {
4624
+ hostname = new URL(url).hostname.toLowerCase();
4625
+ } catch {
4626
+ return false;
4627
+ }
4628
+ if ("localhost" === hostname || "::1" === hostname || "[::1]" === hostname) return true;
4629
+ if (hostname.endsWith(".localhost") || hostname.endsWith(".local")) return true;
4630
+ if (/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(hostname)) return true;
4631
+ if ("0.0.0.0" === hostname) return true;
4632
+ return false;
4633
+ }
4621
4634
  const HTTP_STATUS_MESSAGE = {
4622
4635
  400: "请求参数错误,请检查参数格式是否正确!",
4623
4636
  401: "登录状态已失效,请重新登录后重试!",
@@ -4812,7 +4825,15 @@ class Http {
4812
4825
  const axiosCode = error.extra?.alarmErrorCode;
4813
4826
  const method = (config.method || "get").toUpperCase();
4814
4827
  const baseURL = config.baseURL || this.apiClient.defaults.baseURL || "";
4815
- const fullUrl = config.url ? /^https?:\/\//.test(config.url) ? config.url : `${baseURL.replace(/\/$/, "")}${config.url}` : baseURL || "-";
4828
+ const fullUrl = config.url ? /^https?:\/\//.test(config.url) ? config.url : `${baseURL.replace(/\/$/, "")}${config.url}` : baseURL;
4829
+ if (!fullUrl) {
4830
+ this.logger?.debug(`[告警跳过] 请求失败但无 URL,不上报: ${error.message}`);
4831
+ return;
4832
+ }
4833
+ if (isLocalAddress(fullUrl)) {
4834
+ this.logger?.debug(`[告警跳过] 本机地址不上报: ${fullUrl}`);
4835
+ return;
4836
+ }
4816
4837
  const rawMsg = "string" == typeof error.message && error.message.trim() ? error.message : "";
4817
4838
  const baseMsg = rawMsg || `请求失败(无错误文案,code=${error.code ?? "unknown"})`;
4818
4839
  const retriedSuffix = attempts > 0 ? `(已重试${attempts}次仍失败)` : "";
@@ -4824,7 +4845,7 @@ class Http {
4824
4845
  errorType: status ? `HTTP_${status}` : axiosCode || "NETWORK_ERROR",
4825
4846
  code: error.code,
4826
4847
  msg: `${baseMsg}${retriedSuffix}`,
4827
- url: "-" !== fullUrl ? fullUrl : void 0,
4848
+ url: fullUrl,
4828
4849
  title: "RPA接口异常"
4829
4850
  });
4830
4851
  }
@@ -5991,7 +6012,7 @@ const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-
5991
6012
  const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
5992
6013
  const regexes_base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
5993
6014
  const regexes_base64url = /^[A-Za-z0-9_-]*$/;
5994
- const hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
6015
+ const regexes_hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;
5995
6016
  const e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
5996
6017
  const dateSource = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";
5997
6018
  const regexes_date = /*@__PURE__*/ new RegExp(`^${dateSource}$`);
@@ -6587,7 +6608,7 @@ const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def)=>{
6587
6608
  code: "invalid_format",
6588
6609
  format: "url",
6589
6610
  note: "Invalid hostname",
6590
- pattern: hostname.source,
6611
+ pattern: regexes_hostname.source,
6591
6612
  input: payload.value,
6592
6613
  inst,
6593
6614
  continue: !def.abort
@@ -27375,4 +27396,4 @@ var __webpack_exports__version = package_namespaceObject.i8;
27375
27396
  export { Action, ActionCommonParamsSchema, BaijiahaoPublishParamsSchema, BetaFlag, CollectionDetailSchema, ConfigDataSchema, DouyinCheckVerifyQrCodeParamsSchema, DouyinCreateCommentReplyParamsSchema, DouyinGetCollectionParamsSchema, DouyinGetCommentListParamsSchema, DouyinGetCommentReplyListParamsSchema, DouyinGetHotParamsSchema, DouyinGetLocationParamsSchema, DouyinGetMusicByCategoryParamsSchema, DouyinGetMusicCategoryParamsSchema, DouyinGetMusicParamsSchema, DouyinGetTopicsParamsSchema, DouyinGetVerifyQrCodeParamsSchema, DouyinGetWorkListParamsSchema, DouyinPublishParamsSchema, FetchArticlesDataSchema, FetchArticlesParamsSchema, Http, ProxyAgent, SearchAccountInfoParamsSchema, SessionCheckResultSchema, ShipinhaoCheckLinkValidateParamsSchema, ShipinhaoGetLocationParamsSchema, ShipinhaoGetMsgParamsSchema, ShipinhaoPublishParamsSchema, ShipinhaoPublishVideoParamsSchema, ShipinhaoSendMsgParamsSchema, ToutiaoPublishParamsSchema, UnreadCountSchema, WeixinPublishParamsSchema, WxBjhSessionParamsSchema, XhsWebSearchParamsSchema, XiaohongshuPublishParamsSchema, bjhConfigDataSchema, douyinConfigDataSchema, getFileState, reportLogger, rpaAction_Server_Mock, shipinhaoConfigDataSchema, ttConfigDataSchema, wxConfigDataSchema, xhsConfigDataSchema, __webpack_exports__version as version };
27376
27397
 
27377
27398
  //# sourceMappingURL=index.mjs.map
27378
- //# debugId=47f14957-3de9-5f22-92f5-89210082b96d
27399
+ //# debugId=d182299f-1883-507d-b046-2e397746a037