@iflyrpa/actions 4.0.4-beta.1 → 4.0.4-beta.2
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/actions/shipinhaoPublish/uploader.d.ts +4 -0
- package/dist/bundle.js +18 -9
- package/dist/bundle.js.map +1 -1
- package/dist/index.js +18 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
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]="253dad15-2fc6-50a4-a558-e0db69e40773")}catch(e){}}();
|
|
1
3
|
import * as __WEBPACK_EXTERNAL_MODULE_crypto__ from "crypto";
|
|
2
4
|
import * as __WEBPACK_EXTERNAL_MODULE_fs__ from "fs";
|
|
3
5
|
import * as __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_package_json_58ae5f06__ from "@iflyrpa/share/package.json";
|
|
@@ -4350,7 +4352,7 @@ function __webpack_require__(moduleId) {
|
|
|
4350
4352
|
return module;
|
|
4351
4353
|
};
|
|
4352
4354
|
})();
|
|
4353
|
-
var package_namespaceObject = JSON.parse('{"i8":"4.0.4-beta.
|
|
4355
|
+
var package_namespaceObject = JSON.parse('{"i8":"4.0.4-beta.2"}');
|
|
4354
4356
|
const PROXY_CREDENTIALS = [
|
|
4355
4357
|
{
|
|
4356
4358
|
ip: "47.110.131.129",
|
|
@@ -4583,11 +4585,12 @@ class Http {
|
|
|
4583
4585
|
this.logger?.debug(`未处理的网络错误代码: ${error.code} ${error.message}`, {
|
|
4584
4586
|
errorString: stringifyError(error)
|
|
4585
4587
|
});
|
|
4586
|
-
_message =
|
|
4588
|
+
_message = `网络错误: ${error.message}`;
|
|
4587
4589
|
break;
|
|
4588
4590
|
}
|
|
4589
4591
|
}
|
|
4590
|
-
|
|
4592
|
+
if (error.code && !error.response?.data) errorResponse.message = _message || errorResponse.message;
|
|
4593
|
+
else errorResponse.message = errorResponse.message ? errorResponse.message : _message;
|
|
4591
4594
|
if ("canceled" === errorResponse.message) {
|
|
4592
4595
|
const message = errorResponse.extra?.isProxyRequest ? "代理连接建立超时,请更换区域或稍后重试!" : "网络请求超时,请稍后重试!";
|
|
4593
4596
|
errorResponse.message = message;
|
|
@@ -18017,6 +18020,11 @@ class VideoChannelUploader {
|
|
|
18017
18020
|
this.concurrentLimit = config.concurrentLimit || 4;
|
|
18018
18021
|
this.singleFileSize = config.singleFileSize || 10485760;
|
|
18019
18022
|
this.http = config.http || new Http();
|
|
18023
|
+
this.reqOptions = {
|
|
18024
|
+
timeout: config.timeout ?? 60000,
|
|
18025
|
+
retries: config.retries ?? 3,
|
|
18026
|
+
retryDelay: config.retryDelay ?? 2000
|
|
18027
|
+
};
|
|
18020
18028
|
}
|
|
18021
18029
|
calculateMd5(buffer) {
|
|
18022
18030
|
const MAX_SIZE = 5242880;
|
|
@@ -18073,7 +18081,7 @@ class VideoChannelUploader {
|
|
|
18073
18081
|
url: filePath,
|
|
18074
18082
|
method: "get",
|
|
18075
18083
|
responseType: "arraybuffer"
|
|
18076
|
-
});
|
|
18084
|
+
}, this.reqOptions);
|
|
18077
18085
|
return Buffer.from(resp);
|
|
18078
18086
|
}
|
|
18079
18087
|
return __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].promises.readFile(filePath);
|
|
@@ -18103,7 +18111,7 @@ class VideoChannelUploader {
|
|
|
18103
18111
|
headers,
|
|
18104
18112
|
data: requestBody,
|
|
18105
18113
|
defaultErrorMsg: "获取UploadID失败"
|
|
18106
|
-
});
|
|
18114
|
+
}, this.reqOptions);
|
|
18107
18115
|
if (!resp?.UploadID) throw new Error(`获取 UploadID 失败: ${resp?.errMsg || "未知错误"}`);
|
|
18108
18116
|
return resp.UploadID;
|
|
18109
18117
|
}
|
|
@@ -18124,7 +18132,7 @@ class VideoChannelUploader {
|
|
|
18124
18132
|
headers,
|
|
18125
18133
|
data: chunk,
|
|
18126
18134
|
defaultErrorMsg: `分片 ${partNumber} 上传失败`
|
|
18127
|
-
});
|
|
18135
|
+
}, this.reqOptions);
|
|
18128
18136
|
if (resp?.errCode !== void 0 && 0 !== resp.errCode) throw new Error(`分片 ${partNumber} 上传失败: ${resp.errMsg}`);
|
|
18129
18137
|
if (onProgress) onProgress(chunk.length);
|
|
18130
18138
|
return resp.ETag || "";
|
|
@@ -18148,7 +18156,7 @@ class VideoChannelUploader {
|
|
|
18148
18156
|
headers,
|
|
18149
18157
|
data: requestBody,
|
|
18150
18158
|
defaultErrorMsg: "确认分片上传失败"
|
|
18151
|
-
});
|
|
18159
|
+
}, this.reqOptions);
|
|
18152
18160
|
if (resp?.ListPartsResult?.Part) return resp.ListPartsResult.Part.map((p)=>({
|
|
18153
18161
|
PartNumber: parseInt(p.PartNumber),
|
|
18154
18162
|
ETag: p.ETag
|
|
@@ -18174,7 +18182,7 @@ class VideoChannelUploader {
|
|
|
18174
18182
|
headers,
|
|
18175
18183
|
data: requestBody,
|
|
18176
18184
|
defaultErrorMsg: "完成上传失败"
|
|
18177
|
-
});
|
|
18185
|
+
}, this.reqOptions);
|
|
18178
18186
|
if (!resp?.DownloadURL) throw new Error(`完成上传失败: ${resp?.errMsg || "未知错误"}`);
|
|
18179
18187
|
return resp.DownloadURL;
|
|
18180
18188
|
}
|
|
@@ -25481,4 +25489,5 @@ class Action {
|
|
|
25481
25489
|
var __webpack_exports__version = package_namespaceObject.i8;
|
|
25482
25490
|
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, ShipinhaoSendMsgParamsSchema, ToutiaoPublishParamsSchema, UnreadCountSchema, WeixinPublishParamsSchema, WxBjhSessionParamsSchema, XhsWebSearchParamsSchema, XiaohongshuPublishParamsSchema, bjhConfigDataSchema, getFileState, reportLogger, rpaAction_Server_Mock, ttConfigDataSchema, wxConfigDataSchema, xhsConfigDataSchema, __webpack_exports__version as version };
|
|
25483
25491
|
|
|
25484
|
-
//# sourceMappingURL=index.mjs.map
|
|
25492
|
+
//# sourceMappingURL=index.mjs.map
|
|
25493
|
+
//# debugId=253dad15-2fc6-50a4-a558-e0db69e40773
|