Add API doc for playlists

pull/2677/head
Chocobozzz 2020-04-21 15:04:39 +02:00
parent b029d58a27
commit c18431505f
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 324 additions and 59 deletions

View File

@ -522,7 +522,9 @@ export class VideoPlaylistModel extends Model<VideoPlaylistModel> {
updatedAt: this.updatedAt, updatedAt: this.updatedAt,
ownerAccount: this.OwnerAccount.toFormattedSummaryJSON(), ownerAccount: this.OwnerAccount.toFormattedSummaryJSON(),
videoChannel: this.VideoChannel ? this.VideoChannel.toFormattedSummaryJSON() : null videoChannel: this.VideoChannel
? this.VideoChannel.toFormattedSummaryJSON()
: null
} }
} }

View File

@ -362,7 +362,7 @@ paths:
summary: Follow a server summary: Follow a server
responses: responses:
'204': '204':
$ref: '#/paths/~1users~1me/put/responses/204' description: successful operation
requestBody: requestBody:
content: content:
application/json: application/json:
@ -421,7 +421,7 @@ paths:
- $ref: '#/components/parameters/id' - $ref: '#/components/parameters/id'
responses: responses:
'204': '204':
$ref: '#/paths/~1users~1me/put/responses/204' description: successful operation
get: get:
summary: Get a user summary: Get a user
security: security:
@ -447,7 +447,7 @@ paths:
- $ref: '#/components/parameters/id' - $ref: '#/components/parameters/id'
responses: responses:
'204': '204':
$ref: '#/paths/~1users~1me/put/responses/204' description: successful operation
requestBody: requestBody:
content: content:
application/json: application/json:
@ -461,7 +461,7 @@ paths:
- Users - Users
responses: responses:
'204': '204':
$ref: '#/paths/~1users~1me/put/responses/204' description: successful operation
requestBody: requestBody:
content: content:
application/json: application/json:
@ -717,7 +717,7 @@ paths:
- $ref: '#/components/parameters/idOrUUID' - $ref: '#/components/parameters/idOrUUID'
responses: responses:
'204': '204':
$ref: '#/paths/~1users~1me/put/responses/204' description: successful operation
'/videos/ownership/{id}/refuse': '/videos/ownership/{id}/refuse':
post: post:
summary: Refuse ownership change request summary: Refuse ownership change request
@ -729,7 +729,7 @@ paths:
- $ref: '#/components/parameters/idOrUUID' - $ref: '#/components/parameters/idOrUUID'
responses: responses:
'204': '204':
$ref: '#/paths/~1users~1me/put/responses/204' description: successful operation
'/videos/{id}/give-ownership': '/videos/{id}/give-ownership':
post: post:
summary: Request ownership change summary: Request ownership change
@ -752,7 +752,7 @@ paths:
- username - username
responses: responses:
'204': '204':
$ref: '#/paths/~1users~1me/put/responses/204' description: successful operation
'400': '400':
description: 'Changing video ownership to a remote account is not supported yet' description: 'Changing video ownership to a remote account is not supported yet'
/videos: /videos:
@ -869,6 +869,8 @@ paths:
language: language:
description: Video language description: Video language
type: string type: string
privacy:
$ref: '#/components/schemas/VideoPrivacySet'
description: description:
description: Video description description: Video description
type: string type: string
@ -930,7 +932,7 @@ paths:
- $ref: '#/components/parameters/idOrUUID' - $ref: '#/components/parameters/idOrUUID'
responses: responses:
'204': '204':
$ref: '#/paths/~1users~1me/put/responses/204' description: successful operation
'/videos/{id}/description': '/videos/{id}/description':
get: get:
summary: Get complete video description summary: Get complete video description
@ -954,7 +956,7 @@ paths:
- $ref: '#/components/parameters/idOrUUID' - $ref: '#/components/parameters/idOrUUID'
responses: responses:
'204': '204':
$ref: '#/paths/~1users~1me/put/responses/204' description: successful operation
'/videos/{id}/watching': '/videos/{id}/watching':
put: put:
summary: Set watching progress of a video summary: Set watching progress of a video
@ -972,7 +974,7 @@ paths:
required: true required: true
responses: responses:
'204': '204':
$ref: '#/paths/~1users~1me/put/responses/204' description: successful operation
/videos/upload: /videos/upload:
post: post:
summary: Upload a video summary: Upload a video
@ -1220,7 +1222,7 @@ paths:
- $ref: '#/components/parameters/idOrUUID' - $ref: '#/components/parameters/idOrUUID'
responses: responses:
'204': '204':
$ref: '#/paths/~1users~1me/put/responses/204' description: successful operation
'/videos/{id}/blacklist': '/videos/{id}/blacklist':
post: post:
summary: Blacklist a video summary: Blacklist a video
@ -1234,7 +1236,7 @@ paths:
- $ref: '#/components/parameters/idOrUUID' - $ref: '#/components/parameters/idOrUUID'
responses: responses:
'204': '204':
$ref: '#/paths/~1users~1me/put/responses/204' description: successful operation
delete: delete:
summary: Delete an entry of the blacklist of a video by its id summary: Delete an entry of the blacklist of a video by its id
security: security:
@ -1247,7 +1249,7 @@ paths:
- $ref: '#/components/parameters/idOrUUID' - $ref: '#/components/parameters/idOrUUID'
responses: responses:
'204': '204':
$ref: '#/paths/~1users~1me/put/responses/204' description: successful operation
/videos/blacklist: /videos/blacklist:
get: get:
summary: List blacklisted videos summary: List blacklisted videos
@ -1314,7 +1316,7 @@ paths:
contentType: text/vtt, application/x-subrip, text/plain contentType: text/vtt, application/x-subrip, text/plain
responses: responses:
'204': '204':
$ref: '#/paths/~1users~1me/put/responses/204' description: successful operation
delete: delete:
summary: Delete a video caption summary: Delete a video caption
tags: tags:
@ -1324,7 +1326,7 @@ paths:
- $ref: '#/components/parameters/captionLanguage' - $ref: '#/components/parameters/captionLanguage'
responses: responses:
'204': '204':
$ref: '#/paths/~1users~1me/put/responses/204' description: successful operation
/video-channels: /video-channels:
get: get:
summary: List video channels summary: List video channels
@ -1351,7 +1353,7 @@ paths:
- Video Channels - Video Channels
responses: responses:
'204': '204':
$ref: '#/paths/~1users~1me/put/responses/204' description: successful operation
requestBody: requestBody:
content: content:
application/json: application/json:
@ -1381,7 +1383,7 @@ paths:
- $ref: '#/components/parameters/channelHandle' - $ref: '#/components/parameters/channelHandle'
responses: responses:
'204': '204':
$ref: '#/paths/~1users~1me/put/responses/204' description: successful operation
requestBody: requestBody:
content: content:
application/json: application/json:
@ -1397,7 +1399,7 @@ paths:
- $ref: '#/components/parameters/channelHandle' - $ref: '#/components/parameters/channelHandle'
responses: responses:
'204': '204':
$ref: '#/paths/~1users~1me/put/responses/204' description: successful operation
'/video-channels/{channelHandle}/videos': '/video-channels/{channelHandle}/videos':
get: get:
summary: List videos of a video channel summary: List videos of a video channel
@ -1413,6 +1415,22 @@ paths:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/VideoListResponse' $ref: '#/components/schemas/VideoListResponse'
/video-playlists/privacies:
get:
summary: List available playlist privacies
tags:
- Video Playlists
responses:
'200':
description: successful operation
content:
application/json:
schema:
type: array
items:
type: string
/video-playlists: /video-playlists:
get: get:
summary: List video playlists summary: List video playlists
@ -1431,6 +1449,235 @@ paths:
type: array type: array
items: items:
$ref: '#/components/schemas/VideoPlaylist' $ref: '#/components/schemas/VideoPlaylist'
post:
summary: Create a video playlist
description: 'If the video playlist is set as public, the videoChannelId is mandatory.'
security:
- OAuth2: []
tags:
- Video Playlists
responses:
'200':
description: successful operation
content:
application/json:
schema:
type: object
properties:
videoPlaylist:
type: object
properties:
id:
type: number
uuid:
type: string
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
displayName:
description: Video playlist display name
type: string
thumbnailfile:
description: Video playlist thumbnail file
type: string
format: binary
privacy:
$ref: '#/components/schemas/VideoPlaylistPrivacySet'
description:
description: Video playlist description
type: string
videoChannelId:
description: Video channel in which the playlist will be published
type: number
required:
- displayName
/video-playlists/{id}:
get:
summary: Get a video playlist
tags:
- Video Playlists
parameters:
- $ref: '#/components/parameters/idOrUUID'
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/VideoPlaylist'
put:
summary: Update a video playlist
description: 'If the video playlist is set as public, the playlist must have a assigned channel.'
security:
- OAuth2: []
tags:
- Video Playlists
responses:
'204':
description: successful operation
parameters:
- $ref: '#/components/parameters/idOrUUID'
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
displayName:
description: Video playlist display name
type: string
thumbnailfile:
description: Video playlist thumbnail file
type: string
format: binary
privacy:
$ref: '#/components/schemas/VideoPlaylistPrivacySet'
description:
description: Video playlist description
type: string
videoChannelId:
description: Video channel in which the playlist will be published
type: number
delete:
summary: Delete a video playlist
security:
- OAuth2: []
tags:
- Video Playlists
parameters:
- $ref: '#/components/parameters/idOrUUID'
responses:
'204':
description: successful operation
/video-playlists/{id}/videos:
get:
summary: 'List videos of a playlist'
tags:
- Videos
- Video Playlists
parameters:
- $ref: '#/components/parameters/idOrUUID'
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/VideoListResponse'
post:
summary: 'Add a video in a playlist'
security:
- OAuth2: []
tags:
- Videos
- Video Playlists
parameters:
- $ref: '#/components/parameters/idOrUUID'
responses:
'200':
description: successful operation
content:
application/json:
schema:
type: object
properties:
videoPlaylistElement:
type: object
properties:
id:
type: number
requestBody:
content:
application/json:
schema:
type: object
properties:
videoId:
type: number
description: 'Video to add in the playlist'
startTimestamp:
type: number
description: 'Start the video at this specific timestamp (in seconds)'
stopTimestamp:
type: number
description: 'Stop the video at this specific timestamp (in seconds)'
required:
- videoId
/video-playlists/{id}/videos/reorder:
post:
summary: 'Reorder a playlist'
security:
- OAuth2: []
tags:
- Video Playlists
parameters:
- $ref: '#/components/parameters/idOrUUID'
responses:
'204':
description: successful operation
requestBody:
content:
application/json:
schema:
type: object
properties:
startPosition:
type: number
description: 'Start position of the element to reorder (starts from 1)'
insertAfterPosition:
type: number
description: 'New position for the block to reorder (starts from 0, to add the block before the first element)'
reorderLength:
type: number
description: 'How many element from startPosition to reorder (minimum length is 1)'
required:
- startPosition
- insertAfterPosition
/video-playlists/{id}/videos/:playlistElementId:
put:
summary: 'Update a playlist element'
security:
- OAuth2: []
tags:
- Video Playlists
parameters:
- $ref: '#/components/parameters/idOrUUID'
- $ref: '#/components/parameters/playlistElementId'
responses:
'204':
description: successful operation
requestBody:
content:
application/json:
schema:
type: object
properties:
startTimestamp:
type: number
description: 'Start the video at this specific timestamp (in seconds)'
stopTimestamp:
type: number
description: 'Stop the video at this specific timestamp (in seconds)'
delete:
summary: 'Delete an element from a playlist'
security:
- OAuth2: []
tags:
- Video Playlists
parameters:
- $ref: '#/components/parameters/idOrUUID'
- $ref: '#/components/parameters/playlistElementId'
responses:
'204':
description: successful operation
'/accounts/{name}/video-channels': '/accounts/{name}/video-channels':
get: get:
summary: List video channels of an account summary: List video channels of an account
@ -1553,7 +1800,7 @@ paths:
- $ref: '#/components/parameters/commentId' - $ref: '#/components/parameters/commentId'
responses: responses:
'204': '204':
$ref: '#/paths/~1users~1me/put/responses/204' description: successful operation
'/videos/{id}/rate': '/videos/{id}/rate':
put: put:
summary: Like/dislike a video summary: Like/dislike a video
@ -1565,7 +1812,7 @@ paths:
- $ref: '#/components/parameters/idOrUUID' - $ref: '#/components/parameters/idOrUUID'
responses: responses:
'204': '204':
$ref: '#/paths/~1users~1me/put/responses/204' description: successful operation
/search/videos: /search/videos:
get: get:
tags: tags:
@ -1716,9 +1963,16 @@ components:
name: id name: id
in: path in: path
required: true required: true
description: The video id or uuid description: The object id or uuid
schema: schema:
type: string type: string
playlistElementId:
name: playlistElementId
in: path
required: true
description: Playlist element id
schema:
type: number
captionLanguage: captionLanguage:
name: captionLanguage name: captionLanguage
in: path in: path
@ -1887,21 +2141,46 @@ components:
type: string type: string
label: label:
type: string type: string
VideoPlaylistPrivacySet:
type: integer
enum:
- 1
- 2
- 3
description: 'The video playlist privacy (Public = 1, Unlisted = 2, Private = 3)'
VideoPlaylistPrivacyConstant:
properties:
id:
$ref: '#/components/schemas/VideoPlaylistPrivacySet'
label:
type: string
VideoPlaylistTypeSet:
type: integer
enum:
- 1
- 2
description: 'The video playlist type (Regular = 1, Watch Later = 2)'
VideoPlaylistTypeConstant:
properties:
id:
$ref: '#/components/schemas/VideoPlaylistTypeSet'
label:
type: string
VideoPrivacySet: VideoPrivacySet:
type: integer type: integer
enum: enum:
- 1 - 1
- 2 - 2
- 3 - 3
description: 'The video privacy (Public = 1, Unlisted = 2, Private = 3)' - 4
description: 'The video privacy (Public = 1, Unlisted = 2, Private = 3, Internal = 4)'
VideoPrivacyConstant: VideoPrivacyConstant:
properties: properties:
id: id:
type: integer $ref: '#/components/schemas/VideoPrivacySet'
enum:
- 1
- 2
- 3
label: label:
type: string type: string
VideoStateConstant: VideoStateConstant:
@ -1926,14 +2205,13 @@ components:
properties: properties:
privacy: privacy:
$ref: '#/components/schemas/VideoPrivacySet' $ref: '#/components/schemas/VideoPrivacySet'
description: Video privacy target
updateAt: updateAt:
type: string type: string
format: date format: date
description: When to update the video description: When to update the video
required: required:
- updateAt - updateAt
VideoAccountSummary: AccountSummary:
properties: properties:
id: id:
type: number type: number
@ -1947,7 +2225,8 @@ components:
type: string type: string
avatar: avatar:
nullable: true nullable: true
$ref: '#/components/schemas/Avatar' allOf:
- $ref: '#/components/schemas/Avatar'
VideoChannelSummary: VideoChannelSummary:
properties: properties:
id: id:
@ -1962,7 +2241,8 @@ components:
type: string type: string
avatar: avatar:
nullable: true nullable: true
$ref: '#/components/schemas/Avatar' allOf:
- $ref: '#/components/schemas/Avatar'
PlaylistElement: PlaylistElement:
properties: properties:
position: position:
@ -1973,7 +2253,8 @@ components:
type: number type: number
video: video:
nullable: true nullable: true
$ref: '#/components/schemas/Video' allOf:
- $ref: '#/components/schemas/Video'
VideoFile: VideoFile:
properties: properties:
magnetUri: magnetUri:
@ -2064,7 +2345,8 @@ components:
$ref: '#/components/schemas/VideoStateConstant' $ref: '#/components/schemas/VideoStateConstant'
scheduledUpdate: scheduledUpdate:
nullable: true nullable: true
$ref: '#/components/schemas/VideoScheduledUpdate' allOf:
- $ref: '#/components/schemas/VideoScheduledUpdate'
blacklisted: blacklisted:
nullable: true nullable: true
type: boolean type: boolean
@ -2072,7 +2354,7 @@ components:
nullable: true nullable: true
type: string type: string
account: account:
$ref: '#/components/schemas/VideoAccountSummary' $ref: '#/components/schemas/AccountSummary'
channel: channel:
$ref: '#/components/schemas/VideoChannelSummary' $ref: '#/components/schemas/VideoChannelSummary'
userHistory: userHistory:
@ -2233,32 +2515,13 @@ components:
thumbnailPath: thumbnailPath:
type: string type: string
privacy: privacy:
type: object $ref: '#/components/schemas/VideoPlaylistPrivacyConstant'
properties:
id:
type: number
label:
type: string
type: type:
type: object $ref: '#/components/schemas/VideoPlaylistTypeConstant'
properties:
id:
type: number
label:
type: string
ownerAccount: ownerAccount:
type: object $ref: '#/components/schemas/AccountSummary'
properties: videoChannel:
id: $ref: '#/components/schemas/VideoChannelSummary'
type: number
name:
type: string
displayName:
type: string
url:
type: string
host:
type: string
VideoComment: VideoComment:
properties: properties:
id: id: