@e-mc/file-manager 0.12.2 → 0.12.4

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.
Files changed (3) hide show
  1. package/README.md +10 -10
  2. package/index.js +7 -14
  3. package/package.json +11 -11
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.2/lib/index.d.ts)
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.12.4/lib/index.d.ts)
13
13
 
14
14
  ```typescript
15
15
  import type { DataSource, IncrementalMatch, TaskAction } from "./squared";
@@ -307,15 +307,15 @@ NOTE: **FileManager** is a sub-class of [Host](https://www.npmjs.com/package/@e-
307
307
 
308
308
  ## References
309
309
 
310
- - https://www.unpkg.com/@e-mc/types@0.12.2/lib/squared.d.ts
311
- - https://www.unpkg.com/@e-mc/types@0.12.2/lib/asset.d.ts
312
- - https://www.unpkg.com/@e-mc/types@0.12.2/lib/core.d.ts
313
- - https://www.unpkg.com/@e-mc/types@0.12.2/lib/filemanager.d.ts
314
- - https://www.unpkg.com/@e-mc/types@0.12.2/lib/logger.d.ts
315
- - https://www.unpkg.com/@e-mc/types@0.12.2/lib/module.d.ts
316
- - https://www.unpkg.com/@e-mc/types@0.12.2/lib/node.d.ts
317
- - https://www.unpkg.com/@e-mc/types@0.12.2/lib/request.d.ts
318
- - https://www.unpkg.com/@e-mc/types@0.12.2/lib/settings.d.ts
310
+ - https://www.unpkg.com/@e-mc/types@0.12.4/lib/squared.d.ts
311
+ - https://www.unpkg.com/@e-mc/types@0.12.4/lib/asset.d.ts
312
+ - https://www.unpkg.com/@e-mc/types@0.12.4/lib/core.d.ts
313
+ - https://www.unpkg.com/@e-mc/types@0.12.4/lib/filemanager.d.ts
314
+ - https://www.unpkg.com/@e-mc/types@0.12.4/lib/logger.d.ts
315
+ - https://www.unpkg.com/@e-mc/types@0.12.4/lib/module.d.ts
316
+ - https://www.unpkg.com/@e-mc/types@0.12.4/lib/node.d.ts
317
+ - https://www.unpkg.com/@e-mc/types@0.12.4/lib/request.d.ts
318
+ - https://www.unpkg.com/@e-mc/types@0.12.4/lib/settings.d.ts
319
319
 
320
320
  * https://www.npmjs.com/package/@types/node
321
321
 
package/index.js CHANGED
@@ -573,8 +573,7 @@ const closeResponse = (client) => client?.destroy();
573
573
  const isCacheable = (item) => item.initialValue?.cacheable !== false;
574
574
  const getPmOptions = (value, { matchBase = value.startsWith('*') && !value.includes('/'), dot = false } = {}) => ({ matchBase, nocase: core_1.Host.PLATFORM_WIN32, dot });
575
575
  const isDownloadAll = (type) => type === 4 || type === 0;
576
- const isRclone = (value) => typeof value === 'string' && value.startsWith('rclone:?');
577
- const hasFiles = (type, uri) => type === 3 || type === 4 || type === 0 && isRclone(uri);
576
+ const hasFiles = (type, uri) => type === 3 || type === 4 || type === 0 && request_1.isRclone(uri);
578
577
  const hasIncremental = (value) => value === "etag" || value === "exists";
579
578
  const matchPathname = (value) => core_1.Host.PLATFORM_WIN32 ? value.toLowerCase() : value;
580
579
  const equalAddress = (value, other) => value === other || decodeURIComponent(value) === decodeURIComponent(other);
@@ -1185,12 +1184,12 @@ class ProcessFile {
1185
1184
  }
1186
1185
  else if (hasFiles(type, uri)) {
1187
1186
  const mimeType = queue.mimeType || file.mimeType;
1188
- const pathname = host.getTempDir({ uuidDir: true });
1189
- if (!pathname || !mimeType) {
1187
+ if (!mimeType) {
1190
1188
  queue.invalid = true;
1191
- tasks.push(Promise.reject(!pathname ? new Error("Unable to create temp directory") : (0, types_1.errorValue)("MIME not found", uri)));
1189
+ tasks.push(Promise.reject((0, types_1.errorValue)("MIME not found", uri)));
1192
1190
  break;
1193
1191
  }
1192
+ const pathname = (0, types_1.getTempDir)(true);
1194
1193
  tasks.push(new Promise((resolve, reject) => {
1195
1194
  void host.scheduleTask(queue.url || uri, { pathname, binOpts: queue.binOpts || file.binOpts }, (result) => {
1196
1195
  if (result.length > 0) {
@@ -1199,15 +1198,9 @@ class ProcessFile {
1199
1198
  else {
1200
1199
  queue.invalid = true;
1201
1200
  }
1202
- queueMicrotask(() => {
1203
- core_1.Host.removeDir(pathname);
1204
- });
1205
1201
  resolve();
1206
1202
  }, (err) => {
1207
1203
  queue.invalid = true;
1208
- queueMicrotask(() => {
1209
- core_1.Host.removeDir(pathname);
1210
- });
1211
1204
  reject(err);
1212
1205
  }, 4);
1213
1206
  }));
@@ -2394,7 +2387,7 @@ class FileManager extends core_1.Host {
2394
2387
  if (core_1.Host.isFile(uri, 'torrent')) {
2395
2388
  type = 4;
2396
2389
  }
2397
- else if (isRclone(uri)) {
2390
+ else if (request_1.isRclone(uri)) {
2398
2391
  type = 0;
2399
2392
  }
2400
2393
  else if (!file.url) {
@@ -3050,7 +3043,7 @@ class FileManager extends core_1.Host {
3050
3043
  options = { pathname: options };
3051
3044
  }
3052
3045
  options.pathname ||= this.baseDirectory;
3053
- return isRclone(uri) ? this.Request.rclone(uri, options) : this.Request.aria2c(uri, options);
3046
+ return request_1.isRclone(uri) ? this.Request.rclone(uri, options) : this.Request.aria2c(uri, options);
3054
3047
  }
3055
3048
  async start(emptyDir) {
3056
3049
  const listener = (resolve) => {
@@ -3686,7 +3679,7 @@ class FileManager extends core_1.Host {
3686
3679
  }
3687
3680
  downloading[uri] = [];
3688
3681
  this.performAsyncTask();
3689
- const options = { pathname, binOpts: item.binOpts };
3682
+ const options = { pathname, binOpts: item.binOpts, shellExpansion: item.shellExpansion };
3690
3683
  let src;
3691
3684
  if (type === 0) {
3692
3685
  if (item.filename) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/file-manager",
3
- "version": "0.12.2",
3
+ "version": "0.12.4",
4
4
  "description": "FileManager constructor for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -20,17 +20,17 @@
20
20
  "license": "BSD-3-Clause",
21
21
  "homepage": "https://github.com/anpham6/e-mc#readme",
22
22
  "dependencies": {
23
- "@e-mc/cloud": "0.12.2",
24
- "@e-mc/compress": "0.12.2",
25
- "@e-mc/core": "0.12.2",
26
- "@e-mc/document": "0.12.2",
27
- "@e-mc/image": "0.12.2",
28
- "@e-mc/request": "0.12.2",
29
- "@e-mc/task": "0.12.2",
30
- "@e-mc/types": "0.12.2",
31
- "@e-mc/watch": "0.12.2",
23
+ "@e-mc/cloud": "0.12.4",
24
+ "@e-mc/compress": "0.12.4",
25
+ "@e-mc/core": "0.12.4",
26
+ "@e-mc/document": "0.12.4",
27
+ "@e-mc/image": "0.12.4",
28
+ "@e-mc/request": "0.12.4",
29
+ "@e-mc/task": "0.12.4",
30
+ "@e-mc/types": "0.12.4",
31
+ "@e-mc/watch": "0.12.4",
32
32
  "chalk": "4.1.2",
33
33
  "diff": "^7.0.0",
34
- "picomatch": "^4.0.2"
34
+ "picomatch": "^4.0.3"
35
35
  }
36
36
  }