// /core/js/drivers_files/sftp.js
// Combines SFTP driver and registry into one file
import { createFile } from "./sftpnewfile.js";
export class SFTPDriver {
async create(path, content = "") {
return await createFile(path, content);
}
// Optional placeholder for future listing support
async list(path = "/") {
const res = await fetch("SFTPconnector.php", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ action: "list", path })
});
const data = await res.json();
if (!data.success) throw new Error(data.message || "Failed to load");
return data.data;
}
}
// Registry (was index.js before)
export const FileDrivers = {
sftp: SFTPDriver
};