Cloner

Cloner · GPT 작업

FileSystemEditorAPI

API for file operations in an editor environment, supporting multiple file upload, download, edit, and delete.

  • POST /newworkspacescaffold a new workspace
  • GET /listfiles/{projectID}Retrieve the file structure of workspace
  • GET /readfiles/{projectID}read specific files
  • POST /editFiles/{projectID}Edit multiple files
  • POST /screenshotTakes a screenshot of the provided URL
  • POST /screenshot/sidebysideTakes side-by-side screenshots of a project code and a target URL
  • POST /deployDeploy the current project
원본 API 스키마
{
  "openapi": "3.0.3",
  "info": {
    "title": "FileSystemEditorAPI",
    "description": "API for file operations in an editor environment, supporting multiple file upload, download, edit, and delete.",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://cloner-api-tbxy09.replit.app"
    }
  ],
  "paths": {
    "/newworkspace": {
      "post": {
        "summary": "scaffold a new workspace",
        "operationId": "newworkspace",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArrayFileSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Upload successful"
          }
        }
      }
    },
    "/listfiles/{projectID}": {
      "get": {
        "summary": "Retrieve the file structure of workspace",
        "operationId": "listfiles",
        "parameters": [
          {
            "name": "projectID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "File structure retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "treeprint": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/readfiles/{projectID}": {
      "get": {
        "summary": "read specific files",
        "operationId": "readfiles",
        "parameters": [
          {
            "name": "projectID",
            "in": "path",
            "description": "ID of the project",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filelist",
            "in": "query",
            "description": "Comma-separated list of file paths to download",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Download successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FileSchema"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/editFiles/{projectID}": {
      "post": {
        "summary": "Edit multiple files",
        "operationId": "editFiles",
        "parameters": [
          {
            "name": "projectID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArrayEditSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Files edited successfully"
          }
        }
      }
    },
    "/screenshot": {
      "post": {
        "summary": "Takes a screenshot of the provided URL",
        "operationId": "takeScreenshot",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "The URL to take a screenshot of"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A JSON response with the URL of the captured screenshot",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/screenshot/sidebyside": {
      "post": {
        "summary": "Takes side-by-side screenshots of a project code and a target URL",
        "operationId": "takeSideBySideScreenshot",
        "parameters": [
          {
            "name": "project_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Identifier of the project to capture"
            }
          },
          {
            "name": "url",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "The target URL to capture alongside the project code",
              "default": ""
            }
          },
          {
            "name": "needs_build",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "A flag indicating if the project needs building",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A JSON response with the URL of the combined screenshot",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/deploy": {
      "post": {
        "summary": "Deploy the current project",
        "operationId": "deploy",
        "parameters": [
          {
            "name": "projectID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project deployed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "FileSchema": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "relative path of the file"
          },
          "content": {
            "type": "string",
            "description": "Content of the file"
          }
        }
      },
      "EditSchema": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "relative path of the file"
          },
          "new_content": {
            "type": "string",
            "description": "new Content of the file"
          }
        }
      },
      "ArrayFileSchema": {
        "type": "object",
        "properties": {
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FileSchema"
            }
          }
        }
      },
      "ArrayEditSchema": {
        "type": "object",
        "properties": {
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EditSchema"
            }
          }
        }
      }
    }
  }
}