@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
|
@@ -7,6 +7,9 @@ interface UploadConfig {
|
|
|
7
7
|
concurrentLimit?: number;
|
|
8
8
|
singleFileSize?: number;
|
|
9
9
|
http?: Http;
|
|
10
|
+
timeout?: number;
|
|
11
|
+
retries?: number;
|
|
12
|
+
retryDelay?: number;
|
|
10
13
|
}
|
|
11
14
|
/**
|
|
12
15
|
* 上传进度回调
|
|
@@ -26,6 +29,7 @@ export declare class VideoChannelUploader {
|
|
|
26
29
|
private concurrentLimit;
|
|
27
30
|
private singleFileSize;
|
|
28
31
|
private http;
|
|
32
|
+
private reqOptions;
|
|
29
33
|
private uploadTaskId;
|
|
30
34
|
private partInfo;
|
|
31
35
|
private md5;
|
package/dist/bundle.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/*! For license information please see bundle.js.LICENSE.txt */
|
|
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]="b2126d25-6ff1-5818-8cdb-7b95d8c6627c")}catch(e){}}();
|
|
2
4
|
var __webpack_modules__ = {
|
|
3
5
|
"../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js": function(__unused_webpack_module, exports1, __webpack_require__) {
|
|
4
6
|
"use strict";
|
|
@@ -12488,7 +12490,7 @@ var __webpack_exports__ = {};
|
|
|
12488
12490
|
var package_namespaceObject = {
|
|
12489
12491
|
i8: "0.1.2"
|
|
12490
12492
|
};
|
|
12491
|
-
var package_namespaceObject_0 = JSON.parse('{"i8":"4.0.4-beta.
|
|
12493
|
+
var package_namespaceObject_0 = JSON.parse('{"i8":"4.0.4-beta.2"}');
|
|
12492
12494
|
const external_node_fs_namespaceObject = require("node:fs");
|
|
12493
12495
|
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
12494
12496
|
const external_node_http_namespaceObject = require("node:http");
|
|
@@ -27268,11 +27270,12 @@ var __webpack_exports__ = {};
|
|
|
27268
27270
|
this.logger?.debug(`未处理的网络错误代码: ${error.code} ${error.message}`, {
|
|
27269
27271
|
errorString: stringifyError(error)
|
|
27270
27272
|
});
|
|
27271
|
-
_message =
|
|
27273
|
+
_message = `网络错误: ${error.message}`;
|
|
27272
27274
|
break;
|
|
27273
27275
|
}
|
|
27274
27276
|
}
|
|
27275
|
-
|
|
27277
|
+
if (error.code && !error.response?.data) errorResponse.message = _message || errorResponse.message;
|
|
27278
|
+
else errorResponse.message = errorResponse.message ? errorResponse.message : _message;
|
|
27276
27279
|
if ("canceled" === errorResponse.message) {
|
|
27277
27280
|
const message = errorResponse.extra?.isProxyRequest ? "代理连接建立超时,请更换区域或稍后重试!" : "网络请求超时,请稍后重试!";
|
|
27278
27281
|
errorResponse.message = message;
|
|
@@ -43167,6 +43170,11 @@ var __webpack_exports__ = {};
|
|
|
43167
43170
|
this.concurrentLimit = config.concurrentLimit || 4;
|
|
43168
43171
|
this.singleFileSize = config.singleFileSize || 10485760;
|
|
43169
43172
|
this.http = config.http || new Http();
|
|
43173
|
+
this.reqOptions = {
|
|
43174
|
+
timeout: config.timeout ?? 60000,
|
|
43175
|
+
retries: config.retries ?? 3,
|
|
43176
|
+
retryDelay: config.retryDelay ?? 2000
|
|
43177
|
+
};
|
|
43170
43178
|
}
|
|
43171
43179
|
calculateMd5(buffer) {
|
|
43172
43180
|
const MAX_SIZE = 5242880;
|
|
@@ -43223,7 +43231,7 @@ var __webpack_exports__ = {};
|
|
|
43223
43231
|
url: filePath,
|
|
43224
43232
|
method: "get",
|
|
43225
43233
|
responseType: "arraybuffer"
|
|
43226
|
-
});
|
|
43234
|
+
}, this.reqOptions);
|
|
43227
43235
|
return Buffer.from(resp);
|
|
43228
43236
|
}
|
|
43229
43237
|
return external_node_fs_default().promises.readFile(filePath);
|
|
@@ -43253,7 +43261,7 @@ var __webpack_exports__ = {};
|
|
|
43253
43261
|
headers,
|
|
43254
43262
|
data: requestBody,
|
|
43255
43263
|
defaultErrorMsg: "获取UploadID失败"
|
|
43256
|
-
});
|
|
43264
|
+
}, this.reqOptions);
|
|
43257
43265
|
if (!resp?.UploadID) throw new Error(`获取 UploadID 失败: ${resp?.errMsg || "未知错误"}`);
|
|
43258
43266
|
return resp.UploadID;
|
|
43259
43267
|
}
|
|
@@ -43274,7 +43282,7 @@ var __webpack_exports__ = {};
|
|
|
43274
43282
|
headers,
|
|
43275
43283
|
data: chunk,
|
|
43276
43284
|
defaultErrorMsg: `分片 ${partNumber} 上传失败`
|
|
43277
|
-
});
|
|
43285
|
+
}, this.reqOptions);
|
|
43278
43286
|
if (resp?.errCode !== void 0 && 0 !== resp.errCode) throw new Error(`分片 ${partNumber} 上传失败: ${resp.errMsg}`);
|
|
43279
43287
|
if (onProgress) onProgress(chunk.length);
|
|
43280
43288
|
return resp.ETag || "";
|
|
@@ -43298,7 +43306,7 @@ var __webpack_exports__ = {};
|
|
|
43298
43306
|
headers,
|
|
43299
43307
|
data: requestBody,
|
|
43300
43308
|
defaultErrorMsg: "确认分片上传失败"
|
|
43301
|
-
});
|
|
43309
|
+
}, this.reqOptions);
|
|
43302
43310
|
if (resp?.ListPartsResult?.Part) return resp.ListPartsResult.Part.map((p)=>({
|
|
43303
43311
|
PartNumber: parseInt(p.PartNumber),
|
|
43304
43312
|
ETag: p.ETag
|
|
@@ -43324,7 +43332,7 @@ var __webpack_exports__ = {};
|
|
|
43324
43332
|
headers,
|
|
43325
43333
|
data: requestBody,
|
|
43326
43334
|
defaultErrorMsg: "完成上传失败"
|
|
43327
|
-
});
|
|
43335
|
+
}, this.reqOptions);
|
|
43328
43336
|
if (!resp?.DownloadURL) throw new Error(`完成上传失败: ${resp?.errMsg || "未知错误"}`);
|
|
43329
43337
|
return resp.DownloadURL;
|
|
43330
43338
|
}
|
|
@@ -50635,4 +50643,5 @@ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_targe
|
|
|
50635
50643
|
value: true
|
|
50636
50644
|
});
|
|
50637
50645
|
|
|
50638
|
-
//# sourceMappingURL=bundle.js.map
|
|
50646
|
+
//# sourceMappingURL=bundle.js.map
|
|
50647
|
+
//# debugId=b2126d25-6ff1-5818-8cdb-7b95d8c6627c
|