Skip to content

Commit

Permalink
docs: 📝
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelMRojas committed Sep 1, 2023
1 parent 076044d commit 1b30258
Showing 1 changed file with 218 additions and 16 deletions.
234 changes: 218 additions & 16 deletions docs/spec.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ paths:
schema:
$ref: '#/components/schemas/credentials'
responses:
'201':
'200':
description: Login succeed
content:
application/json:
Expand Down Expand Up @@ -54,7 +54,7 @@ paths:
schema:
$ref: '#/components/schemas/credentials'
responses:
'201':
'200':
description: Registration succeed
content:
application/json:
Expand Down Expand Up @@ -174,11 +174,18 @@ paths:
description: Create a new file
requestBody:
content:
application/json:
multipart/form-data:
schema:
$ref: '#/components/schemas/fileDetails'
type: object
properties:
fileName:
type: string
location:
type: string
file:
type: string
responses:
'201':
'200':
description: File created successfully
content:
application/json:
Expand All @@ -196,6 +203,7 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/statusResponse'

/folders:
post:
tags:
Expand All @@ -205,9 +213,14 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/folderDetails'
type: object
properties:
folderName:
type: string
location:
type: string #UUID
responses:
'201':
'200':
description: Folder created successfully
content:
application/json:
Expand All @@ -225,6 +238,7 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/statusResponse'

/files/shared:
get:
tags:
Expand Down Expand Up @@ -286,7 +300,7 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/statusResponse'
/files/{fileId}/delete:
/files/{fileId}:
delete:
tags:
- Files
Expand Down Expand Up @@ -351,25 +365,195 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/statusResponse'


/files/list:
get:
tags:
- Files
description: List files in a given location
parameters:
- in: query
name: location
required: true
schema:
type: string
description: The location (UUID) to list files from
responses:
'200':
description: List of files in the location
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/fileDetails'
'401':
description: Not authorized
content:
application/json:
schema:
$ref: '#/components/schemas/statusResponse'
'500':
description: Internal error
content:
application/json:
schema:
$ref: '#/components/schemas/statusResponse'

/files/download/{fileUUID}:
get:
tags:
- Files
description: Download a file by UUID
parameters:
- in: path
name: fileUUID
required: true
schema:
type: string
description: The UUID of the file to download
responses:
'200':
description: File downloaded successfully
content:
application/octet-stream:
schema:
type: string
format: binary
'401':
description: Not authorized
content:
application/json:
schema:
$ref: '#/components/schemas/statusResponse'
'404':
description: File not found
content:
application/json:
schema:
$ref: '#/components/schemas/statusResponse'
'500':
description: Internal error
content:
application/json:
schema:
$ref: '#/components/schemas/statusResponse'

/logout:
/files/share:
post:
tags:
- Authentication
description: Closes the current session
- Files
description: Share a file with a user
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/shareWithReq'
responses:
'200':
description: File shared successfully
content:
application/json:
schema:
$ref: '#/components/schemas/statusResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/statusResponse'
'401':
description: Not authorized
content:
application/json:
schema:
$ref: '#/components/schemas/statusResponse'
'404':
description: File not found
content:
application/json:
schema:
$ref: '#/components/schemas/statusResponse'
'500':
description: Internal error
content:
application/json:
schema:
$ref: '#/components/schemas/statusResponse'

/files/unshare:
post:
tags:
- Files
description: Unshare a file with a user
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/unshareWithReq'
responses:
'200':
description: Session successfully closed
description: File unshared successfully
content:
application/json:
schema:
$ref: '#/components/schemas/statusResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/statusResponse'
'401':
description: Not authorized
content:
application/json:
schema:
$ref: '#/components/schemas/statusResponse'
'404':
description: File not found
content:
application/json:
schema:
$ref: '#/components/schemas/statusResponse'
'500':
description: Internal error
content:
application/json:
schema:
$ref: '#/components/schemas/statusResponse'

/files/sharedwithwho:
get:
tags:
- Files
description: Get the list of users the file is shared with
parameters:
- in: query
name: fileUUID
required: true
schema:
type: string
responses:
'200':
description: List of users the file is shared with
content:
application/json:
schema:
$ref: '#/components/schemas/sharedWithWhoResponse'
'401':
description: Not authorized
content:
application/json:
schema:
$ref: '#/components/schemas/statusResponse'
'404':
description: File not found
content:
application/json:
schema:
$ref: '#/components/schemas/statusResponse'
'500':
description: Internal error
content:
Expand Down Expand Up @@ -417,9 +601,27 @@ components:
type: string
fileSize:
type: integer

folderDetails:

shareWithReq:
type: object
properties:
fileUUID:
type: string
otherUserUUID:
type: string

unshareWithReq:
type: object
properties:
fileUUID:
type: string
otherUserUUID:
type: string

sharedWithWhoResponse:
type: object
properties:
folderName:
type: string
sharedUsers:
type: array
items:
$ref: '#/components/schemas/account'

0 comments on commit 1b30258

Please sign in to comment.