@e-mc/request 0.12.4 → 0.12.6

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 CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Interface
11
11
 
12
- * [View Source](https://www.unpkg.com/@e-mc/types@0.12.4/lib/index.d.ts)
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.12.6/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.4/lib/http.d.ts
259
- - https://www.unpkg.com/@e-mc/types@0.12.4/lib/request.d.ts
260
- - https://www.unpkg.com/@e-mc/types@0.12.4/lib/settings.d.ts
258
+ - https://www.unpkg.com/@e-mc/types@0.12.6/lib/http.d.ts
259
+ - https://www.unpkg.com/@e-mc/types@0.12.6/lib/request.d.ts
260
+ - https://www.unpkg.com/@e-mc/types@0.12.6/lib/settings.d.ts
261
261
 
262
262
  * https://www.npmjs.com/package/@types/node
263
263
 
package/index.js CHANGED
@@ -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(types_1.STATUS_TYPE.INFO, path.basename(bin) + ' ' + args.join(' '), name);
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(types_1.STATUS_TYPE.INFO, out);
1475
+ commitLog(4, out);
1476
1476
  }
1477
1477
  else {
1478
- commitLog(types_1.STATUS_TYPE.ERROR, "No files were successfully downloaded");
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(types_1.STATUS_TYPE.ERROR, data.msg);
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(types_1.STATUS_TYPE.INFO, data.msg);
1712
+ commitLog(4, data.msg);
1713
1713
  }
1714
1714
  }
1715
1715
  break;
1716
1716
  case 'error':
1717
- commitLog(types_1.STATUS_TYPE.ERROR, data.msg);
1717
+ commitLog(2, data.msg);
1718
1718
  break;
1719
1719
  }
1720
1720
  }
1721
1721
  }
1722
1722
  catch (err) {
1723
- commitLog(types_1.STATUS_TYPE.ERROR, err);
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(types_1.STATUS_TYPE.INFO, result);
1741
+ commitLog(4, result);
1742
1742
  }
1743
1743
  else {
1744
- commitLog(types_1.STATUS_TYPE.ERROR, "No files were successfully downloaded");
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.4",
3
+ "version": "0.12.6",
4
4
  "description": "Request constructor for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -13,15 +13,14 @@
13
13
  "directory": "src/request"
14
14
  },
15
15
  "keywords": [
16
- "squared",
17
- "squared-functions"
16
+ "squared"
18
17
  ],
19
18
  "author": "An Pham <anpham6@gmail.com>",
20
19
  "license": "BSD-3-Clause",
21
20
  "homepage": "https://github.com/anpham6/e-mc#readme",
22
21
  "dependencies": {
23
- "@e-mc/module": "0.12.4",
24
- "@e-mc/types": "0.12.4",
22
+ "@e-mc/module": "0.12.6",
23
+ "@e-mc/types": "0.12.6",
25
24
  "combined-stream": "^1.0.8",
26
25
  "js-yaml": "^4.1.0",
27
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: