From b77c4d818f69d596a19274eed977776068deffcb Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Mon, 1 Jan 2024 15:06:15 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.129.1 --- README.md | 329 +++++++++++++++++++++++++++ RELEASES.md | 12 +- USAGE.md | 4 +- docs/sdks/activities/README.md | 8 +- docs/sdks/butler/README.md | 24 +- docs/sdks/hubs/README.md | 12 +- docs/sdks/library/README.md | 50 ++-- docs/sdks/log/README.md | 14 +- docs/sdks/media/README.md | 12 +- docs/sdks/playlists/README.md | 42 ++-- docs/sdks/{sdk => plexapi}/README.md | 2 +- docs/sdks/search/README.md | 12 +- docs/sdks/security/README.md | 10 +- docs/sdks/server/README.md | 34 +-- docs/sdks/sessions/README.md | 16 +- docs/sdks/updater/README.md | 16 +- docs/sdks/video/README.md | 10 +- files.gen | 2 +- gen.yaml | 6 +- package-lock.json | 8 +- package.json | 6 +- src/lib/config.ts | 4 +- src/sdk/sdk.ts | 2 +- 23 files changed, 487 insertions(+), 148 deletions(-) create mode 100644 README.md rename docs/sdks/{sdk => plexapi}/README.md (88%) diff --git a/README.md b/README.md new file mode 100644 index 00000000..5339293b --- /dev/null +++ b/README.md @@ -0,0 +1,329 @@ +# plexjs + +
+ + + + +
+ + +## 🏗 **Welcome to your new SDK!** 🏗 + +It has been generated successfully based on your OpenAPI spec. However, it is not yet ready for production use. Here are some next steps: +- [ ] 🛠 Make your SDK feel handcrafted by [customizing it](https://www.speakeasyapi.dev/docs/customize-sdks) +- [ ] ♻️ Refine your SDK quickly by iterating locally with the [Speakeasy CLI](https://github.com/speakeasy-api/speakeasy) +- [ ] 🎁 Publish your SDK to package managers by [configuring automatic publishing](https://www.speakeasyapi.dev/docs/productionize-sdks/publish-sdks) +- [ ] ✨ When ready to productionize, delete this section from the README + + +## SDK Installation + +### NPM + +```bash +npm add plexjs +``` + +### Yarn + +```bash +yarn add plexjs +``` + + + +## SDK Example Usage + +### Example + +```typescript +import { PlexAPI } from "plexjs"; + +async function run() { + const sdk = new PlexAPI({ + accessToken: "", + }); + + const res = await sdk.server.getServerCapabilities(); + + if (res?.statusCode !== 200) { + throw new Error("Unexpected status code: " + res?.statusCode || "-"); + } + + // handle response +} + +run(); + +``` + + + +## Available Resources and Operations + +### [server](docs/sdks/server/README.md) + +* [getServerCapabilities](docs/sdks/server/README.md#getservercapabilities) - Server Capabilities +* [getServerPreferences](docs/sdks/server/README.md#getserverpreferences) - Get Server Preferences +* [getAvailableClients](docs/sdks/server/README.md#getavailableclients) - Get Available Clients +* [getDevices](docs/sdks/server/README.md#getdevices) - Get Devices +* [getServerIdentity](docs/sdks/server/README.md#getserveridentity) - Get Server Identity +* [getMyPlexAccount](docs/sdks/server/README.md#getmyplexaccount) - Get MyPlex Account +* [getResizedPhoto](docs/sdks/server/README.md#getresizedphoto) - Get a Resized Photo +* [getServerList](docs/sdks/server/README.md#getserverlist) - Get Server List + +### [media](docs/sdks/media/README.md) + +* [markPlayed](docs/sdks/media/README.md#markplayed) - Mark Media Played +* [markUnplayed](docs/sdks/media/README.md#markunplayed) - Mark Media Unplayed +* [updatePlayProgress](docs/sdks/media/README.md#updateplayprogress) - Update Media Play Progress + +### [activities](docs/sdks/activities/README.md) + +* [getServerActivities](docs/sdks/activities/README.md#getserveractivities) - Get Server Activities +* [cancelServerActivities](docs/sdks/activities/README.md#cancelserveractivities) - Cancel Server Activities + +### [butler](docs/sdks/butler/README.md) + +* [getButlerTasks](docs/sdks/butler/README.md#getbutlertasks) - Get Butler tasks +* [startAllTasks](docs/sdks/butler/README.md#startalltasks) - Start all Butler tasks +* [stopAllTasks](docs/sdks/butler/README.md#stopalltasks) - Stop all Butler tasks +* [startTask](docs/sdks/butler/README.md#starttask) - Start a single Butler task +* [stopTask](docs/sdks/butler/README.md#stoptask) - Stop a single Butler task + +### [hubs](docs/sdks/hubs/README.md) + +* [getGlobalHubs](docs/sdks/hubs/README.md#getglobalhubs) - Get Global Hubs +* [getLibraryHubs](docs/sdks/hubs/README.md#getlibraryhubs) - Get library specific hubs + +### [search](docs/sdks/search/README.md) + +* [performSearch](docs/sdks/search/README.md#performsearch) - Perform a search +* [performVoiceSearch](docs/sdks/search/README.md#performvoicesearch) - Perform a voice search +* [getSearchResults](docs/sdks/search/README.md#getsearchresults) - Get Search Results + +### [library](docs/sdks/library/README.md) + +* [getFileHash](docs/sdks/library/README.md#getfilehash) - Get Hash Value +* [getRecentlyAdded](docs/sdks/library/README.md#getrecentlyadded) - Get Recently Added +* [getLibraries](docs/sdks/library/README.md#getlibraries) - Get All Libraries +* [getLibrary](docs/sdks/library/README.md#getlibrary) - Get Library Details +* [deleteLibrary](docs/sdks/library/README.md#deletelibrary) - Delete Library Section +* [getLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items +* [refreshLibrary](docs/sdks/library/README.md#refreshlibrary) - Refresh Library +* [getLatestLibraryItems](docs/sdks/library/README.md#getlatestlibraryitems) - Get Latest Library Items +* [getCommonLibraryItems](docs/sdks/library/README.md#getcommonlibraryitems) - Get Common Library Items +* [getMetadata](docs/sdks/library/README.md#getmetadata) - Get Items Metadata +* [getMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children +* [getOnDeck](docs/sdks/library/README.md#getondeck) - Get On Deck + +### [log](docs/sdks/log/README.md) + +* [logLine](docs/sdks/log/README.md#logline) - Logging a single line message. +* [logMultiLine](docs/sdks/log/README.md#logmultiline) - Logging a multi-line message +* [enablePaperTrail](docs/sdks/log/README.md#enablepapertrail) - Enabling Papertrail + +### [playlists](docs/sdks/playlists/README.md) + +* [createPlaylist](docs/sdks/playlists/README.md#createplaylist) - Create a Playlist +* [getPlaylists](docs/sdks/playlists/README.md#getplaylists) - Get All Playlists +* [getPlaylist](docs/sdks/playlists/README.md#getplaylist) - Retrieve Playlist +* [deletePlaylist](docs/sdks/playlists/README.md#deleteplaylist) - Deletes a Playlist +* [updatePlaylist](docs/sdks/playlists/README.md#updateplaylist) - Update a Playlist +* [getPlaylistContents](docs/sdks/playlists/README.md#getplaylistcontents) - Retrieve Playlist Contents +* [clearPlaylistContents](docs/sdks/playlists/README.md#clearplaylistcontents) - Delete Playlist Contents +* [addPlaylistContents](docs/sdks/playlists/README.md#addplaylistcontents) - Adding to a Playlist +* [uploadPlaylist](docs/sdks/playlists/README.md#uploadplaylist) - Upload Playlist + +### [security](docs/sdks/security/README.md) + +* [getTransientToken](docs/sdks/security/README.md#gettransienttoken) - Get a Transient Token. +* [getSourceConnectionInformation](docs/sdks/security/README.md#getsourceconnectioninformation) - Get Source Connection Information + +### [sessions](docs/sdks/sessions/README.md) + +* [getSessions](docs/sdks/sessions/README.md#getsessions) - Get Active Sessions +* [getSessionHistory](docs/sdks/sessions/README.md#getsessionhistory) - Get Session History +* [getTranscodeSessions](docs/sdks/sessions/README.md#gettranscodesessions) - Get Transcode Sessions +* [stopTranscodeSession](docs/sdks/sessions/README.md#stoptranscodesession) - Stop a Transcode Session + +### [updater](docs/sdks/updater/README.md) + +* [getUpdateStatus](docs/sdks/updater/README.md#getupdatestatus) - Querying status of updates +* [checkForUpdates](docs/sdks/updater/README.md#checkforupdates) - Checking for updates +* [applyUpdates](docs/sdks/updater/README.md#applyupdates) - Apply Updates + +### [video](docs/sdks/video/README.md) + +* [startUniversalTranscode](docs/sdks/video/README.md#startuniversaltranscode) - Start Universal Transcode +* [getTimeline](docs/sdks/video/README.md#gettimeline) - Get the timeline for a media item + + + +## Error Handling + +All SDK methods return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type. + +| Error Object | Status Code | Content Type | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| errors.GetServerCapabilitiesResponseBody | 401 | application/json | +| errors.SDKError | 4xx-5xx | */* | + +Example + +```typescript +import { PlexAPI } from "plexjs"; +import * as errors from "plexjs/models/errors"; + +async function run() { + const sdk = new PlexAPI({ + accessToken: "", + }); + + const res = await sdk.server.getServerCapabilities().catch((err) => { + if (err instanceof errors.GetServerCapabilitiesResponseBody) { + console.error(err); // handle exception + return null; + } else { + throw err; + } + }); + + if (res?.statusCode !== 200) { + throw new Error("Unexpected status code: " + res?.statusCode || "-"); + } + + // handle response +} + +run(); + +``` + + + +## Server Selection + +### Select Server by Index + +You can override the default server globally by passing a server index to the `serverIdx: number` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers: + +| # | Server | Variables | +| - | ------ | --------- | +| 0 | `http://10.10.10.47:32400` | None | +| 1 | `{protocol}://{ip}:{port}` | `protocol` (default is `http`), `ip` (default is `10.10.10.47`), `port` (default is `32400`) | + + + +#### Variables + +Some of the server options above contain variables. If you want to set the values of those variables, the following optional parameters are available when initializing the SDK client instance: + * `protocol: models.ServerProtocol` + * `ip: string` + * `port: string` + +### Override Server URL Per-Client + +The default server can also be overridden globally by passing a URL to the `serverURL: str` optional parameter when initializing the SDK client instance. For example: + + + +## Custom HTTP Client + +The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native +[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This +client is a thin wrapper around `fetch` and provides the ability to attach hooks +around the request lifecycle that can be used to modify the request or handle +errors and response. + +The `HTTPClient` constructor takes an optional `fetcher` argument that can be +used to integrate a third-party HTTP client or when writing tests to mock out +the HTTP client and feed in fixtures. + +The following example shows how to use the `"beforeRequest"` hook to to add a +custom header and a timeout to requests and how to use the `"requestError"` hook +to log errors: + +```typescript +import { PlexAPI } from "plexjs"; +import { HTTPClient } from "plexjs/lib/http"; + +const httpClient = new HTTPClient({ + // fetcher takes a function that has the same signature as native `fetch`. + fetcher: (request) => { + return fetch(request); + } +}); + +httpClient.addHook("beforeRequest", (request) => { + const nextRequest = new Request(request, { + signal: request.signal || AbortSignal.timeout(5000); + }); + + nextRequest.headers.set("x-custom-header", "custom value"); + + return nextRequest; +}); + +httpClient.addHook("requestError", (error, request) => { + console.group("Request Error"); + console.log("Reason:", `${error}`); + console.log("Endpoint:", `${request.method} ${request.url}`); + console.groupEnd(); +}); + +const sdk = new PlexAPI({ httpClient }); +``` + + + +## Authentication + +### Per-Client Security Schemes + +This SDK supports the following security scheme globally: + +| Name | Type | Scheme | +| ------------- | ------------- | ------------- | +| `accessToken` | apiKey | API key | + +To authenticate with the API the `accessToken` parameter must be set when initializing the SDK client instance. For example: +```typescript +import { PlexAPI } from "plexjs"; + +async function run() { + const sdk = new PlexAPI({ + accessToken: "", + }); + + const res = await sdk.server.getServerCapabilities(); + + if (res?.statusCode !== 200) { + throw new Error("Unexpected status code: " + res?.statusCode || "-"); + } + + // handle response +} + +run(); + +``` + + + + +# Development + +## Maturity + +This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage +to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally +looking for the latest version. + +## Contributions + +While we value open-source contributions to this SDK, this library is generated programmatically. +Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release! + +### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks) diff --git a/RELEASES.md b/RELEASES.md index afa6bf2e..68f81422 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -8,4 +8,14 @@ Based on: ### Generated - [typescript v0.1.0] . ### Releases -- [NPM v0.1.0] https://www.npmjs.com/package/openapi/v/0.1.0 - . \ No newline at end of file +- [NPM v0.1.0] https://www.npmjs.com/package/openapi/v/0.1.0 - . + +## 2024-01-01 15:05:18 +### Changes +Based on: +- OpenAPI Doc 0.0.3 +- Speakeasy CLI 1.129.1 (2.223.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.2.0] . +### Releases +- [NPM v0.2.0] https://www.npmjs.com/package/plexjs/v/0.2.0 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 8c4da2a1..20af9cf2 100644 --- a/USAGE.md +++ b/USAGE.md @@ -1,9 +1,9 @@ ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); diff --git a/docs/sdks/activities/README.md b/docs/sdks/activities/README.md index 63cc8109..3c9378f5 100644 --- a/docs/sdks/activities/README.md +++ b/docs/sdks/activities/README.md @@ -24,10 +24,10 @@ Get Server Activities ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -68,10 +68,10 @@ Cancel Server Activities ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); diff --git a/docs/sdks/butler/README.md b/docs/sdks/butler/README.md index 10899915..68278d4c 100644 --- a/docs/sdks/butler/README.md +++ b/docs/sdks/butler/README.md @@ -21,10 +21,10 @@ Returns a list of butler tasks ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -70,10 +70,10 @@ This endpoint will attempt to start all Butler tasks that are enabled in the set ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -115,10 +115,10 @@ This endpoint will stop all currently running tasks and remove any scheduled tas ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -164,11 +164,11 @@ This endpoint will attempt to start a single Butler task that is enabled in the ### Example Usage ```typescript -import { SDK } from "openapi"; -import { TaskName } from "openapi/models/operations"; +import { PlexAPI } from "plexjs"; +import { TaskName } from "plexjs/models/operations"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -213,11 +213,11 @@ This endpoint will stop a currently running task by name, or remove it from the ### Example Usage ```typescript -import { SDK } from "openapi"; -import { PathParamTaskName } from "openapi/models/operations"; +import { PlexAPI } from "plexjs"; +import { PathParamTaskName } from "plexjs/models/operations"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); diff --git a/docs/sdks/hubs/README.md b/docs/sdks/hubs/README.md index ad48b750..95ba283f 100644 --- a/docs/sdks/hubs/README.md +++ b/docs/sdks/hubs/README.md @@ -18,11 +18,11 @@ Get Global Hubs filtered by the parameters provided. ### Example Usage ```typescript -import { SDK } from "openapi"; -import { OnlyTransient } from "openapi/models/operations"; +import { PlexAPI } from "plexjs"; +import { OnlyTransient } from "plexjs/models/operations"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -69,11 +69,11 @@ This endpoint will return a list of library specific hubs ### Example Usage ```typescript -import { SDK } from "openapi"; -import { QueryParamOnlyTransient } from "openapi/models/operations"; +import { PlexAPI } from "plexjs"; +import { QueryParamOnlyTransient } from "plexjs/models/operations"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); diff --git a/docs/sdks/library/README.md b/docs/sdks/library/README.md index a599b36b..325d2e2f 100644 --- a/docs/sdks/library/README.md +++ b/docs/sdks/library/README.md @@ -28,10 +28,10 @@ This resource returns hash values for local files ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -78,10 +78,10 @@ This endpoint will return the recently added content. ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -128,10 +128,10 @@ This allows a client to provide a rich interface around the media (e.g. allow so ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -191,11 +191,11 @@ Returns details for the library. This can be thought of as an interstitial endpo ### Example Usage ```typescript -import { SDK } from "openapi"; -import { IncludeDetails } from "openapi/models/operations"; +import { PlexAPI } from "plexjs"; +import { IncludeDetails } from "plexjs/models/operations"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -241,10 +241,10 @@ Delate a library using a specific section ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -289,10 +289,10 @@ This endpoint will return a list of library items filtered by the filter and typ ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -341,10 +341,10 @@ This endpoint Refreshes the library. ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -389,10 +389,10 @@ This endpoint will return a list of the latest library items filtered by the fil ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -441,10 +441,10 @@ Represents a "Common" item. It contains only the common attributes of the items ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -493,10 +493,10 @@ This endpoint will return the metadata of a library item specified with the rati ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -541,10 +541,10 @@ This endpoint will return the children of of a library item specified with the r ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -589,10 +589,10 @@ This endpoint will return the on deck content. ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); diff --git a/docs/sdks/log/README.md b/docs/sdks/log/README.md index 6a8aeeb3..5fbfc403 100644 --- a/docs/sdks/log/README.md +++ b/docs/sdks/log/README.md @@ -20,11 +20,11 @@ This endpoint will write a single-line log message, including a level and source ### Example Usage ```typescript -import { SDK } from "openapi"; -import { Level } from "openapi/models/operations"; +import { PlexAPI } from "plexjs"; +import { Level } from "plexjs/models/operations"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -73,10 +73,10 @@ This endpoint will write multiple lines to the main Plex Media Server log in a s ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -118,10 +118,10 @@ This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); diff --git a/docs/sdks/media/README.md b/docs/sdks/media/README.md index 1edbfd62..9421bd6d 100644 --- a/docs/sdks/media/README.md +++ b/docs/sdks/media/README.md @@ -19,10 +19,10 @@ This will mark the provided media key as Played. ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -66,10 +66,10 @@ This will mark the provided media key as Unplayed. ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -114,10 +114,10 @@ This API command can be used to update the play progress of a media item. ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); diff --git a/docs/sdks/playlists/README.md b/docs/sdks/playlists/README.md index 3e79a6a2..6636e66f 100644 --- a/docs/sdks/playlists/README.md +++ b/docs/sdks/playlists/README.md @@ -31,11 +31,11 @@ Create a new playlist. By default the playlist is blank. To create a playlist al ### Example Usage ```typescript -import { SDK } from "openapi"; -import { Smart, TypeT } from "openapi/models/operations"; +import { PlexAPI } from "plexjs"; +import { Smart, TypeT } from "plexjs/models/operations"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -81,11 +81,11 @@ Get All Playlists given the specified filters. ### Example Usage ```typescript -import { SDK } from "openapi"; -import { PlaylistType, QueryParamSmart } from "openapi/models/operations"; +import { PlexAPI } from "plexjs"; +import { PlaylistType, QueryParamSmart } from "plexjs/models/operations"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -133,10 +133,10 @@ Smart playlist details contain the `content` attribute. This is the content URI ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -181,10 +181,10 @@ This endpoint will delete a playlist ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -229,10 +229,10 @@ From PMS version 1.9.1 clients can also edit playlist metadata using this endpoi ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -280,10 +280,10 @@ Note that for dumb playlists, items have a `playlistItemID` attribute which is u ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -330,10 +330,10 @@ Clears a playlist, only works with dumb playlists. Returns the playlist. ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -379,10 +379,10 @@ With a smart playlist, passing a new `uri` parameter replaces the rules for the ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -431,11 +431,11 @@ Imports m3u playlists by passing a path on the server to scan for m3u-formatted ### Example Usage ```typescript -import { SDK } from "openapi"; -import { Force } from "openapi/models/operations"; +import { PlexAPI } from "plexjs"; +import { Force } from "plexjs/models/operations"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); diff --git a/docs/sdks/sdk/README.md b/docs/sdks/plexapi/README.md similarity index 88% rename from docs/sdks/sdk/README.md rename to docs/sdks/plexapi/README.md index 90cf8ccb..8ee580cf 100644 --- a/docs/sdks/sdk/README.md +++ b/docs/sdks/plexapi/README.md @@ -1,4 +1,4 @@ -# SDK +# PlexAPI SDK ## Overview diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md index bfeab4af..ad29415a 100644 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -31,10 +31,10 @@ This request is intended to be very fast, and called as the user types. ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -86,10 +86,10 @@ Results, as well as their containing per-type hubs, contain a `distance` attribu ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -137,10 +137,10 @@ This will search the database for the string provided. ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); diff --git a/docs/sdks/security/README.md b/docs/sdks/security/README.md index f36e1344..db9b2c3d 100644 --- a/docs/sdks/security/README.md +++ b/docs/sdks/security/README.md @@ -19,11 +19,11 @@ This endpoint provides the caller with a temporary token with the same access le ### Example Usage ```typescript -import { SDK } from "openapi"; -import { QueryParamType, Scope } from "openapi/models/operations"; +import { PlexAPI } from "plexjs"; +import { QueryParamType, Scope } from "plexjs/models/operations"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -71,10 +71,10 @@ Note: requires Plex Media Server >= 1.15.4. ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); diff --git a/docs/sdks/server/README.md b/docs/sdks/server/README.md index 3efb262f..d285b323 100644 --- a/docs/sdks/server/README.md +++ b/docs/sdks/server/README.md @@ -24,10 +24,10 @@ Server Capabilities ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -68,10 +68,10 @@ Get Server Preferences ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -112,10 +112,10 @@ Get Available Clients ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -156,10 +156,10 @@ Get Devices ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -200,10 +200,10 @@ Get Server Identity ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -244,10 +244,10 @@ Returns MyPlex Account Information ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -289,11 +289,11 @@ Plex's Photo transcoder is used throughout the service to serve images at specif ### Example Usage ```typescript -import { SDK } from "openapi"; -import { MinSize, Upscale } from "openapi/models/operations"; +import { PlexAPI } from "plexjs"; +import { MinSize, Upscale } from "plexjs/models/operations"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -343,10 +343,10 @@ Get Server List ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); diff --git a/docs/sdks/sessions/README.md b/docs/sdks/sessions/README.md index f97da0a5..3045466e 100644 --- a/docs/sdks/sessions/README.md +++ b/docs/sdks/sessions/README.md @@ -20,10 +20,10 @@ This will retrieve the "Now Playing" Information of the PMS. ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -64,10 +64,10 @@ This will Retrieve a listing of all history views. ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -108,10 +108,10 @@ Get Transcode Sessions ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -152,10 +152,10 @@ Stop a Transcode Session ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); diff --git a/docs/sdks/updater/README.md b/docs/sdks/updater/README.md index 0032a298..5c65a7cb 100644 --- a/docs/sdks/updater/README.md +++ b/docs/sdks/updater/README.md @@ -20,10 +20,10 @@ Querying status of updates ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -64,11 +64,11 @@ Checking for updates ### Example Usage ```typescript -import { SDK } from "openapi"; -import { Download } from "openapi/models/operations"; +import { PlexAPI } from "plexjs"; +import { Download } from "plexjs/models/operations"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -113,11 +113,11 @@ Note that these two parameters are effectively mutually exclusive. The `tonight` ### Example Usage ```typescript -import { SDK } from "openapi"; -import { Skip, Tonight } from "openapi/models/operations"; +import { PlexAPI } from "plexjs"; +import { Skip, Tonight } from "plexjs/models/operations"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); diff --git a/docs/sdks/video/README.md b/docs/sdks/video/README.md index 70214aa3..cd01feef 100644 --- a/docs/sdks/video/README.md +++ b/docs/sdks/video/README.md @@ -18,10 +18,10 @@ Begin a Universal Transcode Session ### Example Usage ```typescript -import { SDK } from "openapi"; +import { PlexAPI } from "plexjs"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); @@ -69,11 +69,11 @@ Get the timeline for a media item ### Example Usage ```typescript -import { SDK } from "openapi"; -import { State } from "openapi/models/operations"; +import { PlexAPI } from "plexjs"; +import { State } from "plexjs/models/operations"; async function run() { - const sdk = new SDK({ + const sdk = new PlexAPI({ accessToken: "", }); diff --git a/files.gen b/files.gen index 0d562158..9797b4e5 100644 --- a/files.gen +++ b/files.gen @@ -439,7 +439,7 @@ docs/models/errors/startuniversaltranscoderesponsebody.md docs/models/errors/gettimelineerrors.md docs/models/errors/gettimelineresponsebody.md docs/models/components/security.md -docs/sdks/sdk/README.md +docs/sdks/plexapi/README.md docs/sdks/server/README.md docs/sdks/media/README.md docs/sdks/activities/README.md diff --git a/gen.yaml b/gen.yaml index c3fee09e..73288bd0 100755 --- a/gen.yaml +++ b/gen.yaml @@ -7,13 +7,13 @@ management: generation: comments: {} sdkClassName: Plex-API - repoURL: https://github.com/speakeasy-sdks/Personal-sample-sdk-9.git + repoURL: https://github.com/LukeHagar/plexjs.git maintainOpenAPIOrder: true usageSnippets: optionalPropertyRendering: withExample - useClassNamesForArrayFields: true fixes: nameResolutionDec2023: false + useClassNamesForArrayFields: true features: typescript: core: 3.3.12 @@ -22,7 +22,7 @@ features: globalServerURLs: 2.82.1 nameOverrides: 2.81.1 typescript: - version: 0.1.0 + version: 0.2.0 author: LukeHagar clientServerStatusCodesAsErrors: true flattenGlobalSecurity: true diff --git a/package-lock.json b/package-lock.json index f8c59dbf..8b353d43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "openapi", - "version": "0.1.0", + "name": "plexjs", + "version": "0.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "openapi", - "version": "0.1.0", + "name": "plexjs", + "version": "0.2.0", "dependencies": { "decimal.js": "^10.4.3", "jsonpath": "^1.1.1" diff --git a/package.json b/package.json index 79f7ce28..cdac3895 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "type": "commonjs", - "name": "openapi", - "version": "0.1.0", - "author": "Speakeasy", + "name": "plexjs", + "version": "0.2.0", + "author": "LukeHagar", "main": "./index.js", "sideEffects": false, "repository": { diff --git a/src/lib/config.ts b/src/lib/config.ts index 47e03905..d4661e80 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -84,7 +84,7 @@ export function serverURLFromOptions(options: SDKOptions): URL { export const SDK_METADATA = Object.freeze({ language: "typescript", openapiDocVersion: "0.0.3", - sdkVersion: "0.1.0", + sdkVersion: "0.2.0", genVersion: "2.223.3", - userAgent: "speakeasy-sdk/typescript 0.1.0 2.223.3 0.0.3 openapi", + userAgent: "speakeasy-sdk/typescript 0.2.0 2.223.3 0.0.3 plexjs", }); diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index acf82bda..c0460ca6 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -19,7 +19,7 @@ import { Sessions } from "./sessions"; import { Updater } from "./updater"; import { Video } from "./video"; -export class SDK extends ClientSDK { +export class PlexAPI extends ClientSDK { private readonly options$: SDKOptions; constructor(options: SDKOptions = {}) {