mirror of
https://github.com/LukeHagar/plexjs.git
synced 2025-12-06 12:37:46 +00:00
ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.150.0
This commit is contained in:
@@ -15,6 +15,7 @@ API Calls interacting with Plex Media Server Libraries
|
||||
* [deleteLibrary](#deletelibrary) - Delete Library Section
|
||||
* [getLibraryItems](#getlibraryitems) - Get Library Items
|
||||
* [refreshLibrary](#refreshlibrary) - Refresh Library
|
||||
* [searchLibrary](#searchlibrary) - Search Library
|
||||
* [getMetadata](#getmetadata) - Get Items Metadata
|
||||
* [getMetadataChildren](#getmetadatachildren) - Get Items Children
|
||||
* [getOnDeck](#getondeck) - Get On Deck
|
||||
@@ -306,7 +307,6 @@ Fetches details from a specific section of the library identified by a section k
|
||||
- `resolution`: Items categorized by resolution.
|
||||
- `firstCharacter`: Items categorized by the first letter.
|
||||
- `folder`: Items categorized by folder.
|
||||
- `search?type=1`: Search functionality within the section.
|
||||
|
||||
|
||||
### Example Usage
|
||||
@@ -396,6 +396,70 @@ run();
|
||||
| errors.RefreshLibraryResponseBody | 401 | application/json |
|
||||
| errors.SDKError | 4xx-5xx | */* |
|
||||
|
||||
## searchLibrary
|
||||
|
||||
Search for content within a specific section of the library.
|
||||
|
||||
### Types
|
||||
Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls:
|
||||
|
||||
- **Type Object Attributes**:
|
||||
- `type`: Metadata type (if standard Plex type).
|
||||
- `title`: Title for this content type (e.g., "Movies").
|
||||
|
||||
- **Filter Objects**:
|
||||
- Subset of the media query language.
|
||||
- Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`.
|
||||
|
||||
- **Sort Objects**:
|
||||
- Description of sort fields.
|
||||
- Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`.
|
||||
|
||||
> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered.
|
||||
|
||||
|
||||
### Example Usage
|
||||
|
||||
```typescript
|
||||
import { PlexAPI } from "@lukehagar/plexjs";
|
||||
import { TypeT } from "@lukehagar/plexjs/models/operations";
|
||||
|
||||
async function run() {
|
||||
const sdk = new PlexAPI({
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
});
|
||||
|
||||
const sectionId = 933505;
|
||||
const type = TypeT.Four;
|
||||
|
||||
const result = await sdk.library.searchLibrary(sectionId, type);
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `sectionId` | *number* | :heavy_check_mark: | the Id of the library to query |
|
||||
| `type` | [operations.TypeT](../../models/operations/typet.md) | :heavy_check_mark: | Plex content type to search for |
|
||||
| `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. |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**Promise<[operations.SearchLibraryResponse](../../models/operations/searchlibraryresponse.md)>**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| --------------- | --------------- | --------------- |
|
||||
| errors.SDKError | 4xx-5xx | */* |
|
||||
|
||||
## getMetadata
|
||||
|
||||
This endpoint will return the metadata of a library item specified with the ratingKey.
|
||||
|
||||
@@ -32,7 +32,7 @@ Create a new playlist. By default the playlist is blank. To create a playlist al
|
||||
|
||||
```typescript
|
||||
import { PlexAPI } from "@lukehagar/plexjs";
|
||||
import { Smart, TypeT } from "@lukehagar/plexjs/models/operations";
|
||||
import { QueryParamType, Smart } from "@lukehagar/plexjs/models/operations";
|
||||
|
||||
async function run() {
|
||||
const sdk = new PlexAPI({
|
||||
@@ -41,7 +41,7 @@ async function run() {
|
||||
|
||||
const result = await sdk.playlists.createPlaylist({
|
||||
title: "string",
|
||||
type: TypeT.Photo,
|
||||
type: QueryParamType.Photo,
|
||||
smart: Smart.One,
|
||||
uri: "https://inborn-brochure.biz",
|
||||
});
|
||||
|
||||
@@ -20,14 +20,14 @@ This endpoint provides the caller with a temporary token with the same access le
|
||||
|
||||
```typescript
|
||||
import { PlexAPI } from "@lukehagar/plexjs";
|
||||
import { QueryParamType, Scope } from "@lukehagar/plexjs/models/operations";
|
||||
import { GetTransientTokenQueryParamType, Scope } from "@lukehagar/plexjs/models/operations";
|
||||
|
||||
async function run() {
|
||||
const sdk = new PlexAPI({
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
});
|
||||
|
||||
const type = QueryParamType.Delegation;
|
||||
const type = GetTransientTokenQueryParamType.Delegation;
|
||||
const scope = Scope.All;
|
||||
|
||||
const result = await sdk.security.getTransientToken(type, scope);
|
||||
@@ -43,7 +43,7 @@ run();
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `type` | [operations.QueryParamType](../../models/operations/queryparamtype.md) | :heavy_check_mark: | `delegation` - This is the only supported `type` parameter. |
|
||||
| `type` | [operations.GetTransientTokenQueryParamType](../../models/operations/gettransienttokenqueryparamtype.md) | :heavy_check_mark: | `delegation` - This is the only supported `type` parameter. |
|
||||
| `scope` | [operations.Scope](../../models/operations/scope.md) | :heavy_check_mark: | `all` - This is the only supported `scope` parameter. |
|
||||
| `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. |
|
||||
|
||||
Reference in New Issue
Block a user