Compare commits

...

4 Commits

Author SHA1 Message Date
speakeasybot
2712820397 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.528.1 2025-04-03 00:12:07 +00:00
speakeasybot
c895213ae8 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.526.6 2025-03-31 19:44:01 +00:00
Luke Hagar
c473c9d326 Update workflow.yaml 2025-03-31 14:41:40 -05:00
speakeasybot
3c13bba9de ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.526.6 2025-03-31 19:35:21 +00:00
85 changed files with 3140 additions and 158 deletions

File diff suppressed because one or more lines are too long

View File

@@ -15,7 +15,7 @@ generation:
oAuth2ClientCredentialsEnabled: true oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false oAuth2PasswordEnabled: false
typescript: typescript:
version: 0.35.2 version: 0.36.0
additionalDependencies: additionalDependencies:
dependencies: {} dependencies: {}
devDependencies: {} devDependencies: {}

View File

@@ -1,4 +1,4 @@
speakeasyVersion: 1.526.6 speakeasyVersion: 1.528.1
sources: sources:
my-source: my-source:
sourceNamespace: my-source sourceNamespace: my-source
@@ -9,20 +9,20 @@ sources:
- main - main
plexapi: plexapi:
sourceNamespace: plexapi sourceNamespace: plexapi
sourceRevisionDigest: sha256:cffb18feaa0523b300655a6f0073caad99133b143f5a420fddbb1e1efe47bcaf sourceRevisionDigest: sha256:b5580df6ec4a386e12249ff13f35b916fe5559e101de4a816b53e47d6947f1a5
sourceBlobDigest: sha256:1737023e29cd9cf36c07ccd8c8c48c47e14f47ce22b4d6ba9ee241afbbd8f351 sourceBlobDigest: sha256:6108b6c35fbe7e9163ffe0c804170f5e3a6edb63b8e745454ea8ee249bd790c3
tags: tags:
- latest - latest
- speakeasy-sdk-regen-1743438725 - speakeasy-sdk-regen-1743639051
- 0.0.3 - 0.0.3
targets: targets:
plexjs: plexjs:
source: plexapi source: plexapi
sourceNamespace: plexapi sourceNamespace: plexapi
sourceRevisionDigest: sha256:cffb18feaa0523b300655a6f0073caad99133b143f5a420fddbb1e1efe47bcaf sourceRevisionDigest: sha256:b5580df6ec4a386e12249ff13f35b916fe5559e101de4a816b53e47d6947f1a5
sourceBlobDigest: sha256:1737023e29cd9cf36c07ccd8c8c48c47e14f47ce22b4d6ba9ee241afbbd8f351 sourceBlobDigest: sha256:6108b6c35fbe7e9163ffe0c804170f5e3a6edb63b8e745454ea8ee249bd790c3
codeSamplesNamespace: code-samples-typescript-plexjs codeSamplesNamespace: code-samples-typescript-plexjs
codeSamplesRevisionDigest: sha256:1e82144ee5f8b57f2ee0633b982f4dd97305e92b7810d3ea83a6960fb89390cf codeSamplesRevisionDigest: sha256:1d984798d2ba05ff7dfba1649556f6ece8cbfabbf9260f6a2678748f02977d47
workflow: workflow:
workflowVersion: 1.0.0 workflowVersion: 1.0.0
speakeasyVersion: latest speakeasyVersion: latest
@@ -43,6 +43,5 @@ workflow:
output: codeSamples.yaml output: codeSamples.yaml
registry: registry:
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-typescript-plexjs location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-typescript-plexjs
langOverride: TypeScript
labelOverride: labelOverride:
fixedValue: PlexJS fixedValue: PlexJS

View File

@@ -17,6 +17,5 @@ targets:
output: codeSamples.yaml output: codeSamples.yaml
registry: registry:
location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-typescript-plexjs location: registry.speakeasyapi.dev/plexapi/plexapi/code-samples-typescript-plexjs
langOverride: TypeScript
labelOverride: labelOverride:
fixedValue: PlexJS fixedValue: PlexJS

View File

@@ -54,6 +54,7 @@ The following SDKs are generated from the OpenAPI Specification. They are automa
* [Authentication](#authentication) * [Authentication](#authentication)
* [Requirements](#requirements) * [Requirements](#requirements)
* [Standalone functions](#standalone-functions) * [Standalone functions](#standalone-functions)
* [File uploads](#file-uploads)
* [Retries](#retries) * [Retries](#retries)
* [Debugging](#debugging) * [Debugging](#debugging)
* [Development](#development) * [Development](#development)
@@ -167,6 +168,10 @@ run();
* [getActorsLibrary](docs/sdks/library/README.md#getactorslibrary) - Get Actors of library media * [getActorsLibrary](docs/sdks/library/README.md#getactorslibrary) - Get Actors of library media
* [getSearchAllLibraries](docs/sdks/library/README.md#getsearchalllibraries) - Search All Libraries * [getSearchAllLibraries](docs/sdks/library/README.md#getsearchalllibraries) - Search All Libraries
* [getMediaMetaData](docs/sdks/library/README.md#getmediametadata) - Get Media Metadata * [getMediaMetaData](docs/sdks/library/README.md#getmediametadata) - Get Media Metadata
* [getMediaArts](docs/sdks/library/README.md#getmediaarts) - Get Media Background Artwork
* [postMediaArts](docs/sdks/library/README.md#postmediaarts) - Upload Media Background Artwork
* [getMediaPosters](docs/sdks/library/README.md#getmediaposters) - Get Media Posters
* [postMediaPoster](docs/sdks/library/README.md#postmediaposter) - Upload Media Poster
* [getMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children * [getMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children
* [getTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content * [getTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content
@@ -543,13 +548,17 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
- [`libraryGetGenresLibrary`](docs/sdks/library/README.md#getgenreslibrary) - Get Genres of library media - [`libraryGetGenresLibrary`](docs/sdks/library/README.md#getgenreslibrary) - Get Genres of library media
- [`libraryGetLibraryDetails`](docs/sdks/library/README.md#getlibrarydetails) - Get Library Details - [`libraryGetLibraryDetails`](docs/sdks/library/README.md#getlibrarydetails) - Get Library Details
- [`libraryGetLibraryItems`](docs/sdks/library/README.md#getlibraryitems) - Get Library Items - [`libraryGetLibraryItems`](docs/sdks/library/README.md#getlibraryitems) - Get Library Items
- [`libraryGetMediaArts`](docs/sdks/library/README.md#getmediaarts) - Get Media Background Artwork
- [`libraryGetMediaMetaData`](docs/sdks/library/README.md#getmediametadata) - Get Media Metadata - [`libraryGetMediaMetaData`](docs/sdks/library/README.md#getmediametadata) - Get Media Metadata
- [`libraryGetMediaPosters`](docs/sdks/library/README.md#getmediaposters) - Get Media Posters
- [`libraryGetMetadataChildren`](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children - [`libraryGetMetadataChildren`](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children
- [`libraryGetRecentlyAddedLibrary`](docs/sdks/library/README.md#getrecentlyaddedlibrary) - Get Recently Added - [`libraryGetRecentlyAddedLibrary`](docs/sdks/library/README.md#getrecentlyaddedlibrary) - Get Recently Added
- [`libraryGetRefreshLibraryMetadata`](docs/sdks/library/README.md#getrefreshlibrarymetadata) - Refresh Metadata Of The Library - [`libraryGetRefreshLibraryMetadata`](docs/sdks/library/README.md#getrefreshlibrarymetadata) - Refresh Metadata Of The Library
- [`libraryGetSearchAllLibraries`](docs/sdks/library/README.md#getsearchalllibraries) - Search All Libraries - [`libraryGetSearchAllLibraries`](docs/sdks/library/README.md#getsearchalllibraries) - Search All Libraries
- [`libraryGetSearchLibrary`](docs/sdks/library/README.md#getsearchlibrary) - Search Library - [`libraryGetSearchLibrary`](docs/sdks/library/README.md#getsearchlibrary) - Search Library
- [`libraryGetTopWatchedContent`](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content - [`libraryGetTopWatchedContent`](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content
- [`libraryPostMediaArts`](docs/sdks/library/README.md#postmediaarts) - Upload Media Background Artwork
- [`libraryPostMediaPoster`](docs/sdks/library/README.md#postmediaposter) - Upload Media Poster
- [`logEnablePaperTrail`](docs/sdks/log/README.md#enablepapertrail) - Enabling Papertrail - [`logEnablePaperTrail`](docs/sdks/log/README.md#enablepapertrail) - Enabling Papertrail
- [`logLogLine`](docs/sdks/log/README.md#logline) - Logging a single line message. - [`logLogLine`](docs/sdks/log/README.md#logline) - Logging a single line message.
- [`logLogMultiLine`](docs/sdks/log/README.md#logmultiline) - Logging a multi-line message - [`logLogMultiLine`](docs/sdks/log/README.md#logmultiline) - Logging a multi-line message
@@ -604,6 +613,42 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
</details> </details>
<!-- End Standalone functions [standalone-funcs] --> <!-- End Standalone functions [standalone-funcs] -->
<!-- Start File uploads [file-upload] -->
## File uploads
Certain SDK methods accept files as part of a multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.
> [!TIP]
>
> Depending on your JavaScript runtime, there are convenient utilities that return a handle to a file without reading the entire contents into memory:
>
> - **Node.js v20+:** Since v20, Node.js comes with a native `openAsBlob` function in [`node:fs`](https://nodejs.org/docs/latest-v20.x/api/fs.html#fsopenasblobpath-options).
> - **Bun:** The native [`Bun.file`](https://bun.sh/docs/api/file-io#reading-files-bun-file) function produces a file handle that can be used for streaming file uploads.
> - **Browsers:** All supported browsers return an instance to a [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) when reading the value from an `<input type="file">` element.
> - **Node.js v18:** A file stream can be created using the `fileFrom` helper from [`fetch-blob/from.js`](https://www.npmjs.com/package/fetch-blob).
```typescript
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.postMediaArts(
2268,
"https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b",
);
// Handle the result
console.log(result);
}
run();
```
<!-- End File uploads [file-upload] -->
<!-- Start Retries [retries] --> <!-- Start Retries [retries] -->
## Retries ## Retries

View File

@@ -1259,3 +1259,33 @@ Based on:
- [typescript v0.35.2] . - [typescript v0.35.2] .
### Releases ### Releases
- [NPM v0.35.2] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.35.2 - . - [NPM v0.35.2] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.35.2 - .
## 2025-03-31 19:33:46
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.526.6 (2.563.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.35.3] .
### Releases
- [NPM v0.35.3] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.35.3 - .
## 2025-03-31 19:42:25
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.526.6 (2.563.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.35.4] .
### Releases
- [NPM v0.35.4] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.35.4 - .
## 2025-04-03 00:10:29
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.528.1 (2.565.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.36.0] .
### Releases
- [NPM v0.36.0] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.36.0 - .

View File

@@ -6,7 +6,7 @@ actions:
- target: $["paths"]["/"]["get"] - target: $["paths"]["/"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -26,7 +26,7 @@ actions:
- target: $["paths"]["/:/prefs"]["get"] - target: $["paths"]["/:/prefs"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -46,7 +46,7 @@ actions:
- target: $["paths"]["/:/progress"]["post"] - target: $["paths"]["/:/progress"]["post"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -66,7 +66,7 @@ actions:
- target: $["paths"]["/:/scrobble"]["get"] - target: $["paths"]["/:/scrobble"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -86,7 +86,7 @@ actions:
- target: $["paths"]["/:/timeline"]["get"] - target: $["paths"]["/:/timeline"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -118,7 +118,7 @@ actions:
- target: $["paths"]["/:/unscrobble"]["get"] - target: $["paths"]["/:/unscrobble"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -138,7 +138,7 @@ actions:
- target: $["paths"]["/activities"]["get"] - target: $["paths"]["/activities"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -158,7 +158,7 @@ actions:
- target: $["paths"]["/activities/{activityUUID}"]["delete"] - target: $["paths"]["/activities/{activityUUID}"]["delete"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -178,7 +178,7 @@ actions:
- target: $["paths"]["/butler"]["delete"] - target: $["paths"]["/butler"]["delete"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -198,7 +198,7 @@ actions:
- target: $["paths"]["/butler"]["get"] - target: $["paths"]["/butler"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -218,7 +218,7 @@ actions:
- target: $["paths"]["/butler"]["post"] - target: $["paths"]["/butler"]["post"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -238,7 +238,7 @@ actions:
- target: $["paths"]["/butler/{taskName}"]["delete"] - target: $["paths"]["/butler/{taskName}"]["delete"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -259,7 +259,7 @@ actions:
- target: $["paths"]["/butler/{taskName}"]["post"] - target: $["paths"]["/butler/{taskName}"]["post"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -280,7 +280,7 @@ actions:
- target: $["paths"]["/clients"]["get"] - target: $["paths"]["/clients"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -300,7 +300,7 @@ actions:
- target: $["paths"]["/companions"]["get"] - target: $["paths"]["/companions"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -320,7 +320,7 @@ actions:
- target: $["paths"]["/devices"]["get"] - target: $["paths"]["/devices"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -340,7 +340,7 @@ actions:
- target: $["paths"]["/friends"]["get"] - target: $["paths"]["/friends"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -360,7 +360,7 @@ actions:
- target: $["paths"]["/geoip"]["get"] - target: $["paths"]["/geoip"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -378,7 +378,7 @@ actions:
- target: $["paths"]["/home"]["get"] - target: $["paths"]["/home"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -398,7 +398,7 @@ actions:
- target: $["paths"]["/hubs"]["get"] - target: $["paths"]["/hubs"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -418,7 +418,7 @@ actions:
- target: $["paths"]["/hubs/home/recentlyAdded"]["get"] - target: $["paths"]["/hubs/home/recentlyAdded"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -443,7 +443,7 @@ actions:
- target: $["paths"]["/hubs/search"]["get"] - target: $["paths"]["/hubs/search"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -463,7 +463,7 @@ actions:
- target: $["paths"]["/hubs/search/voice"]["get"] - target: $["paths"]["/hubs/search/voice"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -483,7 +483,7 @@ actions:
- target: $["paths"]["/hubs/sections/{sectionId}"]["get"] - target: $["paths"]["/hubs/sections/{sectionId}"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -503,7 +503,7 @@ actions:
- target: $["paths"]["/identity"]["get"] - target: $["paths"]["/identity"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -521,7 +521,7 @@ actions:
- target: $["paths"]["/library/all/top"]["get"] - target: $["paths"]["/library/all/top"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -542,7 +542,7 @@ actions:
- target: $["paths"]["/library/hashes"]["get"] - target: $["paths"]["/library/hashes"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -562,7 +562,7 @@ actions:
- target: $["paths"]["/library/metadata/{ratingKey}"]["get"] - target: $["paths"]["/library/metadata/{ratingKey}"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -593,11 +593,51 @@ actions:
console.log(result); console.log(result);
} }
run();
- target: $["paths"]["/library/metadata/{ratingKey}/arts"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getMediaArts(16099);
// Handle the result
console.log(result);
}
run();
- target: $["paths"]["/library/metadata/{ratingKey}/arts"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.postMediaArts(2268, "https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b");
// Handle the result
console.log(result);
}
run(); run();
- target: $["paths"]["/library/metadata/{ratingKey}/banner"]["get"] - target: $["paths"]["/library/metadata/{ratingKey}/banner"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -624,7 +664,7 @@ actions:
- target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"] - target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -640,11 +680,51 @@ actions:
console.log(result); console.log(result);
} }
run();
- target: $["paths"]["/library/metadata/{ratingKey}/posters"]["get"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getMediaPosters(16099);
// Handle the result
console.log(result);
}
run();
- target: $["paths"]["/library/metadata/{ratingKey}/posters"]["post"]
update:
x-codeSamples:
- lang: typescript
label: PlexJS
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.postMediaPoster(2268, "https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b");
// Handle the result
console.log(result);
}
run(); run();
- target: $["paths"]["/library/metadata/{ratingKey}/thumb"]["get"] - target: $["paths"]["/library/metadata/{ratingKey}/thumb"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -671,7 +751,7 @@ actions:
- target: $["paths"]["/library/recentlyAdded"]["get"] - target: $["paths"]["/library/recentlyAdded"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -710,7 +790,7 @@ actions:
- target: $["paths"]["/library/search"]["get"] - target: $["paths"]["/library/search"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -737,7 +817,7 @@ actions:
- target: $["paths"]["/library/sections"]["get"] - target: $["paths"]["/library/sections"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -757,7 +837,7 @@ actions:
- target: $["paths"]["/library/sections/watchlist/{filter}"]["get"] - target: $["paths"]["/library/sections/watchlist/{filter}"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -781,7 +861,7 @@ actions:
- target: $["paths"]["/library/sections/{sectionKey}"]["delete"] - target: $["paths"]["/library/sections/{sectionKey}"]["delete"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -801,7 +881,7 @@ actions:
- target: $["paths"]["/library/sections/{sectionKey}"]["get"] - target: $["paths"]["/library/sections/{sectionKey}"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -821,7 +901,7 @@ actions:
- target: $["paths"]["/library/sections/{sectionKey}/actor"]["get"] - target: $["paths"]["/library/sections/{sectionKey}/actor"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -842,7 +922,7 @@ actions:
- target: $["paths"]["/library/sections/{sectionKey}/all"]["get"] - target: $["paths"]["/library/sections/{sectionKey}/all"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -866,7 +946,7 @@ actions:
- target: $["paths"]["/library/sections/{sectionKey}/country"]["get"] - target: $["paths"]["/library/sections/{sectionKey}/country"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -887,7 +967,7 @@ actions:
- target: $["paths"]["/library/sections/{sectionKey}/genre"]["get"] - target: $["paths"]["/library/sections/{sectionKey}/genre"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -908,7 +988,7 @@ actions:
- target: $["paths"]["/library/sections/{sectionKey}/refresh"]["get"] - target: $["paths"]["/library/sections/{sectionKey}/refresh"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -929,7 +1009,7 @@ actions:
- target: $["paths"]["/library/sections/{sectionKey}/search"]["get"] - target: $["paths"]["/library/sections/{sectionKey}/search"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -950,7 +1030,7 @@ actions:
- target: $["paths"]["/library/sections/{sectionKey}/{tag}"]["get"] - target: $["paths"]["/library/sections/{sectionKey}/{tag}"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -975,7 +1055,7 @@ actions:
- target: $["paths"]["/log"]["get"] - target: $["paths"]["/log"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -996,7 +1076,7 @@ actions:
- target: $["paths"]["/log"]["post"] - target: $["paths"]["/log"]["post"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1018,7 +1098,7 @@ actions:
- target: $["paths"]["/log/networked"]["get"] - target: $["paths"]["/log/networked"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1038,7 +1118,7 @@ actions:
- target: $["paths"]["/media/providers"]["get"] - target: $["paths"]["/media/providers"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1058,7 +1138,7 @@ actions:
- target: $["paths"]["/myplex/account"]["get"] - target: $["paths"]["/myplex/account"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1078,7 +1158,7 @@ actions:
- target: $["paths"]["/photo/:/transcode"]["get"] - target: $["paths"]["/photo/:/transcode"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1107,7 +1187,7 @@ actions:
- target: $["paths"]["/pins"]["post"] - target: $["paths"]["/pins"]["post"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1131,7 +1211,7 @@ actions:
- target: $["paths"]["/pins/{pinID}"]["get"] - target: $["paths"]["/pins/{pinID}"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1156,7 +1236,7 @@ actions:
- target: $["paths"]["/playlists"]["get"] - target: $["paths"]["/playlists"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1176,7 +1256,7 @@ actions:
- target: $["paths"]["/playlists"]["post"] - target: $["paths"]["/playlists"]["post"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1202,7 +1282,7 @@ actions:
- target: $["paths"]["/playlists/upload"]["post"] - target: $["paths"]["/playlists/upload"]["post"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1223,7 +1303,7 @@ actions:
- target: $["paths"]["/playlists/{playlistID}"]["delete"] - target: $["paths"]["/playlists/{playlistID}"]["delete"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1243,7 +1323,7 @@ actions:
- target: $["paths"]["/playlists/{playlistID}"]["get"] - target: $["paths"]["/playlists/{playlistID}"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1263,7 +1343,7 @@ actions:
- target: $["paths"]["/playlists/{playlistID}"]["put"] - target: $["paths"]["/playlists/{playlistID}"]["put"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1283,7 +1363,7 @@ actions:
- target: $["paths"]["/playlists/{playlistID}/items"]["delete"] - target: $["paths"]["/playlists/{playlistID}/items"]["delete"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1303,7 +1383,7 @@ actions:
- target: $["paths"]["/playlists/{playlistID}/items"]["get"] - target: $["paths"]["/playlists/{playlistID}/items"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1324,7 +1404,7 @@ actions:
- target: $["paths"]["/playlists/{playlistID}/items"]["put"] - target: $["paths"]["/playlists/{playlistID}/items"]["put"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1344,7 +1424,7 @@ actions:
- target: $["paths"]["/resources"]["get"] - target: $["paths"]["/resources"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1364,7 +1444,7 @@ actions:
- target: $["paths"]["/search"]["get"] - target: $["paths"]["/search"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1384,7 +1464,7 @@ actions:
- target: $["paths"]["/security/resources"]["get"] - target: $["paths"]["/security/resources"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1404,7 +1484,7 @@ actions:
- target: $["paths"]["/security/token"]["get"] - target: $["paths"]["/security/token"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1425,7 +1505,7 @@ actions:
- target: $["paths"]["/servers"]["get"] - target: $["paths"]["/servers"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1445,7 +1525,7 @@ actions:
- target: $["paths"]["/statistics/bandwidth"]["get"] - target: $["paths"]["/statistics/bandwidth"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1465,7 +1545,7 @@ actions:
- target: $["paths"]["/statistics/media"]["get"] - target: $["paths"]["/statistics/media"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1485,7 +1565,7 @@ actions:
- target: $["paths"]["/statistics/resources"]["get"] - target: $["paths"]["/statistics/resources"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1505,7 +1585,7 @@ actions:
- target: $["paths"]["/status/sessions"]["get"] - target: $["paths"]["/status/sessions"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1525,7 +1605,7 @@ actions:
- target: $["paths"]["/status/sessions/history/all"]["get"] - target: $["paths"]["/status/sessions/history/all"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1545,7 +1625,7 @@ actions:
- target: $["paths"]["/transcode/sessions"]["get"] - target: $["paths"]["/transcode/sessions"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1565,7 +1645,7 @@ actions:
- target: $["paths"]["/transcode/sessions/{sessionKey}"]["delete"] - target: $["paths"]["/transcode/sessions/{sessionKey}"]["delete"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1585,7 +1665,7 @@ actions:
- target: $["paths"]["/updater/apply"]["put"] - target: $["paths"]["/updater/apply"]["put"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1606,7 +1686,7 @@ actions:
- target: $["paths"]["/updater/check"]["put"] - target: $["paths"]["/updater/check"]["put"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1627,7 +1707,7 @@ actions:
- target: $["paths"]["/updater/status"]["get"] - target: $["paths"]["/updater/status"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1647,7 +1727,7 @@ actions:
- target: $["paths"]["/user"]["get"] - target: $["paths"]["/user"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1667,7 +1747,7 @@ actions:
- target: $["paths"]["/users"]["get"] - target: $["paths"]["/users"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1699,7 +1779,7 @@ actions:
- target: $["paths"]["/users/signin"]["post"] - target: $["paths"]["/users/signin"]["post"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
@@ -1728,7 +1808,7 @@ actions:
- target: $["paths"]["/video/:/transcode/universal/start.mpd"]["get"] - target: $["paths"]["/video/:/transcode/universal/start.mpd"]["get"]
update: update:
x-codeSamples: x-codeSamples:
- lang: TypeScript - lang: typescript
label: PlexJS label: PlexJS
source: |- source: |-
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";

View File

@@ -6,7 +6,7 @@
import { AddPlaylistContentsRequest } from "@lukehagar/plexjs/sdk/models/operations"; import { AddPlaylistContentsRequest } from "@lukehagar/plexjs/sdk/models/operations";
let value: AddPlaylistContentsRequest = { let value: AddPlaylistContentsRequest = {
playlistID: 2776.28, playlistID: 5654.21,
uri: "server://12345/com.plexapp.plugins.library/library/metadata/1", uri: "server://12345/com.plexapp.plugins.library/library/metadata/1",
playQueueID: 123, playQueueID: 123,
}; };

View File

@@ -7,7 +7,7 @@ import { AddPlaylistContentsResponse } from "@lukehagar/plexjs/sdk/models/operat
let value: AddPlaylistContentsResponse = { let value: AddPlaylistContentsResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 307, statusCode: 100,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -7,7 +7,7 @@ import { ApplyUpdatesResponse } from "@lukehagar/plexjs/sdk/models/operations";
let value: ApplyUpdatesResponse = { let value: ApplyUpdatesResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 208, statusCode: 305,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -7,7 +7,7 @@ import { Billing } from "@lukehagar/plexjs/sdk/models/operations";
let value: Billing = { let value: Billing = {
internalPaymentMethod: {}, internalPaymentMethod: {},
paymentMethodId: 903720, paymentMethodId: 16429,
}; };
``` ```

View File

@@ -7,7 +7,7 @@ import { CheckForUpdatesResponse } from "@lukehagar/plexjs/sdk/models/operations
let value: CheckForUpdatesResponse = { let value: CheckForUpdatesResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 428, statusCode: 505,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -6,7 +6,7 @@
import { ClearPlaylistContentsRequest } from "@lukehagar/plexjs/sdk/models/operations"; import { ClearPlaylistContentsRequest } from "@lukehagar/plexjs/sdk/models/operations";
let value: ClearPlaylistContentsRequest = { let value: ClearPlaylistContentsRequest = {
playlistID: 4246.85, playlistID: 1320.68,
}; };
``` ```

View File

@@ -7,7 +7,7 @@ import { ClearPlaylistContentsResponse } from "@lukehagar/plexjs/sdk/models/oper
let value: ClearPlaylistContentsResponse = { let value: ClearPlaylistContentsResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 204, statusCode: 411,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -7,7 +7,7 @@ type of playlist to create
```typescript ```typescript
import { CreatePlaylistQueryParamType } from "@lukehagar/plexjs/sdk/models/operations"; import { CreatePlaylistQueryParamType } from "@lukehagar/plexjs/sdk/models/operations";
let value: CreatePlaylistQueryParamType = CreatePlaylistQueryParamType.Photo; let value: CreatePlaylistQueryParamType = CreatePlaylistQueryParamType.Video;
``` ```
## Values ## Values

View File

@@ -7,9 +7,9 @@ import { CreatePlaylistQueryParamType, CreatePlaylistRequest, Smart } from "@luk
let value: CreatePlaylistRequest = { let value: CreatePlaylistRequest = {
title: "<value>", title: "<value>",
type: CreatePlaylistQueryParamType.Audio, type: CreatePlaylistQueryParamType.Photo,
smart: Smart.One, smart: Smart.One,
uri: "https://ajar-reward.biz/", uri: "https://firsthand-section.biz",
}; };
``` ```

View File

@@ -7,7 +7,7 @@ import { CreatePlaylistResponse } from "@lukehagar/plexjs/sdk/models/operations"
let value: CreatePlaylistResponse = { let value: CreatePlaylistResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 205, statusCode: 507,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -6,7 +6,7 @@
import { DeletePlaylistRequest } from "@lukehagar/plexjs/sdk/models/operations"; import { DeletePlaylistRequest } from "@lukehagar/plexjs/sdk/models/operations";
let value: DeletePlaylistRequest = { let value: DeletePlaylistRequest = {
playlistID: 6874.88, playlistID: 2074.7,
}; };
``` ```

View File

@@ -7,7 +7,7 @@ import { DeletePlaylistResponse } from "@lukehagar/plexjs/sdk/models/operations"
let value: DeletePlaylistResponse = { let value: DeletePlaylistResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 226, statusCode: 303,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -7,7 +7,7 @@ import { EnablePaperTrailResponse } from "@lukehagar/plexjs/sdk/models/operation
let value: EnablePaperTrailResponse = { let value: EnablePaperTrailResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 304, statusCode: 409,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -7,7 +7,7 @@ Filter
```typescript ```typescript
import { Filter } from "@lukehagar/plexjs/sdk/models/operations"; import { Filter } from "@lukehagar/plexjs/sdk/models/operations";
let value: Filter = Filter.Released; let value: Filter = Filter.Available;
``` ```
## Values ## Values

View File

@@ -7,7 +7,7 @@ import { GetBandwidthStatisticsResponse } from "@lukehagar/plexjs/sdk/models/ope
let value: GetBandwidthStatisticsResponse = { let value: GetBandwidthStatisticsResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 205, statusCode: 226,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -0,0 +1,36 @@
# GetMediaArtsMediaContainer
## Example Usage
```typescript
import { GetMediaArtsMediaContainer } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetMediaArtsMediaContainer = {
size: 50,
mediaTagVersion: 1734362201,
mediaTagPrefix: "/system/bundle/media/flags/",
identifier: "com.plexapp.plugins.library",
metadata: [
{
key:
"https://image.tmdb.org/t/p/original/ixgFmf1X59PUZam2qbAfskx2gQr.jpg",
provider: "tmdb",
ratingKey:
"https://image.tmdb.org/t/p/original/ixgFmf1X59PUZam2qbAfskx2gQr.jpg",
selected: true,
thumb:
"https://images.plex.tv/photo?height=270&width=480&minSize=1&upscale=1&url=https%3A%2F%2Fimage%2Etmdb%2Eorg%2Ft%2Fp%2Foriginal%2FixgFmf1X59PUZam2qbAfskx2gQr%2Ejpg",
},
],
};
```
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `size` | *number* | :heavy_check_mark: | Number of media items returned in this response. | 50 |
| `mediaTagVersion` | *number* | :heavy_check_mark: | The version number for media tags. | 1734362201 |
| `mediaTagPrefix` | *string* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ |
| `identifier` | *string* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library |
| `metadata` | [operations.GetMediaArtsMetadata](../../../sdk/models/operations/getmediaartsmetadata.md)[] | :heavy_check_mark: | N/A | |

View File

@@ -0,0 +1,27 @@
# GetMediaArtsMetadata
## Example Usage
```typescript
import { GetMediaArtsMetadata } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetMediaArtsMetadata = {
key: "https://image.tmdb.org/t/p/original/ixgFmf1X59PUZam2qbAfskx2gQr.jpg",
provider: "tmdb",
ratingKey:
"https://image.tmdb.org/t/p/original/ixgFmf1X59PUZam2qbAfskx2gQr.jpg",
selected: true,
thumb:
"https://images.plex.tv/photo?height=270&width=480&minSize=1&upscale=1&url=https%3A%2F%2Fimage%2Etmdb%2Eorg%2Ft%2Fp%2Foriginal%2FixgFmf1X59PUZam2qbAfskx2gQr%2Ejpg",
};
```
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `key` | *string* | :heavy_check_mark: | The URL of the artwork. | https://image.tmdb.org/t/p/original/ixgFmf1X59PUZam2qbAfskx2gQr.jpg |
| `provider` | *string* | :heavy_minus_sign: | The provider of the artwork. | tmdb |
| `ratingKey` | *string* | :heavy_check_mark: | The URL of the artwork. | https://image.tmdb.org/t/p/original/ixgFmf1X59PUZam2qbAfskx2gQr.jpg |
| `selected` | *boolean* | :heavy_check_mark: | Whether this is the selected artwork. | true |
| `thumb` | *string* | :heavy_check_mark: | The URL of the artwork thumbnail. | https://images.plex.tv/photo?height=270&width=480&minSize=1&upscale=1&url=https%3A%2F%2Fimage%2Etmdb%2Eorg%2Ft%2Fp%2Foriginal%2FixgFmf1X59PUZam2qbAfskx2gQr%2Ejpg |

View File

@@ -0,0 +1,17 @@
# GetMediaArtsRequest
## Example Usage
```typescript
import { GetMediaArtsRequest } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetMediaArtsRequest = {
ratingKey: 16099,
};
```
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
| `ratingKey` | *number* | :heavy_check_mark: | the id of the library item to return the artwork of. | 16099 |

View File

@@ -0,0 +1,44 @@
# GetMediaArtsResponse
## Example Usage
```typescript
import { GetMediaArtsResponse } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetMediaArtsResponse = {
contentType: "<value>",
statusCode: 203,
rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" },
}),
object: {
mediaContainer: {
size: 50,
mediaTagVersion: 1734362201,
mediaTagPrefix: "/system/bundle/media/flags/",
identifier: "com.plexapp.plugins.library",
metadata: [
{
key:
"https://image.tmdb.org/t/p/original/ixgFmf1X59PUZam2qbAfskx2gQr.jpg",
provider: "tmdb",
ratingKey:
"https://image.tmdb.org/t/p/original/ixgFmf1X59PUZam2qbAfskx2gQr.jpg",
selected: true,
thumb:
"https://images.plex.tv/photo?height=270&width=480&minSize=1&upscale=1&url=https%3A%2F%2Fimage%2Etmdb%2Eorg%2Ft%2Fp%2Foriginal%2FixgFmf1X59PUZam2qbAfskx2gQr%2Ejpg",
},
],
},
},
};
```
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation |
| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
| `object` | [operations.GetMediaArtsResponseBody](../../../sdk/models/operations/getmediaartsresponsebody.md) | :heavy_minus_sign: | The available background artwork for the library item. |

View File

@@ -0,0 +1,36 @@
# GetMediaArtsResponseBody
The available background artwork for the library item.
## Example Usage
```typescript
import { GetMediaArtsResponseBody } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetMediaArtsResponseBody = {
mediaContainer: {
size: 50,
mediaTagVersion: 1734362201,
mediaTagPrefix: "/system/bundle/media/flags/",
identifier: "com.plexapp.plugins.library",
metadata: [
{
key:
"https://image.tmdb.org/t/p/original/ixgFmf1X59PUZam2qbAfskx2gQr.jpg",
provider: "tmdb",
ratingKey:
"https://image.tmdb.org/t/p/original/ixgFmf1X59PUZam2qbAfskx2gQr.jpg",
selected: true,
thumb:
"https://images.plex.tv/photo?height=270&width=480&minSize=1&upscale=1&url=https%3A%2F%2Fimage%2Etmdb%2Eorg%2Ft%2Fp%2Foriginal%2FixgFmf1X59PUZam2qbAfskx2gQr%2Ejpg",
},
],
},
};
```
## Fields
| Field | Type | Required | Description |
| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `mediaContainer` | [operations.GetMediaArtsMediaContainer](../../../sdk/models/operations/getmediaartsmediacontainer.md) | :heavy_minus_sign: | N/A |

View File

@@ -0,0 +1,36 @@
# GetMediaPostersMediaContainer
## Example Usage
```typescript
import { GetMediaPostersMediaContainer } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetMediaPostersMediaContainer = {
size: 50,
mediaTagVersion: 1734362201,
mediaTagPrefix: "/system/bundle/media/flags/",
identifier: "com.plexapp.plugins.library",
metadata: [
{
key:
"https://image.tmdb.org/t/p/original/hntBJjqbv4m0Iyniqaztv9xaudI.jpg",
provider: "tmdb",
ratingKey:
"https://image.tmdb.org/t/p/original/hntBJjqbv4m0Iyniqaztv9xaudI.jpg",
selected: true,
thumb:
"https://images.plex.tv/photo?height=336&width=225&minSize=1&upscale=1&url=https%3A%2F%2Fimage%2Etmdb%2Eorg%2Ft%2Fp%2Foriginal%2FhntBJjqbv4m0Iyniqaztv9xaudI%2Ejpg",
},
],
};
```
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| `size` | *number* | :heavy_check_mark: | Number of media items returned in this response. | 50 |
| `mediaTagVersion` | *number* | :heavy_check_mark: | The version number for media tags. | 1734362201 |
| `mediaTagPrefix` | *string* | :heavy_check_mark: | The prefix used for media tag resource paths. | /system/bundle/media/flags/ |
| `identifier` | *string* | :heavy_check_mark: | An plugin identifier for the media container. | com.plexapp.plugins.library |
| `metadata` | [operations.GetMediaPostersMetadata](../../../sdk/models/operations/getmediapostersmetadata.md)[] | :heavy_check_mark: | N/A | |

View File

@@ -0,0 +1,27 @@
# GetMediaPostersMetadata
## Example Usage
```typescript
import { GetMediaPostersMetadata } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetMediaPostersMetadata = {
key: "https://image.tmdb.org/t/p/original/hntBJjqbv4m0Iyniqaztv9xaudI.jpg",
provider: "tmdb",
ratingKey:
"https://image.tmdb.org/t/p/original/hntBJjqbv4m0Iyniqaztv9xaudI.jpg",
selected: true,
thumb:
"https://images.plex.tv/photo?height=336&width=225&minSize=1&upscale=1&url=https%3A%2F%2Fimage%2Etmdb%2Eorg%2Ft%2Fp%2Foriginal%2FhntBJjqbv4m0Iyniqaztv9xaudI%2Ejpg",
};
```
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `key` | *string* | :heavy_check_mark: | The URL of the poster. | https://image.tmdb.org/t/p/original/hntBJjqbv4m0Iyniqaztv9xaudI.jpg |
| `provider` | *string* | :heavy_minus_sign: | The provider of the poster. | tmdb |
| `ratingKey` | *string* | :heavy_check_mark: | The URL of the poster. | https://image.tmdb.org/t/p/original/hntBJjqbv4m0Iyniqaztv9xaudI.jpg |
| `selected` | *boolean* | :heavy_check_mark: | Whether this is the selected poster. | true |
| `thumb` | *string* | :heavy_check_mark: | The URL of the poster thumbnail. | https://images.plex.tv/photo?height=336&width=225&minSize=1&upscale=1&url=https%3A%2F%2Fimage%2Etmdb%2Eorg%2Ft%2Fp%2Foriginal%2FhntBJjqbv4m0Iyniqaztv9xaudI%2Ejpg |

View File

@@ -0,0 +1,17 @@
# GetMediaPostersRequest
## Example Usage
```typescript
import { GetMediaPostersRequest } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetMediaPostersRequest = {
ratingKey: 16099,
};
```
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
| `ratingKey` | *number* | :heavy_check_mark: | the id of the library item to return the posters of. | 16099 |

View File

@@ -0,0 +1,44 @@
# GetMediaPostersResponse
## Example Usage
```typescript
import { GetMediaPostersResponse } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetMediaPostersResponse = {
contentType: "<value>",
statusCode: 508,
rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" },
}),
object: {
mediaContainer: {
size: 50,
mediaTagVersion: 1734362201,
mediaTagPrefix: "/system/bundle/media/flags/",
identifier: "com.plexapp.plugins.library",
metadata: [
{
key:
"https://image.tmdb.org/t/p/original/hntBJjqbv4m0Iyniqaztv9xaudI.jpg",
provider: "tmdb",
ratingKey:
"https://image.tmdb.org/t/p/original/hntBJjqbv4m0Iyniqaztv9xaudI.jpg",
selected: true,
thumb:
"https://images.plex.tv/photo?height=336&width=225&minSize=1&upscale=1&url=https%3A%2F%2Fimage%2Etmdb%2Eorg%2Ft%2Fp%2Foriginal%2FhntBJjqbv4m0Iyniqaztv9xaudI%2Ejpg",
},
],
},
},
};
```
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation |
| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
| `object` | [operations.GetMediaPostersResponseBody](../../../sdk/models/operations/getmediapostersresponsebody.md) | :heavy_minus_sign: | The available posters for the library item. |

View File

@@ -0,0 +1,36 @@
# GetMediaPostersResponseBody
The available posters for the library item.
## Example Usage
```typescript
import { GetMediaPostersResponseBody } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetMediaPostersResponseBody = {
mediaContainer: {
size: 50,
mediaTagVersion: 1734362201,
mediaTagPrefix: "/system/bundle/media/flags/",
identifier: "com.plexapp.plugins.library",
metadata: [
{
key:
"https://image.tmdb.org/t/p/original/hntBJjqbv4m0Iyniqaztv9xaudI.jpg",
provider: "tmdb",
ratingKey:
"https://image.tmdb.org/t/p/original/hntBJjqbv4m0Iyniqaztv9xaudI.jpg",
selected: true,
thumb:
"https://images.plex.tv/photo?height=336&width=225&minSize=1&upscale=1&url=https%3A%2F%2Fimage%2Etmdb%2Eorg%2Ft%2Fp%2Foriginal%2FhntBJjqbv4m0Iyniqaztv9xaudI%2Ejpg",
},
],
},
};
```
## Fields
| Field | Type | Required | Description |
| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `mediaContainer` | [operations.GetMediaPostersMediaContainer](../../../sdk/models/operations/getmediapostersmediacontainer.md) | :heavy_minus_sign: | N/A |

View File

@@ -6,7 +6,7 @@
import { GetMetadataChildrenRequest } from "@lukehagar/plexjs/sdk/models/operations"; import { GetMetadataChildrenRequest } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetMetadataChildrenRequest = { let value: GetMetadataChildrenRequest = {
ratingKey: 3119.45, ratingKey: 2543.56,
}; };
``` ```

View File

@@ -7,7 +7,7 @@ import { GetMetadataChildrenResponse } from "@lukehagar/plexjs/sdk/models/operat
let value: GetMetadataChildrenResponse = { let value: GetMetadataChildrenResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 202, statusCode: 101,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -6,7 +6,7 @@
import { GetPlaylistContentsQueryParamType, GetPlaylistContentsRequest } from "@lukehagar/plexjs/sdk/models/operations"; import { GetPlaylistContentsQueryParamType, GetPlaylistContentsRequest } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetPlaylistContentsRequest = { let value: GetPlaylistContentsRequest = {
playlistID: 5182.01, playlistID: 8638.56,
type: GetPlaylistContentsQueryParamType.TvShow, type: GetPlaylistContentsQueryParamType.TvShow,
}; };
``` ```

View File

@@ -8,7 +8,7 @@ import { RFCDate } from "@lukehagar/plexjs/sdk/types";
let value: GetPlaylistContentsResponse = { let value: GetPlaylistContentsResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 100, statusCode: 102,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -6,7 +6,7 @@
import { GetPlaylistRequest } from "@lukehagar/plexjs/sdk/models/operations"; import { GetPlaylistRequest } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetPlaylistRequest = { let value: GetPlaylistRequest = {
playlistID: 7980.47, playlistID: 2133.12,
}; };
``` ```

View File

@@ -7,7 +7,7 @@ import { GetPlaylistResponse } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetPlaylistResponse = { let value: GetPlaylistResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 103, statusCode: 300,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -7,7 +7,7 @@ import { GetPlaylistsResponse } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetPlaylistsResponse = { let value: GetPlaylistsResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 503, statusCode: 407,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -7,7 +7,7 @@ import { GetResourcesStatisticsResponse } from "@lukehagar/plexjs/sdk/models/ope
let value: GetResourcesStatisticsResponse = { let value: GetResourcesStatisticsResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 424, statusCode: 226,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -8,7 +8,7 @@ import { RFCDate } from "@lukehagar/plexjs/sdk/types";
let value: GetSessionHistoryResponse = { let value: GetSessionHistoryResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 510, statusCode: 428,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -7,7 +7,7 @@ import { GetSessionsResponse } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetSessionsResponse = { let value: GetSessionsResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 101, statusCode: 508,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -7,7 +7,7 @@ import { GetSourceConnectionInformationResponse } from "@lukehagar/plexjs/sdk/mo
let value: GetSourceConnectionInformationResponse = { let value: GetSourceConnectionInformationResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 101, statusCode: 305,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -7,7 +7,7 @@ import { GetStatisticsResponse } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetStatisticsResponse = { let value: GetStatisticsResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 103, statusCode: 510,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -13,7 +13,7 @@ import {
let value: GetTokenDetailsResponse = { let value: GetTokenDetailsResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 508, statusCode: 202,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),
@@ -31,7 +31,7 @@ let value: GetTokenDetailsResponse = {
homeSize: 1, homeSize: 1,
id: 13692262, id: 13692262,
joinedAt: 1556281940, joinedAt: 1556281940,
locale: "pl", locale: "fr",
mailingListStatus: MailingListStatus.Active, mailingListStatus: MailingListStatus.Active,
maxHomeSize: 15, maxHomeSize: 15,
profile: { profile: {

View File

@@ -27,7 +27,7 @@ let value: GetTokenDetailsUserPlexAccount = {
homeSize: 1, homeSize: 1,
id: 13692262, id: 13692262,
joinedAt: 1556281940, joinedAt: 1556281940,
locale: "ja", locale: "el",
mailingListStatus: MailingListStatus.Active, mailingListStatus: MailingListStatus.Active,
maxHomeSize: 15, maxHomeSize: 15,
profile: { profile: {

View File

@@ -8,7 +8,7 @@ import { RFCDate } from "@lukehagar/plexjs/sdk/types";
let value: GetTopWatchedContentResponse = { let value: GetTopWatchedContentResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 103, statusCode: 206,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -7,7 +7,7 @@ import { GetTranscodeSessionsResponse } from "@lukehagar/plexjs/sdk/models/opera
let value: GetTranscodeSessionsResponse = { let value: GetTranscodeSessionsResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 226, statusCode: 208,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -7,7 +7,7 @@ import { GetTransientTokenResponse } from "@lukehagar/plexjs/sdk/models/operatio
let value: GetTransientTokenResponse = { let value: GetTransientTokenResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 205, statusCode: 429,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -7,7 +7,7 @@ import { GetUpdateStatusResponse } from "@lukehagar/plexjs/sdk/models/operations
let value: GetUpdateStatusResponse = { let value: GetUpdateStatusResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 508, statusCode: 201,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -7,7 +7,7 @@ import { GetUsersResponse } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetUsersResponse = { let value: GetUsersResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 400, statusCode: 201,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -6,7 +6,7 @@
import { Filter, GetWatchListRequest } from "@lukehagar/plexjs/sdk/models/operations"; import { Filter, GetWatchListRequest } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetWatchListRequest = { let value: GetWatchListRequest = {
filter: Filter.All, filter: Filter.Released,
xPlexToken: "CV5xoxjTpFKUzBTShsaf", xPlexToken: "CV5xoxjTpFKUzBTShsaf",
}; };
``` ```

View File

@@ -7,7 +7,7 @@ import { GetWatchListResponse } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetWatchListResponse = { let value: GetWatchListResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 302, statusCode: 304,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -13,7 +13,7 @@ An integer log level to write to the PMS log with.
```typescript ```typescript
import { Level } from "@lukehagar/plexjs/sdk/models/operations"; import { Level } from "@lukehagar/plexjs/sdk/models/operations";
let value: Level = Level.Three; let value: Level = Level.Four;
``` ```
## Values ## Values

View File

@@ -6,7 +6,7 @@
import { Level, LogLineRequest } from "@lukehagar/plexjs/sdk/models/operations"; import { Level, LogLineRequest } from "@lukehagar/plexjs/sdk/models/operations";
let value: LogLineRequest = { let value: LogLineRequest = {
level: Level.One, level: Level.Four,
message: "Test log message", message: "Test log message",
source: "Postman", source: "Postman",
}; };

View File

@@ -7,7 +7,7 @@ import { LogLineResponse } from "@lukehagar/plexjs/sdk/models/operations";
let value: LogLineResponse = { let value: LogLineResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 100, statusCode: 206,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -7,7 +7,7 @@ import { LogMultiLineResponse } from "@lukehagar/plexjs/sdk/models/operations";
let value: LogMultiLineResponse = { let value: LogMultiLineResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 102, statusCode: 200,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -15,7 +15,7 @@ let value: PastSubscription = {
state: PostUsersSignInDataState.Ended, state: PostUsersSignInDataState.Ended,
billing: { billing: {
internalPaymentMethod: {}, internalPaymentMethod: {},
paymentMethodId: 83422, paymentMethodId: 929530,
}, },
}; };
``` ```

View File

@@ -7,7 +7,7 @@ limit to a type of playlist.
```typescript ```typescript
import { PlaylistType } from "@lukehagar/plexjs/sdk/models/operations"; import { PlaylistType } from "@lukehagar/plexjs/sdk/models/operations";
let value: PlaylistType = PlaylistType.Photo; let value: PlaylistType = PlaylistType.Audio;
``` ```
## Values ## Values

View File

@@ -0,0 +1,17 @@
# PostMediaArtsRequest
## Example Usage
```typescript
import { PostMediaArtsRequest } from "@lukehagar/plexjs/sdk/models/operations";
// No examples available for this model
```
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `ratingKey` | *number* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 |
| `url` | *string* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b |
| `requestBody` | *ReadableStream<Uint8Array>* | :heavy_minus_sign: | The contents of the image, if uploading a local file | |

View File

@@ -0,0 +1,23 @@
# PostMediaArtsResponse
## Example Usage
```typescript
import { PostMediaArtsResponse } from "@lukehagar/plexjs/sdk/models/operations";
let value: PostMediaArtsResponse = {
contentType: "<value>",
statusCode: 201,
rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" },
}),
};
```
## Fields
| Field | Type | Required | Description |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation |
| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |

View File

@@ -0,0 +1,17 @@
# PostMediaPosterRequest
## Example Usage
```typescript
import { PostMediaPosterRequest } from "@lukehagar/plexjs/sdk/models/operations";
// No examples available for this model
```
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `ratingKey` | *number* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 |
| `url` | *string* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b |
| `requestBody` | *ReadableStream<Uint8Array>* | :heavy_minus_sign: | The contents of the image, if uploading a local file | |

View File

@@ -0,0 +1,23 @@
# PostMediaPosterResponse
## Example Usage
```typescript
import { PostMediaPosterResponse } from "@lukehagar/plexjs/sdk/models/operations";
let value: PostMediaPosterResponse = {
contentType: "<value>",
statusCode: 302,
rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" },
}),
};
```
## Fields
| Field | Type | Required | Description |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation |
| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |

View File

@@ -14,7 +14,7 @@ import {
let value: PostUsersSignInDataResponse = { let value: PostUsersSignInDataResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 503, statusCode: 205,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),
@@ -32,7 +32,7 @@ let value: PostUsersSignInDataResponse = {
homeSize: 1, homeSize: 1,
id: 13692262, id: 13692262,
joinedAt: 1556281940, joinedAt: 1556281940,
locale: "it", locale: "es",
mailingListStatus: PostUsersSignInDataMailingListStatus.Active, mailingListStatus: PostUsersSignInDataMailingListStatus.Active,
maxHomeSize: 15, maxHomeSize: 15,
profile: { profile: {
@@ -79,7 +79,7 @@ let value: PostUsersSignInDataResponse = {
state: PostUsersSignInDataState.Ended, state: PostUsersSignInDataState.Ended,
billing: { billing: {
internalPaymentMethod: {}, internalPaymentMethod: {},
paymentMethodId: 100294, paymentMethodId: 485628,
}, },
}, },
], ],

View File

@@ -28,7 +28,7 @@ let value: PostUsersSignInDataUserPlexAccount = {
homeSize: 1, homeSize: 1,
id: 13692262, id: 13692262,
joinedAt: 1556281940, joinedAt: 1556281940,
locale: "hi", locale: "sv",
mailingListStatus: PostUsersSignInDataMailingListStatus.Active, mailingListStatus: PostUsersSignInDataMailingListStatus.Active,
maxHomeSize: 15, maxHomeSize: 15,
profile: { profile: {
@@ -75,7 +75,7 @@ let value: PostUsersSignInDataUserPlexAccount = {
state: PostUsersSignInDataState.Ended, state: PostUsersSignInDataState.Ended,
billing: { billing: {
internalPaymentMethod: {}, internalPaymentMethod: {},
paymentMethodId: 584476, paymentMethodId: 785153,
}, },
}, },
], ],

View File

@@ -7,7 +7,7 @@ import { StopTranscodeSessionResponse } from "@lukehagar/plexjs/sdk/models/opera
let value: StopTranscodeSessionResponse = { let value: StopTranscodeSessionResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 226, statusCode: 400,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -6,7 +6,7 @@
import { UpdatePlaylistRequest } from "@lukehagar/plexjs/sdk/models/operations"; import { UpdatePlaylistRequest } from "@lukehagar/plexjs/sdk/models/operations";
let value: UpdatePlaylistRequest = { let value: UpdatePlaylistRequest = {
playlistID: 7308.56, playlistID: 4635.75,
}; };
``` ```

View File

@@ -7,7 +7,7 @@ import { UpdatePlaylistResponse } from "@lukehagar/plexjs/sdk/models/operations"
let value: UpdatePlaylistResponse = { let value: UpdatePlaylistResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 202, statusCode: 205,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -7,7 +7,7 @@ import { QueryParamForce, UploadPlaylistRequest } from "@lukehagar/plexjs/sdk/mo
let value: UploadPlaylistRequest = { let value: UploadPlaylistRequest = {
path: "/home/barkley/playlist.m3u", path: "/home/barkley/playlist.m3u",
force: QueryParamForce.One, force: QueryParamForce.Zero,
sectionID: 1, sectionID: 1,
}; };
``` ```

View File

@@ -7,7 +7,7 @@ import { UploadPlaylistResponse } from "@lukehagar/plexjs/sdk/models/operations"
let value: UploadPlaylistResponse = { let value: UploadPlaylistResponse = {
contentType: "<value>", contentType: "<value>",
statusCode: 102, statusCode: 508,
rawResponse: new Response("{\"message\": \"hello world\"}", { rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}), }),

View File

@@ -22,6 +22,10 @@ API Calls interacting with Plex Media Server Libraries
* [getActorsLibrary](#getactorslibrary) - Get Actors of library media * [getActorsLibrary](#getactorslibrary) - Get Actors of library media
* [getSearchAllLibraries](#getsearchalllibraries) - Search All Libraries * [getSearchAllLibraries](#getsearchalllibraries) - Search All Libraries
* [getMediaMetaData](#getmediametadata) - Get Media Metadata * [getMediaMetaData](#getmediametadata) - Get Media Metadata
* [getMediaArts](#getmediaarts) - Get Media Background Artwork
* [postMediaArts](#postmediaarts) - Upload Media Background Artwork
* [getMediaPosters](#getmediaposters) - Get Media Posters
* [postMediaPoster](#postmediaposter) - Upload Media Poster
* [getMetadataChildren](#getmetadatachildren) - Get Items Children * [getMetadataChildren](#getmetadatachildren) - Get Items Children
* [getTopWatchedContent](#gettopwatchedcontent) - Get Top Watched Content * [getTopWatchedContent](#gettopwatchedcontent) - Get Top Watched Content
@@ -1269,6 +1273,298 @@ run();
| errors.GetMediaMetaDataUnauthorized | 401 | application/json | | errors.GetMediaMetaDataUnauthorized | 401 | application/json |
| errors.SDKError | 4XX, 5XX | \*/\* | | errors.SDKError | 4XX, 5XX | \*/\* |
## getMediaArts
Returns the background artwork for a library item.
### Example Usage
```typescript
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getMediaArts(16099);
// Handle the result
console.log(result);
}
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { libraryGetMediaArts } from "@lukehagar/plexjs/funcs/libraryGetMediaArts.js";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accessToken: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await libraryGetMediaArts(plexAPI, 16099);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ratingKey` | *number* | :heavy_check_mark: | the id of the library item to return the artwork of. | [object Object] |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
### Response
**Promise\<[operations.GetMediaArtsResponse](../../sdk/models/operations/getmediaartsresponse.md)\>**
### Errors
| Error Type | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4XX, 5XX | \*/\* |
## postMediaArts
Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL
### Example Usage
```typescript
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.postMediaArts(2268, "https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b");
// Handle the result
console.log(result);
}
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { libraryPostMediaArts } from "@lukehagar/plexjs/funcs/libraryPostMediaArts.js";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accessToken: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await libraryPostMediaArts(plexAPI, 2268, "https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ratingKey` | *number* | :heavy_check_mark: | the id of the library item to return the posters of. | [object Object] |
| `url` | *string* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | [object Object] |
| `requestBody` | *ReadableStream<Uint8Array>* | :heavy_minus_sign: | The contents of the image, if uploading a local file | |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
### Response
**Promise\<[operations.PostMediaArtsResponse](../../sdk/models/operations/postmediaartsresponse.md)\>**
### Errors
| Error Type | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4XX, 5XX | \*/\* |
## getMediaPosters
Returns the available posters for a library item.
### Example Usage
```typescript
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.getMediaPosters(16099);
// Handle the result
console.log(result);
}
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { libraryGetMediaPosters } from "@lukehagar/plexjs/funcs/libraryGetMediaPosters.js";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accessToken: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await libraryGetMediaPosters(plexAPI, 16099);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ratingKey` | *number* | :heavy_check_mark: | the id of the library item to return the posters of. | [object Object] |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
### Response
**Promise\<[operations.GetMediaPostersResponse](../../sdk/models/operations/getmediapostersresponse.md)\>**
### Errors
| Error Type | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4XX, 5XX | \*/\* |
## postMediaPoster
Uploads a poster to a library item, either from a local file or a remote URL
### Example Usage
```typescript
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.library.postMediaPoster(2268, "https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b");
// Handle the result
console.log(result);
}
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { libraryPostMediaPoster } from "@lukehagar/plexjs/funcs/libraryPostMediaPoster.js";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accessToken: "<YOUR_API_KEY_HERE>",
});
async function run() {
const res = await libraryPostMediaPoster(plexAPI, 2268, "https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
```
### Parameters
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ratingKey` | *number* | :heavy_check_mark: | the id of the library item to return the posters of. | [object Object] |
| `url` | *string* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | [object Object] |
| `requestBody` | *ReadableStream<Uint8Array>* | :heavy_minus_sign: | The contents of the image, if uploading a local file | |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
### Response
**Promise\<[operations.PostMediaPosterResponse](../../sdk/models/operations/postmediaposterresponse.md)\>**
### Errors
| Error Type | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4XX, 5XX | \*/\* |
## getMetadataChildren ## getMetadataChildren
This endpoint will return the children of of a library item specified with the ratingKey. This endpoint will return the children of of a library item specified with the ratingKey.

View File

@@ -2,7 +2,7 @@
{ {
"name": "@lukehagar/plexjs", "name": "@lukehagar/plexjs",
"version": "0.35.2", "version": "0.36.0",
"exports": { "exports": {
".": "./src/index.ts", ".": "./src/index.ts",
"./sdk/models/errors": "./src/sdk/models/errors/index.ts", "./sdk/models/errors": "./src/sdk/models/errors/index.ts",

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "@lukehagar/plexjs", "name": "@lukehagar/plexjs",
"version": "0.35.2", "version": "0.36.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lukehagar/plexjs", "name": "@lukehagar/plexjs",
"version": "0.35.2", "version": "0.36.0",
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.19.0", "@eslint/js": "^9.19.0",
"eslint": "^9.19.0", "eslint": "^9.19.0",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@lukehagar/plexjs", "name": "@lukehagar/plexjs",
"version": "0.35.2", "version": "0.36.0",
"author": "LukeHagar", "author": "LukeHagar",
"main": "./index.js", "main": "./index.js",
"sideEffects": false, "sideEffects": false,

View File

@@ -0,0 +1,174 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { PlexAPICore } from "../core.js";
import { encodeSimple } from "../lib/encodings.js";
import * as M from "../lib/matchers.js";
import { compactMap } from "../lib/primitives.js";
import { safeParse } from "../lib/schemas.js";
import { RequestOptions } from "../lib/sdks.js";
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
} from "../sdk/models/errors/httpclienterrors.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
* Get Media Background Artwork
*
* @remarks
* Returns the background artwork for a library item.
*/
export function libraryGetMediaArts(
client: PlexAPICore,
ratingKey: number,
options?: RequestOptions,
): APIPromise<
Result<
operations.GetMediaArtsResponse,
| SDKError
| SDKValidationError
| UnexpectedClientError
| InvalidRequestError
| RequestAbortedError
| RequestTimeoutError
| ConnectionError
>
> {
return new APIPromise($do(
client,
ratingKey,
options,
));
}
async function $do(
client: PlexAPICore,
ratingKey: number,
options?: RequestOptions,
): Promise<
[
Result<
operations.GetMediaArtsResponse,
| SDKError
| SDKValidationError
| UnexpectedClientError
| InvalidRequestError
| RequestAbortedError
| RequestTimeoutError
| ConnectionError
>,
APICall,
]
> {
const input: operations.GetMediaArtsRequest = {
ratingKey: ratingKey,
};
const parsed = safeParse(
input,
(value) => operations.GetMediaArtsRequest$outboundSchema.parse(value),
"Input validation failed",
);
if (!parsed.ok) {
return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
ratingKey: encodeSimple("ratingKey", payload.ratingKey, {
explode: false,
charEncoding: "percent",
}),
};
const path = pathToFunc("/library/metadata/{ratingKey}/arts")(pathParams);
const headers = new Headers(compactMap({
Accept: "application/json",
}));
const secConfig = await extractSecurity(client._options.accessToken);
const securityInput = secConfig == null ? {} : { accessToken: secConfig };
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "get-media-arts",
oAuth2Scopes: [],
resolvedSecurity: requestSecurity,
securitySource: client._options.accessToken,
retryConfig: options?.retries
|| client._options.retryConfig
|| { strategy: "none" },
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
};
const requestRes = client._createRequest(context, {
security: requestSecurity,
method: "GET",
baseURL: options?.serverURL,
path: path,
headers: headers,
body: body,
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: ["404", "4XX", "5XX"],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
const responseFields = {
ContentType: response.headers.get("content-type")
?? "application/octet-stream",
StatusCode: response.status,
RawResponse: response,
Headers: {},
};
const [result] = await M.match<
operations.GetMediaArtsResponse,
| SDKError
| SDKValidationError
| UnexpectedClientError
| InvalidRequestError
| RequestAbortedError
| RequestTimeoutError
| ConnectionError
>(
M.json(200, operations.GetMediaArtsResponse$inboundSchema, {
key: "object",
}),
M.fail([404, "4XX"]),
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
return [result, { status: "complete", request: req, response }];
}
return [result, { status: "complete", request: req, response }];
}

View File

@@ -0,0 +1,174 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { PlexAPICore } from "../core.js";
import { encodeSimple } from "../lib/encodings.js";
import * as M from "../lib/matchers.js";
import { compactMap } from "../lib/primitives.js";
import { safeParse } from "../lib/schemas.js";
import { RequestOptions } from "../lib/sdks.js";
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
} from "../sdk/models/errors/httpclienterrors.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
* Get Media Posters
*
* @remarks
* Returns the available posters for a library item.
*/
export function libraryGetMediaPosters(
client: PlexAPICore,
ratingKey: number,
options?: RequestOptions,
): APIPromise<
Result<
operations.GetMediaPostersResponse,
| SDKError
| SDKValidationError
| UnexpectedClientError
| InvalidRequestError
| RequestAbortedError
| RequestTimeoutError
| ConnectionError
>
> {
return new APIPromise($do(
client,
ratingKey,
options,
));
}
async function $do(
client: PlexAPICore,
ratingKey: number,
options?: RequestOptions,
): Promise<
[
Result<
operations.GetMediaPostersResponse,
| SDKError
| SDKValidationError
| UnexpectedClientError
| InvalidRequestError
| RequestAbortedError
| RequestTimeoutError
| ConnectionError
>,
APICall,
]
> {
const input: operations.GetMediaPostersRequest = {
ratingKey: ratingKey,
};
const parsed = safeParse(
input,
(value) => operations.GetMediaPostersRequest$outboundSchema.parse(value),
"Input validation failed",
);
if (!parsed.ok) {
return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
const pathParams = {
ratingKey: encodeSimple("ratingKey", payload.ratingKey, {
explode: false,
charEncoding: "percent",
}),
};
const path = pathToFunc("/library/metadata/{ratingKey}/posters")(pathParams);
const headers = new Headers(compactMap({
Accept: "application/json",
}));
const secConfig = await extractSecurity(client._options.accessToken);
const securityInput = secConfig == null ? {} : { accessToken: secConfig };
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "get-media-posters",
oAuth2Scopes: [],
resolvedSecurity: requestSecurity,
securitySource: client._options.accessToken,
retryConfig: options?.retries
|| client._options.retryConfig
|| { strategy: "none" },
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
};
const requestRes = client._createRequest(context, {
security: requestSecurity,
method: "GET",
baseURL: options?.serverURL,
path: path,
headers: headers,
body: body,
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: ["404", "4XX", "5XX"],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
const responseFields = {
ContentType: response.headers.get("content-type")
?? "application/octet-stream",
StatusCode: response.status,
RawResponse: response,
Headers: {},
};
const [result] = await M.match<
operations.GetMediaPostersResponse,
| SDKError
| SDKValidationError
| UnexpectedClientError
| InvalidRequestError
| RequestAbortedError
| RequestTimeoutError
| ConnectionError
>(
M.json(200, operations.GetMediaPostersResponse$inboundSchema, {
key: "object",
}),
M.fail([404, "4XX"]),
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
return [result, { status: "complete", request: req, response }];
}
return [result, { status: "complete", request: req, response }];
}

View File

@@ -0,0 +1,196 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { PlexAPICore } from "../core.js";
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
import * as M from "../lib/matchers.js";
import { compactMap } from "../lib/primitives.js";
import { safeParse } from "../lib/schemas.js";
import { RequestOptions } from "../lib/sdks.js";
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
} from "../sdk/models/errors/httpclienterrors.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
* Upload Media Background Artwork
*
* @remarks
* Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL
*/
export function libraryPostMediaArts(
client: PlexAPICore,
ratingKey: number,
requestBody?:
| ReadableStream<Uint8Array>
| Blob
| ArrayBuffer
| Uint8Array
| undefined,
url?: string | undefined,
options?: RequestOptions,
): APIPromise<
Result<
operations.PostMediaArtsResponse,
| SDKError
| SDKValidationError
| UnexpectedClientError
| InvalidRequestError
| RequestAbortedError
| RequestTimeoutError
| ConnectionError
>
> {
return new APIPromise($do(
client,
ratingKey,
requestBody,
url,
options,
));
}
async function $do(
client: PlexAPICore,
ratingKey: number,
requestBody?:
| ReadableStream<Uint8Array>
| Blob
| ArrayBuffer
| Uint8Array
| undefined,
url?: string | undefined,
options?: RequestOptions,
): Promise<
[
Result<
operations.PostMediaArtsResponse,
| SDKError
| SDKValidationError
| UnexpectedClientError
| InvalidRequestError
| RequestAbortedError
| RequestTimeoutError
| ConnectionError
>,
APICall,
]
> {
const input: operations.PostMediaArtsRequest = {
ratingKey: ratingKey,
requestBody: requestBody,
url: url,
};
const parsed = safeParse(
input,
(value) => operations.PostMediaArtsRequest$outboundSchema.parse(value),
"Input validation failed",
);
if (!parsed.ok) {
return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = payload.RequestBody;
const pathParams = {
ratingKey: encodeSimple("ratingKey", payload.ratingKey, {
explode: false,
charEncoding: "percent",
}),
};
const path = pathToFunc("/library/metadata/{ratingKey}/arts")(pathParams);
const query = encodeFormQuery({
"url": payload.url,
});
const headers = new Headers(compactMap({
"Content-Type": "image/*",
Accept: "*/*",
}));
const secConfig = await extractSecurity(client._options.accessToken);
const securityInput = secConfig == null ? {} : { accessToken: secConfig };
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "post-media-arts",
oAuth2Scopes: [],
resolvedSecurity: requestSecurity,
securitySource: client._options.accessToken,
retryConfig: options?.retries
|| client._options.retryConfig
|| { strategy: "none" },
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
};
const requestRes = client._createRequest(context, {
security: requestSecurity,
method: "POST",
baseURL: options?.serverURL,
path: path,
headers: headers,
query: query,
body: body,
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: ["404", "4XX", "5XX"],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
const responseFields = {
ContentType: response.headers.get("content-type")
?? "application/octet-stream",
StatusCode: response.status,
RawResponse: response,
Headers: {},
};
const [result] = await M.match<
operations.PostMediaArtsResponse,
| SDKError
| SDKValidationError
| UnexpectedClientError
| InvalidRequestError
| RequestAbortedError
| RequestTimeoutError
| ConnectionError
>(
M.nil(200, operations.PostMediaArtsResponse$inboundSchema),
M.fail([404, "4XX"]),
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
return [result, { status: "complete", request: req, response }];
}
return [result, { status: "complete", request: req, response }];
}

View File

@@ -0,0 +1,196 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { PlexAPICore } from "../core.js";
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
import * as M from "../lib/matchers.js";
import { compactMap } from "../lib/primitives.js";
import { safeParse } from "../lib/schemas.js";
import { RequestOptions } from "../lib/sdks.js";
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
} from "../sdk/models/errors/httpclienterrors.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
* Upload Media Poster
*
* @remarks
* Uploads a poster to a library item, either from a local file or a remote URL
*/
export function libraryPostMediaPoster(
client: PlexAPICore,
ratingKey: number,
requestBody?:
| ReadableStream<Uint8Array>
| Blob
| ArrayBuffer
| Uint8Array
| undefined,
url?: string | undefined,
options?: RequestOptions,
): APIPromise<
Result<
operations.PostMediaPosterResponse,
| SDKError
| SDKValidationError
| UnexpectedClientError
| InvalidRequestError
| RequestAbortedError
| RequestTimeoutError
| ConnectionError
>
> {
return new APIPromise($do(
client,
ratingKey,
requestBody,
url,
options,
));
}
async function $do(
client: PlexAPICore,
ratingKey: number,
requestBody?:
| ReadableStream<Uint8Array>
| Blob
| ArrayBuffer
| Uint8Array
| undefined,
url?: string | undefined,
options?: RequestOptions,
): Promise<
[
Result<
operations.PostMediaPosterResponse,
| SDKError
| SDKValidationError
| UnexpectedClientError
| InvalidRequestError
| RequestAbortedError
| RequestTimeoutError
| ConnectionError
>,
APICall,
]
> {
const input: operations.PostMediaPosterRequest = {
ratingKey: ratingKey,
requestBody: requestBody,
url: url,
};
const parsed = safeParse(
input,
(value) => operations.PostMediaPosterRequest$outboundSchema.parse(value),
"Input validation failed",
);
if (!parsed.ok) {
return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = payload.RequestBody;
const pathParams = {
ratingKey: encodeSimple("ratingKey", payload.ratingKey, {
explode: false,
charEncoding: "percent",
}),
};
const path = pathToFunc("/library/metadata/{ratingKey}/posters")(pathParams);
const query = encodeFormQuery({
"url": payload.url,
});
const headers = new Headers(compactMap({
"Content-Type": "image/*",
Accept: "*/*",
}));
const secConfig = await extractSecurity(client._options.accessToken);
const securityInput = secConfig == null ? {} : { accessToken: secConfig };
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "post-media-poster",
oAuth2Scopes: [],
resolvedSecurity: requestSecurity,
securitySource: client._options.accessToken,
retryConfig: options?.retries
|| client._options.retryConfig
|| { strategy: "none" },
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
};
const requestRes = client._createRequest(context, {
security: requestSecurity,
method: "POST",
baseURL: options?.serverURL,
path: path,
headers: headers,
query: query,
body: body,
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: ["404", "4XX", "5XX"],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
const responseFields = {
ContentType: response.headers.get("content-type")
?? "application/octet-stream",
StatusCode: response.status,
RawResponse: response,
Headers: {},
};
const [result] = await M.match<
operations.PostMediaPosterResponse,
| SDKError
| SDKValidationError
| UnexpectedClientError
| InvalidRequestError
| RequestAbortedError
| RequestTimeoutError
| ConnectionError
>(
M.nil(200, operations.PostMediaPosterResponse$inboundSchema),
M.fail([404, "4XX"]),
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
return [result, { status: "complete", request: req, response }];
}
return [result, { status: "complete", request: req, response }];
}

View File

@@ -90,7 +90,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
export const SDK_METADATA = { export const SDK_METADATA = {
language: "typescript", language: "typescript",
openapiDocVersion: "0.0.3", openapiDocVersion: "0.0.3",
sdkVersion: "0.35.2", sdkVersion: "0.36.0",
genVersion: "2.563.1", genVersion: "2.565.1",
userAgent: "speakeasy-sdk/typescript 0.35.2 2.563.1 0.0.3 @lukehagar/plexjs", userAgent: "speakeasy-sdk/typescript 0.36.0 2.565.1 0.0.3 @lukehagar/plexjs",
} as const; } as const;

View File

@@ -11,13 +11,17 @@ import { libraryGetFileHash } from "../funcs/libraryGetFileHash.js";
import { libraryGetGenresLibrary } from "../funcs/libraryGetGenresLibrary.js"; import { libraryGetGenresLibrary } from "../funcs/libraryGetGenresLibrary.js";
import { libraryGetLibraryDetails } from "../funcs/libraryGetLibraryDetails.js"; import { libraryGetLibraryDetails } from "../funcs/libraryGetLibraryDetails.js";
import { libraryGetLibraryItems } from "../funcs/libraryGetLibraryItems.js"; import { libraryGetLibraryItems } from "../funcs/libraryGetLibraryItems.js";
import { libraryGetMediaArts } from "../funcs/libraryGetMediaArts.js";
import { libraryGetMediaMetaData } from "../funcs/libraryGetMediaMetaData.js"; import { libraryGetMediaMetaData } from "../funcs/libraryGetMediaMetaData.js";
import { libraryGetMediaPosters } from "../funcs/libraryGetMediaPosters.js";
import { libraryGetMetadataChildren } from "../funcs/libraryGetMetadataChildren.js"; import { libraryGetMetadataChildren } from "../funcs/libraryGetMetadataChildren.js";
import { libraryGetRecentlyAddedLibrary } from "../funcs/libraryGetRecentlyAddedLibrary.js"; import { libraryGetRecentlyAddedLibrary } from "../funcs/libraryGetRecentlyAddedLibrary.js";
import { libraryGetRefreshLibraryMetadata } from "../funcs/libraryGetRefreshLibraryMetadata.js"; import { libraryGetRefreshLibraryMetadata } from "../funcs/libraryGetRefreshLibraryMetadata.js";
import { libraryGetSearchAllLibraries } from "../funcs/libraryGetSearchAllLibraries.js"; import { libraryGetSearchAllLibraries } from "../funcs/libraryGetSearchAllLibraries.js";
import { libraryGetSearchLibrary } from "../funcs/libraryGetSearchLibrary.js"; import { libraryGetSearchLibrary } from "../funcs/libraryGetSearchLibrary.js";
import { libraryGetTopWatchedContent } from "../funcs/libraryGetTopWatchedContent.js"; import { libraryGetTopWatchedContent } from "../funcs/libraryGetTopWatchedContent.js";
import { libraryPostMediaArts } from "../funcs/libraryPostMediaArts.js";
import { libraryPostMediaPoster } from "../funcs/libraryPostMediaPoster.js";
import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import * as operations from "./models/operations/index.js"; import * as operations from "./models/operations/index.js";
import { unwrapAsync } from "./types/fp.js"; import { unwrapAsync } from "./types/fp.js";
@@ -353,6 +357,92 @@ export class Library extends ClientSDK {
)); ));
} }
/**
* Get Media Background Artwork
*
* @remarks
* Returns the background artwork for a library item.
*/
async getMediaArts(
ratingKey: number,
options?: RequestOptions,
): Promise<operations.GetMediaArtsResponse> {
return unwrapAsync(libraryGetMediaArts(
this,
ratingKey,
options,
));
}
/**
* Upload Media Background Artwork
*
* @remarks
* Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL
*/
async postMediaArts(
ratingKey: number,
requestBody?:
| ReadableStream<Uint8Array>
| Blob
| ArrayBuffer
| Uint8Array
| undefined,
url?: string | undefined,
options?: RequestOptions,
): Promise<operations.PostMediaArtsResponse> {
return unwrapAsync(libraryPostMediaArts(
this,
ratingKey,
requestBody,
url,
options,
));
}
/**
* Get Media Posters
*
* @remarks
* Returns the available posters for a library item.
*/
async getMediaPosters(
ratingKey: number,
options?: RequestOptions,
): Promise<operations.GetMediaPostersResponse> {
return unwrapAsync(libraryGetMediaPosters(
this,
ratingKey,
options,
));
}
/**
* Upload Media Poster
*
* @remarks
* Uploads a poster to a library item, either from a local file or a remote URL
*/
async postMediaPoster(
ratingKey: number,
requestBody?:
| ReadableStream<Uint8Array>
| Blob
| ArrayBuffer
| Uint8Array
| undefined,
url?: string | undefined,
options?: RequestOptions,
): Promise<operations.PostMediaPosterResponse> {
return unwrapAsync(libraryPostMediaPoster(
this,
ratingKey,
requestBody,
url,
options,
));
}
/** /**
* Get Items Children * Get Items Children
* *

View File

@@ -0,0 +1,420 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { remap as remap$ } from "../../../lib/primitives.js";
import { safeParse } from "../../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
export type GetMediaArtsRequest = {
/**
* the id of the library item to return the artwork of.
*/
ratingKey: number;
};
export type GetMediaArtsMetadata = {
/**
* The URL of the artwork.
*/
key: string;
/**
* The provider of the artwork.
*/
provider?: string | undefined;
/**
* The URL of the artwork.
*/
ratingKey: string;
/**
* Whether this is the selected artwork.
*/
selected: boolean;
/**
* The URL of the artwork thumbnail.
*/
thumb: string;
};
export type GetMediaArtsMediaContainer = {
/**
* Number of media items returned in this response.
*/
size: number;
/**
* The version number for media tags.
*/
mediaTagVersion: number;
/**
* The prefix used for media tag resource paths.
*/
mediaTagPrefix: string;
/**
* An plugin identifier for the media container.
*/
identifier: string;
metadata: Array<GetMediaArtsMetadata>;
};
/**
* The available background artwork for the library item.
*/
export type GetMediaArtsResponseBody = {
mediaContainer?: GetMediaArtsMediaContainer | undefined;
};
export type GetMediaArtsResponse = {
/**
* HTTP response content type for this operation
*/
contentType: string;
/**
* HTTP response status code for this operation
*/
statusCode: number;
/**
* Raw HTTP response; suitable for custom response parsing
*/
rawResponse: Response;
/**
* The available background artwork for the library item.
*/
object?: GetMediaArtsResponseBody | undefined;
};
/** @internal */
export const GetMediaArtsRequest$inboundSchema: z.ZodType<
GetMediaArtsRequest,
z.ZodTypeDef,
unknown
> = z.object({
ratingKey: z.number().int(),
});
/** @internal */
export type GetMediaArtsRequest$Outbound = {
ratingKey: number;
};
/** @internal */
export const GetMediaArtsRequest$outboundSchema: z.ZodType<
GetMediaArtsRequest$Outbound,
z.ZodTypeDef,
GetMediaArtsRequest
> = z.object({
ratingKey: z.number().int(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace GetMediaArtsRequest$ {
/** @deprecated use `GetMediaArtsRequest$inboundSchema` instead. */
export const inboundSchema = GetMediaArtsRequest$inboundSchema;
/** @deprecated use `GetMediaArtsRequest$outboundSchema` instead. */
export const outboundSchema = GetMediaArtsRequest$outboundSchema;
/** @deprecated use `GetMediaArtsRequest$Outbound` instead. */
export type Outbound = GetMediaArtsRequest$Outbound;
}
export function getMediaArtsRequestToJSON(
getMediaArtsRequest: GetMediaArtsRequest,
): string {
return JSON.stringify(
GetMediaArtsRequest$outboundSchema.parse(getMediaArtsRequest),
);
}
export function getMediaArtsRequestFromJSON(
jsonString: string,
): SafeParseResult<GetMediaArtsRequest, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetMediaArtsRequest$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetMediaArtsRequest' from JSON`,
);
}
/** @internal */
export const GetMediaArtsMetadata$inboundSchema: z.ZodType<
GetMediaArtsMetadata,
z.ZodTypeDef,
unknown
> = z.object({
key: z.string(),
provider: z.string().optional(),
ratingKey: z.string(),
selected: z.boolean(),
thumb: z.string(),
});
/** @internal */
export type GetMediaArtsMetadata$Outbound = {
key: string;
provider?: string | undefined;
ratingKey: string;
selected: boolean;
thumb: string;
};
/** @internal */
export const GetMediaArtsMetadata$outboundSchema: z.ZodType<
GetMediaArtsMetadata$Outbound,
z.ZodTypeDef,
GetMediaArtsMetadata
> = z.object({
key: z.string(),
provider: z.string().optional(),
ratingKey: z.string(),
selected: z.boolean(),
thumb: z.string(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace GetMediaArtsMetadata$ {
/** @deprecated use `GetMediaArtsMetadata$inboundSchema` instead. */
export const inboundSchema = GetMediaArtsMetadata$inboundSchema;
/** @deprecated use `GetMediaArtsMetadata$outboundSchema` instead. */
export const outboundSchema = GetMediaArtsMetadata$outboundSchema;
/** @deprecated use `GetMediaArtsMetadata$Outbound` instead. */
export type Outbound = GetMediaArtsMetadata$Outbound;
}
export function getMediaArtsMetadataToJSON(
getMediaArtsMetadata: GetMediaArtsMetadata,
): string {
return JSON.stringify(
GetMediaArtsMetadata$outboundSchema.parse(getMediaArtsMetadata),
);
}
export function getMediaArtsMetadataFromJSON(
jsonString: string,
): SafeParseResult<GetMediaArtsMetadata, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetMediaArtsMetadata$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetMediaArtsMetadata' from JSON`,
);
}
/** @internal */
export const GetMediaArtsMediaContainer$inboundSchema: z.ZodType<
GetMediaArtsMediaContainer,
z.ZodTypeDef,
unknown
> = z.object({
size: z.number().int(),
mediaTagVersion: z.number().int(),
mediaTagPrefix: z.string(),
identifier: z.string(),
Metadata: z.array(z.lazy(() => GetMediaArtsMetadata$inboundSchema)),
}).transform((v) => {
return remap$(v, {
"Metadata": "metadata",
});
});
/** @internal */
export type GetMediaArtsMediaContainer$Outbound = {
size: number;
mediaTagVersion: number;
mediaTagPrefix: string;
identifier: string;
Metadata: Array<GetMediaArtsMetadata$Outbound>;
};
/** @internal */
export const GetMediaArtsMediaContainer$outboundSchema: z.ZodType<
GetMediaArtsMediaContainer$Outbound,
z.ZodTypeDef,
GetMediaArtsMediaContainer
> = z.object({
size: z.number().int(),
mediaTagVersion: z.number().int(),
mediaTagPrefix: z.string(),
identifier: z.string(),
metadata: z.array(z.lazy(() => GetMediaArtsMetadata$outboundSchema)),
}).transform((v) => {
return remap$(v, {
metadata: "Metadata",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace GetMediaArtsMediaContainer$ {
/** @deprecated use `GetMediaArtsMediaContainer$inboundSchema` instead. */
export const inboundSchema = GetMediaArtsMediaContainer$inboundSchema;
/** @deprecated use `GetMediaArtsMediaContainer$outboundSchema` instead. */
export const outboundSchema = GetMediaArtsMediaContainer$outboundSchema;
/** @deprecated use `GetMediaArtsMediaContainer$Outbound` instead. */
export type Outbound = GetMediaArtsMediaContainer$Outbound;
}
export function getMediaArtsMediaContainerToJSON(
getMediaArtsMediaContainer: GetMediaArtsMediaContainer,
): string {
return JSON.stringify(
GetMediaArtsMediaContainer$outboundSchema.parse(getMediaArtsMediaContainer),
);
}
export function getMediaArtsMediaContainerFromJSON(
jsonString: string,
): SafeParseResult<GetMediaArtsMediaContainer, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetMediaArtsMediaContainer$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetMediaArtsMediaContainer' from JSON`,
);
}
/** @internal */
export const GetMediaArtsResponseBody$inboundSchema: z.ZodType<
GetMediaArtsResponseBody,
z.ZodTypeDef,
unknown
> = z.object({
MediaContainer: z.lazy(() => GetMediaArtsMediaContainer$inboundSchema)
.optional(),
}).transform((v) => {
return remap$(v, {
"MediaContainer": "mediaContainer",
});
});
/** @internal */
export type GetMediaArtsResponseBody$Outbound = {
MediaContainer?: GetMediaArtsMediaContainer$Outbound | undefined;
};
/** @internal */
export const GetMediaArtsResponseBody$outboundSchema: z.ZodType<
GetMediaArtsResponseBody$Outbound,
z.ZodTypeDef,
GetMediaArtsResponseBody
> = z.object({
mediaContainer: z.lazy(() => GetMediaArtsMediaContainer$outboundSchema)
.optional(),
}).transform((v) => {
return remap$(v, {
mediaContainer: "MediaContainer",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace GetMediaArtsResponseBody$ {
/** @deprecated use `GetMediaArtsResponseBody$inboundSchema` instead. */
export const inboundSchema = GetMediaArtsResponseBody$inboundSchema;
/** @deprecated use `GetMediaArtsResponseBody$outboundSchema` instead. */
export const outboundSchema = GetMediaArtsResponseBody$outboundSchema;
/** @deprecated use `GetMediaArtsResponseBody$Outbound` instead. */
export type Outbound = GetMediaArtsResponseBody$Outbound;
}
export function getMediaArtsResponseBodyToJSON(
getMediaArtsResponseBody: GetMediaArtsResponseBody,
): string {
return JSON.stringify(
GetMediaArtsResponseBody$outboundSchema.parse(getMediaArtsResponseBody),
);
}
export function getMediaArtsResponseBodyFromJSON(
jsonString: string,
): SafeParseResult<GetMediaArtsResponseBody, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetMediaArtsResponseBody$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetMediaArtsResponseBody' from JSON`,
);
}
/** @internal */
export const GetMediaArtsResponse$inboundSchema: z.ZodType<
GetMediaArtsResponse,
z.ZodTypeDef,
unknown
> = z.object({
ContentType: z.string(),
StatusCode: z.number().int(),
RawResponse: z.instanceof(Response),
object: z.lazy(() => GetMediaArtsResponseBody$inboundSchema).optional(),
}).transform((v) => {
return remap$(v, {
"ContentType": "contentType",
"StatusCode": "statusCode",
"RawResponse": "rawResponse",
});
});
/** @internal */
export type GetMediaArtsResponse$Outbound = {
ContentType: string;
StatusCode: number;
RawResponse: never;
object?: GetMediaArtsResponseBody$Outbound | undefined;
};
/** @internal */
export const GetMediaArtsResponse$outboundSchema: z.ZodType<
GetMediaArtsResponse$Outbound,
z.ZodTypeDef,
GetMediaArtsResponse
> = z.object({
contentType: z.string(),
statusCode: z.number().int(),
rawResponse: z.instanceof(Response).transform(() => {
throw new Error("Response cannot be serialized");
}),
object: z.lazy(() => GetMediaArtsResponseBody$outboundSchema).optional(),
}).transform((v) => {
return remap$(v, {
contentType: "ContentType",
statusCode: "StatusCode",
rawResponse: "RawResponse",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace GetMediaArtsResponse$ {
/** @deprecated use `GetMediaArtsResponse$inboundSchema` instead. */
export const inboundSchema = GetMediaArtsResponse$inboundSchema;
/** @deprecated use `GetMediaArtsResponse$outboundSchema` instead. */
export const outboundSchema = GetMediaArtsResponse$outboundSchema;
/** @deprecated use `GetMediaArtsResponse$Outbound` instead. */
export type Outbound = GetMediaArtsResponse$Outbound;
}
export function getMediaArtsResponseToJSON(
getMediaArtsResponse: GetMediaArtsResponse,
): string {
return JSON.stringify(
GetMediaArtsResponse$outboundSchema.parse(getMediaArtsResponse),
);
}
export function getMediaArtsResponseFromJSON(
jsonString: string,
): SafeParseResult<GetMediaArtsResponse, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetMediaArtsResponse$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetMediaArtsResponse' from JSON`,
);
}

View File

@@ -0,0 +1,424 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { remap as remap$ } from "../../../lib/primitives.js";
import { safeParse } from "../../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
export type GetMediaPostersRequest = {
/**
* the id of the library item to return the posters of.
*/
ratingKey: number;
};
export type GetMediaPostersMetadata = {
/**
* The URL of the poster.
*/
key: string;
/**
* The provider of the poster.
*/
provider?: string | undefined;
/**
* The URL of the poster.
*/
ratingKey: string;
/**
* Whether this is the selected poster.
*/
selected: boolean;
/**
* The URL of the poster thumbnail.
*/
thumb: string;
};
export type GetMediaPostersMediaContainer = {
/**
* Number of media items returned in this response.
*/
size: number;
/**
* The version number for media tags.
*/
mediaTagVersion: number;
/**
* The prefix used for media tag resource paths.
*/
mediaTagPrefix: string;
/**
* An plugin identifier for the media container.
*/
identifier: string;
metadata: Array<GetMediaPostersMetadata>;
};
/**
* The available posters for the library item.
*/
export type GetMediaPostersResponseBody = {
mediaContainer?: GetMediaPostersMediaContainer | undefined;
};
export type GetMediaPostersResponse = {
/**
* HTTP response content type for this operation
*/
contentType: string;
/**
* HTTP response status code for this operation
*/
statusCode: number;
/**
* Raw HTTP response; suitable for custom response parsing
*/
rawResponse: Response;
/**
* The available posters for the library item.
*/
object?: GetMediaPostersResponseBody | undefined;
};
/** @internal */
export const GetMediaPostersRequest$inboundSchema: z.ZodType<
GetMediaPostersRequest,
z.ZodTypeDef,
unknown
> = z.object({
ratingKey: z.number().int(),
});
/** @internal */
export type GetMediaPostersRequest$Outbound = {
ratingKey: number;
};
/** @internal */
export const GetMediaPostersRequest$outboundSchema: z.ZodType<
GetMediaPostersRequest$Outbound,
z.ZodTypeDef,
GetMediaPostersRequest
> = z.object({
ratingKey: z.number().int(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace GetMediaPostersRequest$ {
/** @deprecated use `GetMediaPostersRequest$inboundSchema` instead. */
export const inboundSchema = GetMediaPostersRequest$inboundSchema;
/** @deprecated use `GetMediaPostersRequest$outboundSchema` instead. */
export const outboundSchema = GetMediaPostersRequest$outboundSchema;
/** @deprecated use `GetMediaPostersRequest$Outbound` instead. */
export type Outbound = GetMediaPostersRequest$Outbound;
}
export function getMediaPostersRequestToJSON(
getMediaPostersRequest: GetMediaPostersRequest,
): string {
return JSON.stringify(
GetMediaPostersRequest$outboundSchema.parse(getMediaPostersRequest),
);
}
export function getMediaPostersRequestFromJSON(
jsonString: string,
): SafeParseResult<GetMediaPostersRequest, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetMediaPostersRequest$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetMediaPostersRequest' from JSON`,
);
}
/** @internal */
export const GetMediaPostersMetadata$inboundSchema: z.ZodType<
GetMediaPostersMetadata,
z.ZodTypeDef,
unknown
> = z.object({
key: z.string(),
provider: z.string().optional(),
ratingKey: z.string(),
selected: z.boolean(),
thumb: z.string(),
});
/** @internal */
export type GetMediaPostersMetadata$Outbound = {
key: string;
provider?: string | undefined;
ratingKey: string;
selected: boolean;
thumb: string;
};
/** @internal */
export const GetMediaPostersMetadata$outboundSchema: z.ZodType<
GetMediaPostersMetadata$Outbound,
z.ZodTypeDef,
GetMediaPostersMetadata
> = z.object({
key: z.string(),
provider: z.string().optional(),
ratingKey: z.string(),
selected: z.boolean(),
thumb: z.string(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace GetMediaPostersMetadata$ {
/** @deprecated use `GetMediaPostersMetadata$inboundSchema` instead. */
export const inboundSchema = GetMediaPostersMetadata$inboundSchema;
/** @deprecated use `GetMediaPostersMetadata$outboundSchema` instead. */
export const outboundSchema = GetMediaPostersMetadata$outboundSchema;
/** @deprecated use `GetMediaPostersMetadata$Outbound` instead. */
export type Outbound = GetMediaPostersMetadata$Outbound;
}
export function getMediaPostersMetadataToJSON(
getMediaPostersMetadata: GetMediaPostersMetadata,
): string {
return JSON.stringify(
GetMediaPostersMetadata$outboundSchema.parse(getMediaPostersMetadata),
);
}
export function getMediaPostersMetadataFromJSON(
jsonString: string,
): SafeParseResult<GetMediaPostersMetadata, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetMediaPostersMetadata$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetMediaPostersMetadata' from JSON`,
);
}
/** @internal */
export const GetMediaPostersMediaContainer$inboundSchema: z.ZodType<
GetMediaPostersMediaContainer,
z.ZodTypeDef,
unknown
> = z.object({
size: z.number().int(),
mediaTagVersion: z.number().int(),
mediaTagPrefix: z.string(),
identifier: z.string(),
Metadata: z.array(z.lazy(() => GetMediaPostersMetadata$inboundSchema)),
}).transform((v) => {
return remap$(v, {
"Metadata": "metadata",
});
});
/** @internal */
export type GetMediaPostersMediaContainer$Outbound = {
size: number;
mediaTagVersion: number;
mediaTagPrefix: string;
identifier: string;
Metadata: Array<GetMediaPostersMetadata$Outbound>;
};
/** @internal */
export const GetMediaPostersMediaContainer$outboundSchema: z.ZodType<
GetMediaPostersMediaContainer$Outbound,
z.ZodTypeDef,
GetMediaPostersMediaContainer
> = z.object({
size: z.number().int(),
mediaTagVersion: z.number().int(),
mediaTagPrefix: z.string(),
identifier: z.string(),
metadata: z.array(z.lazy(() => GetMediaPostersMetadata$outboundSchema)),
}).transform((v) => {
return remap$(v, {
metadata: "Metadata",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace GetMediaPostersMediaContainer$ {
/** @deprecated use `GetMediaPostersMediaContainer$inboundSchema` instead. */
export const inboundSchema = GetMediaPostersMediaContainer$inboundSchema;
/** @deprecated use `GetMediaPostersMediaContainer$outboundSchema` instead. */
export const outboundSchema = GetMediaPostersMediaContainer$outboundSchema;
/** @deprecated use `GetMediaPostersMediaContainer$Outbound` instead. */
export type Outbound = GetMediaPostersMediaContainer$Outbound;
}
export function getMediaPostersMediaContainerToJSON(
getMediaPostersMediaContainer: GetMediaPostersMediaContainer,
): string {
return JSON.stringify(
GetMediaPostersMediaContainer$outboundSchema.parse(
getMediaPostersMediaContainer,
),
);
}
export function getMediaPostersMediaContainerFromJSON(
jsonString: string,
): SafeParseResult<GetMediaPostersMediaContainer, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetMediaPostersMediaContainer$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetMediaPostersMediaContainer' from JSON`,
);
}
/** @internal */
export const GetMediaPostersResponseBody$inboundSchema: z.ZodType<
GetMediaPostersResponseBody,
z.ZodTypeDef,
unknown
> = z.object({
MediaContainer: z.lazy(() => GetMediaPostersMediaContainer$inboundSchema)
.optional(),
}).transform((v) => {
return remap$(v, {
"MediaContainer": "mediaContainer",
});
});
/** @internal */
export type GetMediaPostersResponseBody$Outbound = {
MediaContainer?: GetMediaPostersMediaContainer$Outbound | undefined;
};
/** @internal */
export const GetMediaPostersResponseBody$outboundSchema: z.ZodType<
GetMediaPostersResponseBody$Outbound,
z.ZodTypeDef,
GetMediaPostersResponseBody
> = z.object({
mediaContainer: z.lazy(() => GetMediaPostersMediaContainer$outboundSchema)
.optional(),
}).transform((v) => {
return remap$(v, {
mediaContainer: "MediaContainer",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace GetMediaPostersResponseBody$ {
/** @deprecated use `GetMediaPostersResponseBody$inboundSchema` instead. */
export const inboundSchema = GetMediaPostersResponseBody$inboundSchema;
/** @deprecated use `GetMediaPostersResponseBody$outboundSchema` instead. */
export const outboundSchema = GetMediaPostersResponseBody$outboundSchema;
/** @deprecated use `GetMediaPostersResponseBody$Outbound` instead. */
export type Outbound = GetMediaPostersResponseBody$Outbound;
}
export function getMediaPostersResponseBodyToJSON(
getMediaPostersResponseBody: GetMediaPostersResponseBody,
): string {
return JSON.stringify(
GetMediaPostersResponseBody$outboundSchema.parse(
getMediaPostersResponseBody,
),
);
}
export function getMediaPostersResponseBodyFromJSON(
jsonString: string,
): SafeParseResult<GetMediaPostersResponseBody, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetMediaPostersResponseBody$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetMediaPostersResponseBody' from JSON`,
);
}
/** @internal */
export const GetMediaPostersResponse$inboundSchema: z.ZodType<
GetMediaPostersResponse,
z.ZodTypeDef,
unknown
> = z.object({
ContentType: z.string(),
StatusCode: z.number().int(),
RawResponse: z.instanceof(Response),
object: z.lazy(() => GetMediaPostersResponseBody$inboundSchema).optional(),
}).transform((v) => {
return remap$(v, {
"ContentType": "contentType",
"StatusCode": "statusCode",
"RawResponse": "rawResponse",
});
});
/** @internal */
export type GetMediaPostersResponse$Outbound = {
ContentType: string;
StatusCode: number;
RawResponse: never;
object?: GetMediaPostersResponseBody$Outbound | undefined;
};
/** @internal */
export const GetMediaPostersResponse$outboundSchema: z.ZodType<
GetMediaPostersResponse$Outbound,
z.ZodTypeDef,
GetMediaPostersResponse
> = z.object({
contentType: z.string(),
statusCode: z.number().int(),
rawResponse: z.instanceof(Response).transform(() => {
throw new Error("Response cannot be serialized");
}),
object: z.lazy(() => GetMediaPostersResponseBody$outboundSchema).optional(),
}).transform((v) => {
return remap$(v, {
contentType: "ContentType",
statusCode: "StatusCode",
rawResponse: "RawResponse",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace GetMediaPostersResponse$ {
/** @deprecated use `GetMediaPostersResponse$inboundSchema` instead. */
export const inboundSchema = GetMediaPostersResponse$inboundSchema;
/** @deprecated use `GetMediaPostersResponse$outboundSchema` instead. */
export const outboundSchema = GetMediaPostersResponse$outboundSchema;
/** @deprecated use `GetMediaPostersResponse$Outbound` instead. */
export type Outbound = GetMediaPostersResponse$Outbound;
}
export function getMediaPostersResponseToJSON(
getMediaPostersResponse: GetMediaPostersResponse,
): string {
return JSON.stringify(
GetMediaPostersResponse$outboundSchema.parse(getMediaPostersResponse),
);
}
export function getMediaPostersResponseFromJSON(
jsonString: string,
): SafeParseResult<GetMediaPostersResponse, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetMediaPostersResponse$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetMediaPostersResponse' from JSON`,
);
}

View File

@@ -29,7 +29,9 @@ export * from "./gethomedata.js";
export * from "./getlibrarydetails.js"; export * from "./getlibrarydetails.js";
export * from "./getlibraryhubs.js"; export * from "./getlibraryhubs.js";
export * from "./getlibraryitems.js"; export * from "./getlibraryitems.js";
export * from "./getmediaarts.js";
export * from "./getmediametadata.js"; export * from "./getmediametadata.js";
export * from "./getmediaposters.js";
export * from "./getmediaproviders.js"; export * from "./getmediaproviders.js";
export * from "./getmetadatachildren.js"; export * from "./getmetadatachildren.js";
export * from "./getmyplexaccount.js"; export * from "./getmyplexaccount.js";
@@ -72,6 +74,8 @@ export * from "./markplayed.js";
export * from "./markunplayed.js"; export * from "./markunplayed.js";
export * from "./performsearch.js"; export * from "./performsearch.js";
export * from "./performvoicesearch.js"; export * from "./performvoicesearch.js";
export * from "./postmediaarts.js";
export * from "./postmediaposter.js";
export * from "./postuserssignindata.js"; export * from "./postuserssignindata.js";
export * from "./startalltasks.js"; export * from "./startalltasks.js";
export * from "./starttask.js"; export * from "./starttask.js";

View File

@@ -0,0 +1,201 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { remap as remap$ } from "../../../lib/primitives.js";
import { safeParse } from "../../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
export type PostMediaArtsRequest = {
/**
* the id of the library item to return the posters of.
*/
ratingKey: number;
/**
* The URL of the image, if uploading a remote image
*/
url?: string | undefined;
/**
* The contents of the image, if uploading a local file
*/
requestBody?:
| ReadableStream<Uint8Array>
| Blob
| ArrayBuffer
| Uint8Array
| undefined;
};
export type PostMediaArtsResponse = {
/**
* HTTP response content type for this operation
*/
contentType: string;
/**
* HTTP response status code for this operation
*/
statusCode: number;
/**
* Raw HTTP response; suitable for custom response parsing
*/
rawResponse: Response;
};
/** @internal */
export const PostMediaArtsRequest$inboundSchema: z.ZodType<
PostMediaArtsRequest,
z.ZodTypeDef,
unknown
> = z.object({
ratingKey: z.number().int(),
url: z.string().optional(),
RequestBody: z.union([
z.instanceof(ReadableStream<Uint8Array>),
z.instanceof(Blob),
z.instanceof(ArrayBuffer),
z.instanceof(Uint8Array),
]).optional(),
}).transform((v) => {
return remap$(v, {
"RequestBody": "requestBody",
});
});
/** @internal */
export type PostMediaArtsRequest$Outbound = {
ratingKey: number;
url?: string | undefined;
RequestBody?:
| ReadableStream<Uint8Array>
| Blob
| ArrayBuffer
| Uint8Array
| undefined;
};
/** @internal */
export const PostMediaArtsRequest$outboundSchema: z.ZodType<
PostMediaArtsRequest$Outbound,
z.ZodTypeDef,
PostMediaArtsRequest
> = z.object({
ratingKey: z.number().int(),
url: z.string().optional(),
requestBody: z.union([
z.instanceof(ReadableStream<Uint8Array>),
z.instanceof(Blob),
z.instanceof(ArrayBuffer),
z.instanceof(Uint8Array),
]).optional(),
}).transform((v) => {
return remap$(v, {
requestBody: "RequestBody",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostMediaArtsRequest$ {
/** @deprecated use `PostMediaArtsRequest$inboundSchema` instead. */
export const inboundSchema = PostMediaArtsRequest$inboundSchema;
/** @deprecated use `PostMediaArtsRequest$outboundSchema` instead. */
export const outboundSchema = PostMediaArtsRequest$outboundSchema;
/** @deprecated use `PostMediaArtsRequest$Outbound` instead. */
export type Outbound = PostMediaArtsRequest$Outbound;
}
export function postMediaArtsRequestToJSON(
postMediaArtsRequest: PostMediaArtsRequest,
): string {
return JSON.stringify(
PostMediaArtsRequest$outboundSchema.parse(postMediaArtsRequest),
);
}
export function postMediaArtsRequestFromJSON(
jsonString: string,
): SafeParseResult<PostMediaArtsRequest, SDKValidationError> {
return safeParse(
jsonString,
(x) => PostMediaArtsRequest$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostMediaArtsRequest' from JSON`,
);
}
/** @internal */
export const PostMediaArtsResponse$inboundSchema: z.ZodType<
PostMediaArtsResponse,
z.ZodTypeDef,
unknown
> = z.object({
ContentType: z.string(),
StatusCode: z.number().int(),
RawResponse: z.instanceof(Response),
}).transform((v) => {
return remap$(v, {
"ContentType": "contentType",
"StatusCode": "statusCode",
"RawResponse": "rawResponse",
});
});
/** @internal */
export type PostMediaArtsResponse$Outbound = {
ContentType: string;
StatusCode: number;
RawResponse: never;
};
/** @internal */
export const PostMediaArtsResponse$outboundSchema: z.ZodType<
PostMediaArtsResponse$Outbound,
z.ZodTypeDef,
PostMediaArtsResponse
> = z.object({
contentType: z.string(),
statusCode: z.number().int(),
rawResponse: z.instanceof(Response).transform(() => {
throw new Error("Response cannot be serialized");
}),
}).transform((v) => {
return remap$(v, {
contentType: "ContentType",
statusCode: "StatusCode",
rawResponse: "RawResponse",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostMediaArtsResponse$ {
/** @deprecated use `PostMediaArtsResponse$inboundSchema` instead. */
export const inboundSchema = PostMediaArtsResponse$inboundSchema;
/** @deprecated use `PostMediaArtsResponse$outboundSchema` instead. */
export const outboundSchema = PostMediaArtsResponse$outboundSchema;
/** @deprecated use `PostMediaArtsResponse$Outbound` instead. */
export type Outbound = PostMediaArtsResponse$Outbound;
}
export function postMediaArtsResponseToJSON(
postMediaArtsResponse: PostMediaArtsResponse,
): string {
return JSON.stringify(
PostMediaArtsResponse$outboundSchema.parse(postMediaArtsResponse),
);
}
export function postMediaArtsResponseFromJSON(
jsonString: string,
): SafeParseResult<PostMediaArtsResponse, SDKValidationError> {
return safeParse(
jsonString,
(x) => PostMediaArtsResponse$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostMediaArtsResponse' from JSON`,
);
}

View File

@@ -0,0 +1,201 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { remap as remap$ } from "../../../lib/primitives.js";
import { safeParse } from "../../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
export type PostMediaPosterRequest = {
/**
* the id of the library item to return the posters of.
*/
ratingKey: number;
/**
* The URL of the image, if uploading a remote image
*/
url?: string | undefined;
/**
* The contents of the image, if uploading a local file
*/
requestBody?:
| ReadableStream<Uint8Array>
| Blob
| ArrayBuffer
| Uint8Array
| undefined;
};
export type PostMediaPosterResponse = {
/**
* HTTP response content type for this operation
*/
contentType: string;
/**
* HTTP response status code for this operation
*/
statusCode: number;
/**
* Raw HTTP response; suitable for custom response parsing
*/
rawResponse: Response;
};
/** @internal */
export const PostMediaPosterRequest$inboundSchema: z.ZodType<
PostMediaPosterRequest,
z.ZodTypeDef,
unknown
> = z.object({
ratingKey: z.number().int(),
url: z.string().optional(),
RequestBody: z.union([
z.instanceof(ReadableStream<Uint8Array>),
z.instanceof(Blob),
z.instanceof(ArrayBuffer),
z.instanceof(Uint8Array),
]).optional(),
}).transform((v) => {
return remap$(v, {
"RequestBody": "requestBody",
});
});
/** @internal */
export type PostMediaPosterRequest$Outbound = {
ratingKey: number;
url?: string | undefined;
RequestBody?:
| ReadableStream<Uint8Array>
| Blob
| ArrayBuffer
| Uint8Array
| undefined;
};
/** @internal */
export const PostMediaPosterRequest$outboundSchema: z.ZodType<
PostMediaPosterRequest$Outbound,
z.ZodTypeDef,
PostMediaPosterRequest
> = z.object({
ratingKey: z.number().int(),
url: z.string().optional(),
requestBody: z.union([
z.instanceof(ReadableStream<Uint8Array>),
z.instanceof(Blob),
z.instanceof(ArrayBuffer),
z.instanceof(Uint8Array),
]).optional(),
}).transform((v) => {
return remap$(v, {
requestBody: "RequestBody",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostMediaPosterRequest$ {
/** @deprecated use `PostMediaPosterRequest$inboundSchema` instead. */
export const inboundSchema = PostMediaPosterRequest$inboundSchema;
/** @deprecated use `PostMediaPosterRequest$outboundSchema` instead. */
export const outboundSchema = PostMediaPosterRequest$outboundSchema;
/** @deprecated use `PostMediaPosterRequest$Outbound` instead. */
export type Outbound = PostMediaPosterRequest$Outbound;
}
export function postMediaPosterRequestToJSON(
postMediaPosterRequest: PostMediaPosterRequest,
): string {
return JSON.stringify(
PostMediaPosterRequest$outboundSchema.parse(postMediaPosterRequest),
);
}
export function postMediaPosterRequestFromJSON(
jsonString: string,
): SafeParseResult<PostMediaPosterRequest, SDKValidationError> {
return safeParse(
jsonString,
(x) => PostMediaPosterRequest$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostMediaPosterRequest' from JSON`,
);
}
/** @internal */
export const PostMediaPosterResponse$inboundSchema: z.ZodType<
PostMediaPosterResponse,
z.ZodTypeDef,
unknown
> = z.object({
ContentType: z.string(),
StatusCode: z.number().int(),
RawResponse: z.instanceof(Response),
}).transform((v) => {
return remap$(v, {
"ContentType": "contentType",
"StatusCode": "statusCode",
"RawResponse": "rawResponse",
});
});
/** @internal */
export type PostMediaPosterResponse$Outbound = {
ContentType: string;
StatusCode: number;
RawResponse: never;
};
/** @internal */
export const PostMediaPosterResponse$outboundSchema: z.ZodType<
PostMediaPosterResponse$Outbound,
z.ZodTypeDef,
PostMediaPosterResponse
> = z.object({
contentType: z.string(),
statusCode: z.number().int(),
rawResponse: z.instanceof(Response).transform(() => {
throw new Error("Response cannot be serialized");
}),
}).transform((v) => {
return remap$(v, {
contentType: "ContentType",
statusCode: "StatusCode",
rawResponse: "RawResponse",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace PostMediaPosterResponse$ {
/** @deprecated use `PostMediaPosterResponse$inboundSchema` instead. */
export const inboundSchema = PostMediaPosterResponse$inboundSchema;
/** @deprecated use `PostMediaPosterResponse$outboundSchema` instead. */
export const outboundSchema = PostMediaPosterResponse$outboundSchema;
/** @deprecated use `PostMediaPosterResponse$Outbound` instead. */
export type Outbound = PostMediaPosterResponse$Outbound;
}
export function postMediaPosterResponseToJSON(
postMediaPosterResponse: PostMediaPosterResponse,
): string {
return JSON.stringify(
PostMediaPosterResponse$outboundSchema.parse(postMediaPosterResponse),
);
}
export function postMediaPosterResponseFromJSON(
jsonString: string,
): SafeParseResult<PostMediaPosterResponse, SDKValidationError> {
return safeParse(
jsonString,
(x) => PostMediaPosterResponse$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'PostMediaPosterResponse' from JSON`,
);
}