mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-15 23:41:28 +03:00
Add additional named types
This commit is contained in:
@@ -395,7 +395,7 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/body_14'
|
$ref: '#/components/schemas/DeleteMp3Mp4Request'
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: OK
|
description: OK
|
||||||
@@ -436,7 +436,7 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/body_16'
|
$ref: '#/components/schemas/DeleteFileRequest'
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: OK
|
description: OK
|
||||||
@@ -581,7 +581,7 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/body_21'
|
$ref: '#/components/schemas/DeleteMp3Mp4Request'
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: OK
|
description: OK
|
||||||
@@ -637,33 +637,7 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
$ref: '#/components/schemas/GetAllDownloadsResponse'
|
||||||
properties:
|
|
||||||
downloads:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
uid:
|
|
||||||
type: string
|
|
||||||
downloading:
|
|
||||||
type: boolean
|
|
||||||
complete:
|
|
||||||
type: boolean
|
|
||||||
url:
|
|
||||||
type: string
|
|
||||||
type:
|
|
||||||
type: string
|
|
||||||
percent_complete:
|
|
||||||
type: string
|
|
||||||
is_playlist:
|
|
||||||
type: boolean
|
|
||||||
timestamp_start:
|
|
||||||
type: number
|
|
||||||
timestamp_end:
|
|
||||||
type: number
|
|
||||||
fileNames:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
operationId: get-api-downloads
|
operationId: get-api-downloads
|
||||||
description: Retrieves all downloads recorded by the server and their status.
|
description: Retrieves all downloads recorded by the server and their status.
|
||||||
security:
|
security:
|
||||||
@@ -678,46 +652,12 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
$ref: '#/components/schemas/GetDownloadResponse'
|
||||||
properties:
|
|
||||||
download:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
uid:
|
|
||||||
type: string
|
|
||||||
downloading:
|
|
||||||
type: boolean
|
|
||||||
complete:
|
|
||||||
type: boolean
|
|
||||||
url:
|
|
||||||
type: string
|
|
||||||
type:
|
|
||||||
type: string
|
|
||||||
percent_complete:
|
|
||||||
type: string
|
|
||||||
is_playlist:
|
|
||||||
type: boolean
|
|
||||||
timestamp_start:
|
|
||||||
type: number
|
|
||||||
timestamp_end:
|
|
||||||
type: number
|
|
||||||
fileNames:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
$ref: '#/components/schemas/GetDownloadRequest'
|
||||||
properties:
|
|
||||||
session_id:
|
|
||||||
type: string
|
|
||||||
download_id:
|
|
||||||
type: string
|
|
||||||
required:
|
|
||||||
- session_id
|
|
||||||
- download_id
|
|
||||||
description: ''
|
description: ''
|
||||||
description: "Gets a single download using its download_id and session_id. session_id is the device fingerprint. If none was provided at the time of download, then set session_id is 'undeclared'."
|
description: "Gets a single download using its download_id and session_id. session_id is the device fingerprint. If none was provided at the time of download, then set session_id is 'undeclared'."
|
||||||
security:
|
security:
|
||||||
@@ -809,6 +749,10 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: OK
|
description: OK
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/SuccessObject'
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
@@ -816,8 +760,12 @@ paths:
|
|||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
change_object:
|
change_object:
|
||||||
|
required:
|
||||||
|
- uid
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
uid:
|
||||||
|
type: string
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
role:
|
role:
|
||||||
@@ -839,10 +787,7 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
$ref: '#/components/schemas/SuccessObject'
|
||||||
properties:
|
|
||||||
success:
|
|
||||||
type: boolean
|
|
||||||
description: Deletes a user by its uid.
|
description: Deletes a user by its uid.
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
content:
|
||||||
@@ -879,14 +824,14 @@ paths:
|
|||||||
permissions:
|
permissions:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: string
|
$ref: '#/components/schemas/UserPermission'
|
||||||
user:
|
user:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
permissions:
|
permissions:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: string
|
$ref: '#/components/schemas/UserPermission'
|
||||||
description: Gets the available roles and their permissions
|
description: Gets the available roles and their permissions
|
||||||
security:
|
security:
|
||||||
- Auth query parameter: []
|
- Auth query parameter: []
|
||||||
@@ -902,10 +847,7 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
$ref: '#/components/schemas/SuccessObject'
|
||||||
properties:
|
|
||||||
success:
|
|
||||||
type: boolean
|
|
||||||
description: "Changes the permissions for a user. Available values for each permission are: `default`, `yes`, and `no`. `default` will use the user's role's default permission."
|
description: "Changes the permissions for a user. Available values for each permission are: `default`, `yes`, and `no`. `default` will use the user's role's default permission."
|
||||||
security:
|
security:
|
||||||
- Auth query parameter: []
|
- Auth query parameter: []
|
||||||
@@ -913,18 +855,7 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
$ref: '#/components/schemas/ChangeUserPermissionsRequest'
|
||||||
properties:
|
|
||||||
user_uid:
|
|
||||||
type: string
|
|
||||||
permission:
|
|
||||||
type: string
|
|
||||||
new_value:
|
|
||||||
type: string
|
|
||||||
required:
|
|
||||||
- user_uid
|
|
||||||
- permission
|
|
||||||
- new_value
|
|
||||||
tags:
|
tags:
|
||||||
- multi-user mode
|
- multi-user mode
|
||||||
/api/changeRolePermissions:
|
/api/changeRolePermissions:
|
||||||
@@ -937,26 +868,12 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
$ref: '#/components/schemas/SuccessObject'
|
||||||
properties:
|
|
||||||
success:
|
|
||||||
type: boolean
|
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
$ref: '#/components/schemas/ChangeRolePermissionsRequest'
|
||||||
properties:
|
|
||||||
role:
|
|
||||||
type: string
|
|
||||||
permission:
|
|
||||||
type: string
|
|
||||||
new_value:
|
|
||||||
type: string
|
|
||||||
required:
|
|
||||||
- role
|
|
||||||
- permission
|
|
||||||
- new_value
|
|
||||||
description: 'Changes the permissions for a role. Available values for each permission are: `yes`, and `no`.'
|
description: 'Changes the permissions for a role. Available values for each permission are: `yes`, and `no`.'
|
||||||
security:
|
security:
|
||||||
- Auth query parameter: []
|
- Auth query parameter: []
|
||||||
@@ -985,6 +902,13 @@ paths:
|
|||||||
- multi-user mode
|
- multi-user mode
|
||||||
components:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
|
SuccessObject:
|
||||||
|
required:
|
||||||
|
- success
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
success:
|
||||||
|
type: boolean
|
||||||
FileType:
|
FileType:
|
||||||
type: string
|
type: string
|
||||||
enum:
|
enum:
|
||||||
@@ -1064,6 +988,33 @@ components:
|
|||||||
properties:
|
properties:
|
||||||
videopathEncoded:
|
videopathEncoded:
|
||||||
type: string
|
type: string
|
||||||
|
GetDownloadRequest:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
session_id:
|
||||||
|
type: string
|
||||||
|
download_id:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- session_id
|
||||||
|
- download_id
|
||||||
|
GetDownloadResponse:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
download:
|
||||||
|
$ref: '#/components/schemas/Download'
|
||||||
|
nullable: true
|
||||||
|
GetAllDownloadsResponse:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
downloads:
|
||||||
|
type: object
|
||||||
|
description: Map of Session ID to inner map
|
||||||
|
additionalProperties:
|
||||||
|
type: object
|
||||||
|
description: Map of Download UID to downoad
|
||||||
|
additionalProperties:
|
||||||
|
$ref: '#/components/schemas/Download'
|
||||||
GetMp3sResponse:
|
GetMp3sResponse:
|
||||||
required:
|
required:
|
||||||
- mp3s
|
- mp3s
|
||||||
@@ -1370,13 +1321,6 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
type:
|
type:
|
||||||
type: string
|
type: string
|
||||||
body_14:
|
|
||||||
required:
|
|
||||||
- uid
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
uid:
|
|
||||||
type: string
|
|
||||||
body_15:
|
body_15:
|
||||||
required:
|
required:
|
||||||
- fileNames
|
- fileNames
|
||||||
@@ -1402,7 +1346,7 @@ components:
|
|||||||
subscriptionPlaylist:
|
subscriptionPlaylist:
|
||||||
type: boolean
|
type: boolean
|
||||||
description: Only used for subscriptions
|
description: Only used for subscriptions
|
||||||
body_16:
|
DeleteFileRequest:
|
||||||
required:
|
required:
|
||||||
- fileName
|
- fileName
|
||||||
- type
|
- type
|
||||||
@@ -1411,7 +1355,7 @@ components:
|
|||||||
fileName:
|
fileName:
|
||||||
type: string
|
type: string
|
||||||
type:
|
type:
|
||||||
type: string
|
$ref: '#/components/schemas/FileType'
|
||||||
apidownloadArchive_sub:
|
apidownloadArchive_sub:
|
||||||
required:
|
required:
|
||||||
- archive_dir
|
- archive_dir
|
||||||
@@ -1470,13 +1414,15 @@ components:
|
|||||||
new_api_key:
|
new_api_key:
|
||||||
type: string
|
type: string
|
||||||
example: 4241b401-7236-493e-92b5-b72696b9d853
|
example: 4241b401-7236-493e-92b5-b72696b9d853
|
||||||
body_21:
|
DeleteMp3Mp4Request:
|
||||||
required:
|
required:
|
||||||
- uid
|
- uid
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
uid:
|
uid:
|
||||||
type: string
|
type: string
|
||||||
|
blacklistMode:
|
||||||
|
type: boolean
|
||||||
inline_response_200_17:
|
inline_response_200_17:
|
||||||
required:
|
required:
|
||||||
- config_file
|
- config_file
|
||||||
@@ -1552,6 +1498,49 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
thumbnailURL:
|
thumbnailURL:
|
||||||
type: string
|
type: string
|
||||||
|
Download:
|
||||||
|
required:
|
||||||
|
- uid
|
||||||
|
- ui_uid
|
||||||
|
- downloading
|
||||||
|
- complete
|
||||||
|
- url
|
||||||
|
- type
|
||||||
|
- percent_complete
|
||||||
|
- is_playlist
|
||||||
|
- timestamp_start
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
uid:
|
||||||
|
type: string
|
||||||
|
ui_uid:
|
||||||
|
type: string
|
||||||
|
downloading:
|
||||||
|
type: boolean
|
||||||
|
complete:
|
||||||
|
type: boolean
|
||||||
|
url:
|
||||||
|
type: string
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
percent_complete:
|
||||||
|
type: number
|
||||||
|
is_playlist:
|
||||||
|
type: boolean
|
||||||
|
timestamp_start:
|
||||||
|
type: number
|
||||||
|
timestamp_end:
|
||||||
|
type: number
|
||||||
|
filesize:
|
||||||
|
type: number
|
||||||
|
nullable: true
|
||||||
|
error:
|
||||||
|
type: string
|
||||||
|
description: Error text, set if download fails.
|
||||||
|
fileNames:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
inline_response_200_6_new_sub:
|
inline_response_200_6_new_sub:
|
||||||
required:
|
required:
|
||||||
- id
|
- id
|
||||||
@@ -1674,11 +1663,51 @@ components:
|
|||||||
permissions:
|
permissions:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: string
|
$ref: '#/components/schemas/UserPermission'
|
||||||
permission_overrides:
|
permission_overrides:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: string
|
$ref: '#/components/schemas/UserPermission'
|
||||||
|
UserPermission:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- filemanager
|
||||||
|
- settings
|
||||||
|
- subscriptions
|
||||||
|
- sharing
|
||||||
|
- advanced_download
|
||||||
|
- downloads_manager
|
||||||
|
BaseChangePermissionsRequest:
|
||||||
|
required:
|
||||||
|
- permission
|
||||||
|
- new_value
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
permission:
|
||||||
|
$ref: '#/components/schemas/UserPermission'
|
||||||
|
new_value:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- 'yes'
|
||||||
|
- 'no'
|
||||||
|
ChangeUserPermissionsRequest:
|
||||||
|
allOf:
|
||||||
|
- $ref: '#/components/schemas/BaseChangePermissionsRequest'
|
||||||
|
- type: object
|
||||||
|
properties:
|
||||||
|
user_uid:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- user_uid
|
||||||
|
ChangeRolePermissionsRequest:
|
||||||
|
allOf:
|
||||||
|
- $ref: '#/components/schemas/BaseChangePermissionsRequest'
|
||||||
|
- type: object
|
||||||
|
properties:
|
||||||
|
role:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- role
|
||||||
file:
|
file:
|
||||||
title: file
|
title: file
|
||||||
type: object
|
type: object
|
||||||
|
|||||||
@@ -10,7 +10,10 @@ import { DOCUMENT } from '@angular/common';
|
|||||||
import { BehaviorSubject } from 'rxjs';
|
import { BehaviorSubject } from 'rxjs';
|
||||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||||
import * as Fingerprint2 from 'fingerprintjs2';
|
import * as Fingerprint2 from 'fingerprintjs2';
|
||||||
import type { FileType, GetAllFilesResponse, GetFileRequest, GetFileResponse, GetMp3sResponse, GetMp4sResponse, Mp3DownloadRequest, Mp3DownloadResponse, Mp4DownloadRequest, Mp4DownloadResponse } from 'api-types';
|
import type { DeleteMp3Mp4Request, FileType, GetAllFilesResponse, GetFileRequest, GetFileResponse, GetMp3sResponse, GetMp4sResponse, Mp3DownloadRequest, Mp3DownloadResponse, Mp4DownloadRequest, Mp4DownloadResponse } from 'api-types';
|
||||||
|
import { GetAllDownloadsResponse } from 'api-types/models/GetAllDownloadsResponse';
|
||||||
|
import { GetDownloadResponse } from 'api-types/models/GetDownloadResponse';
|
||||||
|
import { GetDownloadRequest } from 'api-types/models/GetDownloadRequest';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class PostsService implements CanActivate {
|
export class PostsService implements CanActivate {
|
||||||
@@ -203,10 +206,11 @@ export class PostsService implements CanActivate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
deleteFile(uid: string, isAudio: boolean, blacklistMode = false) {
|
deleteFile(uid: string, isAudio: boolean, blacklistMode = false) {
|
||||||
|
const body: DeleteMp3Mp4Request = {uid: uid, blacklistMode: blacklistMode}
|
||||||
if (isAudio) {
|
if (isAudio) {
|
||||||
return this.http.post(this.path + 'deleteMp3', {uid: uid, blacklistMode: blacklistMode}, this.httpOptions);
|
return this.http.post<boolean>(this.path + 'deleteMp3', body, this.httpOptions);
|
||||||
} else {
|
} else {
|
||||||
return this.http.post(this.path + 'deleteMp4', {uid: uid, blacklistMode: blacklistMode}, this.httpOptions);
|
return this.http.post<boolean>(this.path + 'deleteMp4', body, this.httpOptions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,12 +334,13 @@ export class PostsService implements CanActivate {
|
|||||||
|
|
||||||
// current downloads
|
// current downloads
|
||||||
getCurrentDownloads() {
|
getCurrentDownloads() {
|
||||||
return this.http.get(this.path + 'downloads', this.httpOptions);
|
return this.http.get<GetAllDownloadsResponse>(this.path + 'downloads', this.httpOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
// current download
|
// current download
|
||||||
getCurrentDownload(session_id, download_id) {
|
getCurrentDownload(session_id: string, download_id: string) {
|
||||||
return this.http.post(this.path + 'download', {download_id: download_id, session_id: session_id}, this.httpOptions);
|
const body: GetDownloadRequest = {download_id: download_id, session_id: session_id};
|
||||||
|
return this.http.post<GetDownloadResponse>(this.path + 'download', body, this.httpOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear downloads. download_id is optional, if it exists only 1 download will be cleared
|
// clear downloads. download_id is optional, if it exists only 1 download will be cleared
|
||||||
|
|||||||
Reference in New Issue
Block a user