Skip to content

Commit

Permalink
Optimize File API
Browse files Browse the repository at this point in the history
  • Loading branch information
r350178982 committed Mar 4, 2024
1 parent d90e63e commit 12d2f9e
Showing 1 changed file with 59 additions and 13 deletions.
72 changes: 59 additions & 13 deletions api/user_account_operations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,61 @@ components:
newname:
$ref: '#/components/schemas/newname'

file_operation:

file_operation_create:
title: 'Create file'
type: object
properties:
operation:
type: string
enum: [create]


file_operation_move:
title: 'Move file'
type: object
properties:
operation:
type: string
enum: [move]
dst_repo:
$ref: '#/components/schemas/dst_repo'
dst_dir:
$ref: '#/components/schemas/dst_dir'

file_operation_copy:
title: 'Copy file'
type: object
properties:
operation:
type: string
enum: [copy]
dst_repo:
$ref: '#/components/schemas/dst_repo'
dst_dir:
$ref: '#/components/schemas/dst_dir'

file_operation_rename:
title: 'Rename file'
type: object
properties:
operation:
type: string
enum: [copy]
newname:
$ref: '#/components/schemas/newname'



file_lock_operation:
title: 'operation'
type: string
enum:
- lock
- unlock
example: "lock"


new_name:
title: 'newname'
type: string
Expand Down Expand Up @@ -1648,16 +1699,11 @@ paths:
content:
multipart/form-data:
schema:
type: object
properties:
newname:
$ref: '#/components/schemas/new_name'
operation:
$ref: '#/components/schemas/file_operation'
dst_repo:
$ref: '#/components/schemas/dst_repo'
dst_dir:
$ref: '#/components/schemas/dst_dir'
oneOf:
- $ref: '#/components/schemas/file_operation_create'
- $ref: '#/components/schemas/file_operation_rename'
- $ref: '#/components/schemas/file_operation_move'
- $ref: '#/components/schemas/file_operation_copy'
responses:
'200':
description: OK
Expand All @@ -1678,7 +1724,7 @@ paths:
type: object
properties:
operation:
$ref: '#/components/schemas/file_operation'
$ref: '#/components/schemas/file_lock_operation'
responses:
'200':
description: OK
Expand Down Expand Up @@ -1759,7 +1805,7 @@ paths:
can_edit: true


/api/v2.1/smart-link/:
/api/v2.1/smart-link/?repo_id={repo_id}&path={path}&is_dir={is_dir}:
get:
tags:
- Files
Expand Down

0 comments on commit 12d2f9e

Please sign in to comment.