From 72c496df4bdabc87edb4f15a39e975ed5c1319fb Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Fri, 6 Dec 2024 10:38:44 -0500 Subject: [PATCH] clean: remove early typescript trial --- src/backend/src/filesystem/backends/Test.js | 24 ------ src/backend/src/filesystem/backends/Test.ts | 3 - src/backend/src/filesystem/core/.gitignore | 2 - src/backend/src/filesystem/core/BackendAPI.ts | 85 ------------------- src/backend/src/filesystem/core/FSEntry.ts | 0 src/backend/src/filesystem/core/Selector.ts | 65 -------------- 6 files changed, 179 deletions(-) delete mode 100644 src/backend/src/filesystem/backends/Test.js delete mode 100644 src/backend/src/filesystem/backends/Test.ts delete mode 100644 src/backend/src/filesystem/core/.gitignore delete mode 100644 src/backend/src/filesystem/core/BackendAPI.ts delete mode 100644 src/backend/src/filesystem/core/FSEntry.ts delete mode 100644 src/backend/src/filesystem/core/Selector.ts diff --git a/src/backend/src/filesystem/backends/Test.js b/src/backend/src/filesystem/backends/Test.js deleted file mode 100644 index d2f35d624..000000000 --- a/src/backend/src/filesystem/backends/Test.js +++ /dev/null @@ -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 . - */ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Test = void 0; -class Test { -} -exports.Test = Test; diff --git a/src/backend/src/filesystem/backends/Test.ts b/src/backend/src/filesystem/backends/Test.ts deleted file mode 100644 index 6b8585ca9..000000000 --- a/src/backend/src/filesystem/backends/Test.ts +++ /dev/null @@ -1,3 +0,0 @@ -export class Test { - // -} \ No newline at end of file diff --git a/src/backend/src/filesystem/core/.gitignore b/src/backend/src/filesystem/core/.gitignore deleted file mode 100644 index dc7e0c2bf..000000000 --- a/src/backend/src/filesystem/core/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Typescript directory -*.js \ No newline at end of file diff --git a/src/backend/src/filesystem/core/BackendAPI.ts b/src/backend/src/filesystem/core/BackendAPI.ts deleted file mode 100644 index 5eb145535..000000000 --- a/src/backend/src/filesystem/core/BackendAPI.ts +++ /dev/null @@ -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; - readdir (selector: ISelector): Promise<[string, ReaddirResult][]>; - - mkdir (selector: ISelector, name: string): Promise; - copy (from: ISelector, to: ISelector, options: IOverwriteOptions): Promise; - rename (from: ISelector, to: ISelector, options: IOverwriteOptions): Promise; - delete (selector: ISelector, options: IDeleteOptions): Promise; - - read_file (selector: ISelector): Promise; - write_file (selector: ISelector, data: Buffer, options: IOverwriteOptions): Promise; -} diff --git a/src/backend/src/filesystem/core/FSEntry.ts b/src/backend/src/filesystem/core/FSEntry.ts deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/backend/src/filesystem/core/Selector.ts b/src/backend/src/filesystem/core/Selector.ts deleted file mode 100644 index 82546c2ff..000000000 --- a/src/backend/src/filesystem/core/Selector.ts +++ /dev/null @@ -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; - } - } -}