From c5db1d30e26dce62a809a5879703b707312fb462 Mon Sep 17 00:00:00 2001 From: Isaac Abadi Date: Thu, 30 Sep 2021 22:18:55 -0600 Subject: [PATCH] Added missing routes to API Changed getDBInfo from post to get request --- Public API v1.yaml | 765 ++++++++++++++++-- backend/app.js | 2 +- package-lock.json | 7 + src/api-types/index.ts | 34 + .../models/AddFileToPlaylistRequest.ts | 9 + src/api-types/models/Category.ts | 15 + src/api-types/models/CategoryRule.ts | 26 + .../models/CheckConcurrentStreamRequest.ts | 11 + .../models/CheckConcurrentStreamResponse.ts | 9 + src/api-types/models/ConcurrentStream.ts | 10 + src/api-types/models/CreateCategoryRequest.ts | 8 + .../models/CreateCategoryResponse.ts | 10 + src/api-types/models/DBInfoResponse.ts | 18 + src/api-types/models/DeleteCategoryRequest.ts | 8 + src/api-types/models/DownloadFileRequest.ts | 7 +- .../DownloadTwitchChatByVODIDRequest.ts | 26 + .../DownloadTwitchChatByVODIDResponse.ts | 9 + src/api-types/models/GenerateArgsResponse.ts | 8 + .../models/GetAllCategoriesResponse.ts | 9 + .../models/GetAllDownloadsRequest.ts | 11 + src/api-types/models/GetFileFormatsRequest.ts | 8 + .../models/GetFileFormatsResponse.ts | 12 + .../models/GetFullTwitchChatRequest.ts | 22 + .../models/GetFullTwitchChatResponse.ts | 9 + src/api-types/models/GetLogsRequest.ts | 8 + src/api-types/models/GetLogsResponse.ts | 12 + .../models/IncrementViewCountRequest.ts | 13 + src/api-types/models/TableInfo.ts | 8 + .../models/TestConnectionStringRequest.ts | 11 + .../models/TestConnectionStringResponse.ts | 9 + src/api-types/models/TransferDBRequest.ts | 11 + src/api-types/models/TransferDBResponse.ts | 9 + src/api-types/models/TwitchChatMessage.ts | 18 + .../models/UpdateCategoriesRequest.ts | 9 + src/api-types/models/UpdateCategoryRequest.ts | 9 + .../models/UpdateConcurrentStreamRequest.ts | 12 + .../models/UpdateConcurrentStreamResponse.ts | 9 + src/api-types/models/Version.ts | 11 + src/api-types/models/VersionInfoResponse.ts | 9 + src/app/main/main.component.ts | 2 +- src/app/posts.services.ts | 160 ++-- 41 files changed, 1255 insertions(+), 118 deletions(-) create mode 100644 src/api-types/models/AddFileToPlaylistRequest.ts create mode 100644 src/api-types/models/Category.ts create mode 100644 src/api-types/models/CategoryRule.ts create mode 100644 src/api-types/models/CheckConcurrentStreamRequest.ts create mode 100644 src/api-types/models/CheckConcurrentStreamResponse.ts create mode 100644 src/api-types/models/ConcurrentStream.ts create mode 100644 src/api-types/models/CreateCategoryRequest.ts create mode 100644 src/api-types/models/CreateCategoryResponse.ts create mode 100644 src/api-types/models/DBInfoResponse.ts create mode 100644 src/api-types/models/DeleteCategoryRequest.ts create mode 100644 src/api-types/models/DownloadTwitchChatByVODIDRequest.ts create mode 100644 src/api-types/models/DownloadTwitchChatByVODIDResponse.ts create mode 100644 src/api-types/models/GenerateArgsResponse.ts create mode 100644 src/api-types/models/GetAllCategoriesResponse.ts create mode 100644 src/api-types/models/GetAllDownloadsRequest.ts create mode 100644 src/api-types/models/GetFileFormatsRequest.ts create mode 100644 src/api-types/models/GetFileFormatsResponse.ts create mode 100644 src/api-types/models/GetFullTwitchChatRequest.ts create mode 100644 src/api-types/models/GetFullTwitchChatResponse.ts create mode 100644 src/api-types/models/GetLogsRequest.ts create mode 100644 src/api-types/models/GetLogsResponse.ts create mode 100644 src/api-types/models/IncrementViewCountRequest.ts create mode 100644 src/api-types/models/TableInfo.ts create mode 100644 src/api-types/models/TestConnectionStringRequest.ts create mode 100644 src/api-types/models/TestConnectionStringResponse.ts create mode 100644 src/api-types/models/TransferDBRequest.ts create mode 100644 src/api-types/models/TransferDBResponse.ts create mode 100644 src/api-types/models/TwitchChatMessage.ts create mode 100644 src/api-types/models/UpdateCategoriesRequest.ts create mode 100644 src/api-types/models/UpdateCategoryRequest.ts create mode 100644 src/api-types/models/UpdateConcurrentStreamRequest.ts create mode 100644 src/api-types/models/UpdateConcurrentStreamResponse.ts create mode 100644 src/api-types/models/Version.ts create mode 100644 src/api-types/models/VersionInfoResponse.ts diff --git a/Public API v1.yaml b/Public API v1.yaml index 01cdfcd..35eaa47 100644 --- a/Public API v1.yaml +++ b/Public API v1.yaml @@ -33,6 +33,27 @@ paths: description: Server download error security: - Auth query parameter: [] + /api/generateArgs: + post: + tags: + - downloader + summary: Download video file + description: Generates args, used for checking what args would run if you ran downloadFile + operationId: post-generateArgs + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DownloadRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GenerateArgsResponse' + security: + - Auth query parameter: [] /api/getMp3s: get: tags: @@ -148,6 +169,27 @@ paths: $ref: '#/components/schemas/SuccessObject' security: - Auth query parameter: [] + /api/incrementViewCount: + post: + summary: Increments a file's view count + tags: + - files + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessObject' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IncrementViewCountRequest' + operationId: post-api-incrementViewCount + description: Increments a file's view count + security: + - Auth query parameter: [] /api/subscribe: post: tags: @@ -359,6 +401,27 @@ paths: $ref: '#/components/schemas/SuccessObject' security: - Auth query parameter: [] + /api/addFileToPlaylist: + post: + tags: + - playlists + summary: Adds a file to a playlist + description: Adds a file to a playlist + operationId: post-api-addFileToPlaylist + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AddFileToPlaylistRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessObject' + security: + - Auth query parameter: [] /api/deleteMp4: post: tags: @@ -487,48 +550,6 @@ paths: $ref: '#/components/schemas/inline_response_200_15' security: - Auth query parameter: [] - /api/checkPin: - post: - tags: - - security - summary: Check if pin is correct - description: Checks the pin against an inputted one. Will return true if they match - operationId: post-api-checkPin - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/body_19' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessObject' - security: - - Auth query parameter: [] - /api/setPin: - post: - tags: - - security - summary: Set pin - operationId: post-api-setPin - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/body_20' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessObject' - security: - - Auth query parameter: [] - description: '' /api/generateNewAPIKey: post: tags: @@ -604,7 +625,7 @@ paths: security: - Auth query parameter: [] /api/downloads: - get: + post: summary: Get info for all downloads tags: - downloader @@ -615,7 +636,12 @@ paths: application/json: schema: $ref: '#/components/schemas/GetAllDownloadsResponse' - operationId: get-api-downloads + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetAllDownloadsRequest' + operationId: post-api-downloads description: Retrieves all downloads recorded by the server and their status. security: - Auth query parameter: [] @@ -799,6 +825,299 @@ paths: - Auth query parameter: [] tags: - multi-user mode + /api/versionInfo: + get: + tags: + - server + summary: Gets server version info + operationId: get-api-versionInfo + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/VersionInfoResponse' + security: + - Auth query parameter: [] + /api/getLogs: + post: + summary: Gets logs from server + tags: + - server + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetLogsResponse' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetLogsRequest' + operationId: post-api-getLogs + description: Gets logs from server + security: + - Auth query parameter: [] + /api/clearAllLogs: + post: + summary: Clears the log file + tags: + - server + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessObject' + operationId: post-api-clearAllLogs + description: Clears the log file + security: + - Auth query parameter: [] + /api/getDBInfo: + get: + tags: + - db + summary: Gets information on the DB + operationId: get-api-getDBInfo + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DBInfoResponse' + security: + - Auth query parameter: [] + /api/transferDB: + post: + summary: Transfers DB between Local and MongoDB + tags: + - db + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/TransferDBResponse' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransferDBRequest' + operationId: post-api-transferDB + description: Initiates a transfer between Local and MongoDB. Connection string must be set. + security: + - Auth query parameter: [] + /api/testConnectionString: + post: + summary: Tests a MongoDB connection string + tags: + - db + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/TestConnectionStringResponse' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TestConnectionStringRequest' + operationId: post-api-testConnectionString + description: Tests a MongoDB connection string and returns an error if one exists. + security: + - Auth query parameter: [] + /api/getFullTwitchChat: + post: + summary: Gets the downloaded Twitch Chat (VODs only) + tags: + - twitch + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetFullTwitchChatResponse' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetFullTwitchChatRequest' + operationId: post-api-getFullTwitchChat + description: Gets the downloaded Twitch Chat (VODs only) + security: + - Auth query parameter: [] + /api/downloadTwitchChatByVODID: + post: + summary: Downloads Twitch Chat for a VOD + tags: + - twitch + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DownloadTwitchChatByVODIDResponse' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DownloadTwitchChatByVODIDRequest' + operationId: post-api-downloadTwitchChatByVODID + description: Downloads Twitch Chat for a VOD + security: + - Auth query parameter: [] + /api/checkConcurrentStream: + post: + summary: Checks status of a concurrent stream + tags: + - player + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CheckConcurrentStreamResponse' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CheckConcurrentStreamRequest' + operationId: post-api-checkConcurrentStream + description: Checks status of a concurrent stream + security: + - Auth query parameter: [] + /api/updateConcurrentStream: + post: + summary: Updates a concurrent stream + tags: + - player + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateConcurrentStreamResponse' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateConcurrentStreamRequest' + operationId: post-api-updateConcurrentStream + description: Updates a concurrent stream + security: + - Auth query parameter: [] + /api/getAllCategories: + post: + summary: Gets all categories + tags: + - categories + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetAllCategoriesResponse' + operationId: post-api-getAllCategories + description: Gets all categories + security: + - Auth query parameter: [] + /api/createCategory: + post: + summary: Creates a category + tags: + - categories + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CreateCategoryResponse' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateCategoryRequest' + operationId: post-api-createCategory + description: Creates a category + security: + - Auth query parameter: [] + /api/deleteCategory: + post: + summary: Deletes a category + tags: + - categories + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessObject' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteCategoryRequest' + operationId: post-api-deleteCategory + description: Deletes a category + security: + - Auth query parameter: [] + /api/updateCategory: + post: + summary: Updates a category + tags: + - categories + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessObject' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateCategoryRequest' + operationId: post-api-updateCategory + description: Updates a category + security: + - Auth query parameter: [] + /api/updateCategories: + post: + summary: Updates all categories + tags: + - categories + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SuccessObject' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateCategoriesRequest' + operationId: post-api-updateCategories + description: Updates all categories + security: + - Auth query parameter: [] components: schemas: SuccessObject: @@ -874,6 +1193,13 @@ components: download: $ref: '#/components/schemas/Download' nullable: true + GenerateArgsResponse: + type: object + properties: + args: + type: array + items: + type: string GetDownloadRequest: type: object properties: @@ -887,6 +1213,15 @@ components: download: $ref: '#/components/schemas/Download' nullable: true + GetAllDownloadsRequest: + type: object + properties: + uids: + type: array + items: + type: string + description: Filters downloads with the array + nullable: true GetAllDownloadsResponse: type: object properties: @@ -1159,8 +1494,6 @@ components: type: $ref: '#/components/schemas/FileType' DownloadFileRequest: - required: - - uid type: object properties: uid: @@ -1169,9 +1502,8 @@ components: type: string sub_id: type: string - is_playlist: - type: boolean - description: Only used for subscriptions + playlist_id: + type: string DownloadArchiveRequest: required: - sub @@ -1203,6 +1535,264 @@ components: properties: tag: type: string + DBInfoResponse: + required: + - db_info + type: object + properties: + using_local_db: + type: boolean + stats_by_table: + type: object + properties: + files: + $ref: '#/components/schemas/TableInfo' + playlists: + $ref: '#/components/schemas/TableInfo' + categories: + $ref: '#/components/schemas/TableInfo' + subscriptions: + $ref: '#/components/schemas/TableInfo' + users: + $ref: '#/components/schemas/TableInfo' + roles: + $ref: '#/components/schemas/TableInfo' + download_queue: + $ref: '#/components/schemas/TableInfo' + TransferDBResponse: + required: + - success + type: object + properties: + success: + type: boolean + error: + type: string + TransferDBRequest: + required: + - local_to_remote + type: object + properties: + local_to_remote: + description: True if transfering DB from Local to MongoDB, false if transferring DB from MongoDB to Local + type: boolean + TestConnectionStringResponse: + required: + - success + type: object + properties: + success: + type: boolean + error: + type: string + TestConnectionStringRequest: + required: + - connection_string + type: object + properties: + connection_string: + description: MongoDB connection string + type: string + GetFullTwitchChatResponse: + required: + - success + type: object + properties: + success: + type: boolean + error: + type: string + GetFullTwitchChatRequest: + required: + - id + - type + type: object + properties: + id: + description: File ID + type: string + type: + $ref: '#/components/schemas/FileType' + uuid: + description: User UID + type: string + sub: + description: Subscription + $ref: '#/components/schemas/Subscription' + DownloadTwitchChatByVODIDResponse: + required: + - chat + type: object + properties: + chat: + type: array + items: + $ref: '#/components/schemas/TwitchChatMessage' + DownloadTwitchChatByVODIDRequest: + required: + - id + - type + - vodId + type: object + properties: + id: + description: File ID + type: string + vodId: + description: ID of the VOD + type: string + type: + $ref: '#/components/schemas/FileType' + uuid: + description: User UID + type: string + sub: + description: Subscription + $ref: '#/components/schemas/Subscription' + CheckConcurrentStreamResponse: + required: + - stream + type: object + properties: + stream: + $ref: '#/components/schemas/ConcurrentStream' + CheckConcurrentStreamRequest: + required: + - uid + type: object + properties: + uid: + description: UID of the concurrent stream + type: string + UpdateConcurrentStreamResponse: + required: + - stream + type: object + properties: + stream: + $ref: '#/components/schemas/ConcurrentStream' + UpdateConcurrentStreamRequest: + allOf: + - $ref: '#/components/schemas/ConcurrentStream' + - type: object + properties: + uid: + type: string + description: Concurrent stream UID + required: + - uid + GetLogsResponse: + type: object + properties: + logs: + type: string + description: Number of lines to retrieve from the bottom + success: + type: boolean + GetLogsRequest: + required: + - connection_string + type: object + properties: + lines: + type: number + GetFileFormatsRequest: + type: object + properties: + url: + type: string + GetFileFormatsResponse: + required: + - result + - success + type: object + properties: + success: + type: boolean + result: + allOf: + - $ref: '#/components/schemas/file' + - type: object + properties: + formats: + type: array + items: + type: object + IncrementViewCountRequest: + required: + - file_uid + type: object + properties: + file_uid: + type: string + sub_id: + type: string + uuid: + type: string + description: User UID + AddFileToPlaylistRequest: + required: + - playlist_id + - file_uid + type: object + properties: + file_uid: + type: string + playlist_id: + type: string + GetAllCategoriesResponse: + required: + - categories + type: object + properties: + categories: + type: array + items: + $ref: '#/components/schemas/Category' + CreateCategoryResponse: + type: object + properties: + new_category: + $ref: '#/components/schemas/Category' + success: + type: boolean + CreateCategoryRequest: + required: + - name + type: object + properties: + name: + type: string + DeleteCategoryRequest: + required: + - category_uid + type: object + properties: + category_uid: + type: string + UpdateCategoryRequest: + required: + - category + type: object + properties: + category: + $ref: '#/components/schemas/Category' + UpdateCategoriesRequest: + required: + - categories + type: object + properties: + categories: + type: array + items: + $ref: '#/components/schemas/Category' + VersionInfoResponse: + required: + - version_info + type: object + properties: + version_info: + $ref: '#/components/schemas/Version' inline_response_200_15: required: - is_set @@ -1495,6 +2085,83 @@ components: enum: - 'yes' - 'no' + TableInfo: + type: object + properties: + records_count: + type: number + TwitchChatMessage: + type: object + properties: + created_at: + type: string + content_offset_seconds: + type: number + commenter: + type: object + properties: + name: + type: string + _id: + type: string + created_at: + type: string + message: + type: object + properties: + body: + type: string + user_color: + type: string + ConcurrentStream: + type: object + properties: + playback_timestamp: + type: number + unix_timestamp: + type: number + playing: + type: boolean + Category: + type: object + properties: + name: + type: string + uid: + type: string + rules: + type: array + items: + $ref: '#/components/schemas/CategoryRule' + custom_output: + type: string + description: Overrides file output for downloaded files in category + CategoryRule: + type: object + properties: + preceding_operator: + type: string + enum: + - 'or' + - 'and' + comparator: + type: string + enum: + - 'includes' + - 'not_includes' + - 'equals' + - 'not_equals' + Version: + type: object + properties: + type: + type: string + tag: + type: string + commit: + type: string + date: + type: string BaseChangePermissionsRequest: required: - permission diff --git a/backend/app.js b/backend/app.js index 6b2ca95..b12d502 100644 --- a/backend/app.js +++ b/backend/app.js @@ -950,7 +950,7 @@ app.post('/api/restartServer', optionalJwt, (req, res) => { res.send({success: true}); }); -app.post('/api/getDBInfo', optionalJwt, async (req, res) => { +app.get('/api/getDBInfo', optionalJwt, async (req, res) => { const db_info = await db_api.getDBStats(); res.send({db_info: db_info}); }); diff --git a/package-lock.json b/package-lock.json index 998567e..10f4d52 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13767,6 +13767,13 @@ "integrity": "sha512-+O8/qh/Qj8CgC6eYBVBykMrNtp5Gebn4dlGD/kKXVkJNDwyrAwSIqwz8CDf+tsAIWVycKcku6gIXJ0qwx/ZXaQ==", "dev": true }, + "uglify-js": { + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.2.tgz", + "integrity": "sha512-rtPMlmcO4agTUfz10CbgJ1k6UAoXM2gWb3GoMPPZB/+/Ackf8lNWk11K4rYi2D0apgoFRLtQOZhb+/iGNJq26A==", + "dev": true, + "optional": true + }, "unicode-canonical-property-names-ecmascript": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", diff --git a/src/api-types/index.ts b/src/api-types/index.ts index 83c73a8..c08044a 100644 --- a/src/api-types/index.ts +++ b/src/api-types/index.ts @@ -2,17 +2,27 @@ /* tslint:disable */ /* eslint-disable */ +export type { AddFileToPlaylistRequest } from './models/AddFileToPlaylistRequest'; export type { BaseChangePermissionsRequest } from './models/BaseChangePermissionsRequest'; export type { body_19 } from './models/body_19'; export type { body_20 } from './models/body_20'; +export type { Category } from './models/Category'; +export { CategoryRule } from './models/CategoryRule'; export type { ChangeRolePermissionsRequest } from './models/ChangeRolePermissionsRequest'; export type { ChangeUserPermissionsRequest } from './models/ChangeUserPermissionsRequest'; +export type { CheckConcurrentStreamRequest } from './models/CheckConcurrentStreamRequest'; +export type { CheckConcurrentStreamResponse } from './models/CheckConcurrentStreamResponse'; +export type { ConcurrentStream } from './models/ConcurrentStream'; export type { Config } from './models/Config'; export type { ConfigResponse } from './models/ConfigResponse'; +export type { CreateCategoryRequest } from './models/CreateCategoryRequest'; +export type { CreateCategoryResponse } from './models/CreateCategoryResponse'; export type { CreatePlaylistRequest } from './models/CreatePlaylistRequest'; export type { CreatePlaylistResponse } from './models/CreatePlaylistResponse'; export type { CropFileSettings } from './models/CropFileSettings'; export type { DatabaseFile } from './models/DatabaseFile'; +export type { DBInfoResponse } from './models/DBInfoResponse'; +export type { DeleteCategoryRequest } from './models/DeleteCategoryRequest'; export type { DeleteMp3Mp4Request } from './models/DeleteMp3Mp4Request'; export type { DeletePlaylistRequest } from './models/DeletePlaylistRequest'; export type { DeleteSubscriptionFileRequest } from './models/DeleteSubscriptionFileRequest'; @@ -22,17 +32,28 @@ export type { DownloadArchiveRequest } from './models/DownloadArchiveRequest'; export type { DownloadFileRequest } from './models/DownloadFileRequest'; export type { DownloadRequest } from './models/DownloadRequest'; export type { DownloadResponse } from './models/DownloadResponse'; +export type { DownloadTwitchChatByVODIDRequest } from './models/DownloadTwitchChatByVODIDRequest'; +export type { DownloadTwitchChatByVODIDResponse } from './models/DownloadTwitchChatByVODIDResponse'; export type { DownloadVideosForSubscriptionRequest } from './models/DownloadVideosForSubscriptionRequest'; export type { File } from './models/File'; export { FileType } from './models/FileType'; +export type { GenerateArgsResponse } from './models/GenerateArgsResponse'; export type { GenerateNewApiKeyResponse } from './models/GenerateNewApiKeyResponse'; +export type { GetAllCategoriesResponse } from './models/GetAllCategoriesResponse'; +export type { GetAllDownloadsRequest } from './models/GetAllDownloadsRequest'; export type { GetAllDownloadsResponse } from './models/GetAllDownloadsResponse'; export type { GetAllFilesResponse } from './models/GetAllFilesResponse'; export type { GetAllSubscriptionsResponse } from './models/GetAllSubscriptionsResponse'; export type { GetDownloadRequest } from './models/GetDownloadRequest'; export type { GetDownloadResponse } from './models/GetDownloadResponse'; +export type { GetFileFormatsRequest } from './models/GetFileFormatsRequest'; +export type { GetFileFormatsResponse } from './models/GetFileFormatsResponse'; export type { GetFileRequest } from './models/GetFileRequest'; export type { GetFileResponse } from './models/GetFileResponse'; +export type { GetFullTwitchChatRequest } from './models/GetFullTwitchChatRequest'; +export type { GetFullTwitchChatResponse } from './models/GetFullTwitchChatResponse'; +export type { GetLogsRequest } from './models/GetLogsRequest'; +export type { GetLogsResponse } from './models/GetLogsResponse'; export type { GetMp3sResponse } from './models/GetMp3sResponse'; export type { GetMp4sResponse } from './models/GetMp4sResponse'; export type { GetPlaylistRequest } from './models/GetPlaylistRequest'; @@ -43,6 +64,7 @@ export type { GetRolesResponse } from './models/GetRolesResponse'; export type { GetSubscriptionRequest } from './models/GetSubscriptionRequest'; export type { GetSubscriptionResponse } from './models/GetSubscriptionResponse'; export type { GetUsersResponse } from './models/GetUsersResponse'; +export type { IncrementViewCountRequest } from './models/IncrementViewCountRequest'; export type { inline_response_200_15 } from './models/inline_response_200_15'; export type { LoginRequest } from './models/LoginRequest'; export type { LoginResponse } from './models/LoginResponse'; @@ -56,12 +78,24 @@ export type { SubscribeResponse } from './models/SubscribeResponse'; export type { Subscription } from './models/Subscription'; export type { SubscriptionRequestData } from './models/SubscriptionRequestData'; export type { SuccessObject } from './models/SuccessObject'; +export type { TableInfo } from './models/TableInfo'; +export type { TestConnectionStringRequest } from './models/TestConnectionStringRequest'; +export type { TestConnectionStringResponse } from './models/TestConnectionStringResponse'; +export type { TransferDBRequest } from './models/TransferDBRequest'; +export type { TransferDBResponse } from './models/TransferDBResponse'; +export type { TwitchChatMessage } from './models/TwitchChatMessage'; export type { UnsubscribeRequest } from './models/UnsubscribeRequest'; export type { UnsubscribeResponse } from './models/UnsubscribeResponse'; +export type { UpdateCategoriesRequest } from './models/UpdateCategoriesRequest'; +export type { UpdateCategoryRequest } from './models/UpdateCategoryRequest'; +export type { UpdateConcurrentStreamRequest } from './models/UpdateConcurrentStreamRequest'; +export type { UpdateConcurrentStreamResponse } from './models/UpdateConcurrentStreamResponse'; export type { UpdatePlaylistRequest } from './models/UpdatePlaylistRequest'; export type { UpdaterStatus } from './models/UpdaterStatus'; export type { UpdateServerRequest } from './models/UpdateServerRequest'; export type { UpdateUserRequest } from './models/UpdateUserRequest'; export type { User } from './models/User'; export { UserPermission } from './models/UserPermission'; +export type { Version } from './models/Version'; +export type { VersionInfoResponse } from './models/VersionInfoResponse'; export { YesNo } from './models/YesNo'; diff --git a/src/api-types/models/AddFileToPlaylistRequest.ts b/src/api-types/models/AddFileToPlaylistRequest.ts new file mode 100644 index 0000000..b701175 --- /dev/null +++ b/src/api-types/models/AddFileToPlaylistRequest.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface AddFileToPlaylistRequest { + file_uid: string; + playlist_id: string; +} \ No newline at end of file diff --git a/src/api-types/models/Category.ts b/src/api-types/models/Category.ts new file mode 100644 index 0000000..055a3d7 --- /dev/null +++ b/src/api-types/models/Category.ts @@ -0,0 +1,15 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import { CategoryRule } from './CategoryRule'; + +export interface Category { + name?: string; + uid?: string; + rules?: Array; + /** + * Overrides file output for downloaded files in category + */ + custom_output?: string; +} \ No newline at end of file diff --git a/src/api-types/models/CategoryRule.ts b/src/api-types/models/CategoryRule.ts new file mode 100644 index 0000000..9a8acb9 --- /dev/null +++ b/src/api-types/models/CategoryRule.ts @@ -0,0 +1,26 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface CategoryRule { + preceding_operator?: CategoryRule.preceding_operator; + comparator?: CategoryRule.comparator; +} + +export namespace CategoryRule { + + export enum preceding_operator { + OR = 'or', + AND = 'and', + } + + export enum comparator { + INCLUDES = 'includes', + NOT_INCLUDES = 'not_includes', + EQUALS = 'equals', + NOT_EQUALS = 'not_equals', + } + + +} \ No newline at end of file diff --git a/src/api-types/models/CheckConcurrentStreamRequest.ts b/src/api-types/models/CheckConcurrentStreamRequest.ts new file mode 100644 index 0000000..416ab37 --- /dev/null +++ b/src/api-types/models/CheckConcurrentStreamRequest.ts @@ -0,0 +1,11 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface CheckConcurrentStreamRequest { + /** + * UID of the concurrent stream + */ + uid: string; +} \ No newline at end of file diff --git a/src/api-types/models/CheckConcurrentStreamResponse.ts b/src/api-types/models/CheckConcurrentStreamResponse.ts new file mode 100644 index 0000000..bd4c70d --- /dev/null +++ b/src/api-types/models/CheckConcurrentStreamResponse.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import { ConcurrentStream } from './ConcurrentStream'; + +export interface CheckConcurrentStreamResponse { + stream: ConcurrentStream; +} \ No newline at end of file diff --git a/src/api-types/models/ConcurrentStream.ts b/src/api-types/models/ConcurrentStream.ts new file mode 100644 index 0000000..19eab7d --- /dev/null +++ b/src/api-types/models/ConcurrentStream.ts @@ -0,0 +1,10 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface ConcurrentStream { + playback_timestamp?: number; + unix_timestamp?: number; + playing?: boolean; +} \ No newline at end of file diff --git a/src/api-types/models/CreateCategoryRequest.ts b/src/api-types/models/CreateCategoryRequest.ts new file mode 100644 index 0000000..0871041 --- /dev/null +++ b/src/api-types/models/CreateCategoryRequest.ts @@ -0,0 +1,8 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface CreateCategoryRequest { + name: string; +} \ No newline at end of file diff --git a/src/api-types/models/CreateCategoryResponse.ts b/src/api-types/models/CreateCategoryResponse.ts new file mode 100644 index 0000000..16efded --- /dev/null +++ b/src/api-types/models/CreateCategoryResponse.ts @@ -0,0 +1,10 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import { Category } from './Category'; + +export interface CreateCategoryResponse { + new_category?: Category; + success?: boolean; +} \ No newline at end of file diff --git a/src/api-types/models/DBInfoResponse.ts b/src/api-types/models/DBInfoResponse.ts new file mode 100644 index 0000000..543f12b --- /dev/null +++ b/src/api-types/models/DBInfoResponse.ts @@ -0,0 +1,18 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import { TableInfo } from './TableInfo'; + +export interface DBInfoResponse { + using_local_db?: boolean; + stats_by_table?: { +files?: TableInfo, +playlists?: TableInfo, +categories?: TableInfo, +subscriptions?: TableInfo, +users?: TableInfo, +roles?: TableInfo, +download_queue?: TableInfo, +}; +} \ No newline at end of file diff --git a/src/api-types/models/DeleteCategoryRequest.ts b/src/api-types/models/DeleteCategoryRequest.ts new file mode 100644 index 0000000..37db8d5 --- /dev/null +++ b/src/api-types/models/DeleteCategoryRequest.ts @@ -0,0 +1,8 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface DeleteCategoryRequest { + category_uid: string; +} \ No newline at end of file diff --git a/src/api-types/models/DownloadFileRequest.ts b/src/api-types/models/DownloadFileRequest.ts index 0bee9d2..0986e59 100644 --- a/src/api-types/models/DownloadFileRequest.ts +++ b/src/api-types/models/DownloadFileRequest.ts @@ -4,11 +4,8 @@ export interface DownloadFileRequest { - uid: string; + uid?: string; uuid?: string; sub_id?: string; - /** - * Only used for subscriptions - */ - is_playlist?: boolean; + playlist_id?: string; } \ No newline at end of file diff --git a/src/api-types/models/DownloadTwitchChatByVODIDRequest.ts b/src/api-types/models/DownloadTwitchChatByVODIDRequest.ts new file mode 100644 index 0000000..01ff2c5 --- /dev/null +++ b/src/api-types/models/DownloadTwitchChatByVODIDRequest.ts @@ -0,0 +1,26 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import { FileType } from './FileType'; +import { Subscription } from './Subscription'; + +export interface DownloadTwitchChatByVODIDRequest { + /** + * File ID + */ + id: string; + /** + * ID of the VOD + */ + vodId: string; + type: FileType; + /** + * User UID + */ + uuid?: string; + /** + * Subscription + */ + sub?: Subscription; +} \ No newline at end of file diff --git a/src/api-types/models/DownloadTwitchChatByVODIDResponse.ts b/src/api-types/models/DownloadTwitchChatByVODIDResponse.ts new file mode 100644 index 0000000..9771759 --- /dev/null +++ b/src/api-types/models/DownloadTwitchChatByVODIDResponse.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import { TwitchChatMessage } from './TwitchChatMessage'; + +export interface DownloadTwitchChatByVODIDResponse { + chat: Array; +} \ No newline at end of file diff --git a/src/api-types/models/GenerateArgsResponse.ts b/src/api-types/models/GenerateArgsResponse.ts new file mode 100644 index 0000000..953a57c --- /dev/null +++ b/src/api-types/models/GenerateArgsResponse.ts @@ -0,0 +1,8 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface GenerateArgsResponse { + args?: Array; +} \ No newline at end of file diff --git a/src/api-types/models/GetAllCategoriesResponse.ts b/src/api-types/models/GetAllCategoriesResponse.ts new file mode 100644 index 0000000..e34671d --- /dev/null +++ b/src/api-types/models/GetAllCategoriesResponse.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import { Category } from './Category'; + +export interface GetAllCategoriesResponse { + categories: Array; +} \ No newline at end of file diff --git a/src/api-types/models/GetAllDownloadsRequest.ts b/src/api-types/models/GetAllDownloadsRequest.ts new file mode 100644 index 0000000..5d26f57 --- /dev/null +++ b/src/api-types/models/GetAllDownloadsRequest.ts @@ -0,0 +1,11 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface GetAllDownloadsRequest { + /** + * Filters downloads with the array + */ + uids?: Array | null; +} \ No newline at end of file diff --git a/src/api-types/models/GetFileFormatsRequest.ts b/src/api-types/models/GetFileFormatsRequest.ts new file mode 100644 index 0000000..1ea3502 --- /dev/null +++ b/src/api-types/models/GetFileFormatsRequest.ts @@ -0,0 +1,8 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface GetFileFormatsRequest { + url?: string; +} \ No newline at end of file diff --git a/src/api-types/models/GetFileFormatsResponse.ts b/src/api-types/models/GetFileFormatsResponse.ts new file mode 100644 index 0000000..dc0f859 --- /dev/null +++ b/src/api-types/models/GetFileFormatsResponse.ts @@ -0,0 +1,12 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import { File } from './File'; + +export interface GetFileFormatsResponse { + success: boolean; + result: { +formats?: Array, +}; +} \ No newline at end of file diff --git a/src/api-types/models/GetFullTwitchChatRequest.ts b/src/api-types/models/GetFullTwitchChatRequest.ts new file mode 100644 index 0000000..6d6a3a6 --- /dev/null +++ b/src/api-types/models/GetFullTwitchChatRequest.ts @@ -0,0 +1,22 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import { FileType } from './FileType'; +import { Subscription } from './Subscription'; + +export interface GetFullTwitchChatRequest { + /** + * File ID + */ + id: string; + type: FileType; + /** + * User UID + */ + uuid?: string; + /** + * Subscription + */ + sub?: Subscription; +} \ No newline at end of file diff --git a/src/api-types/models/GetFullTwitchChatResponse.ts b/src/api-types/models/GetFullTwitchChatResponse.ts new file mode 100644 index 0000000..3bd27f7 --- /dev/null +++ b/src/api-types/models/GetFullTwitchChatResponse.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface GetFullTwitchChatResponse { + success: boolean; + error?: string; +} \ No newline at end of file diff --git a/src/api-types/models/GetLogsRequest.ts b/src/api-types/models/GetLogsRequest.ts new file mode 100644 index 0000000..170ce8b --- /dev/null +++ b/src/api-types/models/GetLogsRequest.ts @@ -0,0 +1,8 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface GetLogsRequest { + lines?: number; +} \ No newline at end of file diff --git a/src/api-types/models/GetLogsResponse.ts b/src/api-types/models/GetLogsResponse.ts new file mode 100644 index 0000000..2acf83a --- /dev/null +++ b/src/api-types/models/GetLogsResponse.ts @@ -0,0 +1,12 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface GetLogsResponse { + /** + * Number of lines to retrieve from the bottom + */ + logs?: string; + success?: boolean; +} \ No newline at end of file diff --git a/src/api-types/models/IncrementViewCountRequest.ts b/src/api-types/models/IncrementViewCountRequest.ts new file mode 100644 index 0000000..1294d10 --- /dev/null +++ b/src/api-types/models/IncrementViewCountRequest.ts @@ -0,0 +1,13 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface IncrementViewCountRequest { + file_uid: string; + sub_id?: string; + /** + * User UID + */ + uuid?: string; +} \ No newline at end of file diff --git a/src/api-types/models/TableInfo.ts b/src/api-types/models/TableInfo.ts new file mode 100644 index 0000000..244c1a9 --- /dev/null +++ b/src/api-types/models/TableInfo.ts @@ -0,0 +1,8 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface TableInfo { + records_count?: number; +} \ No newline at end of file diff --git a/src/api-types/models/TestConnectionStringRequest.ts b/src/api-types/models/TestConnectionStringRequest.ts new file mode 100644 index 0000000..156c01f --- /dev/null +++ b/src/api-types/models/TestConnectionStringRequest.ts @@ -0,0 +1,11 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface TestConnectionStringRequest { + /** + * MongoDB connection string + */ + connection_string: string; +} \ No newline at end of file diff --git a/src/api-types/models/TestConnectionStringResponse.ts b/src/api-types/models/TestConnectionStringResponse.ts new file mode 100644 index 0000000..0cd0573 --- /dev/null +++ b/src/api-types/models/TestConnectionStringResponse.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface TestConnectionStringResponse { + success: boolean; + error?: string; +} \ No newline at end of file diff --git a/src/api-types/models/TransferDBRequest.ts b/src/api-types/models/TransferDBRequest.ts new file mode 100644 index 0000000..fd14f56 --- /dev/null +++ b/src/api-types/models/TransferDBRequest.ts @@ -0,0 +1,11 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface TransferDBRequest { + /** + * True if transfering DB from Local to MongoDB, false if transferring DB from MongoDB to Local + */ + local_to_remote: boolean; +} \ No newline at end of file diff --git a/src/api-types/models/TransferDBResponse.ts b/src/api-types/models/TransferDBResponse.ts new file mode 100644 index 0000000..d8cc1c5 --- /dev/null +++ b/src/api-types/models/TransferDBResponse.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface TransferDBResponse { + success: boolean; + error?: string; +} \ No newline at end of file diff --git a/src/api-types/models/TwitchChatMessage.ts b/src/api-types/models/TwitchChatMessage.ts new file mode 100644 index 0000000..76da85f --- /dev/null +++ b/src/api-types/models/TwitchChatMessage.ts @@ -0,0 +1,18 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface TwitchChatMessage { + created_at?: string; + content_offset_seconds?: number; + commenter?: { +name?: string, +_id?: string, +created_at?: string, +}; + message?: { +body?: string, +user_color?: string, +}; +} \ No newline at end of file diff --git a/src/api-types/models/UpdateCategoriesRequest.ts b/src/api-types/models/UpdateCategoriesRequest.ts new file mode 100644 index 0000000..cbb3436 --- /dev/null +++ b/src/api-types/models/UpdateCategoriesRequest.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import { Category } from './Category'; + +export interface UpdateCategoriesRequest { + categories: Array; +} \ No newline at end of file diff --git a/src/api-types/models/UpdateCategoryRequest.ts b/src/api-types/models/UpdateCategoryRequest.ts new file mode 100644 index 0000000..273bde1 --- /dev/null +++ b/src/api-types/models/UpdateCategoryRequest.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import { Category } from './Category'; + +export interface UpdateCategoryRequest { + category: Category; +} \ No newline at end of file diff --git a/src/api-types/models/UpdateConcurrentStreamRequest.ts b/src/api-types/models/UpdateConcurrentStreamRequest.ts new file mode 100644 index 0000000..2a8f9e4 --- /dev/null +++ b/src/api-types/models/UpdateConcurrentStreamRequest.ts @@ -0,0 +1,12 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import { ConcurrentStream } from './ConcurrentStream'; + +export interface UpdateConcurrentStreamRequest extends ConcurrentStream { + /** + * Concurrent stream UID + */ + uid: string; +} \ No newline at end of file diff --git a/src/api-types/models/UpdateConcurrentStreamResponse.ts b/src/api-types/models/UpdateConcurrentStreamResponse.ts new file mode 100644 index 0000000..b1d32e8 --- /dev/null +++ b/src/api-types/models/UpdateConcurrentStreamResponse.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import { ConcurrentStream } from './ConcurrentStream'; + +export interface UpdateConcurrentStreamResponse { + stream: ConcurrentStream; +} \ No newline at end of file diff --git a/src/api-types/models/Version.ts b/src/api-types/models/Version.ts new file mode 100644 index 0000000..5049571 --- /dev/null +++ b/src/api-types/models/Version.ts @@ -0,0 +1,11 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + + +export interface Version { + type?: string; + tag?: string; + commit?: string; + date?: string; +} \ No newline at end of file diff --git a/src/api-types/models/VersionInfoResponse.ts b/src/api-types/models/VersionInfoResponse.ts new file mode 100644 index 0000000..369927b --- /dev/null +++ b/src/api-types/models/VersionInfoResponse.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import { Version } from './Version'; + +export interface VersionInfoResponse { + version_info: Version; +} \ No newline at end of file diff --git a/src/app/main/main.component.ts b/src/app/main/main.component.ts index 08906bd..69e5eb7 100644 --- a/src/app/main/main.component.ts +++ b/src/app/main/main.component.ts @@ -597,7 +597,7 @@ export class MainComponent implements OnInit { } } - this.postsService.generateArgs(this.url, type, (this.selectedQuality === '' ? null : this.selectedQuality), + this.postsService.generateArgs(this.url, type as FileType, (this.selectedQuality === '' ? null : this.selectedQuality), customQualityConfiguration, customArgs, additionalArgs, customOutput, youtubeUsername, youtubePassword, cropFileSettings).subscribe(res => { const simulated_args = res['args']; if (simulated_args) { diff --git a/src/app/posts.services.ts b/src/app/posts.services.ts index 56cc403..df2f069 100644 --- a/src/app/posts.services.ts +++ b/src/app/posts.services.ts @@ -61,6 +61,35 @@ import { UpdateUserRequest, UserPermission, YesNo, + GenerateArgsResponse, + GetPlaylistsRequest, + UpdateCategoryRequest, + UpdateCategoriesRequest, + DeleteCategoryRequest, + CreateCategoryRequest, + CreateCategoryResponse, + GetAllCategoriesResponse, + AddFileToPlaylistRequest, + IncrementViewCountRequest, + GetLogsRequest, + GetLogsResponse, + UpdateConcurrentStreamResponse, + UpdateConcurrentStreamRequest, + CheckConcurrentStreamRequest, + CheckConcurrentStreamResponse, + DownloadTwitchChatByVODIDRequest, + DownloadTwitchChatByVODIDResponse, + GetFullTwitchChatRequest, + GetFullTwitchChatResponse, + GetAllDownloadsRequest, + TestConnectionStringRequest, + TestConnectionStringResponse, + TransferDBRequest, + TransferDBResponse, + VersionInfoResponse, + DBInfoResponse, + GetFileFormatsRequest, + GetFileFormatsResponse, } from '../api-types'; import { isoLangs } from './settings/locales_list'; import { Title } from '@angular/platform-browser'; @@ -243,37 +272,40 @@ export class PostsService implements CanActivate { return this.http.post(this.path + 'downloadFile', body, this.httpOptions); } - generateArgs(url: string, type: string, selectedQuality: string, customQualityConfiguration: string, customArgs: string = null, additionalArgs: string = null, customOutput: string = null, youtubeUsername: string = null, youtubePassword: string = null, cropFileSettings = null) { - return this.http.post(this.path + 'generateArgs', {url: url, - selectedHeight: selectedQuality, - customQualityConfiguration: customQualityConfiguration, - customArgs: customArgs, - additionalArgs: additionalArgs, - customOutput: customOutput, - youtubeUsername: youtubeUsername, - youtubePassword: youtubePassword, - type: type, - cropFileSettings: cropFileSettings}, this.httpOptions); + generateArgs(url: string, type: FileType, selectedQuality: string, customQualityConfiguration: string, customArgs: string = null, additionalArgs: string = null, customOutput: string = null, youtubeUsername: string = null, youtubePassword: string = null, cropFileSettings = null) { + const body: DownloadRequest = {url: url, + selectedHeight: selectedQuality, + customQualityConfiguration: customQualityConfiguration, + customArgs: customArgs, + additionalArgs: additionalArgs, + customOutput: customOutput, + youtubeUsername: youtubeUsername, + youtubePassword: youtubePassword, + type: type, + cropFileSettings: cropFileSettings} + return this.http.post(this.path + 'generateArgs', body, this.httpOptions); } getDBInfo() { - return this.http.post(this.path + 'getDBInfo', {}, this.httpOptions); + return this.http.get(this.path + 'getDBInfo', this.httpOptions); } transferDB(local_to_remote) { - return this.http.post(this.path + 'transferDB', {local_to_remote: local_to_remote}, this.httpOptions); + const body: TransferDBRequest = {local_to_remote: local_to_remote}; + return this.http.post(this.path + 'transferDB', body, this.httpOptions); } - testConnectionString(connection_string) { - return this.http.post(this.path + 'testConnectionString', {connection_string: connection_string}, this.httpOptions); + testConnectionString(connection_string: string) { + const body: TestConnectionStringRequest = {connection_string: connection_string}; + return this.http.post(this.path + 'testConnectionString', body, this.httpOptions); } killAllDownloads() { - return this.http.post(this.path + 'killAllDownloads', {}, this.httpOptions); + return this.http.post(this.path + 'killAllDownloads', {}, this.httpOptions); } restartServer() { - return this.http.post(this.path + 'restartServer', {}, this.httpOptions); + return this.http.post(this.path + 'restartServer', {}, this.httpOptions); } loadNavItems() { @@ -319,54 +351,51 @@ export class PostsService implements CanActivate { return this.http.post(this.path + 'getAllFiles', {sort: sort, range: range, text_search: text_search, file_type_filter: file_type_filter}, this.httpOptions); } - downloadFileFromServer(uid: string, uuid: string = null, sub_id: string = null, is_playlist: boolean = null) { + downloadFileFromServer(uid: string, uuid: string = null, sub_id: string = null) { const body: DownloadFileRequest = { uid: uid, uuid: uuid, - sub_id: sub_id, - is_playlist: is_playlist + sub_id: sub_id }; return this.http.post(this.path + 'downloadFile', body, {responseType: 'blob', params: this.httpOptions.params}); } getFullTwitchChat(id, type, uuid = null, sub = null) { - return this.http.post(this.path + 'getFullTwitchChat', {id: id, type: type, uuid: uuid, sub: sub}, this.httpOptions); + const body: GetFullTwitchChatRequest = {id: id, type: type, uuid: uuid, sub: sub}; + return this.http.post(this.path + 'getFullTwitchChat', body, this.httpOptions); } downloadTwitchChat(id, type, vodId, uuid = null, sub = null) { - return this.http.post(this.path + 'downloadTwitchChatByVODID', {id: id, type: type, vodId: vodId, uuid: uuid, sub: sub}, this.httpOptions); + const body: DownloadTwitchChatByVODIDRequest = {id: id, type: type, vodId: vodId, uuid: uuid, sub: sub}; + return this.http.post(this.path + 'downloadTwitchChatByVODID', body, this.httpOptions); } downloadPlaylistFromServer(playlist_id, uuid = null) { - return this.http.post(this.path + 'downloadFileFromServer', { - uuid: uuid, - playlist_id: playlist_id - }, - {responseType: 'blob', params: this.httpOptions.params}); + const body: DownloadFileRequest = {uuid: uuid, playlist_id: playlist_id}; + return this.http.post(this.path + 'downloadFileFromServer', body, {responseType: 'blob', params: this.httpOptions.params}); } downloadSubFromServer(sub_id, uuid = null) { - return this.http.post(this.path + 'downloadFileFromServer', { - uuid: uuid, - sub_id: sub_id - }, - {responseType: 'blob', params: this.httpOptions.params}); + const body: DownloadFileRequest = {uuid: uuid, sub_id: sub_id}; + return this.http.post(this.path + 'downloadFileFromServer', body, {responseType: 'blob', params: this.httpOptions.params}); } checkConcurrentStream(uid) { - return this.http.post(this.path + 'checkConcurrentStream', {uid: uid}, this.httpOptions); + const body: CheckConcurrentStreamRequest = {uid: uid}; + return this.http.post(this.path + 'checkConcurrentStream', body, this.httpOptions); } updateConcurrentStream(uid, playback_timestamp, unix_timestamp, playing) { - return this.http.post(this.path + 'updateConcurrentStream', {uid: uid, - playback_timestamp: playback_timestamp, - unix_timestamp: unix_timestamp, - playing: playing}, this.httpOptions); + const body: UpdateConcurrentStreamRequest = {uid: uid, + playback_timestamp: playback_timestamp, + unix_timestamp: unix_timestamp, + playing: playing}; + return this.http.post(this.path + 'updateConcurrentStream', body, this.httpOptions); } uploadCookiesFile(fileFormData) { - return this.http.post(this.path + 'uploadCookies', fileFormData, this.httpOptions); + return this.http.post(this.path + 'uploadCookies', fileFormData, this.httpOptions); } downloadArchive(sub) { @@ -375,15 +404,17 @@ export class PostsService implements CanActivate { } getFileFormats(url) { - return this.http.post(this.path + 'getFileFormats', {url: url}, this.httpOptions); + const body: GetFileFormatsRequest = {url: url}; + return this.http.post(this.path + 'getFileFormats', body, this.httpOptions); } getLogs(lines = 50) { - return this.http.post(this.path + 'logs', {lines: lines}, this.httpOptions); + const body: GetLogsRequest = {lines: lines}; + return this.http.post(this.path + 'logs', body, this.httpOptions); } clearAllLogs() { - return this.http.post(this.path + 'clearAllLogs', {}, this.httpOptions); + return this.http.post(this.path + 'clearAllLogs', {}, this.httpOptions); } generateNewAPIKey() { @@ -415,11 +446,12 @@ export class PostsService implements CanActivate { } incrementViewCount(file_uid, sub_id, uuid) { - return this.http.post(this.path + 'incrementViewCount', {file_uid: file_uid, sub_id: sub_id, uuid: uuid}, this.httpOptions); + const body: IncrementViewCountRequest = {file_uid: file_uid, sub_id: sub_id, uuid: uuid}; + return this.http.post(this.path + 'incrementViewCount', body, this.httpOptions); } getPlaylists() { - return this.http.post(this.path + 'getPlaylists', {}, this.httpOptions); + return this.http.post(this.path + 'getPlaylists', {}, this.httpOptions); } updatePlaylist(playlist: Playlist) { @@ -439,31 +471,34 @@ export class PostsService implements CanActivate { } addFileToPlaylist(playlist_id, file_uid) { - return this.http.post(this.path + 'addFileToPlaylist', {playlist_id: playlist_id, - file_uid: file_uid}, - this.httpOptions); + const body: AddFileToPlaylistRequest = {playlist_id: playlist_id, file_uid: file_uid} + return this.http.post(this.path + 'addFileToPlaylist', body, this.httpOptions); } // categories getAllCategories() { - return this.http.post(this.path + 'getAllCategories', {}, this.httpOptions); + return this.http.post(this.path + 'getAllCategories', {}, this.httpOptions); } createCategory(name) { - return this.http.post(this.path + 'createCategory', {name: name}, this.httpOptions); + const body: CreateCategoryRequest = {name: name}; + return this.http.post(this.path + 'createCategory', body, this.httpOptions); } deleteCategory(category_uid) { - return this.http.post(this.path + 'deleteCategory', {category_uid: category_uid}, this.httpOptions); + const body: DeleteCategoryRequest = {category_uid: category_uid}; + return this.http.post(this.path + 'deleteCategory', body, this.httpOptions); } updateCategory(category) { - return this.http.post(this.path + 'updateCategory', {category: category}, this.httpOptions); + const body: UpdateCategoryRequest = {category: category}; + return this.http.post(this.path + 'updateCategory', body, this.httpOptions); } updateCategories(categories) { - return this.http.post(this.path + 'updateCategories', {categories: categories}, this.httpOptions); + const body: UpdateCategoriesRequest = {categories: categories}; + return this.http.post(this.path + 'updateCategories', body, this.httpOptions); } reloadCategories() { @@ -474,7 +509,7 @@ export class PostsService implements CanActivate { updateSubscription(subscription) { delete subscription['videos']; - return this.http.post(this.path + 'updateSubscription', {subscription: subscription}, this.httpOptions); + return this.http.post(this.path + 'updateSubscription', {subscription: subscription}, this.httpOptions); } unsubscribe(sub: SubscriptionRequestData, deleteMode = false) { @@ -498,7 +533,8 @@ export class PostsService implements CanActivate { } getCurrentDownloads(uids: Array = null) { - return this.http.post(this.path + 'downloads', {uids: uids}, this.httpOptions); + const body: GetAllDownloadsRequest = {uids: uids}; + return this.http.post(this.path + 'downloads', body, this.httpOptions); } getCurrentDownload(download_uid: string) { @@ -507,39 +543,39 @@ export class PostsService implements CanActivate { } pauseDownload(download_uid) { - return this.http.post(this.path + 'pauseDownload', {download_uid: download_uid}, this.httpOptions); + return this.http.post(this.path + 'pauseDownload', {download_uid: download_uid}, this.httpOptions); } pauseAllDownloads() { - return this.http.post(this.path + 'pauseAllDownloads', {}, this.httpOptions); + return this.http.post(this.path + 'pauseAllDownloads', {}, this.httpOptions); } resumeDownload(download_uid) { - return this.http.post(this.path + 'resumeDownload', {download_uid: download_uid}, this.httpOptions); + return this.http.post(this.path + 'resumeDownload', {download_uid: download_uid}, this.httpOptions); } resumeAllDownloads() { - return this.http.post(this.path + 'resumeAllDownloads', {}, this.httpOptions); + return this.http.post(this.path + 'resumeAllDownloads', {}, this.httpOptions); } restartDownload(download_uid) { - return this.http.post(this.path + 'restartDownload', {download_uid: download_uid}, this.httpOptions); + return this.http.post(this.path + 'restartDownload', {download_uid: download_uid}, this.httpOptions); } cancelDownload(download_uid) { - return this.http.post(this.path + 'cancelDownload', {download_uid: download_uid}, this.httpOptions); + return this.http.post(this.path + 'cancelDownload', {download_uid: download_uid}, this.httpOptions); } clearDownload(download_uid) { - return this.http.post(this.path + 'clearDownload', {download_uid: download_uid}, this.httpOptions); + return this.http.post(this.path + 'clearDownload', {download_uid: download_uid}, this.httpOptions); } clearFinishedDownloads() { - return this.http.post(this.path + 'clearFinishedDownloads', {}, this.httpOptions); + return this.http.post(this.path + 'clearFinishedDownloads', {}, this.httpOptions); } getVersionInfo() { - return this.http.get(this.path + 'versionInfo', this.httpOptions); + return this.http.get(this.path + 'versionInfo', this.httpOptions); } updateServer(tag: string) {