@e-mc/request 0.12.5 → 0.12.7
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/README.md +4 -4
- package/index.js +10 -10
- package/package.json +3 -3
- package/util.js +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
## Interface
|
|
11
11
|
|
|
12
|
-
* [View Source](https://www.unpkg.com/@e-mc/types@0.12.
|
|
12
|
+
* [View Source](https://www.unpkg.com/@e-mc/types@0.12.7/lib/index.d.ts)
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
import type { IModule, ModuleConstructor } from "./index";
|
|
@@ -255,9 +255,9 @@ instance.get("http://hostname/path/config.yml", options).then(data => {
|
|
|
255
255
|
|
|
256
256
|
## References
|
|
257
257
|
|
|
258
|
-
- https://www.unpkg.com/@e-mc/types@0.12.
|
|
259
|
-
- https://www.unpkg.com/@e-mc/types@0.12.
|
|
260
|
-
- https://www.unpkg.com/@e-mc/types@0.12.
|
|
258
|
+
- https://www.unpkg.com/@e-mc/types@0.12.7/lib/http.d.ts
|
|
259
|
+
- https://www.unpkg.com/@e-mc/types@0.12.7/lib/request.d.ts
|
|
260
|
+
- https://www.unpkg.com/@e-mc/types@0.12.7/lib/settings.d.ts
|
|
261
261
|
|
|
262
262
|
* https://www.npmjs.com/package/@types/node
|
|
263
263
|
|
package/index.js
CHANGED
|
@@ -21,7 +21,7 @@ const host_1 = require("@e-mc/request/http/host");
|
|
|
21
21
|
const adapter_1 = require("@e-mc/request/http/adapter");
|
|
22
22
|
const kRequest = Symbol.for('request:constructor');
|
|
23
23
|
const SUPPORTED_NODE20 = (0, types_1.supported)(20);
|
|
24
|
-
const SUPPORTED_ZSTD = (0, types_1.supported)(23, 8)
|
|
24
|
+
const SUPPORTED_ZSTD = (0, types_1.supported)(23, 8) || (0, types_1.supported)(22, 15, 0, true);
|
|
25
25
|
const REGEXP_PEMCERT = /^-{3,}[ \t]*BEGIN[ \t].+\n-{3,}[ \t]*END[ \t][^-]+-{3,}$/s;
|
|
26
26
|
const REGEXP_GLOBWITHIN = /\\\?|(?:(?<!\\)(?:\*|\[!?[^!\]]+\]|\{(?:[^,]+,)+[^}]+\}|[!?+*@]\((?:[^|]+\|)*[^)]+\)|\?.*\?|\?$))/;
|
|
27
27
|
const REGEXP_RCLONE = /^rclone:\?/i;
|
|
@@ -533,7 +533,7 @@ function finalizeBinArgs(instance, name, bin, args, opts, binOpts, cmd = []) {
|
|
|
533
533
|
instance.formatMessage(32768, name.toUpperCase(), [bin].concat(cmd).join(' '), args.join(' '), { ...module_1.LOG_STYLE_WARN });
|
|
534
534
|
}
|
|
535
535
|
else {
|
|
536
|
-
instance.addLog(
|
|
536
|
+
instance.addLog(4, path.basename(bin) + ' ' + args.join(' '), name);
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
539
|
return args;
|
|
@@ -1472,10 +1472,10 @@ class Request extends module_1 {
|
|
|
1472
1472
|
if (!silent && LOG_HTTP && LOG_TIMEPROCESS) {
|
|
1473
1473
|
this.writeTimeProcess("aria2", uri, startTime, { type: 1024, queue: true, messageUnit, messageUnitMinWidth: 9, bypassLog: true });
|
|
1474
1474
|
}
|
|
1475
|
-
commitLog(
|
|
1475
|
+
commitLog(4, out);
|
|
1476
1476
|
}
|
|
1477
1477
|
else {
|
|
1478
|
-
commitLog(
|
|
1478
|
+
commitLog(2, "No files were successfully downloaded");
|
|
1479
1479
|
}
|
|
1480
1480
|
resolve(result);
|
|
1481
1481
|
})
|
|
@@ -1702,25 +1702,25 @@ class Request extends module_1 {
|
|
|
1702
1702
|
}
|
|
1703
1703
|
else if ((0, types_1.isPlainObject)(data.stats)) {
|
|
1704
1704
|
if (data.stats.fatalError) {
|
|
1705
|
-
commitLog(
|
|
1705
|
+
commitLog(2, data.msg);
|
|
1706
1706
|
}
|
|
1707
1707
|
else {
|
|
1708
1708
|
if (command === 'copyurl' && data.stats.totalTransfers > 0) {
|
|
1709
1709
|
data.object = module_1.isPath(pathname, true) ? pathname : '';
|
|
1710
1710
|
out.push(data);
|
|
1711
1711
|
}
|
|
1712
|
-
commitLog(
|
|
1712
|
+
commitLog(4, data.msg);
|
|
1713
1713
|
}
|
|
1714
1714
|
}
|
|
1715
1715
|
break;
|
|
1716
1716
|
case 'error':
|
|
1717
|
-
commitLog(
|
|
1717
|
+
commitLog(2, data.msg);
|
|
1718
1718
|
break;
|
|
1719
1719
|
}
|
|
1720
1720
|
}
|
|
1721
1721
|
}
|
|
1722
1722
|
catch (err) {
|
|
1723
|
-
commitLog(
|
|
1723
|
+
commitLog(2, err);
|
|
1724
1724
|
}
|
|
1725
1725
|
};
|
|
1726
1726
|
const { stdout, stderr } = child_process.spawn((0, types_1.sanitizeCmd)(RCLONE.BIN, args), { cwd, shell: true, signal: this.signal, uid: RCLONE.EXEC_UID, gid: RCLONE.EXEC_GID })
|
|
@@ -1738,10 +1738,10 @@ class Request extends module_1 {
|
|
|
1738
1738
|
}
|
|
1739
1739
|
const result = out.map(item => command === 'copyurl' ? item.object : path.join(cwd, item.object));
|
|
1740
1740
|
if (out.length > 0) {
|
|
1741
|
-
commitLog(
|
|
1741
|
+
commitLog(4, result);
|
|
1742
1742
|
}
|
|
1743
1743
|
else {
|
|
1744
|
-
commitLog(
|
|
1744
|
+
commitLog(2, "No files were successfully downloaded");
|
|
1745
1745
|
}
|
|
1746
1746
|
resolve(result);
|
|
1747
1747
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/request",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.7",
|
|
4
4
|
"description": "Request constructor for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"license": "BSD-3-Clause",
|
|
20
20
|
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@e-mc/module": "0.12.
|
|
23
|
-
"@e-mc/types": "0.12.
|
|
22
|
+
"@e-mc/module": "0.12.7",
|
|
23
|
+
"@e-mc/types": "0.12.7",
|
|
24
24
|
"combined-stream": "^1.0.8",
|
|
25
25
|
"js-yaml": "^4.1.0",
|
|
26
26
|
"picomatch": "^4.0.3",
|
package/util.js
CHANGED
|
@@ -224,7 +224,7 @@ function fromURL(url, value) {
|
|
|
224
224
|
return url.protocol + '//' + (auth && (auth + '@')) + url.hostname + (url.port ? ':' + url.port : '') + (value.startsWith('/') ? '' : '/') + value;
|
|
225
225
|
}
|
|
226
226
|
function fromStatusCode(value) {
|
|
227
|
-
value = +value;
|
|
227
|
+
value = Math.floor(+value);
|
|
228
228
|
if (value < 200) {
|
|
229
229
|
switch (value) {
|
|
230
230
|
case 100:
|