瀏覽代碼

clean: remove early typescript trial

KernelDeimos 5 月之前
父節點
當前提交
72c496df4b

+ 0 - 24
src/backend/src/filesystem/backends/Test.js

@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2024 Puter Technologies Inc.
- *
- * This file is part of Puter.
- *
- * Puter is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- */
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.Test = void 0;
-class Test {
-}
-exports.Test = Test;

+ 0 - 3
src/backend/src/filesystem/backends/Test.ts

@@ -1,3 +0,0 @@
-export class Test {
-    //
-}

+ 0 - 2
src/backend/src/filesystem/core/.gitignore

@@ -1,2 +0,0 @@
-# Typescript directory
-*.js

+ 0 - 85
src/backend/src/filesystem/core/BackendAPI.ts

@@ -1,85 +0,0 @@
-import { ISelector } from "./Selector";
-
-type PuterUserID = number;
-
-export const enum FSBackendSupportFlags {
-    None = 0,
-    
-    // Platform-related flags
-    PlatformCaseSensitive = 1 << 1,
-
-    // Puter support flags
-    // PuterStatOwner indicates the backend can store `user_id`
-    PuterStatOwner = 1 << 2,
-    // PuterStatApp indicates the backend can store `associated_app_id`
-    PuterStatApp = 1 << 3,
-
-    // DetailVerboseReaddir indicates the backend will provide a full
-    // stat() result for each entry in readdir().
-    DetailVerboseReaddir = 1 << 4,
-}
-
-export const enum FSNodeType {
-    File,
-    Directory,
-    PuterShortcut,
-    SymbolicLink,
-    KVStore,
-    Socket,
-}
-
-export interface IOverwriteOptions {
-    readonly overwrite: boolean;
-    UserID: PuterUserID,
-}
-
-export interface IWriteOptions extends IOverwriteOptions {
-    readonly create: boolean;
-}
-
-export interface IDeleteOptions {
-    readonly recursive: boolean;
-}
-
-export interface IStatOptions {
-    followSymlinks?: boolean;
-}
-
-export interface IStatResult {
-    uuid: string;
-    name: string;
-    type: FSNodeType;
-    size: number;
-    mtime: Date;
-    ctime: Date;
-    atime: Date;
-    immutable: boolean;
-}
-
-export interface IMiniStatResult {
-    uuid: string;
-    name: string;
-    type: FSNodeType;
-}
-
-type ReaddirResult = IMiniStatResult | IStatResult;
-
-export interface IMkdirOptions {
-    // Not for permission checks by the storage backend.
-    // A supporting storage backend will simply store this and
-    // return it in the stat() call.
-    UserID: PuterUserID,
-}
-
-export interface BackendAPI {
-    stat (selector: ISelector, options: IStatOptions): Promise<IStatResult>;
-    readdir (selector: ISelector): Promise<[string, ReaddirResult][]>;
-
-    mkdir (selector: ISelector, name: string): Promise<void>;
-    copy (from: ISelector, to: ISelector, options: IOverwriteOptions): Promise<void>;
-    rename (from: ISelector, to: ISelector, options: IOverwriteOptions): Promise<void>;
-    delete (selector: ISelector, options: IDeleteOptions): Promise<void>;
-
-    read_file (selector: ISelector): Promise<Buffer>;
-    write_file (selector: ISelector, data: Buffer, options: IOverwriteOptions): Promise<void>;
-}

+ 0 - 0
src/backend/src/filesystem/core/FSEntry.ts


+ 0 - 65
src/backend/src/filesystem/core/Selector.ts

@@ -1,65 +0,0 @@
-import * as _path from 'path';
-import * as _util from 'util';
-
-type TemporeryNodeType = any;
-
-export interface ISelector {
-    describe (showDebug?: boolean): string;
-    setPropertiesKnownBySelector (node: object): void;
-}
-
-export class NodePathSelector {
-    public value: string;
-
-    constructor (path: string) {
-        this.value = path;
-    }
-
-    public describe (showDebug?: boolean): string {
-        return this.value;
-    }
-
-    public setPropertiesKnownBySelector (node: TemporeryNodeType): void {
-        node.path = this.value;
-        node.name = _path.basename(this.value);
-    }
-}
-
-export class NodeInternalUIDSelector {
-    public value: string;
-
-    constructor (uid: string) {
-        this.value = uid;
-    }
-
-    public describe (showDebug?: boolean): string {
-        return `[uid:${this.value}]`;
-    }
-
-    public setPropertiesKnownBySelector (node: TemporeryNodeType): void {
-        node.uid = this.value;
-    }
-}
-
-export class NodeInternalIDSelector {
-    constructor (
-        public service: string,
-        public id: number,
-        public debugInfo: any
-    ) { }
-
-    public describe (showDebug?: boolean): string {
-        if ( showDebug ) {
-            return `[db:${this.id}] (${
-                _util.inspect(this.debugInfo)
-            })`;
-        }
-        return `[db:${this.id}]`;
-    }
-
-    public setPropertiesKnownBySelector (node: TemporeryNodeType): void {
-        if ( this.service === 'mysql' ) {
-            node.id = this.id;
-        }
-    }
-}