Changeset 0.37.17 (#229)
Co-authored-by: gobha <jasafpro@gmail.com> Co-committed-by: gobha <jasafpro@gmail.com>
This commit is contained in:
@@ -4142,11 +4142,23 @@ paths:
|
||||
tags:
|
||||
- Projects
|
||||
- Files
|
||||
summary: List project files
|
||||
summary: List project files (workspace-backed)
|
||||
description: Returns workspace files for the project. Auto-creates workspace on first upload.
|
||||
security:
|
||||
- bearerAuth: []
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/ResourceID'
|
||||
- name: path
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
description: Directory path to list (empty = root)
|
||||
- name: recursive
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
default: 'true'
|
||||
description: Include subdirectories
|
||||
responses:
|
||||
'200':
|
||||
description: Project files
|
||||
@@ -4155,10 +4167,23 @@ paths:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
data:
|
||||
files:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Project'
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
path:
|
||||
type: string
|
||||
is_directory:
|
||||
type: boolean
|
||||
content_type:
|
||||
type: string
|
||||
size_bytes:
|
||||
type: integer
|
||||
count:
|
||||
type: integer
|
||||
'401':
|
||||
$ref: '#/components/responses/Unauthorized'
|
||||
'404':
|
||||
@@ -4167,11 +4192,17 @@ paths:
|
||||
tags:
|
||||
- Projects
|
||||
- Files
|
||||
summary: Upload file to project
|
||||
summary: Upload file to project workspace
|
||||
description: Uploads a file to the project's workspace. Auto-creates workspace on first upload.
|
||||
security:
|
||||
- bearerAuth: []
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/ResourceID'
|
||||
- name: path
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
description: Subdirectory path to upload into
|
||||
requestBody:
|
||||
content:
|
||||
multipart/form-data:
|
||||
@@ -4187,17 +4218,164 @@ paths:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Project'
|
||||
'400':
|
||||
$ref: '#/components/responses/BadRequest'
|
||||
type: object
|
||||
properties:
|
||||
path:
|
||||
type: string
|
||||
filename:
|
||||
type: string
|
||||
content_type:
|
||||
type: string
|
||||
size_bytes:
|
||||
type: integer
|
||||
'413':
|
||||
description: File too large or workspace quota exceeded
|
||||
'401':
|
||||
$ref: '#/components/responses/Unauthorized'
|
||||
delete:
|
||||
tags:
|
||||
- Projects
|
||||
- Files
|
||||
summary: Delete project file
|
||||
security:
|
||||
- bearerAuth: []
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/ResourceID'
|
||||
- name: path
|
||||
in: query
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- name: recursive
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
description: File deleted
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/MessageResponse'
|
||||
'401':
|
||||
$ref: '#/components/responses/Unauthorized'
|
||||
/api/v1/projects/{id}/files/download:
|
||||
get:
|
||||
tags:
|
||||
- Projects
|
||||
- Files
|
||||
summary: Download project file
|
||||
description: Streams raw file content with Content-Disposition attachment header.
|
||||
security:
|
||||
- bearerAuth: []
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/ResourceID'
|
||||
- name: path
|
||||
in: query
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: File content
|
||||
content:
|
||||
application/octet-stream:
|
||||
schema:
|
||||
type: string
|
||||
format: binary
|
||||
'404':
|
||||
$ref: '#/components/responses/NotFound'
|
||||
/api/v1/projects/{id}/files/mkdir:
|
||||
post:
|
||||
tags:
|
||||
- Projects
|
||||
- Files
|
||||
summary: Create directory in project workspace
|
||||
security:
|
||||
- bearerAuth: []
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/ResourceID'
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
path:
|
||||
type: string
|
||||
required:
|
||||
- path
|
||||
responses:
|
||||
'201':
|
||||
description: Directory created
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/MessageResponse'
|
||||
'401':
|
||||
$ref: '#/components/responses/Unauthorized'
|
||||
/api/v1/projects/{id}/archive/upload:
|
||||
post:
|
||||
tags:
|
||||
- Projects
|
||||
- Files
|
||||
summary: Upload and extract archive into project workspace
|
||||
description: Accepts .zip or .tar.gz, extracts contents into workspace root.
|
||||
security:
|
||||
- bearerAuth: []
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/ResourceID'
|
||||
requestBody:
|
||||
content:
|
||||
multipart/form-data:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
file:
|
||||
type: string
|
||||
format: binary
|
||||
responses:
|
||||
'200':
|
||||
description: Archive extracted
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
ok:
|
||||
type: boolean
|
||||
files_extracted:
|
||||
type: integer
|
||||
'400':
|
||||
$ref: '#/components/responses/BadRequest'
|
||||
'401':
|
||||
$ref: '#/components/responses/Unauthorized'
|
||||
/api/v1/projects/{id}/archive/download:
|
||||
get:
|
||||
tags:
|
||||
- Projects
|
||||
- Files
|
||||
summary: Download all project files as archive
|
||||
security:
|
||||
- bearerAuth: []
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/ResourceID'
|
||||
- name: format
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
enum: [zip, tar.gz, tgz]
|
||||
default: zip
|
||||
responses:
|
||||
'200':
|
||||
description: Archive download
|
||||
content:
|
||||
application/zip:
|
||||
schema:
|
||||
type: string
|
||||
format: binary
|
||||
'404':
|
||||
$ref: '#/components/responses/NotFound'
|
||||
/api/v1/workspaces:
|
||||
get:
|
||||
tags:
|
||||
|
||||
Reference in New Issue
Block a user