Skip to content

Latest commit

 

History

History
331 lines (239 loc) · 3.72 KB

File metadata and controls

331 lines (239 loc) · 3.72 KB

Endpoints

Objects

  • FileType

    enum FileType {
      TXT,
      JPG,
      JSON,
    }
  • Path: String

    A:/dir1/dir2/file.txt
    B:/config.json
  • File

    type File {
      name: string;
      content: string;
      created_at: number;
      last_modified_at: number;
      size: number;
      type: TypeFile;
      path: Path;
    }
  • FileStructure

    type FileStructure {
      name: string;
      created_at: number;
      last_modified_at: number;
      size: number;
      type: TypeFile;
      path: Path;
    }
  • Folder

    type Folder {
      name: string;
      files: FileStructure[];
      folders: Folder[];
      created_at: number;
      last_modified_at: number;
      size: number;
      path: Path;
      root: boolean;
    }
  • Disk

    type Disk {
      name: string;
      root: Folder;
      limit_size: number;
      occupied_size: number;
    }
  • Sav

    type Sav {
      settings: {
        theme: Path;
      };
      disks: Disk[];
    }

Endpoints

System

  • completed

    // Import
    POST /api/system/import
    
    body {
      file: MultipartFile,
    }
  • completed

    // Create
    POST /api/system/create
  • completed

    // Export
    GET /api/system/export
  • completed

    // Status
    GET /api/system/status
    
    200 response {
      state: READY | IMPORTING,
    }
    
    401 Unauthorized
  • completed

    // Sync/Resume
    GET /api/system/sync
    
    200 response {
      system: Sav
    }
    
    401 Unauthorized
  • completed

    // Logout
    POST /api/system/logout
    
    200 response
    
    401 Unauthorized

Files

  • completed

    // Upload file
    POST /api/files/upload
    
    body {
      path: Path:"A:/dir1/app.txt",
      file: MultipartFile,
      type: FileType,
    }
    
    200 response File
    
    401 Unauthorized
    
    404 Not found
  • completed

    // Create file
    POST /api/files/create
    
    body {
      path: Path:"A:/dir1/app.txt",
      name: string;
      content: string;
      type: TypeFile;
    }
    
    200 response File
    
    401 Unauthorized
    
    404 Not found
  • completed

    // Read content file
    GET /api/files/read
    
    body {
      path: Path:"A:/dir1/app.txt",
    }
    
    200 response {
      content: string
    }
    
    401 Unauthorized
    
    404 Not found
  • completed

    // Edit file
    PATCH /api/files/edit
    
    body {
      path: Path:"A:/dir1/app.json",
      content: string,
      type: FileType
    }
    
    200 response File
    
    401 Unauthorized
    
    404 Not found
  • completed

    // Delete file
    DELETE /api/files/delete
    
    body {
      path: Path:"A:/dir1/app.txt",
    }
    
    200 response
    
    401 Unauthorized
    
    404 Not found
  • completed

    How download

    // Download file
    GET /api/files/download
    
    body {
      path: Path:"A:/dir1/app.json",
    }
    
    200 response byte[]
    
    401 Unauthorized
    
    404 Not found
  • completed

    // File move
    POST /api/files/move
    
    body {
      from: Path:"A:/dir1/app.json",
      to: Path:"B:/dir2/app.json",
    }
    
    200 response File
    
    401 Unauthorized
    
    404 Not found

Folders

// Create folder
// Rename folder
// Move folder
// Delete folder

A:
themes
golden_sunrise.json // From project resources

B:
user
Documents
Downloads
Images
themes
golden_sunrise.jpg // From project resources Projects\

Disk

// Create disk. Default folder structure: true/false
// Rename disk.
// Delete disk
// Export disk. Export only this disk if possible