@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/index.js 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]="8315ee33-ea9b-5a8e-92af-cf3835f6ed70")}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]="eab7e6bf-8230-5cac-87e0-bda79dd9176d")}catch(e){}}();
3
3
  var __webpack_modules__ = {
4
4
  "./src/utils/XhsXsCommonEnc.js": function(module) {
5
5
  var encrypt_lookup = [
@@ -4403,7 +4403,7 @@ var __webpack_exports__ = {};
4403
4403
  });
4404
4404
  const package_json_namespaceObject = require("@iflyrpa/share/package.json");
4405
4405
  var package_json_default = /*#__PURE__*/ __webpack_require__.n(package_json_namespaceObject);
4406
- var package_namespaceObject = JSON.parse('{"i8":"4.1.0-beta.1"}');
4406
+ var package_namespaceObject = JSON.parse('{"i8":"4.1.0-beta.3"}');
4407
4407
  const share_namespaceObject = require("@iflyrpa/share");
4408
4408
  const external_node_fs_namespaceObject = require("node:fs");
4409
4409
  var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
@@ -4685,6 +4685,19 @@ var __webpack_exports__ = {};
4685
4685
  461,
4686
4686
  471
4687
4687
  ]);
4688
+ function isLocalAddress(url) {
4689
+ let hostname;
4690
+ try {
4691
+ hostname = new URL(url).hostname.toLowerCase();
4692
+ } catch {
4693
+ return false;
4694
+ }
4695
+ if ("localhost" === hostname || "::1" === hostname || "[::1]" === hostname) return true;
4696
+ if (hostname.endsWith(".localhost") || hostname.endsWith(".local")) return true;
4697
+ if (/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(hostname)) return true;
4698
+ if ("0.0.0.0" === hostname) return true;
4699
+ return false;
4700
+ }
4688
4701
  const HTTP_STATUS_MESSAGE = {
4689
4702
  400: "请求参数错误,请检查参数格式是否正确!",
4690
4703
  401: "登录状态已失效,请重新登录后重试!",
@@ -4721,7 +4734,14 @@ var __webpack_exports__ = {};
4721
4734
  };
4722
4735
  class Http {
4723
4736
  static handleApiError(error) {
4724
- if (error && "object" == typeof error && "code" in error && "message" in error) return error;
4737
+ if (error && "object" == typeof error && "code" in error && "message" in error) {
4738
+ const resp = error;
4739
+ if ("string" != typeof resp.message || !resp.message.trim()) return {
4740
+ ...resp,
4741
+ message: USER_MESSAGE.SYSTEM_ERROR
4742
+ };
4743
+ return resp;
4744
+ }
4725
4745
  return {
4726
4746
  code: 500,
4727
4747
  message: USER_MESSAGE.SYSTEM_ERROR,
@@ -4871,17 +4891,28 @@ var __webpack_exports__ = {};
4871
4891
  const status = error.extra?.alarmStatus;
4872
4892
  const axiosCode = error.extra?.alarmErrorCode;
4873
4893
  const method = (config.method || "get").toUpperCase();
4874
- const url = config.url || "-";
4894
+ const baseURL = config.baseURL || this.apiClient.defaults.baseURL || "";
4895
+ const fullUrl = config.url ? /^https?:\/\//.test(config.url) ? config.url : `${baseURL.replace(/\/$/, "")}${config.url}` : baseURL;
4896
+ if (!fullUrl) {
4897
+ this.logger?.debug(`[告警跳过] 请求失败但无 URL,不上报: ${error.message}`);
4898
+ return;
4899
+ }
4900
+ if (isLocalAddress(fullUrl)) {
4901
+ this.logger?.debug(`[告警跳过] 本机地址不上报: ${fullUrl}`);
4902
+ return;
4903
+ }
4904
+ const rawMsg = "string" == typeof error.message && error.message.trim() ? error.message : "";
4905
+ const baseMsg = rawMsg || `请求失败(无错误文案,code=${error.code ?? "unknown"})`;
4875
4906
  const retriedSuffix = attempts > 0 ? `(已重试${attempts}次仍失败)` : "";
4876
4907
  reportFeishuAlarm({
4877
4908
  level: status && ALARM_STATUS.has(status) ? "alarm" : "warning",
4878
- platform: this.platform || "unknown",
4909
+ platform: "@iflyrpa/playwright",
4879
4910
  source: "http",
4880
- stage: `${method} ${url}`,
4911
+ stage: `${method} ${fullUrl}`,
4881
4912
  errorType: status ? `HTTP_${status}` : axiosCode || "NETWORK_ERROR",
4882
4913
  code: error.code,
4883
- msg: `${error.message}${retriedSuffix}`,
4884
- url: config.url,
4914
+ msg: `${baseMsg}${retriedSuffix}`,
4915
+ url: fullUrl,
4885
4916
  title: "RPA接口异常"
4886
4917
  });
4887
4918
  }
@@ -6050,7 +6081,7 @@ var __webpack_exports__ = {};
6050
6081
  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])$/;
6051
6082
  const regexes_base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
6052
6083
  const regexes_base64url = /^[A-Za-z0-9_-]*$/;
6053
- 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])?)*\.?$/;
6084
+ 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])?)*\.?$/;
6054
6085
  const e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
6055
6086
  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])))";
6056
6087
  const regexes_date = /*@__PURE__*/ new RegExp(`^${dateSource}$`);
@@ -6646,7 +6677,7 @@ var __webpack_exports__ = {};
6646
6677
  code: "invalid_format",
6647
6678
  format: "url",
6648
6679
  note: "Invalid hostname",
6649
- pattern: hostname.source,
6680
+ pattern: regexes_hostname.source,
6650
6681
  input: payload.value,
6651
6682
  inst,
6652
6683
  continue: !def.abort
@@ -20827,8 +20858,8 @@ var __webpack_exports__ = {};
20827
20858
  const resultCode = publishResult.data?.baseResp?.errcode ?? publishResult.errCode;
20828
20859
  const resultMsg = publishResult.data?.baseResp?.errmsg ?? (0 === resultCode ? "发布成功" : `发布失败(errCode=${resultCode})`);
20829
20860
  if (0 === resultCode) {
20830
- const publishId = extractEncFileKey(coverUpload.downloadUrl);
20831
- if (!publishId) task.logger.error(`[shipinhaoPublishVideo] 封面 DownloadURL 中未解析到 encfilekey,关联 id 为空: ${coverUpload.downloadUrl}`);
20861
+ const publishId = extractEncFileKey(verticalCoverUpload.downloadUrl);
20862
+ if (!publishId) task.logger.error(`[shipinhaoPublishVideo] 封面 DownloadURL 中未解析到 encfilekey,关联 id 为空: ${verticalCoverUpload.downloadUrl}`);
20832
20863
  await updateTaskState?.({
20833
20864
  state: share_namespaceObject.TaskState.SUCCESS,
20834
20865
  result: {
@@ -27451,4 +27482,4 @@ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_targe
27451
27482
  });
27452
27483
 
27453
27484
  //# sourceMappingURL=index.js.map
27454
- //# debugId=8315ee33-ea9b-5a8e-92af-cf3835f6ed70
27485
+ //# debugId=eab7e6bf-8230-5cac-87e0-bda79dd9176d