filefive 1.2.0 → 1.3.0

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
@@ -8,7 +8,7 @@ FileFive is a free open-source SFTP/FTP client and file manager with intuitive a
8
8
 
9
9
  It is installed as a Node.js package and uses the web browser as GUI.
10
10
 
11
- FileFive has a unique set of features and may an alternative to FileZilla, Cyberduck, Transmit and ForkLift.
11
+ FileFive has a unique set of features and may be an alternative to FileZilla, Cyberduck, Transmit, ForkLift and Commander One.
12
12
 
13
13
  <p align="center">
14
14
  <img src="https://github.com/miroshnikov/filefive/blob/main/screenshot.png" alt="FileFive" />
@@ -37,11 +37,12 @@ Options:
37
37
  ## Features
38
38
  - Cross-platform, runs on Mac OS, Linux and any *nix with Node.js
39
39
  - Supports SSH File Transfer Protocol (SFTP) and FTP
40
- - Minimalistic and intuitive UI, mimicing the VSCode Explorer view
40
+ - Minimalistic and intuitive UI, mimicing the look and feel of VSCode Explorer view
41
41
  - Search/filter files using wildcards and JavaScript Regular Expressions
42
42
  - Synchronized browsing
43
+ - Remote file editing
43
44
  - Connections/servers are plain files stored on your filesystem in the `~/.f5/connections` folder
44
- - Easy to backup connections and settings in `~/.f5` folder, e.g. using Git or other VCS
45
+ - Easy to backup connections and settings in `~/.f5` folder, e.g. by putting them into a Git repo
45
46
  - Drag & drop, copy & paste files support
46
47
  - Use browser tabs to browse more than one server or transfer files simultaneously
47
48
  - Utilize the built-in browser password manager to store passwords
package/dist/App.js CHANGED
@@ -43,7 +43,7 @@ class App {
43
43
  duplicate: ({ src, filter }) => commands_1.commands.duplicate(src, filter),
44
44
  remove: ({ files }) => commands_1.commands.remove(files, connPath),
45
45
  clear: ({ file }) => commands_1.commands.clear(file),
46
- open: ({ file }) => opener(file),
46
+ open: ({ file, app }) => commands_1.commands.open(file, app, opener),
47
47
  mkdir: ({ name, parent }) => commands_1.commands.mkdir(name, parent),
48
48
  read: ({ file }) => commands_1.commands.read(file),
49
49
  write: ({ path, content }) => commands_1.commands.write(path, content),
package/dist/Password.js CHANGED
@@ -15,6 +15,7 @@ class Passwords {
15
15
  else {
16
16
  this.pending.get(id)?.[0](password);
17
17
  remember && this.store.set(id, [password, save]);
18
+ save && this.dump();
18
19
  }
19
20
  }
20
21
  static async get(id, skipMissing = false) {
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.open = open;
7
+ const types_1 = require("./types");
8
+ const URI_1 = require("./utils/URI");
9
+ const commands_1 = require("./commands");
10
+ const node_os_1 = require("node:os");
11
+ const node_path_1 = require("node:path");
12
+ const promises_1 = require("node:fs/promises");
13
+ const FileWatcher_1 = __importDefault(require("./FileWatcher"));
14
+ const Connection_1 = __importDefault(require("./Connection"));
15
+ const App_1 = __importDefault(require("./App"));
16
+ const files = new Map();
17
+ const watcher = new FileWatcher_1.default(path => send(path));
18
+ async function open(file, onLoad) {
19
+ const { path } = (0, URI_1.parseURI)(file);
20
+ try {
21
+ const tmpDir = await (0, promises_1.mkdtemp)((0, node_path_1.join)((0, node_os_1.tmpdir)(), 'f5-'));
22
+ const tmpName = (0, node_path_1.join)(tmpDir, (0, node_path_1.basename)(path));
23
+ return commands_1.commands.copy([file], (0, URI_1.createURI)(types_1.LocalFileSystemID, tmpDir), false, null, null, () => {
24
+ files.set(tmpName, { file, deletion: resetDeletion(tmpName, null), sending: false, changed: false });
25
+ watcher.watch(tmpName);
26
+ onLoad(tmpName);
27
+ });
28
+ }
29
+ catch (err) {
30
+ console.error(err);
31
+ }
32
+ }
33
+ async function send(file) {
34
+ const watched = files.get(file);
35
+ if (!watched) {
36
+ return;
37
+ }
38
+ if (watched.sending) {
39
+ watched.changed = true;
40
+ return;
41
+ }
42
+ watched.sending = true;
43
+ watched.deletion = resetDeletion(file, watched.deletion);
44
+ const { id, path } = (0, URI_1.parseURI)(watched.file);
45
+ const [conn, close] = await Connection_1.default.transmit(id);
46
+ await conn.put(file, path);
47
+ close();
48
+ App_1.default.remoteWatcher.refresh((0, URI_1.createURI)(id, (0, node_path_1.dirname)(path)));
49
+ watched.sending = false;
50
+ if (watched.changed) {
51
+ watched.changed = false;
52
+ send(file);
53
+ }
54
+ }
55
+ function resetDeletion(file, current) {
56
+ clearTimeout(current);
57
+ return setTimeout(() => {
58
+ files.delete(file);
59
+ (0, promises_1.rm)((0, node_path_1.dirname)(file), { force: true, recursive: true });
60
+ }, 1000 * 60 * 60);
61
+ }
@@ -13,6 +13,7 @@ const remove_1 = __importDefault(require("./remove"));
13
13
  const clear_1 = __importDefault(require("./clear"));
14
14
  const mkdir_1 = __importDefault(require("./mkdir"));
15
15
  const read_1 = __importDefault(require("./read"));
16
+ const open_1 = __importDefault(require("./open"));
16
17
  const write_1 = __importDefault(require("./write"));
17
18
  const settings_1 = __importDefault(require("./settings"));
18
19
  const rename_1 = __importDefault(require("./rename"));
@@ -34,6 +35,7 @@ exports.commands = {
34
35
  clear: clear_1.default,
35
36
  mkdir: mkdir_1.default,
36
37
  read: read_1.default,
38
+ open: open_1.default,
37
39
  write: write_1.default,
38
40
  rename: rename_1.default,
39
41
  getConnection: getConnection_1.default,
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = default_1;
4
+ const URI_1 = require("../utils/URI");
5
+ const RemoteFiles_1 = require("../RemoteFiles");
6
+ async function default_1(file, app, opener) {
7
+ if ((0, URI_1.isLocal)(file)) {
8
+ const { id, path } = (0, URI_1.parseURI)(file);
9
+ if (app == 'code') {
10
+ // open files through protocol links
11
+ // vscode://file/<path>
12
+ // vscode-insiders://file/<path>
13
+ opener(`vscode://file/${path}`);
14
+ }
15
+ else {
16
+ opener(path);
17
+ }
18
+ return '';
19
+ }
20
+ else {
21
+ return (0, RemoteFiles_1.open)(file, path => opener(app == 'code' ? `vscode://file/${path}` : path));
22
+ }
23
+ }