mirror of
https://github.com/LukeHagar/plex-api-spec.git
synced 2025-12-10 04:20:52 +00:00
format project
This commit is contained in:
@@ -27,8 +27,8 @@ jobs:
|
||||
commit_message: "build: dereferenced Plex Media Server API Spec updated"
|
||||
skip_checkout: true
|
||||
skip_fetch: true
|
||||
add_options: '-f'
|
||||
file_pattern: './output/*.yaml'
|
||||
add_options: "-f"
|
||||
file_pattern: "./output/*.yaml"
|
||||
skip_dirty_check: true
|
||||
|
||||
- name: Pushes Dereferenced Specification File
|
||||
@@ -42,4 +42,3 @@ jobs:
|
||||
user_email: lukeslakemail@gmail.com
|
||||
user_name: lukehagar
|
||||
commit_message: Updating PMS Spec
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: 'Project Setup'
|
||||
description: 'Setup Bun and install dependencies'
|
||||
name: "Project Setup"
|
||||
description: "Setup Bun and install dependencies"
|
||||
runs:
|
||||
using: 'composite'
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
|
||||
@@ -5,13 +5,15 @@ Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/)
|
||||
An Open Source OpenAPI Specification for Plex Media Server
|
||||
|
||||
## Documentation
|
||||
|
||||
[API Documentation](https://plexapi.dev)
|
||||
|
||||
## SDKs
|
||||
|
||||
The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the respective repository.
|
||||
|
||||
| Language | Repository | Releases | Other |
|
||||
| -------- | ---------- | ------- | ----- |
|
||||
| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |
|
||||
| Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - |
|
||||
| JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - |
|
||||
| Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) |
|
||||
@@ -22,4 +24,5 @@ The following SDKs are generated from the OpenAPI Specification. They are automa
|
||||
| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | - |
|
||||
|
||||
## Questions?
|
||||
|
||||
Reach out to me on the [Discord Server](https://discord.gg/mxqjsJHwUm)
|
||||
|
||||
@@ -3,9 +3,9 @@ x-examples:
|
||||
Example 1:
|
||||
id: 373040866
|
||||
code: 7RQZ
|
||||
product: '0'
|
||||
product: "0"
|
||||
trusted: false
|
||||
qr: 'https://plex.tv/api/v2/pins/qr/7RQZ'
|
||||
qr: "https://plex.tv/api/v2/pins/qr/7RQZ"
|
||||
clientIdentifier: 9klpwueublnfbvlx95w83ah9
|
||||
location:
|
||||
code: NL
|
||||
@@ -14,23 +14,23 @@ x-examples:
|
||||
country: The Netherlands
|
||||
city: Breda
|
||||
time_zone: Europe/Amsterdam
|
||||
postal_code: '4814'
|
||||
postal_code: "4814"
|
||||
in_privacy_restricted_country: true
|
||||
in_privacy_restricted_region: true
|
||||
subdivisions: North Brabant
|
||||
coordinates: '51.5869, 4.7471'
|
||||
coordinates: "51.5869, 4.7471"
|
||||
expiresIn: 876
|
||||
createdAt: '2024-07-16T17:03:05Z'
|
||||
expiresAt: '2024-07-16T17:18:05Z'
|
||||
createdAt: "2024-07-16T17:03:05Z"
|
||||
expiresAt: "2024-07-16T17:18:05Z"
|
||||
authToken: null
|
||||
newRegistration: null
|
||||
title: AuthPinContainer
|
||||
examples:
|
||||
- id: 308667304
|
||||
code: 7RQZ
|
||||
product: '0'
|
||||
product: "0"
|
||||
trusted: false
|
||||
qr: 'https://plex.tv/api/v2/pins/qr/7RQZ'
|
||||
qr: "https://plex.tv/api/v2/pins/qr/7RQZ"
|
||||
clientIdentifier: string
|
||||
location:
|
||||
code: VI
|
||||
@@ -43,10 +43,10 @@ examples:
|
||||
in_privacy_restricted_country: true
|
||||
in_privacy_restricted_region: true
|
||||
subdivisions: Saint Thomas
|
||||
coordinates: '18.3381, -64.8941'
|
||||
coordinates: "18.3381, -64.8941"
|
||||
expiresIn: 876
|
||||
createdAt: '2024-07-16T17:03:05Z'
|
||||
expiresAt: '2024-07-16T17:18:05Z'
|
||||
createdAt: "2024-07-16T17:03:05Z"
|
||||
expiresAt: "2024-07-16T17:18:05Z"
|
||||
authToken: null
|
||||
newRegistration: null
|
||||
required:
|
||||
@@ -69,13 +69,13 @@ properties:
|
||||
example: 7RQZ
|
||||
product:
|
||||
type: string
|
||||
example: '0'
|
||||
example: "0"
|
||||
trusted:
|
||||
type: boolean
|
||||
default: false
|
||||
qr:
|
||||
type: string
|
||||
example: 'https://plex.tv/api/v2/pins/qr/7RQZ'
|
||||
example: "https://plex.tv/api/v2/pins/qr/7RQZ"
|
||||
clientIdentifier:
|
||||
type: string
|
||||
description: The X-Client-Identifier used in the request
|
||||
@@ -84,17 +84,17 @@ properties:
|
||||
expiresIn:
|
||||
type: integer
|
||||
example: 876
|
||||
description: 'The number of seconds this pin expires, by default 900 seconds'
|
||||
description: "The number of seconds this pin expires, by default 900 seconds"
|
||||
default: 900
|
||||
createdAt:
|
||||
type: string
|
||||
example: '2024-07-16T17:03:05Z'
|
||||
example: "2024-07-16T17:03:05Z"
|
||||
format: date-time
|
||||
expiresAt:
|
||||
type: string
|
||||
format: date-time
|
||||
example: '2024-07-16T17:18:05Z'
|
||||
example: "2024-07-16T17:18:05Z"
|
||||
authToken:
|
||||
type: 'null'
|
||||
type: "null"
|
||||
newRegistration:
|
||||
type: 'null'
|
||||
type: "null"
|
||||
|
||||
@@ -9,7 +9,7 @@ examples:
|
||||
sharedServers: []
|
||||
sharedSources: []
|
||||
status: accepted
|
||||
thumb: 'https://plex.tv/users/7d1916e0d8f6e76b/avatar?c=1694481578'
|
||||
thumb: "https://plex.tv/users/7d1916e0d8f6e76b/avatar?c=1694481578"
|
||||
title: username123
|
||||
username: username123
|
||||
uuid: 7d1916e0d8f6e76b
|
||||
@@ -38,7 +38,7 @@ properties:
|
||||
- null
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
- "null"
|
||||
description: The account full name
|
||||
home:
|
||||
type: boolean
|
||||
@@ -67,7 +67,7 @@ properties:
|
||||
description: Current friend request status
|
||||
thumb:
|
||||
type: string
|
||||
example: 'https://plex.tv/users/7d1916e0d8f6e76b/avatar?c=1694481578'
|
||||
example: "https://plex.tv/users/7d1916e0d8f6e76b/avatar?c=1694481578"
|
||||
format: uri
|
||||
description: URL of the account thumbnail
|
||||
title:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
title: GeoData
|
||||
type: object
|
||||
description: 'Geo location data'
|
||||
description: "Geo location data"
|
||||
examples:
|
||||
- code: VI
|
||||
continent_code: NA
|
||||
@@ -12,7 +12,7 @@ examples:
|
||||
in_privacy_restricted_country: true
|
||||
in_privacy_restricted_region: true
|
||||
subdivisions: Saint Thomas
|
||||
coordinates: '18.3381, -64.8941'
|
||||
coordinates: "18.3381, -64.8941"
|
||||
required:
|
||||
- code
|
||||
- continent_code
|
||||
@@ -71,5 +71,5 @@ properties:
|
||||
example: Saint Thomas
|
||||
coordinates:
|
||||
type: string
|
||||
description: 'The geographical coordinates (latitude, longitude) of the location.'
|
||||
example: '18.3381, -64.8941'
|
||||
description: "The geographical coordinates (latitude, longitude) of the location."
|
||||
example: "18.3381, -64.8941"
|
||||
|
||||
@@ -20,19 +20,19 @@ properties:
|
||||
id:
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
- "null"
|
||||
mode:
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
- "null"
|
||||
renewsAt:
|
||||
oneOf:
|
||||
- $ref: './common/PlexDateTime.yaml'
|
||||
- type: 'null'
|
||||
- $ref: "./common/PlexDateTime.yaml"
|
||||
- type: "null"
|
||||
endsAt:
|
||||
oneOf:
|
||||
- $ref: './common/PlexDateTime.yaml'
|
||||
- type: 'null'
|
||||
- $ref: "./common/PlexDateTime.yaml"
|
||||
- type: "null"
|
||||
canceled:
|
||||
type: boolean
|
||||
example: false
|
||||
@@ -67,7 +67,7 @@ properties:
|
||||
transfer:
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
- "null"
|
||||
state:
|
||||
example: ended
|
||||
enum:
|
||||
@@ -83,4 +83,4 @@ properties:
|
||||
paymentMethodId:
|
||||
type:
|
||||
- integer
|
||||
- 'null'
|
||||
- "null"
|
||||
|
||||
@@ -73,8 +73,8 @@ properties:
|
||||
description: Date the account subscribed to Plex Pass
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
example: '2021-04-12T18:21:12Z'
|
||||
- "null"
|
||||
example: "2021-04-12T18:21:12Z"
|
||||
status:
|
||||
description: String representation of subscriptionActive
|
||||
example: Inactive
|
||||
@@ -85,9 +85,9 @@ properties:
|
||||
description: Payment service used for your Plex Pass subscription
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
- "null"
|
||||
plan:
|
||||
description: Name of Plex Pass subscription plan
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
- "null"
|
||||
|
||||
@@ -2,8 +2,8 @@ title: UserPlexAccount
|
||||
type: object
|
||||
examples:
|
||||
- adsConsent: true
|
||||
adsConsentReminderAt: '2019-08-24T14:15:22Z'
|
||||
adsConsentSetAt: '2019-08-24T14:15:22Z'
|
||||
adsConsentReminderAt: "2019-08-24T14:15:22Z"
|
||||
adsConsentSetAt: "2019-08-24T14:15:22Z"
|
||||
anonymous: false
|
||||
authToken: CxoUzBTSV5hsxjTpFKaf
|
||||
backupCodesCreated: false
|
||||
@@ -29,14 +29,14 @@ examples:
|
||||
- id: string
|
||||
mode: string
|
||||
renewsAt: string
|
||||
endsAt: '1556281940'
|
||||
canceled: '0'
|
||||
gracePeriod: '0'
|
||||
onHold: '0'
|
||||
canReactivate: '0'
|
||||
canUpgrade: '0'
|
||||
canDowngrade: '0'
|
||||
canConvert: '0'
|
||||
endsAt: "1556281940"
|
||||
canceled: "0"
|
||||
gracePeriod: "0"
|
||||
onHold: "0"
|
||||
canReactivate: "0"
|
||||
canUpgrade: "0"
|
||||
canDowngrade: "0"
|
||||
canConvert: "0"
|
||||
type: plexpass
|
||||
transfer: string
|
||||
state: ended
|
||||
@@ -58,10 +58,10 @@ examples:
|
||||
restricted: false
|
||||
roles:
|
||||
- string
|
||||
scrobbleTypes: ''
|
||||
scrobbleTypes: ""
|
||||
services:
|
||||
- identifier: metadata-dev
|
||||
endpoint: 'https://epg.provider.plex.tv'
|
||||
endpoint: "https://epg.provider.plex.tv"
|
||||
token: DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv
|
||||
secret: string
|
||||
status: online
|
||||
@@ -69,7 +69,7 @@ examples:
|
||||
features:
|
||||
- Android - Dolby Vision
|
||||
active: true
|
||||
subscribedAt: '2021-04-12T18:21:12Z'
|
||||
subscribedAt: "2021-04-12T18:21:12Z"
|
||||
status: Inactive
|
||||
paymentService: string
|
||||
plan: string
|
||||
@@ -78,11 +78,11 @@ examples:
|
||||
- features:
|
||||
- Android - Dolby Vision
|
||||
active: true
|
||||
subscribedAt: '2021-04-12T18:21:12Z'
|
||||
subscribedAt: "2021-04-12T18:21:12Z"
|
||||
status: Inactive
|
||||
paymentService: string
|
||||
plan: string
|
||||
thumb: 'https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101'
|
||||
thumb: "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101"
|
||||
title: UsernameTitle
|
||||
trials:
|
||||
- {}
|
||||
@@ -132,24 +132,24 @@ properties:
|
||||
adsConsent:
|
||||
type:
|
||||
- boolean
|
||||
- 'null'
|
||||
- "null"
|
||||
description: Unknown
|
||||
adsConsentReminderAt:
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
- "null"
|
||||
description: Unknown
|
||||
format: date-time
|
||||
adsConsentSetAt:
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
- "null"
|
||||
description: Unknown
|
||||
format: date-time
|
||||
anonymous:
|
||||
type:
|
||||
- boolean
|
||||
- 'null'
|
||||
- "null"
|
||||
description: Unknown
|
||||
default: false
|
||||
authToken:
|
||||
@@ -192,7 +192,7 @@ properties:
|
||||
description: List of devices your allowed to use with this account
|
||||
items:
|
||||
type: string
|
||||
example: '[]'
|
||||
example: "[]"
|
||||
guest:
|
||||
type: boolean
|
||||
description: If the account is a Plex Home guest user
|
||||
@@ -227,7 +227,7 @@ properties:
|
||||
locale:
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
- "null"
|
||||
description: The account locale
|
||||
mailingListActive:
|
||||
type: boolean
|
||||
@@ -245,7 +245,7 @@ properties:
|
||||
format: int32
|
||||
pin:
|
||||
type: string
|
||||
description: '[Might be removed] The hashed Plex Home PIN '
|
||||
description: "[Might be removed] The hashed Plex Home PIN "
|
||||
deprecated: true
|
||||
profile:
|
||||
$ref: ./UserProfile.yaml
|
||||
@@ -264,7 +264,7 @@ properties:
|
||||
default: false
|
||||
roles:
|
||||
type: array
|
||||
description: '[Might be removed] List of account roles. Plexpass membership listed here'
|
||||
description: "[Might be removed] List of account roles. Plexpass membership listed here"
|
||||
items:
|
||||
type: string
|
||||
scrobbleTypes:
|
||||
@@ -286,17 +286,17 @@ properties:
|
||||
example: metadata-dev
|
||||
endpoint:
|
||||
type: string
|
||||
example: 'https://epg.provider.plex.tv'
|
||||
example: "https://epg.provider.plex.tv"
|
||||
format: uri
|
||||
token:
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
- "null"
|
||||
example: DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv
|
||||
secret:
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
- "null"
|
||||
status:
|
||||
example: online
|
||||
enum:
|
||||
@@ -308,7 +308,7 @@ properties:
|
||||
subscriptionDescription:
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
- "null"
|
||||
description: Description of the Plex Pass subscription
|
||||
subscriptions:
|
||||
type: array
|
||||
@@ -318,7 +318,7 @@ properties:
|
||||
type: string
|
||||
description: URL of the account thumbnail
|
||||
format: uri
|
||||
example: 'https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101'
|
||||
example: "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101"
|
||||
title:
|
||||
type: string
|
||||
description: The title of the account (username or friendly name)
|
||||
|
||||
@@ -12,18 +12,18 @@ properties:
|
||||
defaultAudioLanguage:
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
- "null"
|
||||
example: ja
|
||||
description: The preferred audio language for the account
|
||||
defaultSubtitleLanguage:
|
||||
type:
|
||||
- string
|
||||
- 'null'
|
||||
- "null"
|
||||
example: en
|
||||
description: The preferred subtitle language for the account
|
||||
autoSelectSubtitle:
|
||||
example: 1
|
||||
description: 'The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled)'
|
||||
description: "The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled)"
|
||||
enum:
|
||||
- 0
|
||||
- 1
|
||||
@@ -32,13 +32,13 @@ properties:
|
||||
- 0
|
||||
- 1
|
||||
example: 1
|
||||
description: 'The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles)'
|
||||
description: "The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles)"
|
||||
defaultSubtitleForced:
|
||||
enum:
|
||||
- 0
|
||||
- 1
|
||||
example: 0
|
||||
description: 'The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles)'
|
||||
description: "The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles)"
|
||||
watchedIndicator:
|
||||
enum:
|
||||
- 0
|
||||
|
||||
@@ -5,4 +5,3 @@ schema:
|
||||
type: integer
|
||||
example: 9518
|
||||
required: true
|
||||
|
||||
|
||||
@@ -8,4 +8,3 @@ schema:
|
||||
format: int32
|
||||
example: 9518
|
||||
required: true
|
||||
|
||||
|
||||
@@ -4,4 +4,3 @@ required: false
|
||||
schema:
|
||||
type: string
|
||||
example: "Linux"
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
get:
|
||||
servers:
|
||||
- url: 'https://plex.tv/api/v2'
|
||||
- url: "https://plex.tv/api/v2"
|
||||
tags:
|
||||
- Plex
|
||||
summary: Get Companions Data
|
||||
description: Get Companions Data
|
||||
operationId: getCompanionsData
|
||||
responses:
|
||||
'200':
|
||||
"200":
|
||||
description: Companions Data
|
||||
content:
|
||||
application/json:
|
||||
@@ -28,21 +28,21 @@ get:
|
||||
example: tv.plex.sonos
|
||||
baseURL:
|
||||
type: string
|
||||
example: 'https://sonos.plex.tv'
|
||||
example: "https://sonos.plex.tv"
|
||||
format: uri
|
||||
title:
|
||||
type: string
|
||||
example: Sonos
|
||||
linkURL:
|
||||
type: string
|
||||
example: 'https://sonos.plex.tv/link'
|
||||
example: "https://sonos.plex.tv/link"
|
||||
provides:
|
||||
type: string
|
||||
example: 'client,player'
|
||||
example: "client,player"
|
||||
token:
|
||||
type: string
|
||||
description: The plex authtoken used to identify with
|
||||
'400':
|
||||
"400":
|
||||
$ref: ../../responses/400.yaml
|
||||
'401':
|
||||
"401":
|
||||
$ref: ../../responses/401.yaml
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
get:
|
||||
servers:
|
||||
- url: 'https://plex.tv/api/v2'
|
||||
- url: "https://plex.tv/api/v2"
|
||||
tags:
|
||||
- Plex
|
||||
summary: Get list of friends of the user logged in
|
||||
description: Get friends of provided auth token.
|
||||
operationId: getUserFriends
|
||||
responses:
|
||||
'200':
|
||||
"200":
|
||||
description: Friends Data
|
||||
content:
|
||||
application/json:
|
||||
@@ -15,7 +15,7 @@ get:
|
||||
type: array
|
||||
items:
|
||||
$ref: ../../models/Friend.yaml
|
||||
'400':
|
||||
$ref: '../../responses/400.yaml'
|
||||
'401':
|
||||
$ref: '../../responses/401.yaml'
|
||||
"400":
|
||||
$ref: "../../responses/400.yaml"
|
||||
"401":
|
||||
$ref: "../../responses/401.yaml"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
get:
|
||||
servers:
|
||||
- url: 'https://plex.tv/api/v2'
|
||||
- url: "https://plex.tv/api/v2"
|
||||
security: [] # No security required
|
||||
tags:
|
||||
- Plex
|
||||
@@ -8,13 +8,13 @@ get:
|
||||
description: Returns the geolocation and locale data of the caller
|
||||
operationId: getGeoData
|
||||
responses:
|
||||
'200':
|
||||
"200":
|
||||
description: Gets the geo location data of the user
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../../models/GeoData.yaml
|
||||
'400':
|
||||
"400":
|
||||
$ref: ../../responses/400.yaml
|
||||
'401':
|
||||
"401":
|
||||
$ref: ../../responses/401.yaml
|
||||
|
||||
@@ -113,7 +113,8 @@ get:
|
||||
example: Firefly
|
||||
summary:
|
||||
type: string
|
||||
example: Captain Malcolm 'Mal' Reynolds is a former galactic war veteran who is
|
||||
example:
|
||||
Captain Malcolm 'Mal' Reynolds is a former galactic war veteran who is
|
||||
the captain of the transport ship "Serenity". Mal and his crew,
|
||||
ensign Zoe Alleyne Washburne; Zoe's husband, pilot Hoban 'Wash'
|
||||
Washburne; muscular mercenary Jayne Cobb; young mechanic Kaylee
|
||||
|
||||
@@ -60,7 +60,7 @@ get:
|
||||
example: /:/resources/movie.png
|
||||
key:
|
||||
type: string
|
||||
example: '1'
|
||||
example: "1"
|
||||
type:
|
||||
type: string
|
||||
example: movie
|
||||
@@ -80,11 +80,11 @@ get:
|
||||
type: string
|
||||
example: 322a231a-b7f7-49f5-920f-14c61199cd30
|
||||
updatedAt:
|
||||
$ref: '../../models/common/PlexDateTime.yaml'
|
||||
$ref: "../../models/common/PlexDateTime.yaml"
|
||||
createdAt:
|
||||
$ref: '../../models/common/PlexDateTime.yaml'
|
||||
$ref: "../../models/common/PlexDateTime.yaml"
|
||||
scannedAt:
|
||||
$ref: '../../models/common/PlexDateTime.yaml'
|
||||
$ref: "../../models/common/PlexDateTime.yaml"
|
||||
content:
|
||||
type: boolean
|
||||
example: true
|
||||
|
||||
@@ -18,7 +18,7 @@ get:
|
||||
- $ref: "../../../../../parameters/image/upscale.yaml"
|
||||
- $ref: "../../../../../parameters/plex/x-plex-token.yaml"
|
||||
responses:
|
||||
'200':
|
||||
"200":
|
||||
description: Successful response returning an image
|
||||
headers:
|
||||
X-Plex-Protocol:
|
||||
|
||||
@@ -89,7 +89,8 @@ get:
|
||||
example: PG-13
|
||||
summary:
|
||||
type: string
|
||||
example: Serenity continues the story of the TV series it was based upon
|
||||
example:
|
||||
Serenity continues the story of the TV series it was based upon
|
||||
("Firefly"). River Tam had a secret - one in which she's not
|
||||
even aware - so dangerous, no one's safe, as an Alliance
|
||||
operative's sent to capture her, and all others are considered
|
||||
|
||||
@@ -18,7 +18,7 @@ get:
|
||||
- $ref: "../../../../../parameters/image/upscale.yaml"
|
||||
- $ref: "../../../../../parameters/plex/x-plex-token.yaml"
|
||||
responses:
|
||||
'200':
|
||||
"200":
|
||||
description: Successful response returning an image
|
||||
headers:
|
||||
X-Plex-Protocol:
|
||||
|
||||
@@ -5,10 +5,10 @@ get:
|
||||
description: Retrieves media providers and their features from the Plex server.
|
||||
operationId: get-media-providers
|
||||
parameters:
|
||||
- $ref: '../../../parameters/accept-application-json.yaml'
|
||||
- $ref: '../../../parameters/plex/x-plex-token.yaml'
|
||||
- $ref: "../../../parameters/accept-application-json.yaml"
|
||||
- $ref: "../../../parameters/plex/x-plex-token.yaml"
|
||||
responses:
|
||||
'200':
|
||||
"200":
|
||||
description: Media providers and their features
|
||||
content:
|
||||
application/json:
|
||||
|
||||
@@ -16,15 +16,15 @@ get:
|
||||
schema:
|
||||
type: integer
|
||||
responses:
|
||||
'200':
|
||||
"200":
|
||||
description: The Pin with a non-null authToken when it has been verified by the user
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../../models/AuthPinContainer.yaml
|
||||
'400':
|
||||
"400":
|
||||
$ref: ../../responses/400-MissingIdentifier.yaml
|
||||
'404':
|
||||
"404":
|
||||
description: Not Found or Expired
|
||||
content:
|
||||
application/json:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
post:
|
||||
servers:
|
||||
- url: 'https://plex.tv/api/v2'
|
||||
- url: "https://plex.tv/api/v2"
|
||||
tags:
|
||||
- Plex
|
||||
summary: Get a Pin
|
||||
@@ -21,12 +21,11 @@ post:
|
||||
- $ref: ../../parameters/plex/x-plex-identifier.yaml
|
||||
- $ref: ../../parameters/plex/x-plex-product.yaml
|
||||
responses:
|
||||
'200':
|
||||
"200":
|
||||
description: Requests a new pin id used in the authentication flow
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../../models/AuthPinContainer.yaml
|
||||
'400':
|
||||
"400":
|
||||
$ref: ../../responses/400-MissingIdentifier.yaml
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
get:
|
||||
servers:
|
||||
- url: 'https://plex.tv/api/v2'
|
||||
- url: "https://plex.tv/api/v2"
|
||||
security: []
|
||||
tags:
|
||||
- Plex
|
||||
@@ -34,7 +34,7 @@ get:
|
||||
- 0
|
||||
- 1
|
||||
responses:
|
||||
'200':
|
||||
"200":
|
||||
description: List of Plex Devices. This includes Plex hosted servers and clients
|
||||
content:
|
||||
application/json:
|
||||
@@ -42,7 +42,7 @@ get:
|
||||
type: array
|
||||
items:
|
||||
$ref: ../../models/PlexDevice.yaml
|
||||
'400':
|
||||
$ref: '../../responses/400.yaml'
|
||||
'401':
|
||||
$ref: '../../responses/401.yaml'
|
||||
"400":
|
||||
$ref: "../../responses/400.yaml"
|
||||
"401":
|
||||
$ref: "../../responses/401.yaml"
|
||||
|
||||
@@ -36,7 +36,7 @@ get:
|
||||
in: query
|
||||
schema:
|
||||
type: object
|
||||
pattern: '^[A-Za-z][A-Za-z0-9]*[>=<]{0,2}$'
|
||||
pattern: "^[A-Za-z][A-Za-z0-9]*[>=<]{0,2}$"
|
||||
example:
|
||||
viewed-at-greater-than:
|
||||
value: viewedAt>
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
get:
|
||||
servers:
|
||||
- url: 'https://plex.tv/api/v2'
|
||||
- url: "https://plex.tv/api/v2"
|
||||
tags:
|
||||
- Authentication
|
||||
summary: Get User Data By Token
|
||||
description: Get the User data from the provided X-Plex-Token
|
||||
operationId: getUserDetails
|
||||
parameters:
|
||||
- $ref: '../../parameters/plex/x-plex-token.yaml'
|
||||
- $ref: "../../parameters/plex/x-plex-token.yaml"
|
||||
- $ref: "../../parameters/accept-application-json.yaml"
|
||||
responses:
|
||||
'200':
|
||||
"200":
|
||||
description: Logged in user details
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: ../../models/UserPlexAccount.yaml
|
||||
'400':
|
||||
$ref: '../../responses/400.yaml'
|
||||
'401':
|
||||
$ref: '../../responses/401.yaml'
|
||||
"400":
|
||||
$ref: "../../responses/400.yaml"
|
||||
"401":
|
||||
$ref: "../../responses/401.yaml"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
post:
|
||||
servers:
|
||||
- url: 'https://plex.tv/api/v2'
|
||||
- url: "https://plex.tv/api/v2"
|
||||
security: []
|
||||
tags:
|
||||
- Authentication
|
||||
@@ -31,7 +31,7 @@ post:
|
||||
default: false
|
||||
description: Login credentials
|
||||
responses:
|
||||
'201':
|
||||
"201":
|
||||
description: Returns the user account data with a valid auth token
|
||||
content:
|
||||
application/json:
|
||||
@@ -51,7 +51,7 @@ post:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
'400':
|
||||
$ref: '../../responses/400.yaml'
|
||||
'401':
|
||||
$ref: '../../responses/401.yaml'
|
||||
"400":
|
||||
$ref: "../../responses/400.yaml"
|
||||
"401":
|
||||
$ref: "../../responses/401.yaml"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,414 +1,414 @@
|
||||
import {validateResponseSpec} from "../../utils/";
|
||||
import {describe, it} from 'vitest'
|
||||
import { validateResponseSpec } from "../../utils/"
|
||||
import { describe, it } from "vitest"
|
||||
|
||||
describe('GET /library/sections', () => {
|
||||
it('should validate the 200 response when the API spec is valid', () => {
|
||||
describe("GET /library/sections", () => {
|
||||
it("should validate the 200 response when the API spec is valid", () => {
|
||||
const response = {
|
||||
"MediaContainer": {
|
||||
"size": 14,
|
||||
"allowSync": false,
|
||||
"title1": "Plex Library",
|
||||
"Directory": [
|
||||
MediaContainer: {
|
||||
size: 14,
|
||||
allowSync: false,
|
||||
title1: "Plex Library",
|
||||
Directory: [
|
||||
{
|
||||
"allowSync": true,
|
||||
"art": "/:/resources/movie-fanart.jpg",
|
||||
"composite": "/library/sections/7/composite/1893047123",
|
||||
"filters": true,
|
||||
"refreshing": false,
|
||||
"thumb": "/:/resources/movie.png",
|
||||
"key": "7",
|
||||
"type": "movie",
|
||||
"title": "Kids Movies",
|
||||
"agent": "tv.plex.agents.movie",
|
||||
"scanner": "Plex Movie",
|
||||
"language": "en-US",
|
||||
"uuid": "a1b2c3d4e5f67890",
|
||||
"updatedAt": 1728394001,
|
||||
"createdAt": 1598476504,
|
||||
"scannedAt": 1893047123,
|
||||
"content": true,
|
||||
"directory": true,
|
||||
"contentChangedAt": 4738921,
|
||||
"hidden": 0,
|
||||
"Location": [
|
||||
allowSync: true,
|
||||
art: "/:/resources/movie-fanart.jpg",
|
||||
composite: "/library/sections/7/composite/1893047123",
|
||||
filters: true,
|
||||
refreshing: false,
|
||||
thumb: "/:/resources/movie.png",
|
||||
key: "7",
|
||||
type: "movie",
|
||||
title: "Kids Movies",
|
||||
agent: "tv.plex.agents.movie",
|
||||
scanner: "Plex Movie",
|
||||
language: "en-US",
|
||||
uuid: "a1b2c3d4e5f67890",
|
||||
updatedAt: 1728394001,
|
||||
createdAt: 1598476504,
|
||||
scannedAt: 1893047123,
|
||||
content: true,
|
||||
directory: true,
|
||||
contentChangedAt: 4738921,
|
||||
hidden: 0,
|
||||
Location: [
|
||||
{
|
||||
"id": 25,
|
||||
"path": "/KidsMovies"
|
||||
id: 25,
|
||||
path: "/KidsMovies"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"allowSync": true,
|
||||
"art": "/:/resources/movie-fanart.jpg",
|
||||
"composite": "/library/sections/13/composite/1893047124",
|
||||
"filters": true,
|
||||
"refreshing": false,
|
||||
"thumb": "/:/resources/movie.png",
|
||||
"key": "13",
|
||||
"type": "movie",
|
||||
"title": "Kids Movies NL",
|
||||
"agent": "tv.plex.agents.movie",
|
||||
"scanner": "Plex Movie",
|
||||
"language": "nl-NL",
|
||||
"uuid": "b2c3d4e5f67890a1",
|
||||
"updatedAt": 1680007500,
|
||||
"createdAt": 1680007500,
|
||||
"scannedAt": 1893047124,
|
||||
"content": true,
|
||||
"directory": true,
|
||||
"contentChangedAt": 5283714,
|
||||
"hidden": 0,
|
||||
"Location": [
|
||||
allowSync: true,
|
||||
art: "/:/resources/movie-fanart.jpg",
|
||||
composite: "/library/sections/13/composite/1893047124",
|
||||
filters: true,
|
||||
refreshing: false,
|
||||
thumb: "/:/resources/movie.png",
|
||||
key: "13",
|
||||
type: "movie",
|
||||
title: "Kids Movies NL",
|
||||
agent: "tv.plex.agents.movie",
|
||||
scanner: "Plex Movie",
|
||||
language: "nl-NL",
|
||||
uuid: "b2c3d4e5f67890a1",
|
||||
updatedAt: 1680007500,
|
||||
createdAt: 1680007500,
|
||||
scannedAt: 1893047124,
|
||||
content: true,
|
||||
directory: true,
|
||||
contentChangedAt: 5283714,
|
||||
hidden: 0,
|
||||
Location: [
|
||||
{
|
||||
"id": 23,
|
||||
"path": "/KidsMoviesNL"
|
||||
id: 23,
|
||||
path: "/KidsMoviesNL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"allowSync": true,
|
||||
"art": "/:/resources/movie-fanart.jpg",
|
||||
"composite": "/library/sections/1/composite/1893047130",
|
||||
"filters": true,
|
||||
"refreshing": false,
|
||||
"thumb": "/:/resources/movie.png",
|
||||
"key": "1",
|
||||
"type": "movie",
|
||||
"title": "Movies",
|
||||
"agent": "tv.plex.agents.movie",
|
||||
"scanner": "Plex Movie",
|
||||
"language": "en-US",
|
||||
"uuid": "c3d4e5f67890a1b2",
|
||||
"updatedAt": 1728394005,
|
||||
"createdAt": 1598476200,
|
||||
"scannedAt": 1893047130,
|
||||
"content": true,
|
||||
"directory": true,
|
||||
"contentChangedAt": 6379184,
|
||||
"hidden": 0,
|
||||
"Location": [
|
||||
allowSync: true,
|
||||
art: "/:/resources/movie-fanart.jpg",
|
||||
composite: "/library/sections/1/composite/1893047130",
|
||||
filters: true,
|
||||
refreshing: false,
|
||||
thumb: "/:/resources/movie.png",
|
||||
key: "1",
|
||||
type: "movie",
|
||||
title: "Movies",
|
||||
agent: "tv.plex.agents.movie",
|
||||
scanner: "Plex Movie",
|
||||
language: "en-US",
|
||||
uuid: "c3d4e5f67890a1b2",
|
||||
updatedAt: 1728394005,
|
||||
createdAt: 1598476200,
|
||||
scannedAt: 1893047130,
|
||||
content: true,
|
||||
directory: true,
|
||||
contentChangedAt: 6379184,
|
||||
hidden: 0,
|
||||
Location: [
|
||||
{
|
||||
"id": 18,
|
||||
"path": "/Movies"
|
||||
id: 18,
|
||||
path: "/Movies"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"allowSync": true,
|
||||
"art": "/:/resources/movie-fanart.jpg",
|
||||
"composite": "/library/sections/6/composite/1893047135",
|
||||
"filters": true,
|
||||
"refreshing": false,
|
||||
"thumb": "/:/resources/movie.png",
|
||||
"key": "6",
|
||||
"type": "movie",
|
||||
"title": "Movies (Documentaries)",
|
||||
"agent": "tv.plex.agents.movie",
|
||||
"scanner": "Plex Movie",
|
||||
"language": "en-US",
|
||||
"uuid": "d4e5f67890a1b2c3",
|
||||
"updatedAt": 1728394010,
|
||||
"createdAt": 1598476302,
|
||||
"scannedAt": 1893047135,
|
||||
"content": true,
|
||||
"directory": true,
|
||||
"contentChangedAt": 5293874,
|
||||
"hidden": 0,
|
||||
"Location": [
|
||||
allowSync: true,
|
||||
art: "/:/resources/movie-fanart.jpg",
|
||||
composite: "/library/sections/6/composite/1893047135",
|
||||
filters: true,
|
||||
refreshing: false,
|
||||
thumb: "/:/resources/movie.png",
|
||||
key: "6",
|
||||
type: "movie",
|
||||
title: "Movies (Documentaries)",
|
||||
agent: "tv.plex.agents.movie",
|
||||
scanner: "Plex Movie",
|
||||
language: "en-US",
|
||||
uuid: "d4e5f67890a1b2c3",
|
||||
updatedAt: 1728394010,
|
||||
createdAt: 1598476302,
|
||||
scannedAt: 1893047135,
|
||||
content: true,
|
||||
directory: true,
|
||||
contentChangedAt: 5293874,
|
||||
hidden: 0,
|
||||
Location: [
|
||||
{
|
||||
"id": 29,
|
||||
"path": "/Movies (Documentaries)"
|
||||
id: 29,
|
||||
path: "/Movies (Documentaries)"
|
||||
},
|
||||
{
|
||||
"id": 15,
|
||||
"path": "/Plex Library/Documentaries"
|
||||
id: 15,
|
||||
path: "/Plex Library/Documentaries"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"allowSync": true,
|
||||
"art": "/:/resources/movie-fanart.jpg",
|
||||
"composite": "/library/sections/15/composite/1893047145",
|
||||
"filters": true,
|
||||
"refreshing": false,
|
||||
"thumb": "/:/resources/movie.png",
|
||||
"key": "15",
|
||||
"type": "movie",
|
||||
"title": "Test Media Movies",
|
||||
"agent": "tv.plex.agents.movie",
|
||||
"scanner": "Plex Movie",
|
||||
"language": "en-US",
|
||||
"uuid": "e5f67890a1b2c3d4",
|
||||
"updatedAt": 1689075000,
|
||||
"createdAt": 1689075000,
|
||||
"scannedAt": 1893047145,
|
||||
"content": true,
|
||||
"directory": true,
|
||||
"contentChangedAt": 5182738,
|
||||
"hidden": 0,
|
||||
"Location": [
|
||||
allowSync: true,
|
||||
art: "/:/resources/movie-fanart.jpg",
|
||||
composite: "/library/sections/15/composite/1893047145",
|
||||
filters: true,
|
||||
refreshing: false,
|
||||
thumb: "/:/resources/movie.png",
|
||||
key: "15",
|
||||
type: "movie",
|
||||
title: "Test Media Movies",
|
||||
agent: "tv.plex.agents.movie",
|
||||
scanner: "Plex Movie",
|
||||
language: "en-US",
|
||||
uuid: "e5f67890a1b2c3d4",
|
||||
updatedAt: 1689075000,
|
||||
createdAt: 1689075000,
|
||||
scannedAt: 1893047145,
|
||||
content: true,
|
||||
directory: true,
|
||||
contentChangedAt: 5182738,
|
||||
hidden: 0,
|
||||
Location: [
|
||||
{
|
||||
"id": 27,
|
||||
"path": "/TestMedia/Movies"
|
||||
id: 27,
|
||||
path: "/TestMedia/Movies"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"allowSync": true,
|
||||
"art": "/:/resources/show-fanart.jpg",
|
||||
"composite": "/library/sections/3/composite/1893047110",
|
||||
"filters": true,
|
||||
"refreshing": false,
|
||||
"thumb": "/:/resources/show.png",
|
||||
"key": "3",
|
||||
"type": "show",
|
||||
"title": "Anime",
|
||||
"agent": "com.plexapp.agents.hama",
|
||||
"scanner": "Plex Series Scanner",
|
||||
"language": "en",
|
||||
"uuid": "f67890a1b2c3d4e5",
|
||||
"updatedAt": 1684970001,
|
||||
"createdAt": 1598476000,
|
||||
"scannedAt": 1893047110,
|
||||
"content": true,
|
||||
"directory": true,
|
||||
"contentChangedAt": 8379201,
|
||||
"hidden": 0,
|
||||
"Location": [
|
||||
allowSync: true,
|
||||
art: "/:/resources/show-fanart.jpg",
|
||||
composite: "/library/sections/3/composite/1893047110",
|
||||
filters: true,
|
||||
refreshing: false,
|
||||
thumb: "/:/resources/show.png",
|
||||
key: "3",
|
||||
type: "show",
|
||||
title: "Anime",
|
||||
agent: "com.plexapp.agents.hama",
|
||||
scanner: "Plex Series Scanner",
|
||||
language: "en",
|
||||
uuid: "f67890a1b2c3d4e5",
|
||||
updatedAt: 1684970001,
|
||||
createdAt: 1598476000,
|
||||
scannedAt: 1893047110,
|
||||
content: true,
|
||||
directory: true,
|
||||
contentChangedAt: 8379201,
|
||||
hidden: 0,
|
||||
Location: [
|
||||
{
|
||||
"id": 17,
|
||||
"path": "/Anime"
|
||||
id: 17,
|
||||
path: "/Anime"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"allowSync": true,
|
||||
"art": "/:/resources/show-fanart.jpg",
|
||||
"composite": "/library/sections/12/composite/1893047125",
|
||||
"filters": true,
|
||||
"refreshing": false,
|
||||
"thumb": "/:/resources/show.png",
|
||||
"key": "12",
|
||||
"type": "show",
|
||||
"title": "Kids Tv Shows NL",
|
||||
"agent": "tv.plex.agents.series",
|
||||
"scanner": "Plex TV Series",
|
||||
"language": "nl-NL",
|
||||
"uuid": "67890a1b2c3d4e5f",
|
||||
"updatedAt": 1728394002,
|
||||
"createdAt": 1680007400,
|
||||
"scannedAt": 1893047125,
|
||||
"content": true,
|
||||
"directory": true,
|
||||
"contentChangedAt": 5948203,
|
||||
"hidden": 0,
|
||||
"Location": [
|
||||
allowSync: true,
|
||||
art: "/:/resources/show-fanart.jpg",
|
||||
composite: "/library/sections/12/composite/1893047125",
|
||||
filters: true,
|
||||
refreshing: false,
|
||||
thumb: "/:/resources/show.png",
|
||||
key: "12",
|
||||
type: "show",
|
||||
title: "Kids Tv Shows NL",
|
||||
agent: "tv.plex.agents.series",
|
||||
scanner: "Plex TV Series",
|
||||
language: "nl-NL",
|
||||
uuid: "67890a1b2c3d4e5f",
|
||||
updatedAt: 1728394002,
|
||||
createdAt: 1680007400,
|
||||
scannedAt: 1893047125,
|
||||
content: true,
|
||||
directory: true,
|
||||
contentChangedAt: 5948203,
|
||||
hidden: 0,
|
||||
Location: [
|
||||
{
|
||||
"id": 22,
|
||||
"path": "/KidsTvShowsNL"
|
||||
id: 22,
|
||||
path: "/KidsTvShowsNL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"allowSync": true,
|
||||
"art": "/:/resources/show-fanart.jpg",
|
||||
"composite": "/library/sections/14/composite/1893047145",
|
||||
"filters": true,
|
||||
"refreshing": false,
|
||||
"thumb": "/:/resources/show.png",
|
||||
"key": "14",
|
||||
"type": "show",
|
||||
"title": "Reality TV (NL)",
|
||||
"agent": "tv.plex.agents.series",
|
||||
"scanner": "Plex TV Series",
|
||||
"language": "nl-NL",
|
||||
"uuid": "890a1b2c3d4e5f67",
|
||||
"updatedAt": 1728394007,
|
||||
"createdAt": 1601860600,
|
||||
"scannedAt": 1893047145,
|
||||
"content": true,
|
||||
"directory": true,
|
||||
"contentChangedAt": 6283720,
|
||||
"hidden": 0,
|
||||
"Location": [
|
||||
allowSync: true,
|
||||
art: "/:/resources/show-fanart.jpg",
|
||||
composite: "/library/sections/14/composite/1893047145",
|
||||
filters: true,
|
||||
refreshing: false,
|
||||
thumb: "/:/resources/show.png",
|
||||
key: "14",
|
||||
type: "show",
|
||||
title: "Reality TV (NL)",
|
||||
agent: "tv.plex.agents.series",
|
||||
scanner: "Plex TV Series",
|
||||
language: "nl-NL",
|
||||
uuid: "890a1b2c3d4e5f67",
|
||||
updatedAt: 1728394007,
|
||||
createdAt: 1601860600,
|
||||
scannedAt: 1893047145,
|
||||
content: true,
|
||||
directory: true,
|
||||
contentChangedAt: 6283720,
|
||||
hidden: 0,
|
||||
Location: [
|
||||
{
|
||||
"id": 26,
|
||||
"path": "/Reality TV NL"
|
||||
id: 26,
|
||||
path: "/Reality TV NL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"allowSync": true,
|
||||
"art": "/:/resources/show-fanart.jpg",
|
||||
"composite": "/library/sections/2/composite/1893047150",
|
||||
"filters": true,
|
||||
"refreshing": false,
|
||||
"thumb": "/:/resources/show.png",
|
||||
"key": "2",
|
||||
"type": "show",
|
||||
"title": "TV Series ",
|
||||
"agent": "tv.plex.agents.series",
|
||||
"scanner": "Plex TV Series",
|
||||
"language": "en-US",
|
||||
"uuid": "a1b2c3d4e5f67890",
|
||||
"updatedAt": 1728394003,
|
||||
"createdAt": 1598476100,
|
||||
"scannedAt": 1893047150,
|
||||
"content": true,
|
||||
"directory": true,
|
||||
"contentChangedAt": 6472184,
|
||||
"hidden": 0,
|
||||
"Location": [
|
||||
allowSync: true,
|
||||
art: "/:/resources/show-fanart.jpg",
|
||||
composite: "/library/sections/2/composite/1893047150",
|
||||
filters: true,
|
||||
refreshing: false,
|
||||
thumb: "/:/resources/show.png",
|
||||
key: "2",
|
||||
type: "show",
|
||||
title: "TV Series ",
|
||||
agent: "tv.plex.agents.series",
|
||||
scanner: "Plex TV Series",
|
||||
language: "en-US",
|
||||
uuid: "a1b2c3d4e5f67890",
|
||||
updatedAt: 1728394003,
|
||||
createdAt: 1598476100,
|
||||
scannedAt: 1893047150,
|
||||
content: true,
|
||||
directory: true,
|
||||
contentChangedAt: 6472184,
|
||||
hidden: 0,
|
||||
Location: [
|
||||
{
|
||||
"id": 32,
|
||||
"path": "/TV Shows"
|
||||
id: 32,
|
||||
path: "/TV Shows"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"allowSync": true,
|
||||
"art": "/:/resources/show-fanart.jpg",
|
||||
"composite": "/library/sections/16/composite/1893047155",
|
||||
"filters": true,
|
||||
"refreshing": false,
|
||||
"thumb": "/:/resources/show.png",
|
||||
"key": "16",
|
||||
"type": "show",
|
||||
"title": "TV Shows (Documentaries)",
|
||||
"agent": "tv.plex.agents.series",
|
||||
"scanner": "Plex TV Series",
|
||||
"language": "en-US",
|
||||
"uuid": "b2c3d4e5f67890a1",
|
||||
"updatedAt": 1689076000,
|
||||
"createdAt": 1689076000,
|
||||
"scannedAt": 1893047155,
|
||||
"content": true,
|
||||
"directory": true,
|
||||
"contentChangedAt": 4920835,
|
||||
"hidden": 0,
|
||||
"Location": [
|
||||
allowSync: true,
|
||||
art: "/:/resources/show-fanart.jpg",
|
||||
composite: "/library/sections/16/composite/1893047155",
|
||||
filters: true,
|
||||
refreshing: false,
|
||||
thumb: "/:/resources/show.png",
|
||||
key: "16",
|
||||
type: "show",
|
||||
title: "TV Shows (Documentaries)",
|
||||
agent: "tv.plex.agents.series",
|
||||
scanner: "Plex TV Series",
|
||||
language: "en-US",
|
||||
uuid: "b2c3d4e5f67890a1",
|
||||
updatedAt: 1689076000,
|
||||
createdAt: 1689076000,
|
||||
scannedAt: 1893047155,
|
||||
content: true,
|
||||
directory: true,
|
||||
contentChangedAt: 4920835,
|
||||
hidden: 0,
|
||||
Location: [
|
||||
{
|
||||
"id": 28,
|
||||
"path": "/TV Shows (Documentaries)"
|
||||
id: 28,
|
||||
path: "/TV Shows (Documentaries)"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"allowSync": true,
|
||||
"art": "/:/resources/show-fanart.jpg",
|
||||
"composite": "/library/sections/17/composite/1893047155",
|
||||
"filters": true,
|
||||
"refreshing": false,
|
||||
"thumb": "/:/resources/show.png",
|
||||
"key": "17",
|
||||
"type": "show",
|
||||
"title": "TV Shows (Kids)",
|
||||
"agent": "tv.plex.agents.series",
|
||||
"scanner": "Plex TV Series",
|
||||
"language": "en-US",
|
||||
"uuid": "c3d4e5f67890a1b2",
|
||||
"updatedAt": 1689077000,
|
||||
"createdAt": 1689077000,
|
||||
"scannedAt": 1893047155,
|
||||
"content": true,
|
||||
"directory": true,
|
||||
"contentChangedAt": 5309283,
|
||||
"hidden": 0,
|
||||
"Location": [
|
||||
allowSync: true,
|
||||
art: "/:/resources/show-fanart.jpg",
|
||||
composite: "/library/sections/17/composite/1893047155",
|
||||
filters: true,
|
||||
refreshing: false,
|
||||
thumb: "/:/resources/show.png",
|
||||
key: "17",
|
||||
type: "show",
|
||||
title: "TV Shows (Kids)",
|
||||
agent: "tv.plex.agents.series",
|
||||
scanner: "Plex TV Series",
|
||||
language: "en-US",
|
||||
uuid: "c3d4e5f67890a1b2",
|
||||
updatedAt: 1689077000,
|
||||
createdAt: 1689077000,
|
||||
scannedAt: 1893047155,
|
||||
content: true,
|
||||
directory: true,
|
||||
contentChangedAt: 5309283,
|
||||
hidden: 0,
|
||||
Location: [
|
||||
{
|
||||
"id": 31,
|
||||
"path": "/TV Shows (Kids)"
|
||||
id: 31,
|
||||
path: "/TV Shows (Kids)"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"allowSync": true,
|
||||
"art": "/:/resources/show-fanart.jpg",
|
||||
"composite": "/library/sections/10/composite/1893047170",
|
||||
"filters": true,
|
||||
"refreshing": false,
|
||||
"thumb": "/:/resources/show.png",
|
||||
"key": "10",
|
||||
"type": "show",
|
||||
"title": "TV Shows (Reality)",
|
||||
"agent": "tv.plex.agents.series",
|
||||
"scanner": "Plex TV Series",
|
||||
"language": "en-US",
|
||||
"uuid": "d4e5f67890a1b2c3",
|
||||
"updatedAt": 1689078000,
|
||||
"createdAt": 1626704821,
|
||||
"scannedAt": 1893047170,
|
||||
"content": true,
|
||||
"directory": true,
|
||||
"contentChangedAt": 7291885,
|
||||
"hidden": 0,
|
||||
"Location": [
|
||||
allowSync: true,
|
||||
art: "/:/resources/show-fanart.jpg",
|
||||
composite: "/library/sections/10/composite/1893047170",
|
||||
filters: true,
|
||||
refreshing: false,
|
||||
thumb: "/:/resources/show.png",
|
||||
key: "10",
|
||||
type: "show",
|
||||
title: "TV Shows (Reality)",
|
||||
agent: "tv.plex.agents.series",
|
||||
scanner: "Plex TV Series",
|
||||
language: "en-US",
|
||||
uuid: "d4e5f67890a1b2c3",
|
||||
updatedAt: 1689078000,
|
||||
createdAt: 1626704821,
|
||||
scannedAt: 1893047170,
|
||||
content: true,
|
||||
directory: true,
|
||||
contentChangedAt: 7291885,
|
||||
hidden: 0,
|
||||
Location: [
|
||||
{
|
||||
"id": 30,
|
||||
"path": "/TV Shows (Reality)"
|
||||
id: 30,
|
||||
path: "/TV Shows (Reality)"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"allowSync": true,
|
||||
"art": "/:/resources/artist-fanart.jpg",
|
||||
"composite": "/library/sections/9/composite/1893047140",
|
||||
"filters": true,
|
||||
"refreshing": false,
|
||||
"thumb": "/:/resources/artist.png",
|
||||
"key": "9",
|
||||
"type": "artist",
|
||||
"title": "Music",
|
||||
"agent": "tv.plex.agents.music",
|
||||
"scanner": "Plex Music",
|
||||
"language": "en-US",
|
||||
"uuid": "e5f67890a1b2c3d4",
|
||||
"updatedAt": 1684974922,
|
||||
"createdAt": 1598476740,
|
||||
"scannedAt": 1893047140,
|
||||
"content": true,
|
||||
"directory": true,
|
||||
"contentChangedAt": 7204063,
|
||||
"hidden": 0,
|
||||
"Location": [
|
||||
allowSync: true,
|
||||
art: "/:/resources/artist-fanart.jpg",
|
||||
composite: "/library/sections/9/composite/1893047140",
|
||||
filters: true,
|
||||
refreshing: false,
|
||||
thumb: "/:/resources/artist.png",
|
||||
key: "9",
|
||||
type: "artist",
|
||||
title: "Music",
|
||||
agent: "tv.plex.agents.music",
|
||||
scanner: "Plex Music",
|
||||
language: "en-US",
|
||||
uuid: "e5f67890a1b2c3d4",
|
||||
updatedAt: 1684974922,
|
||||
createdAt: 1598476740,
|
||||
scannedAt: 1893047140,
|
||||
content: true,
|
||||
directory: true,
|
||||
contentChangedAt: 7204063,
|
||||
hidden: 0,
|
||||
Location: [
|
||||
{
|
||||
"id": 24,
|
||||
"path": "/Music"
|
||||
id: 24,
|
||||
path: "/Music"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"allowSync": true,
|
||||
"art": "/:/resources/movie-fanart.jpg",
|
||||
"composite": "/library/sections/5/composite/1893047123",
|
||||
"filters": true,
|
||||
"refreshing": false,
|
||||
"thumb": "/:/resources/video.png",
|
||||
"key": "5",
|
||||
"type": "movie",
|
||||
"title": "Graduation",
|
||||
"agent": "com.plexapp.agents.none",
|
||||
"scanner": "Plex Video Files Scanner",
|
||||
"language": "xn",
|
||||
"uuid": "f67890a1b2c3d4e5",
|
||||
"updatedAt": 1684974733,
|
||||
"createdAt": 1598475949,
|
||||
"scannedAt": 1893047123,
|
||||
"content": true,
|
||||
"directory": true,
|
||||
"contentChangedAt": 3828909,
|
||||
"hidden": 0,
|
||||
"Location": [
|
||||
allowSync: true,
|
||||
art: "/:/resources/movie-fanart.jpg",
|
||||
composite: "/library/sections/5/composite/1893047123",
|
||||
filters: true,
|
||||
refreshing: false,
|
||||
thumb: "/:/resources/video.png",
|
||||
key: "5",
|
||||
type: "movie",
|
||||
title: "Graduation",
|
||||
agent: "com.plexapp.agents.none",
|
||||
scanner: "Plex Video Files Scanner",
|
||||
language: "xn",
|
||||
uuid: "f67890a1b2c3d4e5",
|
||||
updatedAt: 1684974733,
|
||||
createdAt: 1598475949,
|
||||
scannedAt: 1893047123,
|
||||
content: true,
|
||||
directory: true,
|
||||
contentChangedAt: 3828909,
|
||||
hidden: 0,
|
||||
Location: [
|
||||
{
|
||||
"id": 14,
|
||||
"path": "/Plex Library/Conspiracy"
|
||||
id: 14,
|
||||
path: "/Plex Library/Conspiracy"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
validateResponseSpec("/library/sections", "get", 200, response)
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,221 +1,222 @@
|
||||
import {validateResponseSpec} from "@utils";
|
||||
import {describe, it} from 'vitest'
|
||||
import { validateResponseSpec } from "@utils"
|
||||
import { describe, it } from "vitest"
|
||||
|
||||
describe('GET /media/providers', () => {
|
||||
it('should validate the 200 response when the API spec is valid', () => {
|
||||
describe("GET /media/providers", () => {
|
||||
it("should validate the 200 response when the API spec is valid", () => {
|
||||
const response = {
|
||||
"MediaContainer": {
|
||||
"size": 7,
|
||||
"allowCameraUpload": false,
|
||||
"allowChannelAccess": false,
|
||||
"allowSharing": true,
|
||||
"allowSync": true,
|
||||
"allowTuners": false,
|
||||
"backgroundProcessing": true,
|
||||
"certificate": true,
|
||||
"companionProxy": true,
|
||||
"countryCode": "uk",
|
||||
"diagnostics": "streaminglogs,databases",
|
||||
"eventStream": true,
|
||||
"friendlyName": "desktop-titan",
|
||||
"livetv": 12,
|
||||
"machineIdentifier": "cf18e74b-7e92-403f-b95a-a99e1f83f77b",
|
||||
"musicAnalysis": 3,
|
||||
"myPlex": true,
|
||||
"myPlexMappingState": "linked",
|
||||
"myPlexSigninState": "active",
|
||||
"myPlexSubscription": true,
|
||||
"myPlexUsername": "random.jason@outlook.com",
|
||||
"offlineTranscode": 4,
|
||||
"ownerFeatures": "5f36ef7d-bf9e-48a4-9399-6fddf0ea47b8,2e5687c9-9e71-4712-aec5-0198a93ff56f,3b84a6a9-bcfa-438b-b732-62cb3fcb6732,7d197f42-dc48-4e7b-a758-b6d52ffb216d",
|
||||
"platform": "Linux",
|
||||
"platformVersion": "18.04 (Build 12345)",
|
||||
"pluginHost": true,
|
||||
"pushNotifications": true,
|
||||
"readOnlyLibraries": true,
|
||||
"streamingBrainABRVersion": 5,
|
||||
"streamingBrainVersion": 4,
|
||||
"sync": true,
|
||||
"transcoderActiveVideoSessions": 2,
|
||||
"transcoderAudio": true,
|
||||
"transcoderLyrics": true,
|
||||
"transcoderSubtitles": true,
|
||||
"transcoderVideo": true,
|
||||
"transcoderVideoBitrates": "150,250,350,500,1000,2000,4000",
|
||||
"transcoderVideoQualities": "2,3,5,7,9",
|
||||
"transcoderVideoResolutions": "160,320,480,720,1080",
|
||||
"updatedAt": 1835421007,
|
||||
"updater": true,
|
||||
"version": "3.40.9.1536-745a67c45",
|
||||
"voiceSearch": true,
|
||||
"MediaProvider": [
|
||||
MediaContainer: {
|
||||
size: 7,
|
||||
allowCameraUpload: false,
|
||||
allowChannelAccess: false,
|
||||
allowSharing: true,
|
||||
allowSync: true,
|
||||
allowTuners: false,
|
||||
backgroundProcessing: true,
|
||||
certificate: true,
|
||||
companionProxy: true,
|
||||
countryCode: "uk",
|
||||
diagnostics: "streaminglogs,databases",
|
||||
eventStream: true,
|
||||
friendlyName: "desktop-titan",
|
||||
livetv: 12,
|
||||
machineIdentifier: "cf18e74b-7e92-403f-b95a-a99e1f83f77b",
|
||||
musicAnalysis: 3,
|
||||
myPlex: true,
|
||||
myPlexMappingState: "linked",
|
||||
myPlexSigninState: "active",
|
||||
myPlexSubscription: true,
|
||||
myPlexUsername: "random.jason@outlook.com",
|
||||
offlineTranscode: 4,
|
||||
ownerFeatures:
|
||||
"5f36ef7d-bf9e-48a4-9399-6fddf0ea47b8,2e5687c9-9e71-4712-aec5-0198a93ff56f,3b84a6a9-bcfa-438b-b732-62cb3fcb6732,7d197f42-dc48-4e7b-a758-b6d52ffb216d",
|
||||
platform: "Linux",
|
||||
platformVersion: "18.04 (Build 12345)",
|
||||
pluginHost: true,
|
||||
pushNotifications: true,
|
||||
readOnlyLibraries: true,
|
||||
streamingBrainABRVersion: 5,
|
||||
streamingBrainVersion: 4,
|
||||
sync: true,
|
||||
transcoderActiveVideoSessions: 2,
|
||||
transcoderAudio: true,
|
||||
transcoderLyrics: true,
|
||||
transcoderSubtitles: true,
|
||||
transcoderVideo: true,
|
||||
transcoderVideoBitrates: "150,250,350,500,1000,2000,4000",
|
||||
transcoderVideoQualities: "2,3,5,7,9",
|
||||
transcoderVideoResolutions: "160,320,480,720,1080",
|
||||
updatedAt: 1835421007,
|
||||
updater: true,
|
||||
version: "3.40.9.1536-745a67c45",
|
||||
voiceSearch: true,
|
||||
MediaProvider: [
|
||||
{
|
||||
"identifier": "com.plexapp.plugins.library",
|
||||
"title": "Random Library",
|
||||
"types": "photo,audio,video",
|
||||
"protocols": "stream,http",
|
||||
"Feature": [
|
||||
identifier: "com.plexapp.plugins.library",
|
||||
title: "Random Library",
|
||||
types: "photo,audio,video",
|
||||
protocols: "stream,http",
|
||||
Feature: [
|
||||
{
|
||||
"key": "/library/sections/new",
|
||||
"type": "content",
|
||||
"Directory": [
|
||||
key: "/library/sections/new",
|
||||
type: "content",
|
||||
Directory: [
|
||||
{
|
||||
"hubKey": "/hubs/home",
|
||||
"title": "Main Hub"
|
||||
hubKey: "/hubs/home",
|
||||
title: "Main Hub"
|
||||
},
|
||||
{
|
||||
"agent": "tv.plex.agents.movie",
|
||||
"language": "fr-FR",
|
||||
"refreshing": false,
|
||||
"scanner": "Random Movie Scanner",
|
||||
"uuid": "9b8e23c4-592c-4d3d-b2b6-7e5d1843c7a8",
|
||||
"id": "5",
|
||||
"key": "/library/sections/5",
|
||||
"hubKey": "/hubs/sections/5",
|
||||
"type": "movie",
|
||||
"title": "Films",
|
||||
"updatedAt": 1835420739,
|
||||
"scannedAt": 1835420123,
|
||||
"Pivot": [
|
||||
agent: "tv.plex.agents.movie",
|
||||
language: "fr-FR",
|
||||
refreshing: false,
|
||||
scanner: "Random Movie Scanner",
|
||||
uuid: "9b8e23c4-592c-4d3d-b2b6-7e5d1843c7a8",
|
||||
id: "5",
|
||||
key: "/library/sections/5",
|
||||
hubKey: "/hubs/sections/5",
|
||||
type: "movie",
|
||||
title: "Films",
|
||||
updatedAt: 1835420739,
|
||||
scannedAt: 1835420123,
|
||||
Pivot: [
|
||||
{
|
||||
"id": "recommended",
|
||||
"key": "/hubs/sections/5",
|
||||
"type": "hub",
|
||||
"title": "Popular",
|
||||
"context": "content.popular",
|
||||
"symbol": "star"
|
||||
id: "recommended",
|
||||
key: "/hubs/sections/5",
|
||||
type: "hub",
|
||||
title: "Popular",
|
||||
context: "content.popular",
|
||||
symbol: "star"
|
||||
},
|
||||
{
|
||||
"id": "library",
|
||||
"key": "/library/sections/5/all?type=5",
|
||||
"type": "list",
|
||||
"title": "Film Library",
|
||||
"context": "content.library",
|
||||
"symbol": "library"
|
||||
id: "library",
|
||||
key: "/library/sections/5/all?type=5",
|
||||
type: "list",
|
||||
title: "Film Library",
|
||||
context: "content.library",
|
||||
symbol: "library"
|
||||
},
|
||||
{
|
||||
"id": "categories",
|
||||
"key": "/library/sections/5/categories",
|
||||
"type": "list",
|
||||
"title": "Film Categories",
|
||||
"context": "content.categories",
|
||||
"symbol": "stack"
|
||||
id: "categories",
|
||||
key: "/library/sections/5/categories",
|
||||
type: "list",
|
||||
title: "Film Categories",
|
||||
context: "content.categories",
|
||||
symbol: "stack"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"agent": "tv.plex.agents.series",
|
||||
"language": "de-DE",
|
||||
"refreshing": false,
|
||||
"scanner": "Random TV Series Scanner",
|
||||
"uuid": "af5832e1-3246-4e31-9f48-b24f670d95d7",
|
||||
"id": "6",
|
||||
"key": "/library/sections/6",
|
||||
"hubKey": "/hubs/sections/6",
|
||||
"type": "show",
|
||||
"title": "Shows",
|
||||
"updatedAt": 1835413943,
|
||||
"scannedAt": 1835413688,
|
||||
"Pivot": [
|
||||
agent: "tv.plex.agents.series",
|
||||
language: "de-DE",
|
||||
refreshing: false,
|
||||
scanner: "Random TV Series Scanner",
|
||||
uuid: "af5832e1-3246-4e31-9f48-b24f670d95d7",
|
||||
id: "6",
|
||||
key: "/library/sections/6",
|
||||
hubKey: "/hubs/sections/6",
|
||||
type: "show",
|
||||
title: "Shows",
|
||||
updatedAt: 1835413943,
|
||||
scannedAt: 1835413688,
|
||||
Pivot: [
|
||||
{
|
||||
"id": "trending",
|
||||
"key": "/hubs/sections/6",
|
||||
"type": "hub",
|
||||
"title": "Trending Shows",
|
||||
"context": "content.trending",
|
||||
"symbol": "fire"
|
||||
id: "trending",
|
||||
key: "/hubs/sections/6",
|
||||
type: "hub",
|
||||
title: "Trending Shows",
|
||||
context: "content.trending",
|
||||
symbol: "fire"
|
||||
},
|
||||
{
|
||||
"id": "library",
|
||||
"key": "/library/sections/6/all?type=6",
|
||||
"type": "list",
|
||||
"title": "TV Library",
|
||||
"context": "content.library",
|
||||
"symbol": "library"
|
||||
id: "library",
|
||||
key: "/library/sections/6/all?type=6",
|
||||
type: "list",
|
||||
title: "TV Library",
|
||||
context: "content.library",
|
||||
symbol: "library"
|
||||
},
|
||||
{
|
||||
"id": "categories",
|
||||
"key": "/library/sections/6/categories",
|
||||
"type": "list",
|
||||
"title": "Show Categories",
|
||||
"context": "content.categories",
|
||||
"symbol": "stack"
|
||||
id: "categories",
|
||||
key: "/library/sections/6/categories",
|
||||
type: "list",
|
||||
title: "Show Categories",
|
||||
context: "content.categories",
|
||||
symbol: "stack"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "/hubs/search/new",
|
||||
"type": "search"
|
||||
key: "/hubs/search/new",
|
||||
type: "search"
|
||||
},
|
||||
{
|
||||
"key": "/library/matches/new",
|
||||
"type": "match"
|
||||
key: "/library/matches/new",
|
||||
type: "match"
|
||||
},
|
||||
{
|
||||
"key": "/library/metadata/new",
|
||||
"type": "metadata"
|
||||
key: "/library/metadata/new",
|
||||
type: "metadata"
|
||||
},
|
||||
{
|
||||
"key": "/photo/:/transcode",
|
||||
"type": "imagetranscoder"
|
||||
key: "/photo/:/transcode",
|
||||
type: "imagetranscoder"
|
||||
},
|
||||
{
|
||||
"key": "/hubs/promoted/new",
|
||||
"type": "promoted"
|
||||
key: "/hubs/promoted/new",
|
||||
type: "promoted"
|
||||
},
|
||||
{
|
||||
"key": "/hubs/continueWatching/new",
|
||||
"type": "continuewatching"
|
||||
key: "/hubs/continueWatching/new",
|
||||
type: "continuewatching"
|
||||
},
|
||||
{
|
||||
"key": "/actions/new",
|
||||
"type": "actions",
|
||||
"Action": [
|
||||
key: "/actions/new",
|
||||
type: "actions",
|
||||
Action: [
|
||||
{
|
||||
"id": "addToContinueWatching",
|
||||
"key": "/actions/addToContinueWatching"
|
||||
id: "addToContinueWatching",
|
||||
key: "/actions/addToContinueWatching"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"flavor": "global",
|
||||
"key": "/playlists/new",
|
||||
"type": "playlist"
|
||||
flavor: "global",
|
||||
key: "/playlists/new",
|
||||
type: "playlist"
|
||||
},
|
||||
{
|
||||
"flavor": "global",
|
||||
"key": "/playQueues/new",
|
||||
"type": "playqueue"
|
||||
flavor: "global",
|
||||
key: "/playQueues/new",
|
||||
type: "playqueue"
|
||||
},
|
||||
{
|
||||
"key": "/library/collections/new",
|
||||
"type": "collection"
|
||||
key: "/library/collections/new",
|
||||
type: "collection"
|
||||
},
|
||||
{
|
||||
"scrobbleKey": "/:/scrobble/new",
|
||||
"unscrobbleKey": "/:/unscrobble/new",
|
||||
"key": "/:/timeline/new",
|
||||
"type": "timeline"
|
||||
scrobbleKey: "/:/scrobble/new",
|
||||
unscrobbleKey: "/:/unscrobble/new",
|
||||
key: "/:/timeline/new",
|
||||
type: "timeline"
|
||||
},
|
||||
{
|
||||
"type": "queryParser"
|
||||
type: "queryParser"
|
||||
},
|
||||
{
|
||||
"flavor": "global",
|
||||
"type": "subscribe"
|
||||
flavor: "global",
|
||||
type: "subscribe"
|
||||
},
|
||||
{
|
||||
"key": "/library/search/new",
|
||||
"type": "universalsearch"
|
||||
key: "/library/search/new",
|
||||
type: "universalsearch"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
} ;
|
||||
}
|
||||
|
||||
validateResponseSpec("/media/providers", "get", 200, response)
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,236 +1,320 @@
|
||||
import {validateResponseSpec} from "../../utils/";
|
||||
import {describe, expect, it} from 'vitest'
|
||||
import { validateResponseSpec } from "../../utils/"
|
||||
import { describe, expect, it } from "vitest"
|
||||
|
||||
describe('POST /users/signin', () => {
|
||||
it('should validate the 201 response when the API spec is valid', () => {
|
||||
describe("POST /users/signin", () => {
|
||||
it("should validate the 201 response when the API spec is valid", () => {
|
||||
const response = {
|
||||
"id": 62735028,
|
||||
"uuid": "b9h6f3c8k1",
|
||||
"username": "ZjFvKLCb",
|
||||
"title": "ZjFvKLCb",
|
||||
"email": "c9eMdShR@example.com",
|
||||
"friendlyName": "",
|
||||
"locale": null,
|
||||
"confirmed": false,
|
||||
"joinedAt": 1552593531,
|
||||
"emailOnlyAuth": false,
|
||||
"hasPassword": true,
|
||||
"protected": false,
|
||||
"thumb": "https://plex.tv/users/b9h6f3c8k1/avatar?c=1724402119",
|
||||
"authToken": "jx9nTbVbHk1gM",
|
||||
"mailingListStatus": "unsubscribed",
|
||||
"mailingListActive": false,
|
||||
"scrobbleTypes": "",
|
||||
"country": "ES",
|
||||
"subscription": {
|
||||
"active": false,
|
||||
"subscribedAt": "2019-03-16T15:20:12Z",
|
||||
"status": "Inactive",
|
||||
"paymentService": null,
|
||||
"plan": null,
|
||||
"features": ["guided-upgrade", "increase-password-complexity", "upgrade-3ds2", "ad-countdown-timer", "adaptive_bitrate", "amazon-loop-debug", "Android - Dolby Vision", "Android - PiP", "avod-ad-analysis", "avod-new-media", "blacklist_get_signin", "CU Sunset", "client-radio-stations", "cloudflare-turnstile-required", "comments_and_replies_push_notifications", "friend_request_push_notifications", "community_access_plex_tv", "companions_sonos", "custom-home-removal", "disable_home_user_friendships", "disable_sharing_friendships", "drm_support", "le_isrg_root_x1", "federated-auth", "home", "HRK_enable_EUR", "ios14-privacy-banner", "iterable-notification-tokens", "keep-payment-method", "kevin-bacon", "korea-consent", "lets_encrypt", "lightning-dvr-pivot", "livetv", "live-tv-support-incomplete-segments", "tuner-sharing", "metadata_search", "vod_cloudflare", "new_plex_pass_prices", "news-provider-sunset-modal", "photos-favorites", "photos-metadata-edition", "pms_health", "rate-limit-client-token", "shared_server_notification", "shared_source_notification", "scrobbling-service-plex-tv", "collections", "radio", "exclude restrictions", "signin_with_apple", "spring_serve_ad_provider", "transcoder_cache", "TREBLE-show-features", "two-factor-authentication", "unsupportedtuners", "vod-schema", "watch-together-invite", "web_server_dashboard"]
|
||||
id: 62735028,
|
||||
uuid: "b9h6f3c8k1",
|
||||
username: "ZjFvKLCb",
|
||||
title: "ZjFvKLCb",
|
||||
email: "c9eMdShR@example.com",
|
||||
friendlyName: "",
|
||||
locale: null,
|
||||
confirmed: false,
|
||||
joinedAt: 1552593531,
|
||||
emailOnlyAuth: false,
|
||||
hasPassword: true,
|
||||
protected: false,
|
||||
thumb: "https://plex.tv/users/b9h6f3c8k1/avatar?c=1724402119",
|
||||
authToken: "jx9nTbVbHk1gM",
|
||||
mailingListStatus: "unsubscribed",
|
||||
mailingListActive: false,
|
||||
scrobbleTypes: "",
|
||||
country: "ES",
|
||||
subscription: {
|
||||
active: false,
|
||||
subscribedAt: "2019-03-16T15:20:12Z",
|
||||
status: "Inactive",
|
||||
paymentService: null,
|
||||
plan: null,
|
||||
features: [
|
||||
"guided-upgrade",
|
||||
"increase-password-complexity",
|
||||
"upgrade-3ds2",
|
||||
"ad-countdown-timer",
|
||||
"adaptive_bitrate",
|
||||
"amazon-loop-debug",
|
||||
"Android - Dolby Vision",
|
||||
"Android - PiP",
|
||||
"avod-ad-analysis",
|
||||
"avod-new-media",
|
||||
"blacklist_get_signin",
|
||||
"CU Sunset",
|
||||
"client-radio-stations",
|
||||
"cloudflare-turnstile-required",
|
||||
"comments_and_replies_push_notifications",
|
||||
"friend_request_push_notifications",
|
||||
"community_access_plex_tv",
|
||||
"companions_sonos",
|
||||
"custom-home-removal",
|
||||
"disable_home_user_friendships",
|
||||
"disable_sharing_friendships",
|
||||
"drm_support",
|
||||
"le_isrg_root_x1",
|
||||
"federated-auth",
|
||||
"home",
|
||||
"HRK_enable_EUR",
|
||||
"ios14-privacy-banner",
|
||||
"iterable-notification-tokens",
|
||||
"keep-payment-method",
|
||||
"kevin-bacon",
|
||||
"korea-consent",
|
||||
"lets_encrypt",
|
||||
"lightning-dvr-pivot",
|
||||
"livetv",
|
||||
"live-tv-support-incomplete-segments",
|
||||
"tuner-sharing",
|
||||
"metadata_search",
|
||||
"vod_cloudflare",
|
||||
"new_plex_pass_prices",
|
||||
"news-provider-sunset-modal",
|
||||
"photos-favorites",
|
||||
"photos-metadata-edition",
|
||||
"pms_health",
|
||||
"rate-limit-client-token",
|
||||
"shared_server_notification",
|
||||
"shared_source_notification",
|
||||
"scrobbling-service-plex-tv",
|
||||
"collections",
|
||||
"radio",
|
||||
"exclude restrictions",
|
||||
"signin_with_apple",
|
||||
"spring_serve_ad_provider",
|
||||
"transcoder_cache",
|
||||
"TREBLE-show-features",
|
||||
"two-factor-authentication",
|
||||
"unsupportedtuners",
|
||||
"vod-schema",
|
||||
"watch-together-invite",
|
||||
"web_server_dashboard"
|
||||
]
|
||||
},
|
||||
"subscriptionDescription": null,
|
||||
"restricted": false,
|
||||
"anonymous": false,
|
||||
"home": false,
|
||||
"guest": false,
|
||||
"homeSize": 1,
|
||||
"homeAdmin": false,
|
||||
"maxHomeSize": 15,
|
||||
"rememberExpiresAt": 1725611719,
|
||||
"profile": {
|
||||
"autoSelectAudio": true,
|
||||
"defaultAudioLanguage": "ja",
|
||||
"defaultSubtitleLanguage": "en",
|
||||
"autoSelectSubtitle": 1,
|
||||
"defaultSubtitleAccessibility": 0,
|
||||
"defaultSubtitleForced": 0,
|
||||
"watchedIndicator": 1,
|
||||
"mediaReviewsVisibility": 0
|
||||
subscriptionDescription: null,
|
||||
restricted: false,
|
||||
anonymous: false,
|
||||
home: false,
|
||||
guest: false,
|
||||
homeSize: 1,
|
||||
homeAdmin: false,
|
||||
maxHomeSize: 15,
|
||||
rememberExpiresAt: 1725611719,
|
||||
profile: {
|
||||
autoSelectAudio: true,
|
||||
defaultAudioLanguage: "ja",
|
||||
defaultSubtitleLanguage: "en",
|
||||
autoSelectSubtitle: 1,
|
||||
defaultSubtitleAccessibility: 0,
|
||||
defaultSubtitleForced: 0,
|
||||
watchedIndicator: 1,
|
||||
mediaReviewsVisibility: 0
|
||||
},
|
||||
"entitlements": [],
|
||||
"subscriptions": [],
|
||||
"pastSubscriptions": [{
|
||||
"id": null,
|
||||
"mode": null,
|
||||
"renewsAt": null,
|
||||
"endsAt": 1556281940,
|
||||
"billing": {
|
||||
"paymentMethodId": null, "internalPaymentMethod": {}
|
||||
entitlements: [],
|
||||
subscriptions: [],
|
||||
pastSubscriptions: [
|
||||
{
|
||||
id: null,
|
||||
mode: null,
|
||||
renewsAt: null,
|
||||
endsAt: 1556281940,
|
||||
billing: {
|
||||
paymentMethodId: null,
|
||||
internalPaymentMethod: {}
|
||||
},
|
||||
"canceled": false,
|
||||
"gracePeriod": false,
|
||||
"onHold": false,
|
||||
"canReactivate": false,
|
||||
"canUpgrade": false,
|
||||
"canDowngrade": false,
|
||||
"canConvert": false,
|
||||
"type": "plexpass",
|
||||
"transfer": null,
|
||||
"state": "ended"
|
||||
}],
|
||||
"trials": [],
|
||||
"services": [{
|
||||
"identifier": "epg",
|
||||
"endpoint": "https://epg.provider.plex.tv",
|
||||
"token": "d2h7zUjKgT5oLwQ3cQ6d",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
}, {
|
||||
"identifier": "epg-staging",
|
||||
"endpoint": "https://epg-staging.provider.plex.tv",
|
||||
"token": "r7m1nVfPhU4eRwM7eR5a",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
}, {
|
||||
"identifier": "epg-dev",
|
||||
"endpoint": "https://epg-dev.provider.plex.tv",
|
||||
"token": "z4w2sLxPbJ3iRkY2hN8f",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
}, {
|
||||
"identifier": "eyeq",
|
||||
"endpoint": "https://c4412416.ipg.web.cddbp.net/webapi/xml/1.0/",
|
||||
"token": "g1v9kWxHdT3jNiY6dF4b",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
}, {
|
||||
"identifier": "eyeq-channel-icons",
|
||||
"endpoint": "http://akamai-b.cdn.cddbp.net/cds/2.0/image",
|
||||
"token": null,
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
}, {
|
||||
"identifier": "graph-dev",
|
||||
"endpoint": "https://community-dev.plex.tv",
|
||||
"token": null,
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
}, {
|
||||
"identifier": "graph-staging",
|
||||
"endpoint": "https://community-staging.plex.tv",
|
||||
"token": null,
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
}, {
|
||||
"identifier": "community-dev",
|
||||
"endpoint": "https://community-dev.plex.tv",
|
||||
"token": null,
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
}, {
|
||||
"identifier": "community-staging",
|
||||
"endpoint": "https://community-staging.plex.tv",
|
||||
"token": null,
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
}, {
|
||||
"identifier": "community",
|
||||
"endpoint": "https://community.plex.tv",
|
||||
"token": null,
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
}, {
|
||||
"identifier": "metadata",
|
||||
"endpoint": "https://metadata.provider.plex.tv",
|
||||
"token": "h5z3rQxLhJ2lRyB4gN7v",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
}, {
|
||||
"identifier": "scrobbling",
|
||||
"endpoint": "https://scrobbles.plex.tv",
|
||||
"token": "s6y1wTxFpL7jMxC3nR8e",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
}, {
|
||||
"identifier": "metadata-dev",
|
||||
"endpoint": "https://metadata-dev.provider.plex.tv",
|
||||
"token": "j2h4tWmNpO3lRyD7vF9x",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
}, {
|
||||
"identifier": "metadata-provider",
|
||||
"endpoint": "https://mpm.plex.tv/",
|
||||
"token": null,
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
}, {
|
||||
"identifier": "tmsapi",
|
||||
"endpoint": "https://tmsapi.plex.tv/v1.1/",
|
||||
"token": "p7c8xVhLpM5oTzQ1wR2b",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
}, {
|
||||
"identifier": "subtitles-search",
|
||||
"endpoint": "https://metadata.provider.plex.tv/library/streams/matches",
|
||||
"token": "t8f3kWqNhP6uLyX4mC2y",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
}, {
|
||||
"identifier": "acoustid",
|
||||
"endpoint": "https://acoustid.plex.tv/",
|
||||
"token": "l5n7rQxHpV2oRyD9gF6b",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
}, {
|
||||
"identifier": "lyricfind",
|
||||
"endpoint": "https://lyricfind.plex.tv/",
|
||||
"token": "m3y4tUjKlN8fMxC7oQ2b",
|
||||
"secret": "a1d5vWxHpQ6oLyT4gR3c",
|
||||
"status": "online"
|
||||
}, {
|
||||
"identifier": "lyricfind-search",
|
||||
"endpoint": "https://lyricfind.plex.tv/",
|
||||
"token": "q6c8wTxFpO9kLrZ2hV5b",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
}, {
|
||||
"identifier": "tvdb",
|
||||
"endpoint": "https://api4.thetvdb.com/",
|
||||
"token": "r4h7zUjMgL1fTzN3yP5x",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
}],
|
||||
"adsConsent": null,
|
||||
"adsConsentSetAt": null,
|
||||
"adsConsentReminderAt": null,
|
||||
"experimentalFeatures": false,
|
||||
"twoFactorEnabled": false,
|
||||
"backupCodesCreated": false,
|
||||
"attributionPartner": null
|
||||
};
|
||||
canceled: false,
|
||||
gracePeriod: false,
|
||||
onHold: false,
|
||||
canReactivate: false,
|
||||
canUpgrade: false,
|
||||
canDowngrade: false,
|
||||
canConvert: false,
|
||||
type: "plexpass",
|
||||
transfer: null,
|
||||
state: "ended"
|
||||
}
|
||||
],
|
||||
trials: [],
|
||||
services: [
|
||||
{
|
||||
identifier: "epg",
|
||||
endpoint: "https://epg.provider.plex.tv",
|
||||
token: "d2h7zUjKgT5oLwQ3cQ6d",
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
identifier: "epg-staging",
|
||||
endpoint: "https://epg-staging.provider.plex.tv",
|
||||
token: "r7m1nVfPhU4eRwM7eR5a",
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
identifier: "epg-dev",
|
||||
endpoint: "https://epg-dev.provider.plex.tv",
|
||||
token: "z4w2sLxPbJ3iRkY2hN8f",
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
identifier: "eyeq",
|
||||
endpoint: "https://c4412416.ipg.web.cddbp.net/webapi/xml/1.0/",
|
||||
token: "g1v9kWxHdT3jNiY6dF4b",
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
identifier: "eyeq-channel-icons",
|
||||
endpoint: "http://akamai-b.cdn.cddbp.net/cds/2.0/image",
|
||||
token: null,
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
identifier: "graph-dev",
|
||||
endpoint: "https://community-dev.plex.tv",
|
||||
token: null,
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
identifier: "graph-staging",
|
||||
endpoint: "https://community-staging.plex.tv",
|
||||
token: null,
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
identifier: "community-dev",
|
||||
endpoint: "https://community-dev.plex.tv",
|
||||
token: null,
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
identifier: "community-staging",
|
||||
endpoint: "https://community-staging.plex.tv",
|
||||
token: null,
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
identifier: "community",
|
||||
endpoint: "https://community.plex.tv",
|
||||
token: null,
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
identifier: "metadata",
|
||||
endpoint: "https://metadata.provider.plex.tv",
|
||||
token: "h5z3rQxLhJ2lRyB4gN7v",
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
identifier: "scrobbling",
|
||||
endpoint: "https://scrobbles.plex.tv",
|
||||
token: "s6y1wTxFpL7jMxC3nR8e",
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
identifier: "metadata-dev",
|
||||
endpoint: "https://metadata-dev.provider.plex.tv",
|
||||
token: "j2h4tWmNpO3lRyD7vF9x",
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
identifier: "metadata-provider",
|
||||
endpoint: "https://mpm.plex.tv/",
|
||||
token: null,
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
identifier: "tmsapi",
|
||||
endpoint: "https://tmsapi.plex.tv/v1.1/",
|
||||
token: "p7c8xVhLpM5oTzQ1wR2b",
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
identifier: "subtitles-search",
|
||||
endpoint: "https://metadata.provider.plex.tv/library/streams/matches",
|
||||
token: "t8f3kWqNhP6uLyX4mC2y",
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
identifier: "acoustid",
|
||||
endpoint: "https://acoustid.plex.tv/",
|
||||
token: "l5n7rQxHpV2oRyD9gF6b",
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
identifier: "lyricfind",
|
||||
endpoint: "https://lyricfind.plex.tv/",
|
||||
token: "m3y4tUjKlN8fMxC7oQ2b",
|
||||
secret: "a1d5vWxHpQ6oLyT4gR3c",
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
identifier: "lyricfind-search",
|
||||
endpoint: "https://lyricfind.plex.tv/",
|
||||
token: "q6c8wTxFpO9kLrZ2hV5b",
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
identifier: "tvdb",
|
||||
endpoint: "https://api4.thetvdb.com/",
|
||||
token: "r4h7zUjMgL1fTzN3yP5x",
|
||||
secret: null,
|
||||
status: "online"
|
||||
}
|
||||
],
|
||||
adsConsent: null,
|
||||
adsConsentSetAt: null,
|
||||
adsConsentReminderAt: null,
|
||||
experimentalFeatures: false,
|
||||
twoFactorEnabled: false,
|
||||
backupCodesCreated: false,
|
||||
attributionPartner: null
|
||||
}
|
||||
|
||||
validateResponseSpec("/users/signin", "post", 201, response)
|
||||
});
|
||||
})
|
||||
|
||||
it('should validate the 201 response when the API spec is valid', () => {
|
||||
it("should validate the 201 response when the API spec is valid", () => {
|
||||
const response = {
|
||||
"id": 475829302,
|
||||
"uuid": "a1b2c3d4e5f67890",
|
||||
"username": "user12345",
|
||||
"title": "user12345",
|
||||
"email": "user12345@example.com",
|
||||
"friendlyName": "",
|
||||
"locale": null,
|
||||
"confirmed": false,
|
||||
"joinedAt": 1633376532,
|
||||
"emailOnlyAuth": false,
|
||||
"hasPassword": true,
|
||||
"protected": false,
|
||||
"thumb": "https://plex.tv/users/a1b2c3d4e5f67890/avatar?c=1234567890",
|
||||
"authToken": "gHjKlMnOpQrStUvWxYz",
|
||||
"mailingListStatus": "active",
|
||||
"mailingListActive": true,
|
||||
"scrobbleTypes": "",
|
||||
"country": "IT",
|
||||
"subscription": {
|
||||
"active": false,
|
||||
"subscribedAt": null,
|
||||
"status": "Inactive",
|
||||
"paymentService": null,
|
||||
"plan": null,
|
||||
"features": [
|
||||
id: 475829302,
|
||||
uuid: "a1b2c3d4e5f67890",
|
||||
username: "user12345",
|
||||
title: "user12345",
|
||||
email: "user12345@example.com",
|
||||
friendlyName: "",
|
||||
locale: null,
|
||||
confirmed: false,
|
||||
joinedAt: 1633376532,
|
||||
emailOnlyAuth: false,
|
||||
hasPassword: true,
|
||||
protected: false,
|
||||
thumb: "https://plex.tv/users/a1b2c3d4e5f67890/avatar?c=1234567890",
|
||||
authToken: "gHjKlMnOpQrStUvWxYz",
|
||||
mailingListStatus: "active",
|
||||
mailingListActive: true,
|
||||
scrobbleTypes: "",
|
||||
country: "IT",
|
||||
subscription: {
|
||||
active: false,
|
||||
subscribedAt: null,
|
||||
status: "Inactive",
|
||||
paymentService: null,
|
||||
plan: null,
|
||||
features: [
|
||||
"guided-upgrade",
|
||||
"increase-password-complexity",
|
||||
"upgrade-3ds2",
|
||||
@@ -290,174 +374,172 @@ describe('POST /users/signin', () => {
|
||||
"web_server_dashboard"
|
||||
]
|
||||
},
|
||||
"subscriptionDescription": null,
|
||||
"restricted": false,
|
||||
"anonymous": null,
|
||||
"home": false,
|
||||
"guest": false,
|
||||
"homeSize": 1,
|
||||
"homeAdmin": false,
|
||||
"maxHomeSize": 15,
|
||||
"rememberExpiresAt": 1725684008,
|
||||
"profile": {
|
||||
"autoSelectAudio": true,
|
||||
"defaultAudioLanguage": null,
|
||||
"defaultSubtitleLanguage": null,
|
||||
"autoSelectSubtitle": 1,
|
||||
"defaultSubtitleAccessibility": 0,
|
||||
"defaultSubtitleForced": 0,
|
||||
"watchedIndicator": 1,
|
||||
"mediaReviewsVisibility": 0
|
||||
subscriptionDescription: null,
|
||||
restricted: false,
|
||||
anonymous: null,
|
||||
home: false,
|
||||
guest: false,
|
||||
homeSize: 1,
|
||||
homeAdmin: false,
|
||||
maxHomeSize: 15,
|
||||
rememberExpiresAt: 1725684008,
|
||||
profile: {
|
||||
autoSelectAudio: true,
|
||||
defaultAudioLanguage: null,
|
||||
defaultSubtitleLanguage: null,
|
||||
autoSelectSubtitle: 1,
|
||||
defaultSubtitleAccessibility: 0,
|
||||
defaultSubtitleForced: 0,
|
||||
watchedIndicator: 1,
|
||||
mediaReviewsVisibility: 0
|
||||
},
|
||||
"entitlements": [],
|
||||
"subscriptions": [],
|
||||
"pastSubscriptions": [],
|
||||
"trials": [],
|
||||
"services": [
|
||||
entitlements: [],
|
||||
subscriptions: [],
|
||||
pastSubscriptions: [],
|
||||
trials: [],
|
||||
services: [
|
||||
{
|
||||
"identifier": "epg",
|
||||
"endpoint": "https://epg.provider.plex.tv",
|
||||
"token": "A1B2C3D4E5F6G7H8I9J0",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
identifier: "epg",
|
||||
endpoint: "https://epg.provider.plex.tv",
|
||||
token: "A1B2C3D4E5F6G7H8I9J0",
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
"identifier": "epg-staging",
|
||||
"endpoint": "https://epg-staging.provider.plex.tv",
|
||||
"token": "J9I8H7G6F5E4D3C2B1A0",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
identifier: "epg-staging",
|
||||
endpoint: "https://epg-staging.provider.plex.tv",
|
||||
token: "J9I8H7G6F5E4D3C2B1A0",
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
"identifier": "epg-dev",
|
||||
"endpoint": "https://epg-dev.provider.plex.tv",
|
||||
"token": "0J9I8H7G6F5E4D3C2B1A",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
identifier: "epg-dev",
|
||||
endpoint: "https://epg-dev.provider.plex.tv",
|
||||
token: "0J9I8H7G6F5E4D3C2B1A",
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
"identifier": "eyeq",
|
||||
"endpoint": "https://c4412416.ipg.web.cddbp.net/webapi/xml/1.0/",
|
||||
"token": "Z1X2C3V4B5N6M7Q8W9R0",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
identifier: "eyeq",
|
||||
endpoint: "https://c4412416.ipg.web.cddbp.net/webapi/xml/1.0/",
|
||||
token: "Z1X2C3V4B5N6M7Q8W9R0",
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
"identifier": "eyeq-channel-icons",
|
||||
"endpoint": "http://akamai-b.cdn.cddbp.net/cds/2.0/image",
|
||||
"token": null,
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
identifier: "eyeq-channel-icons",
|
||||
endpoint: "http://akamai-b.cdn.cddbp.net/cds/2.0/image",
|
||||
token: null,
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
"identifier": "graph-dev",
|
||||
"endpoint": "https://community-dev.plex.tv",
|
||||
"token": null,
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
identifier: "graph-dev",
|
||||
endpoint: "https://community-dev.plex.tv",
|
||||
token: null,
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
"identifier": "graph-staging",
|
||||
"endpoint": "https://community-staging.plex.tv",
|
||||
"token": null,
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
identifier: "graph-staging",
|
||||
endpoint: "https://community-staging.plex.tv",
|
||||
token: null,
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
"identifier": "community-dev",
|
||||
"endpoint": "https://community-dev.plex.tv",
|
||||
"token": null,
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
identifier: "community-dev",
|
||||
endpoint: "https://community-dev.plex.tv",
|
||||
token: null,
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
"identifier": "community-staging",
|
||||
"endpoint": "https://community-staging.plex.tv",
|
||||
"token": null,
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
identifier: "community-staging",
|
||||
endpoint: "https://community-staging.plex.tv",
|
||||
token: null,
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
"identifier": "community",
|
||||
"endpoint": "https://community.plex.tv",
|
||||
"token": null,
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
identifier: "community",
|
||||
endpoint: "https://community.plex.tv",
|
||||
token: null,
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
"identifier": "metadata",
|
||||
"endpoint": "https://metadata.provider.plex.tv",
|
||||
"token": "K1L2M3N4O5P6Q7R8S9T0",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
identifier: "metadata",
|
||||
endpoint: "https://metadata.provider.plex.tv",
|
||||
token: "K1L2M3N4O5P6Q7R8S9T0",
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
"identifier": "metadata-dev",
|
||||
"endpoint": "https://metadata-dev.provider.plex.tv",
|
||||
"token": "T0S9R8Q7P6O5N4M3L2K1",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
identifier: "metadata-dev",
|
||||
endpoint: "https://metadata-dev.provider.plex.tv",
|
||||
token: "T0S9R8Q7P6O5N4M3L2K1",
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
"identifier": "metadata-provider",
|
||||
"endpoint": "https://mpm.plex.tv/",
|
||||
"token": null,
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
identifier: "metadata-provider",
|
||||
endpoint: "https://mpm.plex.tv/",
|
||||
token: null,
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
"identifier": "tmsapi",
|
||||
"endpoint": "https://tmsapi.plex.tv/v1.1/",
|
||||
"token": "F1G2H3J4K5L6M7N8O9P0",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
identifier: "tmsapi",
|
||||
endpoint: "https://tmsapi.plex.tv/v1.1/",
|
||||
token: "F1G2H3J4K5L6M7N8O9P0",
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
"identifier": "subtitles-search",
|
||||
"endpoint": "https://metadata.provider.plex.tv/library/streams/matches",
|
||||
"token": "Q1W2E3R4T5Y6U7I8O9P0",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
identifier: "subtitles-search",
|
||||
endpoint: "https://metadata.provider.plex.tv/library/streams/matches",
|
||||
token: "Q1W2E3R4T5Y6U7I8O9P0",
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
"identifier": "acoustid",
|
||||
"endpoint": "https://acoustid.plex.tv/",
|
||||
"token": "1A2S3D4F5G6H7J8K9L0",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
identifier: "acoustid",
|
||||
endpoint: "https://acoustid.plex.tv/",
|
||||
token: "1A2S3D4F5G6H7J8K9L0",
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
"identifier": "lyricfind",
|
||||
"endpoint": "https://lyricfind.plex.tv/",
|
||||
"token": "Z9X8C7V6B5N4M3Q2W1E0",
|
||||
"secret": "X1C2V3B4N5M6Q7W8E9R0",
|
||||
"status": "online"
|
||||
identifier: "lyricfind",
|
||||
endpoint: "https://lyricfind.plex.tv/",
|
||||
token: "Z9X8C7V6B5N4M3Q2W1E0",
|
||||
secret: "X1C2V3B4N5M6Q7W8E9R0",
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
"identifier": "lyricfind-search",
|
||||
"endpoint": "https://lyricfind.plex.tv/",
|
||||
"token": "F6D5S4A3J2K1L8P7O9M0",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
identifier: "lyricfind-search",
|
||||
endpoint: "https://lyricfind.plex.tv/",
|
||||
token: "F6D5S4A3J2K1L8P7O9M0",
|
||||
secret: null,
|
||||
status: "online"
|
||||
},
|
||||
{
|
||||
"identifier": "tvdb",
|
||||
"endpoint": "https://api4.thetvdb.com/",
|
||||
"token": "L1K2J3H4G5F6D7S8A9P0",
|
||||
"secret": null,
|
||||
"status": "online"
|
||||
identifier: "tvdb",
|
||||
endpoint: "https://api4.thetvdb.com/",
|
||||
token: "L1K2J3H4G5F6D7S8A9P0",
|
||||
secret: null,
|
||||
status: "online"
|
||||
}
|
||||
],
|
||||
"adsConsent": null,
|
||||
"adsConsentSetAt": null,
|
||||
"adsConsentReminderAt": null,
|
||||
"experimentalFeatures": false,
|
||||
"twoFactorEnabled": false,
|
||||
"backupCodesCreated": false,
|
||||
"attributionPartner": null
|
||||
adsConsent: null,
|
||||
adsConsentSetAt: null,
|
||||
adsConsentReminderAt: null,
|
||||
experimentalFeatures: false,
|
||||
twoFactorEnabled: false,
|
||||
backupCodesCreated: false,
|
||||
attributionPartner: null
|
||||
}
|
||||
;
|
||||
|
||||
validateResponseSpec("/users/signin", "post", 201, response)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,25 +1,26 @@
|
||||
import PMSSpec from '../../output/plex-media-server-spec-dereferenced.yaml';
|
||||
import Ajv from "ajv";
|
||||
import addFormats from "ajv-formats";
|
||||
import {expect} from 'vitest'
|
||||
|
||||
|
||||
export function validateResponseSpec(path: string, type: 'get' | 'post' | 'delete', statusCode: number, response: any): void {
|
||||
|
||||
const ajv = new Ajv({allErrors: true, strict: false});
|
||||
ajv.addSchema(PMSSpec, "API.yaml");
|
||||
addFormats(ajv);
|
||||
import PMSSpec from "../../output/plex-media-server-spec-dereferenced.yaml"
|
||||
import Ajv from "ajv"
|
||||
import addFormats from "ajv-formats"
|
||||
import { expect } from "vitest"
|
||||
|
||||
export function validateResponseSpec(
|
||||
path: string,
|
||||
type: "get" | "post" | "delete",
|
||||
statusCode: number,
|
||||
response: any
|
||||
): void {
|
||||
const ajv = new Ajv({ allErrors: true, strict: false })
|
||||
ajv.addSchema(PMSSpec, "API.yaml")
|
||||
addFormats(ajv)
|
||||
|
||||
// Convert JSONPath to JSON Pointer
|
||||
const pathPointer = `/paths/${path.replace(/\//g, `~1`)}/${type}/responses/${statusCode}/content/application~1json/schema`
|
||||
|
||||
const validate = ajv.validate({$ref: "API.yaml#" + pathPointer}, response);
|
||||
const validate = ajv.validate({ $ref: "API.yaml#" + pathPointer }, response)
|
||||
|
||||
if (!validate) {
|
||||
console.error(ajv.errors);
|
||||
console.error(ajv.errors)
|
||||
}
|
||||
|
||||
expect(validate).toBe(true);
|
||||
|
||||
expect(validate).toBe(true)
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
export * from './import.js';
|
||||
export * from "./import.js"
|
||||
|
||||
@@ -4,16 +4,10 @@
|
||||
"outDir": "./output",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"],
|
||||
"@utils": [
|
||||
"./tests/utils/index.ts"
|
||||
]
|
||||
"@utils": ["./tests/utils/index.ts"]
|
||||
},
|
||||
"types": [
|
||||
"@modyfi/vite-plugin-yaml/modules"
|
||||
],
|
||||
"types": ["@modyfi/vite-plugin-yaml/modules"],
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import ViteYaml from '@modyfi/vite-plugin-yaml';
|
||||
import tsconfigPaths from 'vite-tsconfig-paths'
|
||||
import { defineConfig } from 'vite'
|
||||
import ViteYaml from "@modyfi/vite-plugin-yaml"
|
||||
import tsconfigPaths from "vite-tsconfig-paths"
|
||||
import { defineConfig } from "vite"
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [tsconfigPaths(), ViteYaml()],
|
||||
plugins: [tsconfigPaths(), ViteYaml()]
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user