From 5e1c08eb94746c44b8b14a12c0937aadb34feb57 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 24 Jan 2018 11:54:32 +0100 Subject: [PATCH] Add api doc in html --- package.json | 3 + scripts/generate-api-doc.sh | 3 + server/tests/utils/miscs/miscs.ts | 1 - server/tests/utils/videos/videos.ts | 2 +- support/doc/api/html/index.html | 5953 +++++++++++++++++ support/doc/api/html/javascripts/spectacle.js | 242 + .../doc/api/html/javascripts/spectacle.min.js | 1 + .../doc/api/html/stylesheets/foundation.css | 2278 +++++++ .../api/html/stylesheets/foundation.min.css | 1 + .../doc/api/html/stylesheets/spectacle.css | 1335 ++++ .../api/html/stylesheets/spectacle.min.css | 1 + support/doc/api/openapi.yaml | 18 +- yarn.lock | 1617 ++++- 13 files changed, 11388 insertions(+), 67 deletions(-) create mode 100755 scripts/generate-api-doc.sh create mode 100644 support/doc/api/html/index.html create mode 100644 support/doc/api/html/javascripts/spectacle.js create mode 100644 support/doc/api/html/javascripts/spectacle.min.js create mode 100644 support/doc/api/html/stylesheets/foundation.css create mode 100644 support/doc/api/html/stylesheets/foundation.min.css create mode 100644 support/doc/api/html/stylesheets/spectacle.css create mode 100644 support/doc/api/html/stylesheets/spectacle.min.css diff --git a/package.json b/package.json index 82bf57095..45651a1e5 100644 --- a/package.json +++ b/package.json @@ -37,9 +37,11 @@ "update-host": "ts-node ./scripts/update-host.ts", "test": "scripty", "help": "scripty", + "generate-api-doc": "scripty", "parse-log": "ts-node ./scripts/parse-log.ts", "postinstall": "cd client && yarn install --pure-lockfile", "tsc": "tsc", + "spectacle-docs": "node_modules/spectacle-docs/bin/spectacle.js", "commander": "commander", "ng": "ng", "nodemon": "nodemon", @@ -120,6 +122,7 @@ "mocha": "^5.0.0", "nodemon": "^1.11.0", "source-map-support": "^0.5.0", + "spectacle-docs": "^0.9.13", "standard": "^10.0.0", "supertest": "^3.0.0", "tslint": "^5.7.0", diff --git a/scripts/generate-api-doc.sh b/scripts/generate-api-doc.sh new file mode 100755 index 000000000..81b80a0be --- /dev/null +++ b/scripts/generate-api-doc.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +npm run spectacle-docs -- -t support/doc/api/html support/doc/api/openapi.yaml diff --git a/server/tests/utils/miscs/miscs.ts b/server/tests/utils/miscs/miscs.ts index f93e2372e..99d109bfe 100644 --- a/server/tests/utils/miscs/miscs.ts +++ b/server/tests/utils/miscs/miscs.ts @@ -1,6 +1,5 @@ /* tslint:disable:no-unused-expression */ -import { expect } from 'chai' import { join } from 'path' import * as request from 'supertest' import * as WebTorrent from 'webtorrent' diff --git a/server/tests/utils/videos/videos.ts b/server/tests/utils/videos/videos.ts index 605acf565..860f04fd8 100644 --- a/server/tests/utils/videos/videos.ts +++ b/server/tests/utils/videos/videos.ts @@ -7,7 +7,7 @@ import { extname, isAbsolute, join } from 'path' import * as request from 'supertest' import { getMyUserInformation, makeGetRequest, root, ServerInfo, testImage } from '../' import { VideoPrivacy } from '../../../../shared/models/videos' -import { readdirPromise, readFileBufferPromise } from '../../../helpers/core-utils' +import { readdirPromise } from '../../../helpers/core-utils' import { VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_PRIVACIES } from '../../../initializers' import { dateIsValid, webtorrentAdd } from '../index' diff --git a/support/doc/api/html/index.html b/support/doc/api/html/index.html new file mode 100644 index 000000000..9baa091d1 --- /dev/null +++ b/support/doc/api/html/index.html @@ -0,0 +1,5953 @@ + + + + + + PeerTube | API Reference + + + + + + + +
+ +
+ +
+
+
+

PeerTube + API Reference +

+
+
+

Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular.

+
+
+
+
Version: + 0.0.15-alpha +
+
+
+
+
+

Accounts

+
+ + +
+ Accounts + +
+ + +

+ + GET + /accounts/{id} + +

+
+
+
+
+
+
id
+ +
+
+

The id of the account

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + Account + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
{
+  "displayName": "string",
+  "id": "number",
+  "uuid": "string",
+  "url": "string",
+  "name": "string",
+  "host": "string",
+  "followingCount": "number",
+  "followersCount": "number",
+  "createdAt": "string",
+  "updatedAt": "string",
+  "avatar": {
+    "path": "string",
+    "createdAt": "string",
+    "updatedAt": "string"
+  }
+}
+
+ +
+
+
+
+
+ + +
+ Accounts + +
+ + +

+ + GET + /accounts + +

+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + Account + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  {
+    "displayName": "string",
+    "id": "number",
+    "uuid": "string",
+    "url": "string",
+    "name": "string",
+    "host": "string",
+    "followingCount": "number",
+    "followersCount": "number",
+    "createdAt": "string",
+    "updatedAt": "string",
+    "avatar": {
+      "path": "string",
+      "createdAt": "string",
+      "updatedAt": "string"
+    }
+  }
+]
+
+ +
+
+
+
+

Config

+
+ + +
+ Config + +
+ + +

+ + GET + /config + +

+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + ServerConfig + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
{
+  "signup": {
+    "allowed": "boolean"
+  },
+  "transcoding": {
+    "enabledResolutions": [
+      "number"
+    ]
+  },
+  "avatar": {
+    "file": {
+      "size": {
+        "max": "number"
+      }
+    },
+    "extensions": [
+      "string"
+    ]
+  },
+  "video": {
+    "file": {
+      "extensions": [
+        "string"
+      ]
+    }
+  }
+}
+
+ +
+
+
+
+

Job

+
+ + +
+ Job + +
+ + +

+ + GET + /jobs + +

+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + Job + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  {
+    "id": "number",
+    "state": "string",
+    "category": "string",
+    "handlerName": "string",
+    "handlerInputData": "string",
+    "createdAt": "string",
+    "updatedAt": "string"
+  }
+]
+
+ +
+
+
+
+

ServerFollowing

+
+ + + + + +

+ + DELETE + /server/following/{host} + +

+
+
+
+
+
+
host
+ +
+
+

The host to unfollow

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
201 Created
+
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+ + + + + +

+ + GET + /server/followers + +

+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + Follow + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  {
+    "id": "number",
+    "follower": {
+      "id": "number",
+      "uuid": "string",
+      "url": "string",
+      "name": "string",
+      "host": "string",
+      "followingCount": "number",
+      "followersCount": "number",
+      "createdAt": "string",
+      "updatedAt": "string",
+      "avatar": {
+        "path": "string",
+        "createdAt": "string",
+        "updatedAt": "string"
+      }
+    },
+    "following": {
+      "id": "number",
+      "uuid": "string",
+      "url": "string",
+      "name": "string",
+      "host": "string",
+      "followingCount": "number",
+      "followersCount": "number",
+      "createdAt": "string",
+      "updatedAt": "string",
+      "avatar": {
+        "path": "string",
+        "createdAt": "string",
+        "updatedAt": "string"
+      }
+    },
+    "score": "number",
+    "state": "string",
+    "createdAt": "string",
+    "updatedAt": "string"
+  }
+]
+
+ +
+
+
+
+
+ + + + + +

+ + GET + /server/following + +

+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + Follow + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  {
+    "id": "number",
+    "follower": {
+      "id": "number",
+      "uuid": "string",
+      "url": "string",
+      "name": "string",
+      "host": "string",
+      "followingCount": "number",
+      "followersCount": "number",
+      "createdAt": "string",
+      "updatedAt": "string",
+      "avatar": {
+        "path": "string",
+        "createdAt": "string",
+        "updatedAt": "string"
+      }
+    },
+    "following": {
+      "id": "number",
+      "uuid": "string",
+      "url": "string",
+      "name": "string",
+      "host": "string",
+      "followingCount": "number",
+      "followersCount": "number",
+      "createdAt": "string",
+      "updatedAt": "string",
+      "avatar": {
+        "path": "string",
+        "createdAt": "string",
+        "updatedAt": "string"
+      }
+    },
+    "score": "number",
+    "state": "string",
+    "createdAt": "string",
+    "updatedAt": "string"
+  }
+]
+
+ +
+
+
+
+
+ + + + + +

+ + POST + /server/following + +

+
+
+
+
+
+
+ + Follow + +
+
+
+ undefined + +
+
+
+
+
+
+
Request Content-Types: + application/json +
+
Request Example
+
{
+  "id": "number",
+  "follower": {
+    "id": "number",
+    "uuid": "string",
+    "url": "string",
+    "name": "string",
+    "host": "string",
+    "followingCount": "number",
+    "followersCount": "number",
+    "createdAt": "string",
+    "updatedAt": "string",
+    "avatar": {
+      "path": "string",
+      "createdAt": "string",
+      "updatedAt": "string"
+    }
+  },
+  "following": {
+    "id": "number",
+    "uuid": "string",
+    "url": "string",
+    "name": "string",
+    "host": "string",
+    "followingCount": "number",
+    "followersCount": "number",
+    "createdAt": "string",
+    "updatedAt": "string",
+    "avatar": {
+      "path": "string",
+      "createdAt": "string",
+      "updatedAt": "string"
+    }
+  },
+  "score": "number",
+  "state": "string",
+  "createdAt": "string",
+  "updatedAt": "string"
+}
+
+ +
+
+
+
+
+
+
+
+
204 No Content
+
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+

User

+
+ + +
+ User + +
+ + +

+ + POST + /users + +

+
+
+
+
+
+
+ + AddUser + +
+
+
+ undefined + +
+
+
+
+
+
+
Request Content-Types: + application/json +
+
Request Example
+
{
+  "username": "string",
+  "password": "string",
+  "email": "string",
+  "videoQuota": "string",
+  "role": "string"
+}
+
+ +
+
+
+
+
+
+
+
+
200 OK
+
+ + AddUserResponse + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
{
+  "id": "number",
+  "uuid": "string"
+}
+
+ +
+
+
+
+
+ + +
+ User + +
+ + +

+ + GET + /users + +

+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + User + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  {
+    "id": "number",
+    "username": "string",
+    "email": "string",
+    "displayNSFW": "boolean",
+    "autoPlayVideo": "boolean",
+    "role": "string",
+    "videoQuota": "number",
+    "createdAt": "string",
+    "account": {
+      "displayName": "string",
+      "id": "number",
+      "uuid": "string",
+      "url": "string",
+      "name": "string",
+      "host": "string",
+      "followingCount": "number",
+      "followersCount": "number",
+      "createdAt": "string",
+      "updatedAt": "string",
+      "avatar": {
+        "path": "string",
+        "createdAt": "string",
+        "updatedAt": "string"
+      }
+    },
+    "videoChannels": [
+      {
+        "displayName": "string",
+        "description": "string",
+        "isLocal": "boolean",
+        "owner": {
+          "name": "string",
+          "uuid": "string"
+        },
+        "videos": [
+          {
+            "id": "number",
+            "uuid": "string",
+            "accountName": "string",
+            "createdAt": "string",
+            "updatedAt": "string",
+            "categoryLabel": "string",
+            "category": "number",
+            "licenceLabel": "string",
+            "licence": "number",
+            "languageLabel": "string",
+            "language": "number",
+            "description": "string",
+            "duration": "number",
+            "isLocal": "boolean",
+            "name": "string",
+            "serverHost": "string",
+            "thumbnailPath": "string",
+            "previewPath": "string",
+            "embedPath": "string",
+            "views": "number",
+            "likes": "number",
+            "dislikes": "number",
+            "nsfw": "boolean"
+          }
+        ]
+      }
+    ]
+  }
+]
+
+ +
+
+
+
+
+ + +
+ User + +
+ + +

+ + DELETE + /users/{id} + +

+
+
+
+
+
+
id
+ +
+
+

The user id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
204 No Content
+
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+ + +
+ User + +
+ + +

+ + GET + /users/{id} + +

+
+
+
+
+
+
id
+ +
+
+

The user id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + User + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
{
+  "id": "number",
+  "username": "string",
+  "email": "string",
+  "displayNSFW": "boolean",
+  "autoPlayVideo": "boolean",
+  "role": "string",
+  "videoQuota": "number",
+  "createdAt": "string",
+  "account": {
+    "displayName": "string",
+    "id": "number",
+    "uuid": "string",
+    "url": "string",
+    "name": "string",
+    "host": "string",
+    "followingCount": "number",
+    "followersCount": "number",
+    "createdAt": "string",
+    "updatedAt": "string",
+    "avatar": {
+      "path": "string",
+      "createdAt": "string",
+      "updatedAt": "string"
+    }
+  },
+  "videoChannels": [
+    {
+      "displayName": "string",
+      "description": "string",
+      "isLocal": "boolean",
+      "owner": {
+        "name": "string",
+        "uuid": "string"
+      },
+      "videos": [
+        {
+          "id": "number",
+          "uuid": "string",
+          "accountName": "string",
+          "createdAt": "string",
+          "updatedAt": "string",
+          "categoryLabel": "string",
+          "category": "number",
+          "licenceLabel": "string",
+          "licence": "number",
+          "languageLabel": "string",
+          "language": "number",
+          "description": "string",
+          "duration": "number",
+          "isLocal": "boolean",
+          "name": "string",
+          "serverHost": "string",
+          "thumbnailPath": "string",
+          "previewPath": "string",
+          "embedPath": "string",
+          "views": "number",
+          "likes": "number",
+          "dislikes": "number",
+          "nsfw": "boolean"
+        }
+      ]
+    }
+  ]
+}
+
+ +
+
+
+
+
+ + +
+ User + +
+ + +

+ + PUT + /users/{id} + +

+
+
+
+
+
+
+ + UpdateUser + +
+
+
+ undefined + +
+
+
+
+
+
+
id
+ +
+
+

The user id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
Request Content-Types: + application/json +
+
Request Example
+
{
+  "id": "string",
+  "email": "string",
+  "videoQuota": "string",
+  "role": "string"
+}
+
+ +
+
+
+
+
+
+
+
+
204 No Content
+
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+ + +
+ User + +
+ + +

+ + GET + /users/me + +

+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + User + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  {
+    "id": "number",
+    "username": "string",
+    "email": "string",
+    "displayNSFW": "boolean",
+    "autoPlayVideo": "boolean",
+    "role": "string",
+    "videoQuota": "number",
+    "createdAt": "string",
+    "account": {
+      "displayName": "string",
+      "id": "number",
+      "uuid": "string",
+      "url": "string",
+      "name": "string",
+      "host": "string",
+      "followingCount": "number",
+      "followersCount": "number",
+      "createdAt": "string",
+      "updatedAt": "string",
+      "avatar": {
+        "path": "string",
+        "createdAt": "string",
+        "updatedAt": "string"
+      }
+    },
+    "videoChannels": [
+      {
+        "displayName": "string",
+        "description": "string",
+        "isLocal": "boolean",
+        "owner": {
+          "name": "string",
+          "uuid": "string"
+        },
+        "videos": [
+          {
+            "id": "number",
+            "uuid": "string",
+            "accountName": "string",
+            "createdAt": "string",
+            "updatedAt": "string",
+            "categoryLabel": "string",
+            "category": "number",
+            "licenceLabel": "string",
+            "licence": "number",
+            "languageLabel": "string",
+            "language": "number",
+            "description": "string",
+            "duration": "number",
+            "isLocal": "boolean",
+            "name": "string",
+            "serverHost": "string",
+            "thumbnailPath": "string",
+            "previewPath": "string",
+            "embedPath": "string",
+            "views": "number",
+            "likes": "number",
+            "dislikes": "number",
+            "nsfw": "boolean"
+          }
+        ]
+      }
+    ]
+  }
+]
+
+ +
+
+
+
+
+ + +
+ User + +
+ + +

+ + PUT + /users/me + +

+
+
+
+
+
+
+ + UpdateMe + +
+
+
+ undefined + +
+
+
+
+
+
+
Request Content-Types: + application/json +
+
Request Example
+
{
+  "password": "string",
+  "email": "string",
+  "displayNSFW": "string",
+  "autoPlayVideo": "string"
+}
+
+ +
+
+
+
+
+
+
+
+
204 No Content
+
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+ + +
+ User + +
+ + +

+ + GET + /users/me/video-quota-used + +

+
+
+
+
+
+
+
+
+
+
200 OK
+
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
"number"
+
+ +
+
+
+
+
+ + +
+ User + +
+ + +

+ + GET + /users/me/videos/{videoId}/rating + +

+
+
+
+
+
+
videoId
+ +
+
+

The video id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
200 OK
+ + +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
{
+  "id": "string",
+  "rating": "number"
+}
+
+ +
+
+
+
+
+ + +
+ User + +
+ + +

+ + GET + /users/me/videos + +

+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + Video + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  {
+    "id": "number",
+    "uuid": "string",
+    "accountName": "string",
+    "createdAt": "string",
+    "updatedAt": "string",
+    "categoryLabel": "string",
+    "category": "number",
+    "licenceLabel": "string",
+    "licence": "number",
+    "languageLabel": "string",
+    "language": "number",
+    "description": "string",
+    "duration": "number",
+    "isLocal": "boolean",
+    "name": "string",
+    "serverHost": "string",
+    "thumbnailPath": "string",
+    "previewPath": "string",
+    "embedPath": "string",
+    "views": "number",
+    "likes": "number",
+    "dislikes": "number",
+    "nsfw": "boolean"
+  }
+]
+
+ +
+
+
+
+
+ + +
+ User + +
+ + +

+ + POST + /users/register + +

+
+
+
+
+
+
+ + RegisterUser + +
+
+
+ undefined + +
+
+
+
+
+
+
Request Content-Types: + application/json +
+
Request Example
+
{
+  "username": "string",
+  "password": "string",
+  "email": "string"
+}
+
+ +
+
+
+
+
+
+
+
+
204 No Content
+
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+ + +
+ User + +
+ + +

+ + POST + /users/me/avatar/pick + +

+
+
+
+
+
+
avatarfile
+
+
+

The file to upload.

+
+
+
+
type
+
+ file + +
+
+
+
in
+
formData
+
+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + Avatar + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
{
+  "path": "string",
+  "createdAt": "string",
+  "updatedAt": "string"
+}
+
+ +
+
+
+
+

Video

+
+ + +
+ Video + +
+ + +

+ + GET + /video + +

+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + Video + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  {
+    "id": "number",
+    "uuid": "string",
+    "accountName": "string",
+    "createdAt": "string",
+    "updatedAt": "string",
+    "categoryLabel": "string",
+    "category": "number",
+    "licenceLabel": "string",
+    "licence": "number",
+    "languageLabel": "string",
+    "language": "number",
+    "description": "string",
+    "duration": "number",
+    "isLocal": "boolean",
+    "name": "string",
+    "serverHost": "string",
+    "thumbnailPath": "string",
+    "previewPath": "string",
+    "embedPath": "string",
+    "views": "number",
+    "likes": "number",
+    "dislikes": "number",
+    "nsfw": "boolean"
+  }
+]
+
+ +
+
+
+
+
+ + +
+ Video + +
+ + +

+ + GET + /video/categories + +

+
+
+
+
+
+
+
+
+
+
200 OK
+
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  "string"
+]
+
+ +
+
+
+
+
+ + +
+ Video + +
+ + +

+ + GET + /video/licences + +

+
+
+
+
+
+
+
+
+
+
200 OK
+
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  "string"
+]
+
+ +
+
+
+
+
+ + +
+ Video + +
+ + +

+ + GET + /video/languages + +

+
+
+
+
+
+
+
+
+
+
200 OK
+
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  "string"
+]
+
+ +
+
+
+
+
+ + +
+ Video + +
+ + +

+ + GET + /video/privacies + +

+
+
+
+
+
+
+
+
+
+
200 OK
+
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  "string"
+]
+
+ +
+
+
+
+
+ + +
+ Video + +
+ + +

+ + GET + /video/search + +

+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + Video + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  {
+    "id": "number",
+    "uuid": "string",
+    "accountName": "string",
+    "createdAt": "string",
+    "updatedAt": "string",
+    "categoryLabel": "string",
+    "category": "number",
+    "licenceLabel": "string",
+    "licence": "number",
+    "languageLabel": "string",
+    "language": "number",
+    "description": "string",
+    "duration": "number",
+    "isLocal": "boolean",
+    "name": "string",
+    "serverHost": "string",
+    "thumbnailPath": "string",
+    "previewPath": "string",
+    "embedPath": "string",
+    "views": "number",
+    "likes": "number",
+    "dislikes": "number",
+    "nsfw": "boolean"
+  }
+]
+
+ +
+
+
+
+
+ + +
+ Video + +
+ + +

+ + PUT + /video/{id} + +

+
+
+
+
+
+
id
+ +
+
+

The video id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + Video + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
{
+  "id": "number",
+  "uuid": "string",
+  "accountName": "string",
+  "createdAt": "string",
+  "updatedAt": "string",
+  "categoryLabel": "string",
+  "category": "number",
+  "licenceLabel": "string",
+  "licence": "number",
+  "languageLabel": "string",
+  "language": "number",
+  "description": "string",
+  "duration": "number",
+  "isLocal": "boolean",
+  "name": "string",
+  "serverHost": "string",
+  "thumbnailPath": "string",
+  "previewPath": "string",
+  "embedPath": "string",
+  "views": "number",
+  "likes": "number",
+  "dislikes": "number",
+  "nsfw": "boolean"
+}
+
+ +
+
+
+
+
+ + +
+ Video + +
+ + +

+ + GET + /video/{id} + +

+
+
+
+
+
+
id
+ +
+
+

The video id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + Video + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
{
+  "id": "number",
+  "uuid": "string",
+  "accountName": "string",
+  "createdAt": "string",
+  "updatedAt": "string",
+  "categoryLabel": "string",
+  "category": "number",
+  "licenceLabel": "string",
+  "licence": "number",
+  "languageLabel": "string",
+  "language": "number",
+  "description": "string",
+  "duration": "number",
+  "isLocal": "boolean",
+  "name": "string",
+  "serverHost": "string",
+  "thumbnailPath": "string",
+  "previewPath": "string",
+  "embedPath": "string",
+  "views": "number",
+  "likes": "number",
+  "dislikes": "number",
+  "nsfw": "boolean"
+}
+
+ +
+
+
+
+
+ + +
+ Video + +
+ + +

+ + DELETE + /video/{id} + +

+
+
+
+
+
+
id
+ +
+
+

The video id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
204 No Content
+
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+ + +
+ Video + +
+ + +

+ + GET + /video/{id}/description + +

+
+
+
+
+
+
id
+ +
+
+

The video id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
200 OK
+
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
"string"
+
+ +
+
+
+
+
+ + +
+ Video + +
+ + +

+ + POST + /video/{id}/views + +

+
+
+
+
+
+
id
+ +
+
+

The video id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
204 No Content
+
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+ + +
+ Video + +
+ + +

+ + POST + /video/upload + +

+
+
+
+
+
+
videofile
+
+
+

The file to upload.

+
+
+
+
type
+
+ file + +
+
+
+
in
+
formData
+
+
+
+
+
+
+
+
+
+
+
200 OK
+ + +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
{
+  "id": "number",
+  "uuid": "string"
+}
+
+ +
+
+
+
+

VideoAbuse

+
+ + +
+ VideoAbuse + +
+ + +

+ + GET + /video/abuse + +

+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + VideoAbuse + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  {
+    "id": "number",
+    "reason": "string",
+    "reporterUsername": "string",
+    "reporterServerHost": "string",
+    "videoId": "number",
+    "videoUUID": "string",
+    "videoName": "string",
+    "createdAt": "string"
+  }
+]
+
+ +
+
+
+
+
+ + +
+ VideoAbuse + +
+ + +

+ + POST + /video/{id}/abuse + +

+
+
+
+
+
+
id
+ +
+
+

The video id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
204 No Content
+
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+

VideoBlacklist

+
+ + + + + +

+ + POST + /video/{videoId}/blacklist + +

+
+
+
+
+
+
videoId
+ +
+
+

The video id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
204 No Content
+
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+ + + + + +

+ + DELETE + /video/{videoId}/blacklist + +

+
+
+
+
+
+
videoId
+ +
+
+

The video id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
204 No Content
+
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+ + + + + +

+ + GET + /video/blacklist + +

+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + VideoBlacklist + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  {
+    "id": "number",
+    "videoId": "number",
+    "createdAt": "string",
+    "updatedAt": "string",
+    "name": "string",
+    "uuid": "string",
+    "description": "string",
+    "duration": "number",
+    "views": "number",
+    "likes": "number",
+    "dislikes": "number",
+    "nsfw": "boolean"
+  }
+]
+
+ +
+
+
+
+

VideoChannel

+
+ + +
+ VideoChannel + +
+ + +

+ + GET + /video/channels + +

+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + VideoChannel + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  {
+    "displayName": "string",
+    "description": "string",
+    "isLocal": "boolean",
+    "owner": {
+      "name": "string",
+      "uuid": "string"
+    },
+    "videos": [
+      {
+        "id": "number",
+        "uuid": "string",
+        "accountName": "string",
+        "createdAt": "string",
+        "updatedAt": "string",
+        "categoryLabel": "string",
+        "category": "number",
+        "licenceLabel": "string",
+        "licence": "number",
+        "languageLabel": "string",
+        "language": "number",
+        "description": "string",
+        "duration": "number",
+        "isLocal": "boolean",
+        "name": "string",
+        "serverHost": "string",
+        "thumbnailPath": "string",
+        "previewPath": "string",
+        "embedPath": "string",
+        "views": "number",
+        "likes": "number",
+        "dislikes": "number",
+        "nsfw": "boolean"
+      }
+    ]
+  }
+]
+
+ +
+
+
+
+
+ + +
+ VideoChannel + +
+ + +

+ + POST + /video/channels + +

+
+
+
+
+
+ +
+
+ undefined + +
+
+
+
+
+
+
Request Content-Types: + application/json +
+
Request Example
+
{
+  "name": "string",
+  "description": "string"
+}
+
+ +
+
+
+
+
+
+
+
+
204 No Content
+
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+ + +
+ VideoChannel + +
+ + +

+ + GET + /video/channels/{id} + +

+
+
+
+
+
+
id
+ +
+
+

The video id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + VideoChannel + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
{
+  "displayName": "string",
+  "description": "string",
+  "isLocal": "boolean",
+  "owner": {
+    "name": "string",
+    "uuid": "string"
+  },
+  "videos": [
+    {
+      "id": "number",
+      "uuid": "string",
+      "accountName": "string",
+      "createdAt": "string",
+      "updatedAt": "string",
+      "categoryLabel": "string",
+      "category": "number",
+      "licenceLabel": "string",
+      "licence": "number",
+      "languageLabel": "string",
+      "language": "number",
+      "description": "string",
+      "duration": "number",
+      "isLocal": "boolean",
+      "name": "string",
+      "serverHost": "string",
+      "thumbnailPath": "string",
+      "previewPath": "string",
+      "embedPath": "string",
+      "views": "number",
+      "likes": "number",
+      "dislikes": "number",
+      "nsfw": "boolean"
+    }
+  ]
+}
+
+ +
+
+
+
+
+ + +
+ VideoChannel + +
+ + +

+ + PUT + /video/channels/{id} + +

+
+
+
+
+
+ +
+
+ undefined + +
+
+
+
+
+
+
id
+ +
+
+

The video id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
Request Content-Types: + application/json +
+
Request Example
+
{
+  "name": "string",
+  "description": "string"
+}
+
+ +
+
+
+
+
+
+
+
+
204 No Content
+
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+ + +
+ VideoChannel + +
+ + +

+ + DELETE + /video/channels/{id} + +

+
+
+
+
+
+
id
+ +
+
+

The video id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
204 No Content
+
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+ + +
+ VideoChannel + +
+ + +

+ + GET + /video/accounts/{accountId}/channels + +

+
+
+
+
+
+
accountId
+ +
+
+

The account id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + VideoChannel + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
[
+  {
+    "displayName": "string",
+    "description": "string",
+    "isLocal": "boolean",
+    "owner": {
+      "name": "string",
+      "uuid": "string"
+    },
+    "videos": [
+      {
+        "id": "number",
+        "uuid": "string",
+        "accountName": "string",
+        "createdAt": "string",
+        "updatedAt": "string",
+        "categoryLabel": "string",
+        "category": "number",
+        "licenceLabel": "string",
+        "licence": "number",
+        "languageLabel": "string",
+        "language": "number",
+        "description": "string",
+        "duration": "number",
+        "isLocal": "boolean",
+        "name": "string",
+        "serverHost": "string",
+        "thumbnailPath": "string",
+        "previewPath": "string",
+        "embedPath": "string",
+        "views": "number",
+        "likes": "number",
+        "dislikes": "number",
+        "nsfw": "boolean"
+      }
+    ]
+  }
+]
+
+ +
+
+
+
+

VideoComment

+
+ + +
+ VideoComment + +
+ + +

+ + GET + /video/{videoId}/comment-threads + +

+
+
+
+
+
+
videoId
+ +
+
+

The video id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
200 OK
+
+ + VideoComment + +
+ +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+ + +
+
+
+
+
+ + +
+ VideoComment + +
+ + +

+ + POST + /video/{videoId}/comment-threads + +

+
+
+
+
+
+
videoId
+ +
+
+

The video id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
200 OK
+
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+ + +
+ VideoComment + +
+ + +

+ + GET + /video/{videoId}/comment-threads/{threadId} + +

+
+
+
+
+
+
videoId
+ +
+
+

The video id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
threadId
+ +
+
+

The thread id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
200 OK
+ + +
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
Response Example + (200 OK) +
+
{
+  "comment": {
+    "id": "number",
+    "url": "string",
+    "text": "string",
+    "threadId": "number",
+    "inReplyToCommentId": "number",
+    "videoId": "number",
+    "createdAt": "string",
+    "updatedAt": "string",
+    "totalReplies": "number",
+    "account": {
+      "displayName": "string",
+      "id": "number",
+      "uuid": "string",
+      "url": "string",
+      "name": "string",
+      "host": "string",
+      "followingCount": "number",
+      "followersCount": "number",
+      "createdAt": "string",
+      "updatedAt": "string",
+      "avatar": {
+        "path": "string",
+        "createdAt": "string",
+        "updatedAt": "string"
+      }
+    }
+  },
+  "children": [
+    {
+      "comment": {
+        "id": "number",
+        "url": "string",
+        "text": "string",
+        "threadId": "number",
+        "inReplyToCommentId": "number",
+        "videoId": "number",
+        "createdAt": "string",
+        "updatedAt": "string",
+        "totalReplies": "number",
+        "account": {
+          "displayName": "string",
+          "id": "number",
+          "uuid": "string",
+          "url": "string",
+          "name": "string",
+          "host": "string",
+          "followingCount": "number",
+          "followersCount": "number",
+          "createdAt": "string",
+          "updatedAt": "string",
+          "avatar": {
+            "path": "string",
+            "createdAt": "string",
+            "updatedAt": "string"
+          }
+        }
+      },
+      "children": [
+        {
+          "comment": {
+            "id": "number",
+            "url": "string",
+            "text": "string",
+            "threadId": "number",
+            "inReplyToCommentId": "number",
+            "videoId": "number",
+            "createdAt": "string",
+            "updatedAt": "string",
+            "totalReplies": "number",
+            "account": {
+              "id": "number",
+              "uuid": "string",
+              "url": "string",
+              "name": "string",
+              "host": "string",
+              "followingCount": "number",
+              "followersCount": "number",
+              "createdAt": "string",
+              "updatedAt": "string",
+              "avatar": {
+                "path": "string",
+                "createdAt": "string",
+                "updatedAt": "string"
+              }
+            }
+          }
+        }
+      ]
+    }
+  ]
+}
+
+ +
+
+
+
+
+ + +
+ VideoComment + +
+ + +

+ + POST + /video/{videoId}/comments/{commentId} + +

+
+
+
+
+
+
videoId
+ +
+
+

The video id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
commentId
+ +
+
+

The comment id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
200 OK
+
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+
+ + +
+ VideoComment + +
+ + +

+ + DELETE + /video/{videoId}/comments/{commentId} + +

+
+
+
+
+
+
videoId
+ +
+
+

The video id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
commentId
+ +
+
+

The comment id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
204 No Content
+
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+

VideoRate

+
+ + +
+ VideoRate + +
+ + +

+ + PUT + /video/{id}/rate + +

+
+
+
+
+
+
id
+ +
+
+

The video id

+
+
+
+
type
+
+ string + +
+
+
+
in
+
path
+
+
+
+
+
+
+
+
+
+
+
204 No Content
+
+
+

successful operation

+
+
+
+
+
+
Response Content-Types: + application/json +
+
+
+
+

Schema Definitions

+
+

+ Video: + +

+
+
+
+
+
+ id: + number + +
+
+ uuid: + string + +
+
+ accountName: + string + +
+
+ createdAt: + string + +
+
+ updatedAt: + string + +
+
+ categoryLabel: + string + +
+
+ category: + number + +
+
+ licenceLabel: + string + +
+
+ licence: + number + +
+
+ languageLabel: + string + +
+
+ language: + number + +
+
+ description: + string + +
+
+ duration: + number + +
+
+ isLocal: + boolean + +
+
+ name: + string + +
+
+ serverHost: + string + +
+
+ thumbnailPath: + string + +
+
+ previewPath: + string + +
+
+ embedPath: + string + +
+
+ views: + number + +
+
+ likes: + number + +
+
+ dislikes: + number + +
+
+ nsfw: + boolean + +
+
+
+
+
+
+
Example
+
{
+  "id": "number",
+  "uuid": "string",
+  "accountName": "string",
+  "createdAt": "string",
+  "updatedAt": "string",
+  "categoryLabel": "string",
+  "category": "number",
+  "licenceLabel": "string",
+  "licence": "number",
+  "languageLabel": "string",
+  "language": "number",
+  "description": "string",
+  "duration": "number",
+  "isLocal": "boolean",
+  "name": "string",
+  "serverHost": "string",
+  "thumbnailPath": "string",
+  "previewPath": "string",
+  "embedPath": "string",
+  "views": "number",
+  "likes": "number",
+  "dislikes": "number",
+  "nsfw": "boolean"
+}
+
+ +
+
+
+
+
+

+ VideoAbuse: + +

+
+
+
+
+
+ id: + number + +
+
+ reason: + string + +
+
+ reporterUsername: + string + +
+
+ reporterServerHost: + string + +
+
+ videoId: + number + +
+
+ videoUUID: + string + +
+
+ videoName: + string + +
+
+ createdAt: + string + +
+
+
+
+
+
+
Example
+
{
+  "id": "number",
+  "reason": "string",
+  "reporterUsername": "string",
+  "reporterServerHost": "string",
+  "videoId": "number",
+  "videoUUID": "string",
+  "videoName": "string",
+  "createdAt": "string"
+}
+
+ +
+
+
+
+
+

+ VideoBlacklist: + +

+
+
+
+
+
+ id: + number + +
+
+ videoId: + number + +
+
+ createdAt: + string + +
+
+ updatedAt: + string + +
+
+ name: + string + +
+
+ uuid: + string + +
+
+ description: + string + +
+
+ duration: + number + +
+
+ views: + number + +
+
+ likes: + number + +
+
+ dislikes: + number + +
+
+ nsfw: + boolean + +
+
+
+
+
+
+
Example
+
{
+  "id": "number",
+  "videoId": "number",
+  "createdAt": "string",
+  "updatedAt": "string",
+  "name": "string",
+  "uuid": "string",
+  "description": "string",
+  "duration": "number",
+  "views": "number",
+  "likes": "number",
+  "dislikes": "number",
+  "nsfw": "boolean"
+}
+
+ +
+
+
+
+
+

+ VideoChannel: + +

+
+
+
+
+
+ displayName: + string + +
+
+ description: + string + +
+
+ isLocal: + boolean + +
+
+ owner: + object + +
+
+ videos: + + + Video + + + +
+
+
+
+
+
+
Example
+
{
+  "displayName": "string",
+  "description": "string",
+  "isLocal": "boolean",
+  "owner": {
+    "name": "string",
+    "uuid": "string"
+  },
+  "videos": [
+    {
+      "id": "number",
+      "uuid": "string",
+      "accountName": "string",
+      "createdAt": "string",
+      "updatedAt": "string",
+      "categoryLabel": "string",
+      "category": "number",
+      "licenceLabel": "string",
+      "licence": "number",
+      "languageLabel": "string",
+      "language": "number",
+      "description": "string",
+      "duration": "number",
+      "isLocal": "boolean",
+      "name": "string",
+      "serverHost": "string",
+      "thumbnailPath": "string",
+      "previewPath": "string",
+      "embedPath": "string",
+      "views": "number",
+      "likes": "number",
+      "dislikes": "number",
+      "nsfw": "boolean"
+    }
+  ]
+}
+
+ +
+
+
+
+
+

+ VideoComment: + +

+
+
+
+
+
+ id: + number + +
+
+ url: + string + +
+
+ text: + string + +
+
+ threadId: + number + +
+
+ inReplyToCommentId: + number + +
+
+ videoId: + number + +
+
+ createdAt: + string + +
+
+ updatedAt: + string + +
+
+ totalReplies: + number + +
+
+ account: + + + Account + + + +
+
+
+
+
+
+
Example
+
{
+  "id": "number",
+  "url": "string",
+  "text": "string",
+  "threadId": "number",
+  "inReplyToCommentId": "number",
+  "videoId": "number",
+  "createdAt": "string",
+  "updatedAt": "string",
+  "totalReplies": "number",
+  "account": {
+    "displayName": "string",
+    "id": "number",
+    "uuid": "string",
+    "url": "string",
+    "name": "string",
+    "host": "string",
+    "followingCount": "number",
+    "followersCount": "number",
+    "createdAt": "string",
+    "updatedAt": "string",
+    "avatar": {
+      "path": "string",
+      "createdAt": "string",
+      "updatedAt": "string"
+    }
+  }
+}
+
+ +
+
+
+
+
+

+ VideoCommentThreadTree: + +

+
+
+
+
+
+ comment: + + + VideoComment + + + +
+
+ children: + + + VideoCommentThreadTree + + + +
+
+
+
+
+
+
Example
+
{
+  "comment": {
+    "id": "number",
+    "url": "string",
+    "text": "string",
+    "threadId": "number",
+    "inReplyToCommentId": "number",
+    "videoId": "number",
+    "createdAt": "string",
+    "updatedAt": "string",
+    "totalReplies": "number",
+    "account": {
+      "displayName": "string",
+      "id": "number",
+      "uuid": "string",
+      "url": "string",
+      "name": "string",
+      "host": "string",
+      "followingCount": "number",
+      "followersCount": "number",
+      "createdAt": "string",
+      "updatedAt": "string",
+      "avatar": {
+        "path": "string",
+        "createdAt": "string",
+        "updatedAt": "string"
+      }
+    }
+  },
+  "children": [
+    {
+      "comment": {
+        "id": "number",
+        "url": "string",
+        "text": "string",
+        "threadId": "number",
+        "inReplyToCommentId": "number",
+        "videoId": "number",
+        "createdAt": "string",
+        "updatedAt": "string",
+        "totalReplies": "number",
+        "account": {
+          "displayName": "string",
+          "id": "number",
+          "uuid": "string",
+          "url": "string",
+          "name": "string",
+          "host": "string",
+          "followingCount": "number",
+          "followersCount": "number",
+          "createdAt": "string",
+          "updatedAt": "string",
+          "avatar": {
+            "path": "string",
+            "createdAt": "string",
+            "updatedAt": "string"
+          }
+        }
+      },
+      "children": [
+        {
+          "comment": {
+            "id": "number",
+            "url": "string",
+            "text": "string",
+            "threadId": "number",
+            "inReplyToCommentId": "number",
+            "videoId": "number",
+            "createdAt": "string",
+            "updatedAt": "string",
+            "totalReplies": "number",
+            "account": {
+              "displayName": "string",
+              "id": "number",
+              "uuid": "string",
+              "url": "string",
+              "name": "string",
+              "host": "string",
+              "followingCount": "number",
+              "followersCount": "number",
+              "createdAt": "string",
+              "updatedAt": "string",
+              "avatar": {
+                "path": "string",
+                "createdAt": "string",
+                "updatedAt": "string"
+              }
+            }
+          }
+        }
+      ]
+    }
+  ]
+}
+
+ +
+
+
+
+
+

+ Avatar: + +

+
+
+
+
+
+ path: + string + +
+
+ createdAt: + string + +
+
+ updatedAt: + string + +
+
+
+
+
+
+
Example
+
{
+  "path": "string",
+  "createdAt": "string",
+  "updatedAt": "string"
+}
+
+ +
+
+
+
+
+

+ Actor: + +

+
+
+
+
+
+ id: + number + +
+
+ uuid: + string + +
+
+ url: + string + +
+
+ name: + string + +
+
+ host: + string + +
+
+ followingCount: + number + +
+
+ followersCount: + number + +
+
+ createdAt: + string + +
+
+ updatedAt: + string + +
+
+ avatar: + + + Avatar + + + +
+
+
+
+
+
+
Example
+
{
+  "id": "number",
+  "uuid": "string",
+  "url": "string",
+  "name": "string",
+  "host": "string",
+  "followingCount": "number",
+  "followersCount": "number",
+  "createdAt": "string",
+  "updatedAt": "string",
+  "avatar": {
+    "path": "string",
+    "createdAt": "string",
+    "updatedAt": "string"
+  }
+}
+
+ +
+
+
+
+
+

+ Account: + +

+
+
+
+
+ +
+
+
+
+
+ displayName: + string + +
+
+
+
+
+
+
+
+
Example
+
{
+  "displayName": "string",
+  "id": "number",
+  "uuid": "string",
+  "url": "string",
+  "name": "string",
+  "host": "string",
+  "followingCount": "number",
+  "followersCount": "number",
+  "createdAt": "string",
+  "updatedAt": "string",
+  "avatar": {
+    "path": "string",
+    "createdAt": "string",
+    "updatedAt": "string"
+  }
+}
+
+ +
+
+
+
+
+

+ User: + +

+
+
+
+
+
+ id: + number + +
+
+ username: + string + +
+
+ email: + string + +
+
+ displayNSFW: + boolean + +
+
+ autoPlayVideo: + boolean + +
+
+ role: + string + + User, + Moderator, + Administrator + + +
+
+ videoQuota: + number + +
+
+ createdAt: + string + +
+
+ account: + + + Account + + + +
+
+ videoChannels: + + + VideoChannel + + + +
+
+
+
+
+
+
Example
+
{
+  "id": "number",
+  "username": "string",
+  "email": "string",
+  "displayNSFW": "boolean",
+  "autoPlayVideo": "boolean",
+  "role": "string",
+  "videoQuota": "number",
+  "createdAt": "string",
+  "account": {
+    "displayName": "string",
+    "id": "number",
+    "uuid": "string",
+    "url": "string",
+    "name": "string",
+    "host": "string",
+    "followingCount": "number",
+    "followersCount": "number",
+    "createdAt": "string",
+    "updatedAt": "string",
+    "avatar": {
+      "path": "string",
+      "createdAt": "string",
+      "updatedAt": "string"
+    }
+  },
+  "videoChannels": [
+    {
+      "displayName": "string",
+      "description": "string",
+      "isLocal": "boolean",
+      "owner": {
+        "name": "string",
+        "uuid": "string"
+      },
+      "videos": [
+        {
+          "id": "number",
+          "uuid": "string",
+          "accountName": "string",
+          "createdAt": "string",
+          "updatedAt": "string",
+          "categoryLabel": "string",
+          "category": "number",
+          "licenceLabel": "string",
+          "licence": "number",
+          "languageLabel": "string",
+          "language": "number",
+          "description": "string",
+          "duration": "number",
+          "isLocal": "boolean",
+          "name": "string",
+          "serverHost": "string",
+          "thumbnailPath": "string",
+          "previewPath": "string",
+          "embedPath": "string",
+          "views": "number",
+          "likes": "number",
+          "dislikes": "number",
+          "nsfw": "boolean"
+        }
+      ]
+    }
+  ]
+}
+
+ +
+
+
+
+
+

+ ServerConfig: + +

+
+
+
+
+
+ signup: + object + +
+
+ transcoding: + object + +
+
+ avatar: + object + +
+
+ video: + object + +
+
+
+
+
+
+
Example
+
{
+  "signup": {
+    "allowed": "boolean"
+  },
+  "transcoding": {
+    "enabledResolutions": [
+      "number"
+    ]
+  },
+  "avatar": {
+    "file": {
+      "size": {
+        "max": "number"
+      }
+    },
+    "extensions": [
+      "string"
+    ]
+  },
+  "video": {
+    "file": {
+      "extensions": [
+        "string"
+      ]
+    }
+  }
+}
+
+ +
+
+
+
+
+

+ Follow: + +

+
+
+
+
+
+ id: + number + +
+
+ follower: + + + Actor + + + +
+
+ following: + + + Actor + + + +
+
+ score: + number + +
+
+ state: + string + + pending, + accepted + + +
+
+ createdAt: + string + +
+
+ updatedAt: + string + +
+
+
+
+
+
+
Example
+
{
+  "id": "number",
+  "follower": {
+    "id": "number",
+    "uuid": "string",
+    "url": "string",
+    "name": "string",
+    "host": "string",
+    "followingCount": "number",
+    "followersCount": "number",
+    "createdAt": "string",
+    "updatedAt": "string",
+    "avatar": {
+      "path": "string",
+      "createdAt": "string",
+      "updatedAt": "string"
+    }
+  },
+  "following": {
+    "id": "number",
+    "uuid": "string",
+    "url": "string",
+    "name": "string",
+    "host": "string",
+    "followingCount": "number",
+    "followersCount": "number",
+    "createdAt": "string",
+    "updatedAt": "string",
+    "avatar": {
+      "path": "string",
+      "createdAt": "string",
+      "updatedAt": "string"
+    }
+  },
+  "score": "number",
+  "state": "string",
+  "createdAt": "string",
+  "updatedAt": "string"
+}
+
+ +
+
+
+
+
+

+ Job: + +

+
+
+
+
+
+ id: + number + +
+
+ state: + string + + pending, + processing, + error, + success + + +
+
+ category: + string + + transcoding, + activitypub-http + + +
+
+ handlerName: + string + +
+
+ handlerInputData: + string + +
+
+ createdAt: + string + +
+
+ updatedAt: + string + +
+
+
+
+
+
+
Example
+
{
+  "id": "number",
+  "state": "string",
+  "category": "string",
+  "handlerName": "string",
+  "handlerInputData": "string",
+  "createdAt": "string",
+  "updatedAt": "string"
+}
+
+ +
+
+
+
+
+

+ AddUserResponse: + +

+
+
+
+
+
+ id: + number + +
+
+ uuid: + string + +
+
+
+
+
+
+
Example
+
{
+  "id": "number",
+  "uuid": "string"
+}
+
+ +
+
+
+
+
+

+ VideoUploadResponse: + +

+
+
+
+
+
+ id: + number + +
+
+ uuid: + string + +
+
+
+
+
+
+
Example
+
{
+  "id": "number",
+  "uuid": "string"
+}
+
+ +
+
+
+
+
+

+ AddUser: + +

+
+
+
+
+
+ username: + string + + +
+
+

The user username

+
+
+ password: + string + + +
+
+

The user password

+
+
+ email: + string + + +
+
+

The user email

+
+
+ videoQuota: + string + + +
+
+

The user videoQuota

+
+
+ role: + string + + +
+
+

The user role

+
+
+
+
+
+
+
Example
+
{
+  "username": "string",
+  "password": "string",
+  "email": "string",
+  "videoQuota": "string",
+  "role": "string"
+}
+
+ +
+
+
+
+
+

+ UpdateUser: + +

+
+
+
+
+
+ id: + string + + +
+
+

The user id

+
+
+ email: + string + + +
+
+

The updated email of the user

+
+
+ videoQuota: + string + + +
+
+

The updated videoQuota of the user

+
+
+ role: + string + + +
+
+

The updated role of the user

+
+
+
+
+
+
+
Example
+
{
+  "id": "string",
+  "email": "string",
+  "videoQuota": "string",
+  "role": "string"
+}
+
+ +
+
+
+
+
+

+ UpdateMe: + +

+
+
+
+
+
+ password: + string + + +
+
+

Your new password

+
+
+ email: + string + + +
+
+

Your new email

+
+
+ displayNSFW: + string + + +
+
+

Your new displayNSFW

+
+
+ autoPlayVideo: + string + + +
+
+

Your new autoPlayVideo

+
+
+
+
+
+
+
Example
+
{
+  "password": "string",
+  "email": "string",
+  "displayNSFW": "string",
+  "autoPlayVideo": "string"
+}
+
+ +
+
+
+
+
+

+ GetMeVideoRating: + +

+
+
+
+
+
+ id: + string + + +
+
+

Id of the video

+
+
+ rating: + number + + +
+
+

Rating of the video

+
+
+
+
+
+
+
Example
+
{
+  "id": "string",
+  "rating": "number"
+}
+
+ +
+
+
+
+
+

+ RegisterUser: + +

+
+
+
+
+
+ username: + string + + +
+
+

The username of the user

+
+
+ password: + string + + +
+
+

The password of the user

+
+
+ email: + string + + +
+
+

The email of the user

+
+
+
+
+
+
+
Example
+
{
+  "username": "string",
+  "password": "string",
+  "email": "string"
+}
+
+ +
+
+
+
+
+

+ VideoChannelInput: + +

+
+
+
+
+
+ name: + string + +
+
+ description: + string + +
+
+
+
+
+
+
Example
+
{
+  "name": "string",
+  "description": "string"
+}
+
+ +
+
+
+
+ +
+
+
+ + \ No newline at end of file diff --git a/support/doc/api/html/javascripts/spectacle.js b/support/doc/api/html/javascripts/spectacle.js new file mode 100644 index 000000000..e75fc6a3a --- /dev/null +++ b/support/doc/api/html/javascripts/spectacle.js @@ -0,0 +1,242 @@ +$(function() { + // $(document).foundation(); + + var $sidebar = $('#sidebar'); + if ($sidebar.length) { + var $docs = $('#docs'); + var $nav = $sidebar.find('nav'); + + // + // Setup sidebar navigation + var traverse = new Traverse($nav, { + threshold: 10, + barOffset: $sidebar.position().top + }); + + $nav.on('update.traverse', function(event, element) { + $nav.find('section').removeClass('expand'); + var $section = element.parents('section:first'); + if ($section.length) { + $section.addClass('expand'); + } + }); + + // + // Bind the drawer layout + var $drawerLayout = $('.drawer-layout'), + $drawer = $drawerLayout.find('.drawer'), + closeDrawer = function() { + $drawer.removeClass('slide-right slide-left'); + $drawer.find('.drawer-overlay').remove(); + $drawerLayout.removeClass('drawer-open drawer-slide-left-large drawer-slide-right-large'); + return false; + }; + + // Drawer open buttons + $drawerLayout.find('[data-drawer-slide]').click(function(e) { + var $this = $(this), + direction = $this.data('drawer-slide'); + $drawerLayout.addClass('drawer-open'); + $drawer.addClass('slide-' + direction); + + var $overlay = $('') + $drawer.append($overlay); + $overlay.click(closeDrawer); + + return false; + }); + + // Drawer close buttons + $drawerLayout.find('[data-drawer-close]').click(closeDrawer); + } +}); + +/** + * Creates a new instance of Traverse. + * @class + * @fires Traverse#init + * @param {Object} element - jQuery object to add the trigger to. + * @param {Object} options - Overrides to the default plugin settings. + */ +function Traverse(element, options) { + this.$element = element; + this.options = $.extend({}, Traverse.defaults, this.$element.data(), options); + + this._init(); +} + +/** + * Default settings for plugin + */ +Traverse.defaults = { + /** + * Amount of time, in ms, the animated scrolling should take between locations. + * @option + * @example 500 + */ + animationDuration: 500, + /** + * Animation style to use when scrolling between locations. + * @option + * @example 'ease-in-out' + */ + animationEasing: 'linear', + /** + * Number of pixels to use as a marker for location changes. + * @option + * @example 50 + */ + threshold: 50, + /** + * Class applied to the active locations link on the traverse container. + * @option + * @example 'active' + */ + activeClass: 'active', + /** + * Allows the script to manipulate the url of the current page, and if supported, alter the history. + * @option + * @example true + */ + deepLinking: false, + /** + * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar. + * @option + * @example 25 + */ + barOffset: 0 +}; + +/** + * Initializes the Traverse plugin and calls functions to get equalizer functioning on load. + * @private + */ +Traverse.prototype._init = function() { + var id = this.$element[0].id, // || Foundation.GetYoDigits(6, 'traverse'), + _this = this; + this.$targets = $('[data-traverse-target]'); + this.$links = this.$element.find('a'); + this.$element.attr({ + 'data-resize': id, + 'data-scroll': id, + 'id': id + }); + this.$active = $(); + this.scrollPos = parseInt(window.pageYOffset, 10); + + this._events(); +}; + +/** + * Calculates an array of pixel values that are the demarcation lines between locations on the page. + * Can be invoked if new elements are added or the size of a location changes. + * @function + */ +Traverse.prototype.calcPoints = function(){ + var _this = this, + body = document.body, + html = document.documentElement; + + this.points = []; + this.winHeight = Math.round(Math.max(window.innerHeight, html.clientHeight)); + this.docHeight = Math.round(Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight)); + + this.$targets.each(function(){ + var $tar = $(this), + pt = $tar.offset().top; // Math.round($tar.offset().top - _this.options.threshold); + $tar.targetPoint = pt; + _this.points.push(pt); + }); +}; + +/** + * Initializes events for Traverse. + * @private + */ +Traverse.prototype._events = function() { + var _this = this, + $body = $('html, body'), + opts = { + duration: _this.options.animationDuration, + easing: _this.options.animationEasing + }; + + $(window).one('load', function(){ + _this.calcPoints(); + _this._updateActive(); + + $(this).resize(function(e) { + _this.reflow(); + }).scroll(function(e) { + _this._updateActive(); + }); + }) + + this.$element.on('click', 'a[href^="#"]', function(e) { //'click.zf.traverse' + e.preventDefault(); + var arrival = this.getAttribute('href').replace(".", "\\."), + scrollPos = $(arrival).offset().top - _this.options.barOffset; // - _this.options.threshold / 2 - _this.options.barOffset; + + $body.stop(true).animate({ + scrollTop: scrollPos + }, opts); + }); +}; + +/** + * Calls necessary functions to update Traverse upon DOM change + * @function + */ +Traverse.prototype.reflow = function(){ + this.calcPoints(); + this._updateActive(); +}; + +/** + * Updates the visibility of an active location link, + * and updates the url hash for the page, if deepLinking enabled. + * @private + * @function + * @fires Traverse#update + */ + Traverse.prototype._updateActive = function(){ + var winPos = parseInt(window.pageYOffset, 10), + curIdx; + + if(winPos + this.winHeight === this.docHeight){ curIdx = this.points.length - 1; } + else if(winPos < this.points[0]){ curIdx = 0; } + else{ + var isDown = this.scrollPos < winPos, + _this = this, + curVisible = this.points.filter(function(p, i){ + return isDown ? + p <= (winPos + _this.options.barOffset + _this.options.threshold) : + (p - (_this.options.barOffset + _this.options.threshold)) <= winPos; + // p <= (winPos - (offset - _this.options.threshold)) : + // (p - (-offset + _this.options.threshold)) <= winPos; + }); + curIdx = curVisible.length ? curVisible.length - 1 : 0; + } + + var $prev = this.$active; + var $next = this.$links.eq(curIdx); + this.$active.removeClass(this.options.activeClass); + this.$active = $next.addClass(this.options.activeClass); + + if(this.options.deepLinking){ + var hash = this.$active[0].getAttribute('href'); + if(window.history.pushState){ + window.history.pushState(null, null, hash); + }else{ + window.location.hash = hash; + } + } + + this.scrollPos = winPos; + + // Fire event if the active element was changed + var changed = $prev[0] !== $next[0]; + if (changed) { + this.$element.trigger('update.traverse', [this.$active]); + } + }; diff --git a/support/doc/api/html/javascripts/spectacle.min.js b/support/doc/api/html/javascripts/spectacle.min.js new file mode 100644 index 000000000..f196234a4 --- /dev/null +++ b/support/doc/api/html/javascripts/spectacle.min.js @@ -0,0 +1 @@ +function Traverse(a,b){this.$element=a,this.options=$.extend({},Traverse.defaults,this.$element.data(),b),this._init()}$(function(){var a=$("#sidebar");if(a.length){var b=($("#docs"),a.find("nav"));new Traverse(b,{threshold:10,barOffset:a.position().top});b.on("update.traverse",function(a,c){b.find("section").removeClass("expand");var d=c.parents("section:first");d.length&&d.addClass("expand")});var c=$(".drawer-layout"),d=c.find(".drawer"),e=function(){return d.removeClass("slide-right slide-left"),d.find(".drawer-overlay").remove(),c.removeClass("drawer-open drawer-slide-left-large drawer-slide-right-large"),!1};c.find("[data-drawer-slide]").click(function(a){var b=$(this),f=b.data("drawer-slide");c.addClass("drawer-open"),d.addClass("slide-"+f);var g=$('');return d.append(g),g.click(e),!1}),c.find("[data-drawer-close]").click(e)}}),Traverse.defaults={animationDuration:500,animationEasing:"linear",threshold:50,activeClass:"active",deepLinking:!1,barOffset:0},Traverse.prototype._init=function(){var a=this.$element[0].id;this.$targets=$("[data-traverse-target]"),this.$links=this.$element.find("a"),this.$element.attr({"data-resize":a,"data-scroll":a,id:a}),this.$active=$(),this.scrollPos=parseInt(window.pageYOffset,10),this._events()},Traverse.prototype.calcPoints=function(){var a=this,b=document.body,c=document.documentElement;this.points=[],this.winHeight=Math.round(Math.max(window.innerHeight,c.clientHeight)),this.docHeight=Math.round(Math.max(b.scrollHeight,b.offsetHeight,c.clientHeight,c.scrollHeight,c.offsetHeight)),this.$targets.each(function(){var b=$(this),c=b.offset().top;b.targetPoint=c,a.points.push(c)})},Traverse.prototype._events=function(){var a=this,b=$("html, body"),c={duration:a.options.animationDuration,easing:a.options.animationEasing};$(window).one("load",function(){a.calcPoints(),a._updateActive(),$(this).resize(function(b){a.reflow()}).scroll(function(b){a._updateActive()})}),this.$element.on("click",'a[href^="#"]',function(d){d.preventDefault();var e=this.getAttribute("href").replace(".","\\."),f=$(e).offset().top-a.options.barOffset;b.stop(!0).animate({scrollTop:f},c)})},Traverse.prototype.reflow=function(){this.calcPoints(),this._updateActive()},Traverse.prototype._updateActive=function(){var a,b=parseInt(window.pageYOffset,10);if(b+this.winHeight===this.docHeight)a=this.points.length-1;else if(b