1
0
This repository has been archived on 2023-12-27. You can view files and clone it, but cannot push or open issues or pull requests.
DotDeploy/resources/api-docs/file.json

163 lines
5.8 KiB
JSON

{
"apiVersion": "0.0.1",
"swaggerVersion": "1.2",
"basePath": "http://api.dotdeploy.works",
"resourcePath": "/file",
"produces": ["application/json"],
"apis": [
{
"path": "/file/{file-id}",
"operations": [
{
"method": "GET",
"summary": "Get a file with the given file-id",
"type": "string",
"nickname": "getFileBinary",
"authorizations": {},
"parameters": [
{
"name": "accesstoken",
"description": "Token provided from authentication with Google OAuth",
"required": "true",
"type": "string",
"paramType": "query"
},
{
"name": "file-id",
"description": "File-id of the file which should be retrieved",
"required": "true",
"type": "string",
"paramType": "path"
}
],
"responseMessages": [
{
"code": 500,
"message": "This is temporary and likely means your accesstoken is invalid."
}
]
}
]
},
{
"path": "/file",
"operations": [
{
"method": "POST",
"summary": "Upload a new file for the user which corresponds with the provided accesstoken",
"type": "void",
"nickname": "createNewFile",
"authorizations": {},
"parameters": [
{
"name": "token-id",
"description": "Token for the user which will own this new machine",
"required": "true",
"type": "string",
"paramType": "query"
},
{
"name": "sha256",
"description": "SHA256 hash of the content of the file being uploaded",
"required": "true",
"type": "string",
"paramType": "query"
},
{
"name": "path",
"description": "Path in which this file is located when on a machine",
"required": "true",
"type": "string",
"paramType": "query"
},
{
"name": "content",
"description": "Body of the file to upload",
"required": "true",
"type": "string",
"paramType": "body"
}
]
}
]
}
],
"models": {
"FileRevision": {
"id": "FileRevision",
"required": [
"created-on",
"grid-id",
"sha256",
"revision-id"
],
"properties": {
"created-on": {
"type": "dateTime"
},
"grid-id": {
"type": "string",
"description": "The location of this file in GridFS"
},
"sha256": {
"type": "string",
"description": "The SHA256 hash of the body of this file"
},
"revision-id": {
"type": "int",
"description": "An incrementing integrer representing the current iteration of this file"
}
}
},
"File": {
"id": "File",
"required": [
"file-id",
"path",
"profiles",
"type",
"active",
"revisions",
"public",
"shared-users"
],
"properties": {
"file-id": {
"type": "string"
},
"path": {
"type": "string",
"description": "The path where this file should be located on a machine"
},
"type": {
"type": "string",
"description": "The type of dotfile this file represents. Ex: bashrc, zshrc, gitconfig"
},
"active": {
"type": "boolean",
"description": "A deleted file will be set to inactive"
},
"revisions": {
"type": "array",
"items": {
"$ref": "FileRevision"
}
},
"public": {
"type": "boolean",
"description": "If true, anyone with the link can see this file"
},
"shared-users": {
"type": "array",
"items": {
"type": "string"
}
},
"forked-from": {
"type": "string",
"description": "If set, this indicates the file-id this file was copied from"
}
}
}
}
}