mirror of
https://github.com/get-drexa/drive.git
synced 2026-02-02 18:51:17 +00:00
2737 lines
75 KiB
JSON
2737 lines
75 KiB
JSON
{
|
|
"openapi": "3.0.0",
|
|
"info": {
|
|
"description": "Drexa is a file storage and management API. It provides endpoints for authentication, user management, file uploads, and virtual filesystem operations.",
|
|
"title": "Drexa API",
|
|
"contact": {
|
|
"name": "Drexa Support",
|
|
"url": "https://github.com/get-drexa/drexa"
|
|
},
|
|
"license": {
|
|
"name": "MIT",
|
|
"url": "https://opensource.org/licenses/MIT"
|
|
},
|
|
"version": "1.0"
|
|
},
|
|
"paths": {
|
|
"/accounts": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Retrieve all accounts for the authenticated user",
|
|
"tags": [
|
|
"accounts"
|
|
],
|
|
"summary": "List accounts",
|
|
"responses": {
|
|
"200": {
|
|
"description": "List of accounts for the authenticated user",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/internal_account.Account"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"description": "Create a new user account with email and password. Returns the account, user, and authentication tokens. Tokens can be delivered via HTTP-only cookies or in the response body based on the tokenDelivery field.",
|
|
"tags": [
|
|
"accounts"
|
|
],
|
|
"summary": "Register new account",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_account.registerAccountRequest"
|
|
}
|
|
}
|
|
},
|
|
"description": "Registration details",
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Account created successfully",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_account.registerAccountResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid request body or token delivery method",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"409": {
|
|
"description": "Email already registered",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/accounts/{accountID}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Retrieve account details including storage usage and quota",
|
|
"tags": [
|
|
"accounts"
|
|
],
|
|
"summary": "Get account",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Account details",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_account.Account"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Account not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/accounts/{accountID}/directories": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Create a new directory within a parent directory",
|
|
"tags": [
|
|
"directories"
|
|
],
|
|
"summary": "Create directory",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
},
|
|
{
|
|
"description": "Include additional fields",
|
|
"name": "include",
|
|
"in": "query",
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": [
|
|
"path"
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_catalog.createDirectoryRequest"
|
|
}
|
|
}
|
|
},
|
|
"description": "Directory details",
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Created directory",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_catalog.DirectoryInfo"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Parent not found or not a directory",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"409": {
|
|
"description": "Directory already exists",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Delete multiple directories permanently or move them to trash. Deleting directories also affects all their contents. All items must be directories.",
|
|
"tags": [
|
|
"directories"
|
|
],
|
|
"summary": "Bulk delete directories",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
},
|
|
{
|
|
"description": "Comma-separated list of directory IDs to delete",
|
|
"name": "id",
|
|
"in": "query",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"description": "Move to trash instead of permanent delete",
|
|
"name": "trash",
|
|
"in": "query",
|
|
"schema": {
|
|
"type": "boolean",
|
|
"default": false
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Trashed directories (when trash=true)",
|
|
"content": {
|
|
"*/*": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/internal_catalog.DirectoryInfo"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"204": {
|
|
"description": "Directories deleted",
|
|
"content": {
|
|
"*/*": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "All items must be directories",
|
|
"content": {
|
|
"*/*": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"*/*": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/accounts/{accountID}/directories/{directoryID}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Retrieve metadata for a specific directory",
|
|
"tags": [
|
|
"directories"
|
|
],
|
|
"summary": "Get directory info",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
},
|
|
{
|
|
"description": "Directory ID",
|
|
"name": "directoryID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"description": "Include additional fields",
|
|
"name": "include",
|
|
"in": "query",
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": [
|
|
"path"
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Directory metadata",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_catalog.DirectoryInfo"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Directory not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Delete a directory permanently or move it to trash. Deleting a directory also affects all its contents.",
|
|
"tags": [
|
|
"directories"
|
|
],
|
|
"summary": "Delete directory",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
},
|
|
{
|
|
"description": "Directory ID",
|
|
"name": "directoryID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"description": "Move to trash instead of permanent delete",
|
|
"name": "trash",
|
|
"in": "query",
|
|
"schema": {
|
|
"type": "boolean",
|
|
"default": false
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Trashed directory info (when trash=true)",
|
|
"content": {
|
|
"*/*": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_catalog.DirectoryInfo"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"204": {
|
|
"description": "Directory deleted",
|
|
"content": {
|
|
"*/*": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"*/*": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Directory not found",
|
|
"content": {
|
|
"*/*": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Update directory properties such as name (rename)",
|
|
"tags": [
|
|
"directories"
|
|
],
|
|
"summary": "Update directory",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
},
|
|
{
|
|
"description": "Directory ID",
|
|
"name": "directoryID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_catalog.patchDirectoryRequest"
|
|
}
|
|
}
|
|
},
|
|
"description": "Directory update",
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Updated directory metadata",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_catalog.DirectoryInfo"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid request",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Directory not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/accounts/{accountID}/directories/{directoryID}/content": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Get all files and subdirectories within a directory with optional pagination and sorting",
|
|
"tags": [
|
|
"directories"
|
|
],
|
|
"summary": "List directory contents",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
},
|
|
{
|
|
"description": "Directory ID (use 'root' for the root directory)",
|
|
"name": "directoryID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"description": "Sort field: name, createdAt, or updatedAt",
|
|
"name": "orderBy",
|
|
"in": "query",
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": [
|
|
"name",
|
|
"createdAt",
|
|
"updatedAt"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"description": "Sort direction: asc or desc",
|
|
"name": "dir",
|
|
"in": "query",
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": [
|
|
"asc",
|
|
"desc"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"description": "Maximum number of items to return (default: 100, min: 1)",
|
|
"name": "limit",
|
|
"in": "query",
|
|
"schema": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
{
|
|
"description": "Cursor for pagination (base64-encoded cursor from previous response)",
|
|
"name": "cursor",
|
|
"in": "query",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Paginated list of FileInfo and DirectoryInfo objects",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_catalog.listDirectoryResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid limit or cursor",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Directory not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Move one or more files or directories into this directory. Returns detailed status for each item including which were successfully moved, which had conflicts, and which encountered errors.",
|
|
"tags": [
|
|
"directories"
|
|
],
|
|
"summary": "Move items to directory",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
},
|
|
{
|
|
"description": "Target directory ID",
|
|
"name": "directoryID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_catalog.postDirectoryContentRequest"
|
|
}
|
|
}
|
|
},
|
|
"description": "Items to move",
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Move operation results with moved, conflict, and error states",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_catalog.moveItemsToDirectoryResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid request or items not in same directory",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "One or more items not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/accounts/{accountID}/directories/{directoryID}/shares": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Get all share links that include this directory",
|
|
"tags": [
|
|
"directories"
|
|
],
|
|
"summary": "List directory shares",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
},
|
|
{
|
|
"description": "Directory ID",
|
|
"name": "directoryID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Array of shares",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/github_com_get-drexa_drexa_internal_sharing.Share"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Directory not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/accounts/{accountID}/files": {
|
|
"delete": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Delete multiple files permanently or move them to trash. All items must be files.",
|
|
"tags": [
|
|
"files"
|
|
],
|
|
"summary": "Bulk delete files",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
},
|
|
{
|
|
"description": "Comma-separated list of file IDs to delete",
|
|
"name": "id",
|
|
"in": "query",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"description": "Move to trash instead of permanent delete",
|
|
"name": "trash",
|
|
"in": "query",
|
|
"schema": {
|
|
"type": "boolean",
|
|
"default": false
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Trashed files (when trash=true)",
|
|
"content": {
|
|
"*/*": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/internal_catalog.FileInfo"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"204": {
|
|
"description": "Files deleted",
|
|
"content": {
|
|
"*/*": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "All items must be files",
|
|
"content": {
|
|
"*/*": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"*/*": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/accounts/{accountID}/files/{fileID}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Retrieve metadata for a specific file",
|
|
"tags": [
|
|
"files"
|
|
],
|
|
"summary": "Get file info",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
},
|
|
{
|
|
"description": "File ID",
|
|
"name": "fileID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "File metadata",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_catalog.FileInfo"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "File not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Delete a file permanently or move it to trash",
|
|
"tags": [
|
|
"files"
|
|
],
|
|
"summary": "Delete file",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
},
|
|
{
|
|
"description": "File ID",
|
|
"name": "fileID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"description": "Move to trash instead of permanent delete",
|
|
"name": "trash",
|
|
"in": "query",
|
|
"schema": {
|
|
"type": "boolean",
|
|
"default": false
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Trashed file info (when trash=true)",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_catalog.FileInfo"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"204": {
|
|
"description": "Permanently deleted (when trash=false)",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "File not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Update file properties such as name (rename)",
|
|
"tags": [
|
|
"files"
|
|
],
|
|
"summary": "Update file",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
},
|
|
{
|
|
"description": "File ID",
|
|
"name": "fileID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_catalog.patchFileRequest"
|
|
}
|
|
}
|
|
},
|
|
"description": "File update",
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Updated file metadata",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_catalog.FileInfo"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid request",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "File not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/accounts/{accountID}/files/{fileID}/content": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Download the file content. May redirect to a signed URL for external storage.",
|
|
"tags": [
|
|
"files"
|
|
],
|
|
"summary": "Download file",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
},
|
|
{
|
|
"description": "File ID",
|
|
"name": "fileID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "File content stream",
|
|
"content": {
|
|
"application/octet-stream": {
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "binary"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"307": {
|
|
"description": "Redirect to download URL",
|
|
"content": {
|
|
"application/octet-stream": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"application/octet-stream": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "File not found",
|
|
"content": {
|
|
"application/octet-stream": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/accounts/{accountID}/files/{fileID}/shares": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Get all share links that include this file",
|
|
"tags": [
|
|
"files"
|
|
],
|
|
"summary": "List file shares",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
},
|
|
{
|
|
"description": "File ID",
|
|
"name": "fileID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Array of shares",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/github_com_get-drexa_drexa_internal_sharing.Share"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "File not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/accounts/{accountID}/shares": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Create a new share link for one or more files or directories. All items must be in the same parent directory. Root directory cannot be shared.",
|
|
"tags": [
|
|
"shares"
|
|
],
|
|
"summary": "Create share",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_sharing.createShareRequest"
|
|
}
|
|
}
|
|
},
|
|
"description": "Share details",
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Created share",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_sharing.Share"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid request, items not in same directory, or root directory cannot be shared",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "One or more items not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/accounts/{accountID}/shares/{shareID}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Retrieve share link details by ID",
|
|
"tags": [
|
|
"shares"
|
|
],
|
|
"summary": "Get share",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
},
|
|
{
|
|
"description": "Share ID",
|
|
"name": "shareID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Share details",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_sharing.Share"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Share not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Delete a share link, revoking access for all users",
|
|
"tags": [
|
|
"shares"
|
|
],
|
|
"summary": "Delete share",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
},
|
|
{
|
|
"description": "Share ID",
|
|
"name": "shareID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "Share deleted",
|
|
"content": {
|
|
"*/*": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"*/*": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Share not found",
|
|
"content": {
|
|
"*/*": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Update share link details. Omit expiresAt to keep the current value. Use null to remove the expiry.",
|
|
"tags": [
|
|
"shares"
|
|
],
|
|
"summary": "Update share",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
},
|
|
{
|
|
"description": "Share ID",
|
|
"name": "shareID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_sharing.patchShareRequest"
|
|
}
|
|
}
|
|
},
|
|
"description": "Share details",
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Updated share",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_sharing.Share"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid request",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Share not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/accounts/{accountID}/uploads": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Start a new file upload session. Returns an upload URL to PUT file content to.",
|
|
"tags": [
|
|
"uploads"
|
|
],
|
|
"summary": "Create upload session",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_upload.createUploadRequest"
|
|
}
|
|
}
|
|
},
|
|
"description": "Upload details",
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Upload session created",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_upload.Upload"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Parent is not a directory",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Parent directory not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"409": {
|
|
"description": "File with this name already exists",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/accounts/{accountID}/uploads/{uploadID}": {
|
|
"patch": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Mark an upload as completed after content has been uploaded. This finalizes the file in the filesystem.",
|
|
"tags": [
|
|
"uploads"
|
|
],
|
|
"summary": "Complete upload",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
},
|
|
{
|
|
"description": "Upload session ID",
|
|
"name": "uploadID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_upload.updateUploadRequest"
|
|
}
|
|
}
|
|
},
|
|
"description": "Status update",
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Upload completed",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_upload.Upload"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Content not uploaded yet or invalid status",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Upload session not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/accounts/{accountID}/uploads/{uploadID}/content": {
|
|
"put": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Stream file content to complete an upload. Send raw binary data in the request body.",
|
|
"tags": [
|
|
"uploads"
|
|
],
|
|
"summary": "Upload file content",
|
|
"parameters": [
|
|
{
|
|
"description": "Account ID",
|
|
"name": "accountID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
},
|
|
{
|
|
"description": "Upload session ID",
|
|
"name": "uploadID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"content": {
|
|
"application/octet-stream": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"description": "File content (binary)",
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"204": {
|
|
"description": "Content received successfully",
|
|
"content": {
|
|
"*/*": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"*/*": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Upload session not found",
|
|
"content": {
|
|
"*/*": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/login": {
|
|
"post": {
|
|
"description": "Authenticate with email and password to receive JWT tokens. Tokens can be delivered via HTTP-only cookies or in the response body based on the tokenDelivery field.",
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"summary": "User login",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_auth.loginRequest"
|
|
}
|
|
}
|
|
},
|
|
"description": "Login credentials",
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful authentication",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_auth.loginResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid request body or token delivery method",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Invalid email or password",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/tokens": {
|
|
"post": {
|
|
"description": "Exchange a valid refresh token for a new pair of access and refresh tokens. The old refresh token is invalidated (rotation).",
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"summary": "Refresh access token",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_auth.refreshAccessTokenRequest"
|
|
}
|
|
}
|
|
},
|
|
"description": "Refresh token",
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "New tokens",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_auth.tokenResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid request body",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Invalid, expired, or reused refresh token",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/me": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
}
|
|
],
|
|
"description": "Retrieve the authenticated user's profile information",
|
|
"tags": [
|
|
"users"
|
|
],
|
|
"summary": "Get current user",
|
|
"responses": {
|
|
"200": {
|
|
"description": "User profile",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/internal_user.User"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Not authenticated",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"servers": [
|
|
{
|
|
"url": "//localhost:8080/api"
|
|
}
|
|
],
|
|
"components": {
|
|
"securitySchemes": {
|
|
"BearerAuth": {
|
|
"description": "JWT access token. Format: \"Bearer {token}\"",
|
|
"type": "apiKey",
|
|
"name": "Authorization",
|
|
"in": "header"
|
|
}
|
|
},
|
|
"schemas": {
|
|
"github_com_get-drexa_drexa_internal_sharing.Share": {
|
|
"description": "Share link information including expiration and timestamps",
|
|
"type": "object",
|
|
"properties": {
|
|
"createdAt": {
|
|
"description": "When the share was created (ISO 8601)",
|
|
"type": "string",
|
|
"example": "2024-12-13T15:04:05Z"
|
|
},
|
|
"expiresAt": {
|
|
"description": "When the share expires, null if it never expires (ISO 8601)",
|
|
"type": "string",
|
|
"example": "2025-01-15T00:00:00Z"
|
|
},
|
|
"id": {
|
|
"description": "Unique share identifier (public ID)",
|
|
"type": "string",
|
|
"example": "kRp2XYTq9A55"
|
|
},
|
|
"updatedAt": {
|
|
"description": "When the share was last updated (ISO 8601)",
|
|
"type": "string",
|
|
"example": "2024-12-13T16:30:00Z"
|
|
}
|
|
}
|
|
},
|
|
"github_com_get-drexa_drexa_internal_user.User": {
|
|
"description": "User account information",
|
|
"type": "object",
|
|
"properties": {
|
|
"displayName": {
|
|
"description": "User's display name",
|
|
"type": "string",
|
|
"example": "John Doe"
|
|
},
|
|
"email": {
|
|
"description": "User's email address",
|
|
"type": "string",
|
|
"example": "john@example.com"
|
|
},
|
|
"id": {
|
|
"description": "Unique user identifier",
|
|
"type": "string",
|
|
"example": "550e8400-e29b-41d4-a716-446655440000"
|
|
}
|
|
}
|
|
},
|
|
"github_com_get-drexa_drexa_internal_virtualfs.PathSegment": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"internal_account.Account": {
|
|
"description": "Storage account with usage and quota details",
|
|
"type": "object",
|
|
"properties": {
|
|
"createdAt": {
|
|
"description": "When the account was created (ISO 8601)",
|
|
"type": "string",
|
|
"example": "2024-12-13T15:04:05Z"
|
|
},
|
|
"id": {
|
|
"description": "Unique account identifier",
|
|
"type": "string",
|
|
"example": "550e8400-e29b-41d4-a716-446655440000"
|
|
},
|
|
"storageQuotaBytes": {
|
|
"description": "Maximum storage quota in bytes",
|
|
"type": "integer",
|
|
"example": 10737418240
|
|
},
|
|
"storageUsageBytes": {
|
|
"description": "Current storage usage in bytes",
|
|
"type": "integer",
|
|
"example": 1073741824
|
|
},
|
|
"updatedAt": {
|
|
"description": "When the account was last updated (ISO 8601)",
|
|
"type": "string",
|
|
"example": "2024-12-13T16:30:00Z"
|
|
},
|
|
"userId": {
|
|
"description": "ID of the user who owns this account",
|
|
"type": "string",
|
|
"example": "550e8400-e29b-41d4-a716-446655440001"
|
|
}
|
|
}
|
|
},
|
|
"internal_account.registerAccountRequest": {
|
|
"description": "Request to create a new account and user",
|
|
"type": "object",
|
|
"properties": {
|
|
"displayName": {
|
|
"description": "Display name for the user",
|
|
"type": "string",
|
|
"example": "Jane Doe"
|
|
},
|
|
"email": {
|
|
"description": "Email address for the new account",
|
|
"type": "string",
|
|
"example": "newuser@example.com"
|
|
},
|
|
"password": {
|
|
"description": "Password for the new account (min 8 characters)",
|
|
"type": "string",
|
|
"example": "securepassword123"
|
|
},
|
|
"tokenDelivery": {
|
|
"description": "How to deliver tokens: \"cookie\" (set HTTP-only cookies) or \"body\" (include in response)",
|
|
"type": "string",
|
|
"enum": [
|
|
"cookie",
|
|
"body"
|
|
],
|
|
"example": "body"
|
|
}
|
|
}
|
|
},
|
|
"internal_account.registerAccountResponse": {
|
|
"description": "Response after successful account registration",
|
|
"type": "object",
|
|
"properties": {
|
|
"accessToken": {
|
|
"description": "JWT access token for immediate authentication (only included when tokenDelivery is \"body\")",
|
|
"type": "string",
|
|
"example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1NTBlODQwMC1lMjliLTQxZDQtYTcxNi00NDY2NTU0NDAwMDAifQ.signature"
|
|
},
|
|
"account": {
|
|
"description": "The created account",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/internal_account.Account"
|
|
}
|
|
]
|
|
},
|
|
"refreshToken": {
|
|
"description": "Base64 URL encoded refresh token (only included when tokenDelivery is \"body\")",
|
|
"type": "string",
|
|
"example": "dR4nD0mUu1DkZXlCeXRlc0FuZFJhbmRvbURhdGFIZXJlMTIzNDU2Nzg5MGFi"
|
|
},
|
|
"user": {
|
|
"description": "The created user",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/github_com_get-drexa_drexa_internal_user.User"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"internal_auth.loginRequest": {
|
|
"description": "Login request with email, password, and token delivery preference",
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"description": "User's email address",
|
|
"type": "string",
|
|
"example": "user@example.com"
|
|
},
|
|
"password": {
|
|
"description": "User's password",
|
|
"type": "string",
|
|
"example": "secretpassword123"
|
|
},
|
|
"tokenDelivery": {
|
|
"description": "How to deliver tokens: \"cookie\" (set HTTP-only cookies) or \"body\" (include in response)",
|
|
"type": "string",
|
|
"enum": [
|
|
"cookie",
|
|
"body"
|
|
],
|
|
"example": "body"
|
|
}
|
|
}
|
|
},
|
|
"internal_auth.loginResponse": {
|
|
"description": "Login response containing user info and optionally tokens",
|
|
"type": "object",
|
|
"properties": {
|
|
"accessToken": {
|
|
"description": "JWT access token (only included when tokenDelivery is \"body\")",
|
|
"type": "string",
|
|
"example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1NTBlODQwMC1lMjliLTQxZDQtYTcxNi00NDY2NTU0NDAwMDAifQ.signature"
|
|
},
|
|
"refreshToken": {
|
|
"description": "Base64 URL encoded refresh token (only included when tokenDelivery is \"body\")",
|
|
"type": "string",
|
|
"example": "dR4nD0mUu1DkZXlCeXRlc0FuZFJhbmRvbURhdGFIZXJlMTIzNDU2Nzg5MGFi"
|
|
},
|
|
"user": {
|
|
"description": "Authenticated user information",
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/github_com_get-drexa_drexa_internal_user.User"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"internal_auth.refreshAccessTokenRequest": {
|
|
"description": "Request to exchange a refresh token for new tokens",
|
|
"type": "object",
|
|
"properties": {
|
|
"refreshToken": {
|
|
"description": "Base64 URL encoded refresh token",
|
|
"type": "string",
|
|
"example": "dR4nD0mUu1DkZXlCeXRlc0FuZFJhbmRvbURhdGFIZXJlMTIzNDU2Nzg5MGFi"
|
|
}
|
|
}
|
|
},
|
|
"internal_auth.tokenResponse": {
|
|
"description": "Response containing new access token and refresh token",
|
|
"type": "object",
|
|
"properties": {
|
|
"accessToken": {
|
|
"description": "New JWT access token",
|
|
"type": "string",
|
|
"example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1NTBlODQwMC1lMjliLTQxZDQtYTcxNi00NDY2NTU0NDAwMDAifQ.signature"
|
|
},
|
|
"refreshToken": {
|
|
"description": "New base64 URL encoded refresh token",
|
|
"type": "string",
|
|
"example": "xK9mPqRsTuVwXyZ0AbCdEfGhIjKlMnOpQrStUvWxYz1234567890abcdefgh"
|
|
}
|
|
}
|
|
},
|
|
"internal_catalog.DirectoryInfo": {
|
|
"description": "Directory information including path and timestamps",
|
|
"type": "object",
|
|
"properties": {
|
|
"createdAt": {
|
|
"description": "When the directory was created (ISO 8601)",
|
|
"type": "string",
|
|
"example": "2024-12-13T15:04:05Z"
|
|
},
|
|
"deletedAt": {
|
|
"description": "When the directory was trashed, null if not trashed (ISO 8601)",
|
|
"type": "string",
|
|
"example": "2024-12-14T10:00:00Z"
|
|
},
|
|
"id": {
|
|
"description": "Unique directory identifier",
|
|
"type": "string",
|
|
"example": "kRp2XYTq9A55"
|
|
},
|
|
"kind": {
|
|
"description": "Item type, always \"directory\"",
|
|
"type": "string",
|
|
"example": "directory"
|
|
},
|
|
"name": {
|
|
"description": "Directory name",
|
|
"type": "string",
|
|
"example": "My Documents"
|
|
},
|
|
"parentId": {
|
|
"description": "ParentID is the public ID of the directory this directory is in",
|
|
"type": "string",
|
|
"example": "kRp2XYTq9A55"
|
|
},
|
|
"path": {
|
|
"description": "Full path from root (included when ?include=path)",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/github_com_get-drexa_drexa_internal_virtualfs.PathSegment"
|
|
}
|
|
},
|
|
"updatedAt": {
|
|
"description": "When the directory was last updated (ISO 8601)",
|
|
"type": "string",
|
|
"example": "2024-12-13T16:30:00Z"
|
|
}
|
|
}
|
|
},
|
|
"internal_catalog.FileInfo": {
|
|
"description": "File information including name, size, and timestamps",
|
|
"type": "object",
|
|
"properties": {
|
|
"createdAt": {
|
|
"description": "When the file was created (ISO 8601)",
|
|
"type": "string",
|
|
"example": "2024-12-13T15:04:05Z"
|
|
},
|
|
"deletedAt": {
|
|
"description": "When the file was trashed, null if not trashed (ISO 8601)",
|
|
"type": "string",
|
|
"example": "2024-12-14T10:00:00Z"
|
|
},
|
|
"id": {
|
|
"description": "Unique file identifier",
|
|
"type": "string",
|
|
"example": "mElnUNCm8F22"
|
|
},
|
|
"kind": {
|
|
"description": "Item type, always \"file\"",
|
|
"type": "string",
|
|
"example": "file"
|
|
},
|
|
"mimeType": {
|
|
"description": "MIME type of the file",
|
|
"type": "string",
|
|
"example": "application/pdf"
|
|
},
|
|
"name": {
|
|
"description": "File name",
|
|
"type": "string",
|
|
"example": "document.pdf"
|
|
},
|
|
"parentId": {
|
|
"description": "ParentID is the public ID of the directory this file is in",
|
|
"type": "string",
|
|
"example": "kRp2XYTq9A55"
|
|
},
|
|
"size": {
|
|
"description": "File size in bytes",
|
|
"type": "integer",
|
|
"example": 1048576
|
|
},
|
|
"updatedAt": {
|
|
"description": "When the file was last updated (ISO 8601)",
|
|
"type": "string",
|
|
"example": "2024-12-13T16:30:00Z"
|
|
}
|
|
}
|
|
},
|
|
"internal_catalog.createDirectoryRequest": {
|
|
"description": "Request to create a new directory",
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"description": "Name for the new directory",
|
|
"type": "string",
|
|
"example": "New Folder"
|
|
},
|
|
"parentID": {
|
|
"description": "ID of the parent directory",
|
|
"type": "string",
|
|
"example": "kRp2XYTq9A55"
|
|
}
|
|
}
|
|
},
|
|
"internal_catalog.listDirectoryResponse": {
|
|
"description": "Response to a request to list the contents of a directory",
|
|
"type": "object",
|
|
"properties": {
|
|
"items": {
|
|
"description": "Items is the list of items in the directory, limited to the limit specified in the request",
|
|
"type": "array",
|
|
"items": {}
|
|
},
|
|
"nextCursor": {
|
|
"description": "NextCursor is the cursor to use to get the next page of results",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"internal_catalog.moveItemError": {
|
|
"description": "Error details for a failed item move",
|
|
"type": "object",
|
|
"properties": {
|
|
"error": {
|
|
"description": "Error message describing what went wrong",
|
|
"type": "string",
|
|
"example": "permission denied"
|
|
},
|
|
"id": {
|
|
"description": "ID of the item that failed to move",
|
|
"type": "string",
|
|
"example": "mElnUNCm8F22"
|
|
}
|
|
}
|
|
},
|
|
"internal_catalog.moveItemsToDirectoryResponse": {
|
|
"description": "Response from moving items to a directory with status for each item",
|
|
"type": "object",
|
|
"properties": {
|
|
"conflicts": {
|
|
"description": "Array of IDs of items that conflicted with existing items in the target directory",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"example": [
|
|
"xYz123AbC456"
|
|
]
|
|
},
|
|
"errors": {
|
|
"description": "Array of errors that occurred during the move operation",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/internal_catalog.moveItemError"
|
|
}
|
|
},
|
|
"items": {
|
|
"type": "array",
|
|
"description": "Array of items included in the request (FileInfo or DirectoryInfo objects)",
|
|
"items": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/components/schemas/internal_catalog.FileInfo"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/internal_catalog.DirectoryInfo"
|
|
}
|
|
],
|
|
"discriminator": {
|
|
"propertyName": "kind",
|
|
"mapping": {
|
|
"file": "#/components/schemas/internal_catalog.FileInfo",
|
|
"directory": "#/components/schemas/internal_catalog.DirectoryInfo"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"moved": {
|
|
"description": "Array of IDs of successfully moved items",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"example": [
|
|
"mElnUNCm8F22",
|
|
"kRp2XYTq9A55"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"internal_catalog.patchDirectoryRequest": {
|
|
"description": "Request to update directory properties",
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"description": "New name for the directory",
|
|
"type": "string",
|
|
"example": "My Documents"
|
|
}
|
|
}
|
|
},
|
|
"internal_catalog.patchFileRequest": {
|
|
"description": "Request to update file properties",
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"description": "New name for the file",
|
|
"type": "string",
|
|
"example": "renamed-document.pdf"
|
|
}
|
|
}
|
|
},
|
|
"internal_catalog.postDirectoryContentRequest": {
|
|
"description": "Request to move items into this directory",
|
|
"type": "object",
|
|
"properties": {
|
|
"items": {
|
|
"description": "Array of file/directory IDs to move",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"example": [
|
|
"mElnUNCm8F22",
|
|
"kRp2XYTq9A55"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"internal_sharing.Share": {
|
|
"description": "Share link information including expiration and timestamps",
|
|
"type": "object",
|
|
"properties": {
|
|
"createdAt": {
|
|
"description": "When the share was created (ISO 8601)",
|
|
"type": "string",
|
|
"example": "2024-12-13T15:04:05Z"
|
|
},
|
|
"expiresAt": {
|
|
"description": "When the share expires, null if it never expires (ISO 8601)",
|
|
"type": "string",
|
|
"example": "2025-01-15T00:00:00Z"
|
|
},
|
|
"id": {
|
|
"description": "Unique share identifier (public ID)",
|
|
"type": "string",
|
|
"example": "kRp2XYTq9A55"
|
|
},
|
|
"updatedAt": {
|
|
"description": "When the share was last updated (ISO 8601)",
|
|
"type": "string",
|
|
"example": "2024-12-13T16:30:00Z"
|
|
}
|
|
}
|
|
},
|
|
"internal_sharing.createShareRequest": {
|
|
"description": "Request to create a new share link for files or directories",
|
|
"type": "object",
|
|
"properties": {
|
|
"expiresAt": {
|
|
"description": "Optional expiration time for the share (ISO 8601)",
|
|
"type": "string",
|
|
"example": "2025-01-15T00:00:00Z"
|
|
},
|
|
"items": {
|
|
"description": "Array of file/directory IDs to share",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"example": [
|
|
"mElnUNCm8F22",
|
|
"kRp2XYTq9A55"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"internal_sharing.patchShareRequest": {
|
|
"description": "Request to update a share link. Omit expiresAt to keep the current value. Use null to remove the expiry.",
|
|
"type": "object",
|
|
"properties": {
|
|
"expiresAt": {
|
|
"description": "Optional expiration time for the share (ISO 8601), null clears it.",
|
|
"type": "string",
|
|
"example": "2025-01-15T00:00:00Z"
|
|
}
|
|
}
|
|
},
|
|
"internal_upload.Status": {
|
|
"description": "Upload status enumeration",
|
|
"type": "string",
|
|
"enum": [
|
|
"pending",
|
|
"completed",
|
|
"failed"
|
|
],
|
|
"x-enum-varnames": [
|
|
"StatusPending",
|
|
"StatusCompleted",
|
|
"StatusFailed"
|
|
]
|
|
},
|
|
"internal_upload.Upload": {
|
|
"description": "File upload session with status and upload URL",
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"description": "Unique upload session identifier",
|
|
"type": "string",
|
|
"example": "xNq5RVBt3K88"
|
|
},
|
|
"status": {
|
|
"description": "Current upload status",
|
|
"enum": [
|
|
"pending",
|
|
"completed",
|
|
"failed"
|
|
],
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/internal_upload.Status"
|
|
}
|
|
],
|
|
"example": "pending"
|
|
},
|
|
"uploadUrl": {
|
|
"description": "URL to upload file content to",
|
|
"type": "string",
|
|
"example": "https://api.example.com/api/accounts/550e8400-e29b-41d4-a716-446655440000/uploads/xNq5RVBt3K88/content"
|
|
}
|
|
}
|
|
},
|
|
"internal_upload.createUploadRequest": {
|
|
"description": "Request to initiate a file upload",
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"description": "Name of the file being uploaded",
|
|
"type": "string",
|
|
"example": "document.pdf"
|
|
},
|
|
"parentId": {
|
|
"description": "ID of the parent directory to upload into",
|
|
"type": "string",
|
|
"example": "kRp2XYTq9A55"
|
|
}
|
|
}
|
|
},
|
|
"internal_upload.updateUploadRequest": {
|
|
"description": "Request to update upload status (e.g., mark as completed)",
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {
|
|
"description": "New status for the upload",
|
|
"enum": [
|
|
"completed"
|
|
],
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/internal_upload.Status"
|
|
}
|
|
],
|
|
"example": "completed"
|
|
}
|
|
}
|
|
},
|
|
"internal_user.User": {
|
|
"description": "User account information",
|
|
"type": "object",
|
|
"properties": {
|
|
"displayName": {
|
|
"description": "User's display name",
|
|
"type": "string",
|
|
"example": "John Doe"
|
|
},
|
|
"email": {
|
|
"description": "User's email address",
|
|
"type": "string",
|
|
"example": "john@example.com"
|
|
},
|
|
"id": {
|
|
"description": "Unique user identifier",
|
|
"type": "string",
|
|
"example": "550e8400-e29b-41d4-a716-446655440000"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |