@e-mc/request 0.12.0 → 0.12.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/README.md +4 -4
- package/index.js +5 -9
- package/package.json +3 -3
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.2/lib/index.d.ts)
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
import type { IModule, ModuleConstructor } from "./index";
|
|
@@ -253,9 +253,9 @@ instance.get("http://hostname/path/config.yml", options).then(data => {
|
|
|
253
253
|
|
|
254
254
|
## References
|
|
255
255
|
|
|
256
|
-
- https://www.unpkg.com/@e-mc/types@0.12.
|
|
257
|
-
- https://www.unpkg.com/@e-mc/types@0.12.
|
|
258
|
-
- https://www.unpkg.com/@e-mc/types@0.12.
|
|
256
|
+
- https://www.unpkg.com/@e-mc/types@0.12.2/lib/http.d.ts
|
|
257
|
+
- https://www.unpkg.com/@e-mc/types@0.12.2/lib/request.d.ts
|
|
258
|
+
- https://www.unpkg.com/@e-mc/types@0.12.2/lib/settings.d.ts
|
|
259
259
|
|
|
260
260
|
* https://www.npmjs.com/package/@types/node
|
|
261
261
|
|
package/index.js
CHANGED
|
@@ -427,7 +427,7 @@ function parseBinOpts(instance, options, ignore, skip) {
|
|
|
427
427
|
case '--help':
|
|
428
428
|
return [];
|
|
429
429
|
default:
|
|
430
|
-
return match[3] ? [match[1]
|
|
430
|
+
return match[3] ? [match[1] + '=' + (0, types_1.sanitizeArgs)(match[3])] : [match[1]];
|
|
431
431
|
}
|
|
432
432
|
}
|
|
433
433
|
}
|
|
@@ -1427,7 +1427,7 @@ class Request extends module_1 {
|
|
|
1427
1427
|
closeTorrent(pid);
|
|
1428
1428
|
reject(err);
|
|
1429
1429
|
};
|
|
1430
|
-
const { pid, stdout, stderr } = child_process.spawn((0, types_1.sanitizeCmd)(ARIA2.BIN
|
|
1430
|
+
const { pid, stdout, stderr } = child_process.spawn((0, types_1.sanitizeCmd)(ARIA2.BIN, args), { cwd: pathname, shell: true, signal: signal || this.signal, uid: ARIA2.EXEC_UID, gid: ARIA2.EXEC_GID })
|
|
1431
1431
|
.on('exit', code => {
|
|
1432
1432
|
closeTorrent(pid);
|
|
1433
1433
|
if (this.aborted) {
|
|
@@ -1544,14 +1544,10 @@ class Request extends module_1 {
|
|
|
1544
1544
|
switch (command) {
|
|
1545
1545
|
case 'copy':
|
|
1546
1546
|
case 'copyto':
|
|
1547
|
-
|
|
1548
|
-
return Promise.reject((0, types_1.errorMessage)("rclone", "Unsupported protocol", uri));
|
|
1549
|
-
}
|
|
1547
|
+
source = uri.replace(/^rclone:\?/i, '');
|
|
1550
1548
|
break;
|
|
1551
1549
|
case 'copyurl':
|
|
1552
|
-
|
|
1553
|
-
return Promise.reject((0, types_1.errorMessage)("rclone", "Unsupported protocol", uri));
|
|
1554
|
-
}
|
|
1550
|
+
source = uri;
|
|
1555
1551
|
break;
|
|
1556
1552
|
default:
|
|
1557
1553
|
return Promise.reject((0, types_1.errorMessage)("rclone", "Invalid command", command || uri));
|
|
@@ -1724,7 +1720,7 @@ class Request extends module_1 {
|
|
|
1724
1720
|
commitLog(types_1.STATUS_TYPE.ERROR, err);
|
|
1725
1721
|
}
|
|
1726
1722
|
};
|
|
1727
|
-
const { stdout, stderr } = child_process.spawn((0, types_1.sanitizeCmd)(RCLONE.BIN
|
|
1723
|
+
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 })
|
|
1728
1724
|
.on('exit', code => {
|
|
1729
1725
|
if (options.signal || this.aborted) {
|
|
1730
1726
|
reject((0, types_1.createAbortError)());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/request",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"description": "Request constructor for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"license": "BSD-3-Clause",
|
|
21
21
|
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/module": "0.12.
|
|
24
|
-
"@e-mc/types": "0.12.
|
|
23
|
+
"@e-mc/module": "0.12.2",
|
|
24
|
+
"@e-mc/types": "0.12.2",
|
|
25
25
|
"combined-stream": "^1.0.8",
|
|
26
26
|
"js-yaml": "^4.1.0",
|
|
27
27
|
"picomatch": "^4.0.2",
|