mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-02 14:18:43 +08:00
dev: remove unnecessary filesystem methods
These used to serve a purpose but now they only cause a dependency loop between LL*/HL* operations and FilesystemService itself, making it difficult to strategize filesystem behavior.
This commit is contained in:
parent
dacbbf033d
commit
2728761d3c
@ -174,32 +174,6 @@ class FilesystemService extends BaseService {
|
||||
return this.systemfs_;
|
||||
}
|
||||
|
||||
// NOTE: these are the parameters being passed
|
||||
// (assuming this comment is up-to-date)
|
||||
// {
|
||||
// node, actor, immutable,
|
||||
// file, tmp, fsentry_tmp,
|
||||
// message,
|
||||
// }
|
||||
async owrite (parameters) {
|
||||
const ll_owrite = new LLOWrite();
|
||||
return await ll_owrite.run(parameters);
|
||||
}
|
||||
|
||||
// REMINDER: There was an idea that FilesystemService implements
|
||||
// an interface, and if that ever happens these arguments are
|
||||
// important:
|
||||
// parent, name, user, immutable, file, message
|
||||
async cwrite (parameters) {
|
||||
const ll_cwrite = new LLCWrite();
|
||||
return await ll_cwrite.run(parameters);
|
||||
}
|
||||
|
||||
async mkdir_2 ({parent, name, actor, immutable}) {
|
||||
const ll_mkdir = new LLMkdir();
|
||||
return await ll_mkdir.run({ parent, name, actor, immutable });
|
||||
}
|
||||
|
||||
async mkshortcut ({ parent, name, user, target }) {
|
||||
|
||||
// Access Control
|
||||
@ -335,11 +309,6 @@ class FilesystemService extends BaseService {
|
||||
return node;
|
||||
}
|
||||
|
||||
async copy_2 (...a) {
|
||||
const ll_copy = new LLCopy();
|
||||
return await ll_copy.run(...a);
|
||||
}
|
||||
|
||||
async update_child_paths (old_path, new_path, user_id) {
|
||||
const svc_performanceMonitor = this.services.get('performance-monitor');
|
||||
const monitor = svc_performanceMonitor.createContext('update_child_paths');
|
||||
|
@ -206,7 +206,8 @@ class HLCopy extends HLFilesystemOperation {
|
||||
}
|
||||
}
|
||||
|
||||
this.copied = await fs.copy_2({
|
||||
const ll_copy = new LLCopy();
|
||||
this.copied = await ll_copy.run({
|
||||
source,
|
||||
parent,
|
||||
user: values.user,
|
||||
|
@ -31,6 +31,7 @@ const { OtelFeature } = require('../../traits/OtelFeature');
|
||||
const { HLFilesystemOperation } = require('./definitions');
|
||||
const { is_valid_path } = require('../validation');
|
||||
const { HLRemove } = require('./hl_remove');
|
||||
const { LLMkdir } = require('../ll_operations/ll_mkdir');
|
||||
|
||||
class MkTree extends HLFilesystemOperation {
|
||||
static DESCRIPTION = `
|
||||
@ -142,7 +143,8 @@ class MkTree extends HLFilesystemOperation {
|
||||
const currentParent = current;
|
||||
current = new NodeChildSelector(current, dir);
|
||||
|
||||
const node = await fs.mkdir_2({
|
||||
const ll_mkdir = new LLMkdir();
|
||||
const node = await ll_mkdir.run({
|
||||
parent: await fs.node(currentParent),
|
||||
name: current.name,
|
||||
actor,
|
||||
@ -201,7 +203,8 @@ class QuickMkdir extends HLFilesystemOperation {
|
||||
const currentParent = current;
|
||||
current = new NodeChildSelector(current, dir);
|
||||
|
||||
const node = await fs.mkdir_2({
|
||||
const ll_mkdir = new LLMkdir();
|
||||
const node = await ll_mkdir.run({
|
||||
parent: await fs.node(currentParent),
|
||||
name: current.name,
|
||||
actor,
|
||||
@ -358,7 +361,8 @@ class HLMkdir extends HLFilesystemOperation {
|
||||
return await this.created.getSafeEntry();
|
||||
}
|
||||
|
||||
this.created = await fs.mkdir_2({
|
||||
const ll_mkdir = new LLMkdir();
|
||||
this.created = await ll_mkdir.run({
|
||||
parent: parent_node,
|
||||
name: target_basename,
|
||||
actor: values.actor,
|
||||
|
@ -32,6 +32,7 @@ const { is_valid_node_name } = require("../validation");
|
||||
const { HLFilesystemOperation } = require("./definitions");
|
||||
const { MkTree } = require("./hl_mkdir");
|
||||
const { Actor } = require("../../services/auth/Actor");
|
||||
const { LLCWrite, LLOWrite } = require("../ll_operations/ll_write");
|
||||
|
||||
class WriteCommonFeature {
|
||||
install_in_instance (instance) {
|
||||
@ -381,7 +382,8 @@ class HLWrite extends HLFilesystemOperation {
|
||||
}
|
||||
|
||||
if ( is_overwrite ) {
|
||||
this.written = await fs.owrite({
|
||||
const ll_owrite = new LLOWrite();
|
||||
this.written = await ll_owrite.run({
|
||||
node: destination,
|
||||
actor: values.actor,
|
||||
file: values.file,
|
||||
@ -396,7 +398,8 @@ class HLWrite extends HLFilesystemOperation {
|
||||
message: values.message,
|
||||
});
|
||||
} else {
|
||||
this.written = await fs.cwrite({
|
||||
const ll_cwrite = new LLCWrite();
|
||||
this.written = await ll_cwrite.run({
|
||||
parent,
|
||||
name: target_name,
|
||||
actor: values.actor,
|
||||
|
Loading…
Reference in New Issue
Block a user