ref sectionKey

This commit is contained in:
JasonLandbridge
2024-09-03 15:50:48 +02:00
parent edc93f8d76
commit 03977988b5
13 changed files with 48 additions and 74 deletions

BIN
bun.lockb

Binary file not shown.

View File

@@ -12,6 +12,7 @@
"test": "bun run build && vitest --run",
"setup-speakeasy-cli": "curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh",
"lint": "speakeasy lint openapi -s ./src/pms-spec.yaml",
"lint-redocly": "redocly lint",
"lint-bundled": "speakeasy lint openapi -s ./output/plex-media-server-spec-dereferenced.yaml"
},
"keywords": ["plex", "api", "specification", "openapi", "swagger"],

View File

@@ -1,2 +1,9 @@
extends:
- recommended
apis:
core@v1:
root: ./src/pms-spec.yaml
rules:
no-ambiguous-paths: off

View File

@@ -1,10 +1,12 @@
name: X-Plex-Container-Size
in: query
description: |
Add the length/size of the number of media to be retrieved.
The number of items to return. If not specified, all items will be returned.
If the number of items exceeds the limit, the response will be paginated.
By default this is 50
schema:
type: integer
format: int32
default: 50
example: 50
required: false

View File

@@ -1,10 +1,12 @@
name: X-Plex-Container-Start
in: query
description: |
Add the index start from which the media items should be returned.
The index of the first item to return. If not specified, the first item will be returned.
If the number of items exceeds the limit, the response will be paginated.
By default this is 0
schema:
type: integer
format: int32
default: 0
example: 0
required: false

View File

@@ -0,0 +1,9 @@
name: sectionKey
description: The unique key of the library item to return the children of.
in: path
schema:
type: integer
format: int32
example: 9518
required: true

View File

@@ -45,13 +45,7 @@ get:
operationId: get-library-details
parameters:
- name: sectionId
description: The id of the library
in: path
schema:
type: number
example: 15
required: true
- $ref: "../../../parameters/library/section-key.yaml"
- name: includeDetails
description: |
Whether or not to include details for a section (types, filters, and sorts).
@@ -64,7 +58,6 @@ get:
- 1
default: 0
required: false
responses:
"200":
description: The details of the library
@@ -245,13 +238,7 @@ delete:
description: Delete a library using a specific section id
operationId: deleteLibrary
parameters:
- name: sectionId
description: The id of the library
in: path
schema:
type: number
example: 15
required: true
- $ref: "../../../parameters/library/section-key.yaml"
responses:
"200":
description: The library is deleted

View File

@@ -25,12 +25,7 @@ get:
- `firstCharacter`: Items categorized by the first letter.
- `folder`: Items categorized by folder.
parameters:
- name: sectionId
in: path
required: true
description: the Id of the library to query
schema:
type: [integer, string]
- $ref: "../../../parameters/library/section-key.yaml"
- name: tag
in: path
required: true

View File

@@ -23,12 +23,7 @@ get:
> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered.
parameters:
- name: sectionId
in: path
required: true
description: the Id of the library to query
schema:
type: integer
- $ref: "../../../parameters/library/section-key.yaml"
- $ref: "../../../parameters/accept-application-json.yaml"
- $ref: "../../../parameters/type.yaml"
responses:

View File

@@ -6,13 +6,7 @@ get:
This endpoint Refreshes all the Metadata of the library.
operationId: get-refresh-library-metadata
parameters:
- name: sectionId
description: The id of the library
in: path
schema:
type: number
example: 15
required: true
- $ref: "../../../../parameters/library/section-key.yaml"
- name: force
description: Force the refresh even if the library is already being refreshed.
in: query

View File

@@ -6,7 +6,7 @@ get:
- Watchlist
summary: Get User Watchlist
description: Get User Watchlist
operationId: getWatchlist
operationId: get-watch-list
parameters:
# Many details of this api were taken from the python-plexapi library
# See: https://github.com/pkkid/python-plexapi/blob/dd80deb18fe1111050777d067f3d87b0524d4850/plexapi/myplex.py#L904
@@ -68,30 +68,10 @@ get:
enum:
- 1
- 0
- name: X-Plex-Token
description: User Token
in: query
required: true
schema:
type: string
- name: X-Plex-Container-Start
description: |
The index of the first item to return. If not specified, the first item will be returned.
If the number of items exceeds the limit, the response will be paginated.
in: query
required: false
schema:
type: integer
format: int32
- name: X-Plex-Container-Size
description: |
The number of items to return. If not specified, all items will be returned.
If the number of items exceeds the limit, the response will be paginated.
in: query
required: false
schema:
type: integer
format: int32
- $ref: "../../../../parameters/accept-application-json.yaml"
- $ref: "../../../../parameters/container-start.yaml"
- $ref: "../../../../parameters/container-size.yaml"
- $ref: "../../../../parameters/plex-token.yaml"
responses:
"200":
description: Watchlist Data
@@ -208,6 +188,6 @@ get:
playableKey:
type: string
"400":
$ref: "../../responses/400.yaml"
$ref: "../../../../responses/400.yaml"
"401":
$ref: "../../responses/401.yaml"
$ref: "../../../../responses/401.yaml"

View File

@@ -87,14 +87,14 @@ get:
items:
type: object
properties:
accountID:
accountID:
type: integer
format: int32
example: 238960586
deviceID:
deviceID:
type: integer
format: int32
exmaple: 208
example: 208
timespan:
type: integer
example: 6
@@ -102,7 +102,7 @@ get:
type: integer
format: int32
example: 1718387650
lan:
lan:
type: boolean
example: true
bytes:

View File

@@ -119,17 +119,21 @@ paths:
$ref: "./paths/library/get-recently-added.yaml"
/library/sections:
$ref: "./paths/library/get-all-libraries.yaml"
/library/sections/{sectionId}:
/library/sections/{sectionKey}:
$ref: "./paths/library/[sectionId]/get-and-delete-library-details.yaml"
# Watchlist
/library/sections/watchlist/{filter}:
$ref: "./paths/library/sections/watchlist/get-watch-list.yaml"
/library/sections/{sectionId}/{tag}:
/library/sections/{sectionKey}/{tag}:
$ref: "./paths/library/[sectionId]/get-library-items.yaml"
/library/sections/{sectionId}/refresh:
/library/sections/{sectionKey}/refresh:
$ref: "./paths/library/[sectionId]/refresh/get-refresh-library-metadata.yaml"
/library/sections/{sectionId}/search:
/library/sections/{sectionKey}/search:
$ref: "./paths/library/[sectionId]/get-search-library.yaml"
/library/metadata/{ratingKey}:
$ref: "./paths/library/metadata/[ratingKey]/get-meta-data-by-rating-key.yaml"
/library/metadata/{ratingKey}/banner:
@@ -227,9 +231,7 @@ paths:
/users/signin:
$ref: "./paths/users/post-sign-in.yaml"
# Watchlist
/library/sections/watchlist/{filter}:
$ref: "./paths/metadata/watchlist.yaml"
tags:
- name: Activities