@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/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]="
|
|
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.
|
|
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: "登录状态已失效,请重新登录后重试!",
|
|
@@ -4654,7 +4667,14 @@ const HTTP_STATUS_MESSAGE = {
|
|
|
4654
4667
|
};
|
|
4655
4668
|
class Http {
|
|
4656
4669
|
static handleApiError(error) {
|
|
4657
|
-
if (error && "object" == typeof error && "code" in error && "message" in error)
|
|
4670
|
+
if (error && "object" == typeof error && "code" in error && "message" in error) {
|
|
4671
|
+
const resp = error;
|
|
4672
|
+
if ("string" != typeof resp.message || !resp.message.trim()) return {
|
|
4673
|
+
...resp,
|
|
4674
|
+
message: USER_MESSAGE.SYSTEM_ERROR
|
|
4675
|
+
};
|
|
4676
|
+
return resp;
|
|
4677
|
+
}
|
|
4658
4678
|
return {
|
|
4659
4679
|
code: 500,
|
|
4660
4680
|
message: USER_MESSAGE.SYSTEM_ERROR,
|
|
@@ -4804,17 +4824,28 @@ class Http {
|
|
|
4804
4824
|
const status = error.extra?.alarmStatus;
|
|
4805
4825
|
const axiosCode = error.extra?.alarmErrorCode;
|
|
4806
4826
|
const method = (config.method || "get").toUpperCase();
|
|
4807
|
-
const
|
|
4827
|
+
const baseURL = config.baseURL || this.apiClient.defaults.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
|
+
}
|
|
4837
|
+
const rawMsg = "string" == typeof error.message && error.message.trim() ? error.message : "";
|
|
4838
|
+
const baseMsg = rawMsg || `请求失败(无错误文案,code=${error.code ?? "unknown"})`;
|
|
4808
4839
|
const retriedSuffix = attempts > 0 ? `(已重试${attempts}次仍失败)` : "";
|
|
4809
4840
|
reportFeishuAlarm({
|
|
4810
4841
|
level: status && ALARM_STATUS.has(status) ? "alarm" : "warning",
|
|
4811
|
-
platform:
|
|
4842
|
+
platform: "@iflyrpa/playwright",
|
|
4812
4843
|
source: "http",
|
|
4813
|
-
stage: `${method} ${
|
|
4844
|
+
stage: `${method} ${fullUrl}`,
|
|
4814
4845
|
errorType: status ? `HTTP_${status}` : axiosCode || "NETWORK_ERROR",
|
|
4815
4846
|
code: error.code,
|
|
4816
|
-
msg: `${
|
|
4817
|
-
url:
|
|
4847
|
+
msg: `${baseMsg}${retriedSuffix}`,
|
|
4848
|
+
url: fullUrl,
|
|
4818
4849
|
title: "RPA接口异常"
|
|
4819
4850
|
});
|
|
4820
4851
|
}
|
|
@@ -5981,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-
|
|
|
5981
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])$/;
|
|
5982
6013
|
const regexes_base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
5983
6014
|
const regexes_base64url = /^[A-Za-z0-9_-]*$/;
|
|
5984
|
-
const
|
|
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])?)*\.?$/;
|
|
5985
6016
|
const e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
|
|
5986
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])))";
|
|
5987
6018
|
const regexes_date = /*@__PURE__*/ new RegExp(`^${dateSource}$`);
|
|
@@ -6577,7 +6608,7 @@ const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def)=>{
|
|
|
6577
6608
|
code: "invalid_format",
|
|
6578
6609
|
format: "url",
|
|
6579
6610
|
note: "Invalid hostname",
|
|
6580
|
-
pattern:
|
|
6611
|
+
pattern: regexes_hostname.source,
|
|
6581
6612
|
input: payload.value,
|
|
6582
6613
|
inst,
|
|
6583
6614
|
continue: !def.abort
|
|
@@ -20745,8 +20776,8 @@ const shipinhaoPublishVideo_mock_mockAction = async (task, params)=>{
|
|
|
20745
20776
|
const resultCode = publishResult.data?.baseResp?.errcode ?? publishResult.errCode;
|
|
20746
20777
|
const resultMsg = publishResult.data?.baseResp?.errmsg ?? (0 === resultCode ? "发布成功" : `发布失败(errCode=${resultCode})`);
|
|
20747
20778
|
if (0 === resultCode) {
|
|
20748
|
-
const publishId = extractEncFileKey(
|
|
20749
|
-
if (!publishId) task.logger.error(`[shipinhaoPublishVideo] 封面 DownloadURL 中未解析到 encfilekey,关联 id 为空: ${
|
|
20779
|
+
const publishId = extractEncFileKey(verticalCoverUpload.downloadUrl);
|
|
20780
|
+
if (!publishId) task.logger.error(`[shipinhaoPublishVideo] 封面 DownloadURL 中未解析到 encfilekey,关联 id 为空: ${verticalCoverUpload.downloadUrl}`);
|
|
20750
20781
|
await updateTaskState?.({
|
|
20751
20782
|
state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.SUCCESS,
|
|
20752
20783
|
result: {
|
|
@@ -27365,4 +27396,4 @@ var __webpack_exports__version = package_namespaceObject.i8;
|
|
|
27365
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 };
|
|
27366
27397
|
|
|
27367
27398
|
//# sourceMappingURL=index.mjs.map
|
|
27368
|
-
//# debugId=
|
|
27399
|
+
//# debugId=d182299f-1883-507d-b046-2e397746a037
|