mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-02 23:28:39 +08:00
clean: remove early typescript trial
This commit is contained in:
parent
7f37c42219
commit
72c496df4b
@ -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;
|
@ -1,3 +0,0 @@
|
||||
export class Test {
|
||||
//
|
||||
}
|
2
src/backend/src/filesystem/core/.gitignore
vendored
2
src/backend/src/filesystem/core/.gitignore
vendored
@ -1,2 +0,0 @@
|
||||
# Typescript directory
|
||||
*.js
|
@ -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>;
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user