X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=support%2Fdoc%2Fapi%2Fopenapi.yaml;h=4230fc82716b12ffb615fa641505490224c48ad7;hb=94bb740b49c9991c331b36f1ea29a283ffdba18d;hp=7ffe8c67bf6dcb31b33b9f9c9c58e2b8eb3ca859;hpb=3545e72c686ff1725bbdfd8d16d693e2f4aa75a3;p=github%2FChocobozzz%2FPeerTube.git diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index 7ffe8c67b..4230fc827 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: PeerTube - version: 4.0.0 + version: 5.1.0 contact: name: PeerTube Community url: https://joinpeertube.org @@ -21,7 +21,7 @@ info: - [Go](https://framagit.org/framasoft/peertube/clients/go) - [Kotlin](https://framagit.org/framasoft/peertube/clients/kotlin) - See the [REST API quick start](https://docs.joinpeertube.org/api-rest-getting-started) for a few + See the [REST API quick start](https://docs.joinpeertube.org/api/rest-getting-started) for a few examples of using the PeerTube API. # Authentication @@ -33,7 +33,7 @@ info: ## Roles Accounts are given permissions based on their role. There are three roles on - PeerTube: Administrator, Moderator, and User. See the [roles guide](https://docs.joinpeertube.org/admin-managing-users?id=roles) for a detail of their permissions. + PeerTube: Administrator, Moderator, and User. See the [roles guide](https://docs.joinpeertube.org/admin/managing-users#roles) for a detail of their permissions. # Errors @@ -204,7 +204,7 @@ tags: information across its social graph by posting activities to actors' inbox endpoints. externalDocs: - url: https://docs.joinpeertube.org/admin-following-instances?id=instances-follows + url: https://docs.joinpeertube.org/admin/following-instances#instances-follows - name: Instance Redundancy description: > Redundancy is part of the inter-server solidarity that PeerTube fosters. @@ -212,12 +212,12 @@ tags: to the policy of video selection of your choice. Note that you have a similar functionality to mirror individual videos, see [video mirroring](#tag/Video-Mirroring). externalDocs: - url: https://docs.joinpeertube.org/admin-following-instances?id=instances-redundancy + url: https://docs.joinpeertube.org/admin/following-instances#instances-redundancy - name: Plugins description: > Managing plugins installed from a local path or from NPM, or search for new ones. externalDocs: - url: https://docs.joinpeertube.org/api-plugins + url: https://docs.joinpeertube.org/api/plugins - name: Abuses description: | Abuses deal with reports of local or remote videos/comments/accounts alike. @@ -274,7 +274,7 @@ tags: description: Operations on video files - name: Video Transcoding description: Video transcoding related operations - - name: Video stats + - name: Video Stats description: Video statistics - name: Video Feeds description: Server syndication feeds of videos @@ -297,6 +297,9 @@ tags: - name: Stats description: | Statistics + - name: Runner Registration Token + description: | + Manage runner registration token x-tagGroups: - name: Static endpoints @@ -353,6 +356,12 @@ x-tagGroups: - Stats - Logs - Job + - name: Remote Jobs + tags: + - Runner Registration Token + - Runner Jobs + - Runners + paths: '/static/webseed/{filename}': get: @@ -408,6 +417,7 @@ paths: parameters: - $ref: '#/components/parameters/staticFilename' - $ref: '#/components/parameters/videoFileToken' + - $ref: '#/components/parameters/reinjectVideoFileToken' security: - OAuth2: [] responses: @@ -716,6 +726,7 @@ paths: - $ref: '#/components/parameters/start' - $ref: '#/components/parameters/count' - $ref: '#/components/parameters/videosSort' + - $ref: '#/components/parameters/excludeAlreadyWatched' responses: '200': description: successful operation @@ -804,9 +815,15 @@ paths: content: 'application/json': schema: - type: array - items: - $ref: '#/components/schemas/Account' + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/Account' /api/v1/config: get: @@ -1400,22 +1417,48 @@ paths: '200': description: successful operation - /api/v1/users/register: + /api/v1/users/ask-send-verify-email: post: - summary: Register a user - operationId: registerUser + summary: Resend user verification link + operationId: resendEmailToVerifyUser tags: - Users - Register + requestBody: + content: + application/json: + schema: + type: object + properties: + email: + type: string + description: User email + required: + - email responses: '204': description: successful operation + + /api/v1/users/registrations/ask-send-verify-email: + post: + summary: Resend verification link to registration email + operationId: resendEmailToVerifyRegistration + tags: + - Register requestBody: content: application/json: schema: - $ref: '#/components/schemas/RegisterUser' - required: true + type: object + properties: + email: + type: string + description: Registration email + required: + - email + responses: + '204': + description: successful operation /api/v1/users/{id}/verify-email: post: @@ -1424,6 +1467,7 @@ paths: description: | Following a user registration, the new user will receive an email asking to click a link containing a secret. + This endpoint can also be used to verify a new email set in the user account. tags: - Users - Register @@ -1450,6 +1494,36 @@ paths: '404': description: user not found + /api/v1/users/registrations/{registrationId}/verify-email: + post: + summary: Verify a registration email + operationId: verifyRegistrationEmail + description: | + Following a user registration request, the user will receive an email asking to click a link + containing a secret. + tags: + - Register + parameters: + - $ref: '#/components/parameters/registrationId' + requestBody: + content: + application/json: + schema: + type: object + properties: + verificationString: + type: string + format: url + required: + - verificationString + responses: + '204': + description: successful operation + '403': + description: invalid verification string + '404': + description: registration not found + /api/v1/users/{id}/two-factor/request: post: summary: Request two factor auth @@ -1540,18 +1614,6 @@ paths: '404': description: user not found - - /api/v1/users/ask-send-verify-email: - post: - summary: Resend user verification link - operationId: resendEmailToVerifyUser - tags: - - Users - - Register - responses: - '204': - description: successful operation - /api/v1/users/me: get: summary: Get my user information @@ -1789,6 +1851,7 @@ paths: - $ref: '#/components/parameters/start' - $ref: '#/components/parameters/count' - $ref: '#/components/parameters/videosSort' + - $ref: '#/components/parameters/excludeAlreadyWatched' responses: '200': description: successful operation @@ -2036,6 +2099,158 @@ paths: '204': description: successful operation + /api/v1/users/register: + post: + summary: Register a user + operationId: registerUser + description: Signup has to be enabled and signup approval is not required + tags: + - Register + responses: + '204': + description: successful operation + '400': + description: request error + '403': + description: user registration is not enabled, user limit is reached, registration is not allowed for the ip, requires approval or blocked by a plugin + '409': + description: 'a user with this username, channel name or email already exists' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterUser' + required: true + + /api/v1/users/registrations/request: + post: + summary: Request registration + description: Signup has to be enabled and require approval on the instance + operationId: requestRegistration + tags: + - Register + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/UserRegistration' + '400': + description: request error or signup approval is not enabled on the instance + '403': + description: user registration is not enabled, user limit is reached, registration is not allowed for the ip or blocked by a plugin + '409': + description: 'a user or registration with this username, channel name or email already exists' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserRegistrationRequest' + + /api/v1/users/registrations/{registrationId}/accept: + post: + security: + - OAuth2: + - admin + - moderator + summary: Accept registration + operationId: acceptRegistration + tags: + - Register + parameters: + - $ref: '#/components/parameters/registrationId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserRegistrationAcceptOrReject' + responses: + '204': + description: successful operation + + /api/v1/users/registrations/{registrationId}/reject: + post: + security: + - OAuth2: + - admin + - moderator + summary: Reject registration + operationId: rejectRegistration + tags: + - Register + parameters: + - $ref: '#/components/parameters/registrationId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserRegistrationAcceptOrReject' + responses: + '204': + description: successful operation + + /api/v1/users/registrations/{registrationId}: + delete: + security: + - OAuth2: + - admin + - moderator + summary: Delete registration + description: 'Delete the registration entry. It will not remove the user associated with this registration (if any)' + operationId: deleteRegistration + tags: + - Register + parameters: + - $ref: '#/components/parameters/registrationId' + responses: + '204': + description: successful operation + + /api/v1/users/registrations: + get: + security: + - OAuth2: + - admin + - moderator + summary: List registrations + operationId: listRegistrations + tags: + - Register + parameters: + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - name: search + in: query + required: false + schema: + type: string + - name: sort + in: query + required: false + schema: + type: string + enum: + - -createdAt + - createdAt + - state + - -state + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/UserRegistration' + /api/v1/videos/ownership: get: summary: List video ownership changes @@ -2180,6 +2395,7 @@ paths: - $ref: '#/components/parameters/start' - $ref: '#/components/parameters/count' - $ref: '#/components/parameters/videosSort' + - $ref: '#/components/parameters/excludeAlreadyWatched' responses: '200': description: successful operation @@ -2248,7 +2464,7 @@ paths: /api/v1/videos/privacies: get: summary: List available video privacy policies - operationId: getPrivacyPolicies + operationId: getVideoPrivacyPolicies tags: - Video responses: @@ -2889,6 +3105,8 @@ paths: type: integer saveReplay: type: boolean + replaySettings: + $ref: '#/components/schemas/LiveVideoReplaySettings' permanentLive: description: User can stream multiple times in a permanent live type: boolean @@ -3599,6 +3817,7 @@ paths: - $ref: '#/components/parameters/start' - $ref: '#/components/parameters/count' - $ref: '#/components/parameters/videosSort' + - $ref: '#/components/parameters/excludeAlreadyWatched' responses: '200': description: successful operation @@ -3607,6 +3826,34 @@ paths: schema: $ref: '#/components/schemas/VideoListResponse' + '/api/v1/video-channels/{channelHandle}/video-playlists': + get: + summary: List playlists of a channel + tags: + - Video Playlists + - Video Channels + parameters: + - $ref: '#/components/parameters/channelHandle' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + - $ref: '#/components/parameters/videoPlaylistType' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/VideoPlaylist' + '/api/v1/video-channels/{channelHandle}/followers': get: tags: @@ -3851,6 +4098,7 @@ paths: - $ref: '#/components/parameters/start' - $ref: '#/components/parameters/count' - $ref: '#/components/parameters/sort' + - $ref: '#/components/parameters/videoPlaylistType' responses: '200': description: successful operation @@ -4167,7 +4415,35 @@ paths: format: seconds stopTimestamp: type: integer - format: seconds + + '/api/v1/accounts/{name}/video-playlists': + get: + summary: List playlists of an account + tags: + - Video Playlists + - Accounts + parameters: + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + - $ref: '#/components/parameters/search' + - $ref: '#/components/parameters/videoPlaylistType' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/VideoPlaylist' '/api/v1/accounts/{name}/video-channels': get: @@ -4477,6 +4753,7 @@ paths: - $ref: '#/components/parameters/isLocal' - $ref: '#/components/parameters/include' - $ref: '#/components/parameters/privacyOneOf' + - $ref: '#/components/parameters/uuids' - $ref: '#/components/parameters/hasHLSFiles' - $ref: '#/components/parameters/hasWebtorrentFiles' - $ref: '#/components/parameters/skipCount' @@ -4484,6 +4761,7 @@ paths: - $ref: '#/components/parameters/count' - $ref: '#/components/parameters/searchTarget' - $ref: '#/components/parameters/videosSearchSort' + - $ref: '#/components/parameters/excludeAlreadyWatched' - name: startDate in: query description: Get videos that are published after this date @@ -5206,19 +5484,456 @@ paths: '204': description: successful operation -servers: - - url: 'https://peertube2.cpy.re' - description: Live Test Server (live data - latest nightly version) - - url: 'https://peertube3.cpy.re' - description: Live Test Server (live data - latest RC version) - - url: 'https://peertube.cpy.re' - description: Live Test Server (live data - stable version) -components: - parameters: - start: - name: start - in: query - required: false + /api/v1/runners/registration-tokens/generate: + post: + summary: Generate registration token + description: Generate a new runner registration token + security: + - OAuth2: + - admin + tags: + - Runner Registration Token + responses: + '204': + description: successful operation + + /api/v1/runners/registration-tokens/{registrationTokenId}: + delete: + summary: Remove registration token + description: Remove a registration token. Runners that used this token for their registration are automatically removed. + security: + - OAuth2: + - admin + tags: + - Runner Registration Token + parameters: + - $ref: '#/components/parameters/registrationTokenId' + responses: + '204': + description: successful operation + + /api/v1/runners/registration-tokens: + get: + summary: List registration tokens + security: + - OAuth2: + - admin + tags: + - Runner Registration Token + parameters: + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/registrationTokenSort' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/RunnerRegistrationToken' + + /api/v1/runners/register: + post: + summary: Register a new runner + description: API used by PeerTube runners + tags: + - Runners + requestBody: + content: + application/json: + schema: + type: object + properties: + registrationToken: + type: string + name: + type: string + description: + type: string + required: + - registrationToken + - name + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + id: + type: integer + description: Runner id + runnerToken: + type: string + + /api/v1/runners/unregister: + post: + summary: Unregister a runner + description: API used by PeerTube runners + tags: + - Runners + requestBody: + content: + application/json: + schema: + type: object + properties: + runnerToken: + type: string + required: + - runnerToken + responses: + '204': + description: successful operation + + /api/v1/runners/{runnerId}: + delete: + summary: Delete a runner + security: + - OAuth2: + - admin + tags: + - Runners + parameters: + - $ref: '#/components/parameters/runnerId' + requestBody: + content: + application/json: + schema: + type: object + properties: + runnerToken: + type: string + required: + - runnerToken + responses: + '204': + description: successful operation + + /api/v1/runners: + get: + summary: List runners + security: + - OAuth2: + - admin + tags: + - Runners + parameters: + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/runnerSort' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/Runner' + + + /api/v1/runners/jobs/request: + post: + summary: Request a new job + description: API used by PeerTube runners + tags: + - Runner Jobs + requestBody: + content: + application/json: + schema: + type: object + properties: + runnerToken: + type: string + required: + - runnerToken + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + availableJobs: + type: array + items: + type: object + properties: + uuid: + $ref: '#/components/schemas/UUIDv4' + type: + $ref: '#/components/schemas/RunnerJobType' + payload: + $ref: '#/components/schemas/RunnerJobPayload' + + /api/v1/runners/jobs/{jobUUID}/accept: + post: + summary: Accept job + description: API used by PeerTube runners + tags: + - Runner Jobs + parameters: + - $ref: '#/components/parameters/jobUUID' + requestBody: + content: + application/json: + schema: + type: object + properties: + runnerToken: + type: string + required: + - runnerToken + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + job: + allOf: + - $ref: '#/components/schemas/RunnerJob' + - type: object + properties: + jobToken: + type: string + + /api/v1/runners/jobs/{jobUUID}/abort: + post: + summary: Abort job + description: API used by PeerTube runners + tags: + - Runner Jobs + parameters: + - $ref: '#/components/parameters/jobUUID' + requestBody: + content: + application/json: + schema: + type: object + properties: + runnerToken: + type: string + jobToken: + type: string + reason: + type: string + description: Why the runner aborts this job + required: + - runnerToken + - jobToken + - reason + responses: + '204': + description: successful operation + + /api/v1/runners/jobs/{jobUUID}/update: + post: + summary: Update job + description: API used by PeerTube runners + tags: + - Runner Jobs + parameters: + - $ref: '#/components/parameters/jobUUID' + requestBody: + content: + application/json: + schema: + type: object + properties: + runnerToken: + type: string + jobToken: + type: string + progress: + type: integer + description: Update job progression percentage (optional) + payload: + anyOf: + - type: object + description: Provide live transcoding chunks update + properties: + type: + type: string + enum: + - 'add-chunk' + - 'remove-chunk' + masterPlaylistFile: + type: string + format: binary + resolutionPlaylistFile: + type: string + format: binary + resolutionPlaylistFilename: + type: string + videoChunkFile: + type: string + format: binary + videoChunkFilename: + type: string + required: + - runnerToken + - jobToken + responses: + '204': + description: successful operation + + /api/v1/runners/jobs/{jobUUID}/error: + post: + summary: Post job error + description: API used by PeerTube runners + tags: + - Runner Jobs + parameters: + - $ref: '#/components/parameters/jobUUID' + requestBody: + content: + application/json: + schema: + type: object + properties: + runnerToken: + type: string + jobToken: + type: string + message: + type: string + description: Why the runner failed to process this job + required: + - runnerToken + - jobToken + - message + responses: + '204': + description: successful operation + + /api/v1/runners/jobs/{jobUUID}/success: + post: + summary: Post job success + description: API used by PeerTube runners + tags: + - Runner Jobs + parameters: + - $ref: '#/components/parameters/jobUUID' + requestBody: + content: + application/json: + schema: + type: object + properties: + runnerToken: + type: string + jobToken: + type: string + payload: + anyOf: + - type: object + title: VOD web video transcoding + properties: + videoFile: + type: string + format: binary + - type: object + title: VOD HLS transcoding + properties: + videoFile: + type: string + format: binary + resolutionPlaylistFile: + type: string + format: binary + - type: object + title: VOD audio merge transcoding + properties: + videoFile: + type: string + format: binary + - type: object + title: Live RTMP to HLS transcoding + required: + - runnerToken + - jobToken + - payload + responses: + '204': + description: successful operation + + /api/v1/runners/jobs/{jobUUID}/cancel: + get: + summary: Cancel a job + security: + - OAuth2: + - admin + tags: + - Runner Jobs + parameters: + - $ref: '#/components/parameters/jobUUID' + responses: + '204': + description: successful operation + + /api/v1/runners/jobs: + get: + summary: List jobs + security: + - OAuth2: + - admin + tags: + - Runner Jobs + parameters: + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/runnerJobSort' + - $ref: '#/components/parameters/search' + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + total: + type: integer + example: 1 + data: + type: array + items: + $ref: '#/components/schemas/RunnerJobAdmin' + +servers: + - url: 'https://peertube2.cpy.re' + description: Live Test Server (live data - latest nightly version) + - url: 'https://peertube3.cpy.re' + description: Live Test Server (live data - latest RC version) + - url: 'https://peertube.cpy.re' + description: Live Test Server (live data - stable version) +components: + parameters: + start: + name: start + in: query + required: false description: Offset used to paginate results schema: type: integer @@ -5387,6 +6102,38 @@ components: type: string enum: - createdAt + registrationTokenSort: + name: sort + in: query + required: false + description: Sort registration tokens by criteria + schema: + type: string + enum: + - createdAt + runnerSort: + name: sort + in: query + required: false + description: Sort runners by criteria + schema: + type: string + enum: + - createdAt + runnerJobSort: + name: sort + in: query + required: false + description: Sort runner jobs by criteria + schema: + type: string + enum: + - updatedAt + - createdAt + - priority + - state + - progress + name: name: name in: path @@ -5402,6 +6149,13 @@ components: description: Entity id schema: $ref: '#/components/schemas/id' + registrationId: + name: registrationId + in: path + required: true + description: Registration ID + schema: + $ref: '#/components/schemas/id' idOrUUID: name: id in: path @@ -5606,6 +6360,20 @@ components: schema: $ref: '#/components/schemas/VideoPrivacySet' description: '**PeerTube >= 4.0** Display only videos in this specific privacy/privacies' + excludeAlreadyWatched: + name: excludeAlreadyWatched + in: query + description: Whether or not to exclude videos that are in the user's video history + schema: + type: boolean + uuids: + name: uuids + in: query + required: false + schema: + items: + type: string + description: 'Find videos with specific UUIDs' include: name: include in: query @@ -5702,7 +6470,37 @@ components: description: Video file token [generated](#operation/requestVideoToken) by PeerTube so you don't need to provide an OAuth token in the request header. schema: type: string - + reinjectVideoFileToken: + name: reinjectVideoFileToken + in: query + required: false + description: Ask the server to reinject videoFileToken in URLs in m3u8 playlist + schema: + type: boolean + videoPlaylistType: + name: playlistType + in: query + required: false + schema: + $ref: '#/components/schemas/VideoPlaylistTypeSet' + registrationTokenId: + name: registrationTokenId + in: path + required: true + schema: + type: integer + runnerId: + name: runnerId + in: path + required: true + schema: + type: integer + jobUUID: + name: jobUUID + in: path + required: true + schema: + $ref: '#/components/schemas/UUIDv4' securitySchemes: OAuth2: @@ -5716,7 +6514,7 @@ components: Note that the __access token is valid for 1 day__ and is given along with a __refresh token valid for 2 weeks__. - [Generate]: https://docs.joinpeertube.org/api-rest-getting-started + [Generate]: https://docs.joinpeertube.org/api/rest-getting-started type: oauth2 flows: password: @@ -5804,7 +6602,7 @@ components: - 1 - 2 - 3 - description: Video playlist privacy policy (see [/video-playlists/privacies]) + description: Video playlist privacy policy (see [/video-playlists/privacies](#operation/getPlaylistPrivacyPolicies)) VideoPlaylistPrivacyConstant: properties: id: @@ -5832,7 +6630,7 @@ components: - 2 - 3 - 4 - description: privacy id of the video (see [/videos/privacies](#operation/getPrivacyPolicies)) + description: privacy id of the video (see [/videos/privacies](#operation/getVideoPrivacyPolicies)) VideoPrivacyConstant: properties: id: @@ -5894,6 +6692,14 @@ components: - 3 description: 'The live latency mode (Default = `1`, High latency = `2`, Small Latency = `3`)' + LiveVideoReplaySettings: + type: object + properties: + privacy: + # description: Video playlist privacy policy (see [../video-playlists/privacies]) + $ref: '#/components/schemas/VideoPrivacySet' + + VideoStateConstant: properties: id: @@ -7522,13 +8328,16 @@ components: nsfwPolicy: $ref: '#/components/schemas/NSFWPolicy' role: - $ref: '#/components/schemas/UserRole' - roleLabel: - type: string - enum: - - User - - Moderator - - Administrator + type: object + properties: + id: + $ref: '#/components/schemas/UserRole' + label: + type: string + enum: + - User + - Moderator + - Administrator theme: type: string description: Theme enabled by this user @@ -7597,8 +8406,6 @@ components: - username - password - email - - videoQuota - - videoQuotaDaily - role UpdateUser: properties: @@ -7705,6 +8512,7 @@ components: required: - video - rating + RegisterUser: properties: username: @@ -7735,6 +8543,77 @@ components: - password - email + UserRegistrationRequest: + allOf: + - $ref: '#/components/schemas/RegisterUser' + - type: object + properties: + registrationReason: + type: string + description: reason for the user to register on the instance + required: + - registrationReason + + UserRegistrationAcceptOrReject: + type: object + properties: + moderationResponse: + type: string + description: Moderation response to send to the user + preventEmailDelivery: + type: boolean + description: Set it to true if you don't want PeerTube to send an email to the user + required: + - moderationResponse + + UserRegistration: + properties: + id: + $ref: '#/components/schemas/id' + state: + type: object + properties: + id: + type: integer + enum: + - 1 + - 2 + - 3 + description: 'The registration state (Pending = `1`, Rejected = `2`, Accepted = `3`)' + label: + type: string + registrationReason: + type: string + moderationResponse: + type: string + nullable: true + username: + type: string + email: + type: string + format: email + emailVerified: + type: boolean + accountDisplayName: + type: string + channelHandle: + type: string + channelDisplayName: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + user: + type: object + nullable: true + description: If the registration has been accepted, this is a partial user object created by the registration + properties: + id: + $ref: '#/components/schemas/id' + OAuthClient: properties: client_id: @@ -7833,9 +8712,18 @@ components: uuid: $ref: '#/components/schemas/UUIDv4' + VideoChannelEdit: + properties: + displayName: + description: Channel display name + description: + description: Channel description + support: + description: How to support/fund the channel + VideoChannelCreate: allOf: - - $ref: '#/components/schemas/VideoChannel' + - $ref: '#/components/schemas/VideoChannelEdit' - properties: name: description: username of the channel to create @@ -7846,11 +8734,12 @@ components: - displayName VideoChannelUpdate: allOf: - - $ref: '#/components/schemas/VideoChannel' + - $ref: '#/components/schemas/VideoChannelEdit' - properties: bulkVideosSupportUpdate: type: boolean description: Update the support field for all videos of this channel + VideoChannelList: properties: total: @@ -8109,17 +8998,13 @@ components: NotificationSettingValue: type: integer description: > - Notification type + Notification type. One of the following values, or a sum of multiple values: - `0` NONE - `1` WEB - `2` EMAIL - enum: - - 0 - - 1 - - 2 Notification: properties: id: @@ -8328,6 +9213,8 @@ components: properties: saveReplay: type: boolean + replaySettings: + $ref: '#/components/schemas/LiveVideoReplaySettings' permanentLive: description: User can stream multiple times in a permanent live type: boolean @@ -8348,6 +9235,8 @@ components: description: RTMP stream key to use to stream into this live video. Included in the response if an appropriate token is provided saveReplay: type: boolean + replaySettings: + $ref: '#/components/schemas/LiveVideoReplaySettings' permanentLive: description: User can stream multiple times in a permanent live type: boolean @@ -8514,6 +9403,195 @@ components: - uploadedBytesP2P - videoId + RunnerRegistrationToken: + properties: + id: + type: integer + registrationToken: + type: string + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + registeredRunnersCount: + type: integer + + Runner: + properties: + id: + type: integer + name: + type: string + description: + type: string + ip: + type: string + updatedAt: + type: string + format: date-time + createdAt: + type: string + format: date-time + lastContact: + type: string + format: date-time + + RunnerJobType: + type: string + enum: + - vod-web-video-transcoding + - vod-hls-transcoding + - vod-audio-merge-transcoding + - live-rtmp-hls-transcoding + + RunnerJobState: + type: integer + enum: + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 8 + description: > + The runner job state: + - `1` Pending + - `2` Processing + - `3` Completed + - `4` Errored + - `5` Waiting for a parent job + - `6` Cancelled + - `7` Parent had an error + - `8` Parent has been cancelled + + RunnerJobStateConstant: + type: object + properties: + id: + $ref: '#/components/schemas/RunnerJobState' + label: + type: string + example: 'Processing' + + RunnerJobPayload: + anyOf: + - type: object + title: VOD web video transcoding + properties: + input: + type: object + properties: + videoFileUrl: + type: string + output: + type: object + properties: + resolution: + type: number + fps: + type: number + - type: object + title: VOD HLS transcoding + properties: + input: + type: object + properties: + videoFileUrl: + type: string + output: + type: object + properties: + resolution: + type: number + fps: + type: number + - type: object + title: VOD audio merge transcoding + properties: + input: + type: object + properties: + audioFileUrl: + type: string + previewFileUrl: + type: string + output: + type: object + properties: + resolution: + type: number + fps: + type: number + + RunnerJob: + properties: + uuid: + $ref: '#/components/schemas/UUIDv4' + type: + $ref: '#/components/schemas/RunnerJobType' + state: + $ref: '#/components/schemas/RunnerJobStateConstant' + payload: + $ref: '#/components/schemas/RunnerJobPayload' + failures: + type: integer + description: Number of times a remote runner failed to process this job. After too many failures, the job in "error" state + error: + nullable: true + type: string + description: Error message if the job is errored + progress: + type: integer + description: Percentage progress + priority: + type: integer + description: Job priority (less has more priority) + updatedAt: + type: string + format: date-time + createdAt: + type: string + format: date-time + startedAt: + type: string + format: date-time + finishedAt: + type: string + format: date-time + parent: + nullable: true + description: If job has a parent job + type: object + properties: + type: + $ref: '#/components/schemas/RunnerJobType' + state: + $ref: '#/components/schemas/RunnerJobStateConstant' + uuid: + $ref: '#/components/schemas/UUIDv4' + runner: + nullable: true + description: If job is associated to a runner + properties: + id: + type: number + name: + type: string + description: + type: string + + RunnerJobAdmin: + allOf: + - $ref: '#/components/schemas/RunnerJob' + - type: object + properties: + privatePayload: + type: object + callbacks: searchIndex: 'https://search.example.org/api/v1/search/videos':