diff --git a/.eslintrc.js b/.eslintrc.cjs similarity index 100% rename from .eslintrc.js rename to .eslintrc.cjs diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index b0ccadca..bb86861c 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 16f22cbf-f23f-4419-8924-3a4b06381947 management: - docChecksum: 37654ea0982ab5e87a9a9576014c9d19 + docChecksum: e73920abd3a55e8d249592f2e3090574 docVersion: 0.0.3 - speakeasyVersion: 1.308.1 - generationVersion: 2.342.6 - releaseVersion: 0.17.0 - configChecksum: 91cb964c770722eba5f69c04d32554eb + speakeasyVersion: 1.314.2 + generationVersion: 2.349.6 + releaseVersion: 0.18.0 + configChecksum: 1f3f4b17023439730da2bea719ba5703 repoURL: https://github.com/LukeHagar/plexjs.git repoSubDirectory: . installationURL: https://github.com/LukeHagar/plexjs @@ -15,7 +15,7 @@ features: typescript: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.5 - core: 3.9.14 + core: 3.10.2 flattening: 2.81.1 globalSecurity: 2.82.9 globalSecurityCallbacks: 0.1.0 @@ -24,9 +24,11 @@ features: globals: 2.82.1 methodServerURLs: 2.82.1 nameOverrides: 2.81.2 + nullables: 0.1.0 responseFormat: 0.2.3 sdkHooks: 0.1.0 typeOverrides: 2.81.1 + unions: 2.85.5 generatedFiles: - src/sdk/server.ts - src/sdk/media.ts @@ -45,7 +47,7 @@ generatedFiles: - src/sdk/updater.ts - src/sdk/watchlist.ts - src/sdk/sdk.ts - - .eslintrc.js + - .eslintrc.cjs - .npmignore - RUNTIMES.md - jsr.json @@ -109,6 +111,7 @@ generatedFiles: - src/models/searchlibraryop.ts - src/models/getmetadataop.ts - src/models/getmetadatachildrenop.ts + - src/models/gettopwatchedcontentop.ts - src/models/getondeckop.ts - src/models/loglineop.ts - src/models/logmultilineop.ts @@ -125,6 +128,8 @@ generatedFiles: - src/models/gettransienttokenop.ts - src/models/getsourceconnectioninformationop.ts - src/models/getstatisticsop.ts + - src/models/getresourcesstatisticsop.ts + - src/models/getbandwidthstatisticsop.ts - src/models/getsessionsop.ts - src/models/getsessionhistoryop.ts - src/models/gettranscodesessionsop.ts @@ -348,6 +353,7 @@ generatedFiles: - docs/models/getlibraryitemsrequest.md - docs/models/getlibraryitemserrors.md - docs/models/getlibraryitemslibraryresponsebody.md + - docs/models/librarysectionid.md - docs/models/getlibraryitemspart.md - docs/models/getlibraryitemsmedia.md - docs/models/getlibraryitemsgenre.md @@ -397,6 +403,16 @@ generatedFiles: - docs/models/getmetadatachildrenmediacontainer.md - docs/models/getmetadatachildrenresponsebody.md - docs/models/getmetadatachildrenresponse.md + - docs/models/gettopwatchedcontentrequest.md + - docs/models/gettopwatchedcontentgenre.md + - docs/models/gettopwatchedcontentcountry.md + - docs/models/gettopwatchedcontentguids.md + - docs/models/gettopwatchedcontentrole.md + - docs/models/user.md + - docs/models/gettopwatchedcontentmetadata.md + - docs/models/gettopwatchedcontentmediacontainer.md + - docs/models/gettopwatchedcontentresponsebody.md + - docs/models/gettopwatchedcontentresponse.md - docs/models/getondeckerrors.md - docs/models/getondecklibraryresponsebody.md - docs/models/getondeckstream.md @@ -500,18 +516,36 @@ generatedFiles: - docs/models/getstatisticsmediacontainer.md - docs/models/getstatisticsresponsebody.md - docs/models/getstatisticsresponse.md + - docs/models/getresourcesstatisticsrequest.md + - docs/models/getresourcesstatisticserrors.md + - docs/models/getresourcesstatisticsstatisticsresponsebody.md + - docs/models/statisticsresources.md + - docs/models/getresourcesstatisticsmediacontainer.md + - docs/models/getresourcesstatisticsresponsebody.md + - docs/models/getresourcesstatisticsresponse.md + - docs/models/getbandwidthstatisticsrequest.md + - docs/models/getbandwidthstatisticserrors.md + - docs/models/getbandwidthstatisticsstatisticsresponsebody.md + - docs/models/getbandwidthstatisticsdevice.md + - docs/models/getbandwidthstatisticsaccount.md + - docs/models/statisticsbandwidth.md + - docs/models/getbandwidthstatisticsmediacontainer.md + - docs/models/getbandwidthstatisticsresponsebody.md + - docs/models/getbandwidthstatisticsresponse.md - docs/models/getsessionserrors.md - docs/models/getsessionssessionsresponsebody.md - docs/models/getsessionsstream.md - docs/models/getsessionspart.md - docs/models/getsessionsmedia.md - - docs/models/user.md + - docs/models/getsessionsuser.md - docs/models/player.md - docs/models/session.md - docs/models/getsessionsmetadata.md - docs/models/getsessionsmediacontainer.md - docs/models/getsessionsresponsebody.md - docs/models/getsessionsresponse.md + - docs/models/filter.md + - docs/models/getsessionhistoryrequest.md - docs/models/getsessionhistoryerrors.md - docs/models/getsessionhistorysessionsresponsebody.md - docs/models/getsessionhistorymetadata.md @@ -545,7 +579,7 @@ generatedFiles: - docs/models/applyupdateserrors.md - docs/models/applyupdatesresponsebody.md - docs/models/applyupdatesresponse.md - - docs/models/filter.md + - docs/models/pathparamfilter.md - docs/models/libtype.md - docs/models/includecollections.md - docs/models/includeexternalmedia.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 3556781b..70b5b09f 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true typescript: - version: 0.17.0 + version: 0.18.0 additionalDependencies: dependencies: {} devDependencies: {} @@ -37,3 +37,4 @@ typescript: packageName: '@lukehagar/plexjs' responseFormat: envelope templateVersion: v2 + useIndexModules: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 2c0dfbf0..6d1c4fe0 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.308.1 +speakeasyVersion: 1.314.2 sources: my-source: sourceNamespace: my-source - sourceRevisionDigest: sha256:a86793fdac40fba26c75c05ab0ff742fd4761395ae8a39931652b097c24ad07f - sourceBlobDigest: sha256:a9c0cfefc1a71fa3b70e5cd0458f12e5fe3e88b90a018298db65ace538e7abff + sourceRevisionDigest: sha256:c77d6e83655e2d2c0e436f49ccc7dccaa4b358ac7ebf4a1dfa2a02ce0bf16214 + sourceBlobDigest: sha256:ba5f4f817241c51501710be69994e9f23e1ba8e9c5fc74990c6e6bb68daa6a47 tags: - latest - main @@ -11,8 +11,8 @@ targets: plexjs: source: my-source sourceNamespace: my-source - sourceRevisionDigest: sha256:a86793fdac40fba26c75c05ab0ff742fd4761395ae8a39931652b097c24ad07f - sourceBlobDigest: sha256:a9c0cfefc1a71fa3b70e5cd0458f12e5fe3e88b90a018298db65ace538e7abff + sourceRevisionDigest: sha256:c77d6e83655e2d2c0e436f49ccc7dccaa4b358ac7ebf4a1dfa2a02ce0bf16214 + sourceBlobDigest: sha256:ba5f4f817241c51501710be69994e9f23e1ba8e9c5fc74990c6e6bb68daa6a47 outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/README.md b/README.md index b6a7f707..33c31fb4 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,25 @@ npm add @lukehagar/plexjs ``` +### PNPM + +```bash +pnpm add @lukehagar/plexjs +``` + +### Bun + +```bash +bun add @lukehagar/plexjs +``` + ### Yarn ```bash -yarn add @lukehagar/plexjs +yarn add @lukehagar/plexjs zod + +# Note that Yarn does not install peer dependencies automatically. You will need +# to install zod as shown above. ``` @@ -53,7 +68,7 @@ run(); ### [server](docs/sdks/server/README.md) -* [getServerCapabilities](docs/sdks/server/README.md#getservercapabilities) - Server Capabilities +* [getServerCapabilities](docs/sdks/server/README.md#getservercapabilities) - Get 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 @@ -115,6 +130,7 @@ run(); * [searchLibrary](docs/sdks/library/README.md#searchlibrary) - Search Library * [getMetadata](docs/sdks/library/README.md#getmetadata) - Get Items Metadata * [getMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children +* [getTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content * [getOnDeck](docs/sdks/library/README.md#getondeck) - Get On Deck ### [log](docs/sdks/log/README.md) @@ -143,6 +159,8 @@ run(); ### [statistics](docs/sdks/statistics/README.md) * [getStatistics](docs/sdks/statistics/README.md#getstatistics) - Get Media Statistics +* [getResourcesStatistics](docs/sdks/statistics/README.md#getresourcesstatistics) - Get Resources Statistics +* [getBandwidthStatistics](docs/sdks/statistics/README.md#getbandwidthstatistics) - Get Bandwidth Statistics ### [sessions](docs/sdks/sessions/README.md) @@ -177,7 +195,7 @@ Validation errors can also occur when either method arguments or data returned f ```typescript import { PlexAPI } from "@lukehagar/plexjs"; -import * as errors from "@lukehagar/plexjs/models"; +import { SDKValidationError } from "@lukehagar/plexjs/models"; const plexAPI = new PlexAPI({ accessToken: "", @@ -190,7 +208,7 @@ async function run() { result = await plexAPI.server.getServerCapabilities(); } catch (err) { switch (true) { - case err instanceof errors.SDKValidationError: { + case err instanceof SDKValidationError: { // Validation errors can be pretty-printed console.error(err.pretty()); // Raw value may also be inspected @@ -392,18 +410,18 @@ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md). ## Global Parameters -A parameter is configured globally. This parameter must be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed. +A parameter is configured globally. This parameter may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed. For example, you can set `X-Plex-Client-Identifier` to `"Postman"` at SDK initialization and then you do not have to pass the same value on calls to operations like `getPin`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration. ### Available Globals -The following global parameter is available. The required parameter must be set when you initialize the SDK client. +The following global parameter is available. | Name | Type | Required | Description | | ---- | ---- |:--------:| ----------- | -| xPlexClientIdentifier | string | ✔️ | The unique identifier for the client application +| xPlexClientIdentifier | string | | The unique identifier for the client application This is used to track the client application and its usage (UUID, serial number, or other number unique per device) | diff --git a/RELEASES.md b/RELEASES.md index fd28212a..405431b9 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -808,4 +808,14 @@ Based on: ### Generated - [typescript v0.17.0] . ### Releases -- [NPM v0.17.0] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.17.0 - . \ No newline at end of file +- [NPM v0.17.0] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.17.0 - . + +## 2024-06-22 00:01:06 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.314.2 (2.349.6) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.18.0] . +### Releases +- [NPM v0.18.0] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.18.0 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index be3eb9a2..ff3ac3d4 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,11 +3,11 @@ info: title: CodeSamples overlay for typescript target version: 0.0.0 actions: - - target: $["paths"]["/:/progress"]["post"] + - target: $["paths"]["/library/recentlyAdded"]["get"] update: x-codeSamples: - lang: typescript - label: updatePlayProgress + label: getRecentlyAdded source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -17,18 +17,18 @@ actions: }); async function run() { - const result = await plexAPI.media.updatePlayProgress("", 90000, "played"); + const result = await plexAPI.library.getRecentlyAdded(); // Handle the result console.log(result) } run(); - - target: $["paths"]["/hubs/search"]["get"] + - target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"] update: x-codeSamples: - lang: typescript - label: performSearch + label: getMetadataChildren source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -38,18 +38,18 @@ actions: }); async function run() { - const result = await plexAPI.search.performSearch("dylan", 1516.53, 5); + const result = await plexAPI.library.getMetadataChildren(1539.14, ""); // Handle the result console.log(result) } run(); - - target: $["paths"]["/playlists/{playlistID}/items"]["delete"] + - target: $["paths"]["/playlists/{playlistID}"]["delete"] update: x-codeSamples: - lang: typescript - label: clearPlaylistContents + label: deletePlaylist source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -59,363 +59,7 @@ actions: }); async function run() { - const result = await plexAPI.playlists.clearPlaylistContents(1893.18); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/video/:/transcode/universal/start.mpd"]["get"] - update: - x-codeSamples: - - lang: typescript - label: startUniversalTranscode - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.video.startUniversalTranscode({ - hasMDE: 1, - path: "/library/metadata/23409", - mediaIndex: 0, - partIndex: 0, - protocol: "hls", - fastSeek: 0, - directPlay: 0, - directStream: 0, - subtitleSize: 100, - subtites: "burn", - audioBoost: 100, - location: "lan", - mediaBufferSize: 102400, - session: "zvcage8b7rkioqcm8f4uns4c", - addDebugOverlay: 0, - autoAdjustQuality: 0, - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/activities"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getServerActivities - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.activities.getServerActivities(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/activities/{activityUUID}"]["delete"] - update: - x-codeSamples: - - lang: typescript - label: cancelServerActivities - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.activities.cancelServerActivities("25b71ed5-0f9d-461c-baa7-d404e9e10d3e"); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/security/token"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getTransientToken - source: |- - import { GetTransientTokenQueryParamType, PlexAPI, Scope } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.authentication.getTransientToken(GetTransientTokenQueryParamType.Delegation, Scope.All); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/security/resources"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getSourceConnectionInformation - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.authentication.getSourceConnectionInformation("server://client-identifier"); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/myplex/account"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getMyPlexAccount - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getMyPlexAccount(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/butler"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getButlerTasks - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.butler.getButlerTasks(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/hubs/sections/{sectionId}"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getLibraryHubs - source: |- - import { PlexAPI, QueryParamOnlyTransient } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.hubs.getLibraryHubs(6728.76, 9010.22, QueryParamOnlyTransient.Zero); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/playlists/upload"]["post"] - update: - x-codeSamples: - - lang: typescript - label: uploadPlaylist - source: |- - import { Force, PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.uploadPlaylist("/home/barkley/playlist.m3u", Force.Zero); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/butler/{taskName}"]["post"] - update: - x-codeSamples: - - lang: typescript - label: startTask - source: |- - import { PlexAPI, TaskName } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.butler.startTask(TaskName.CleanOldBundles); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/butler/{taskName}"]["delete"] - update: - x-codeSamples: - - lang: typescript - label: stopTask - source: |- - import { PathParamTaskName, PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.butler.stopTask(PathParamTaskName.BackupDatabase); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/library/hashes"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getFileHash - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getFileHash("file://C:\Image.png&type=13", 4462.17); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/library/sections/watchlist/{filter}"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getWatchlist - source: |- - import { Filter, PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.watchlist.getWatchlist({ - filter: Filter.Released, - xPlexToken: "", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/log"]["get"] - update: - x-codeSamples: - - lang: typescript - label: logLine - source: |- - import { Level, PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.log.logLine(Level.Three, "Test log message", "Postman"); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/playlists"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getPlaylists - source: |- - import { PlaylistType, PlexAPI, QueryParamSmart } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.getPlaylists(PlaylistType.Audio, QueryParamSmart.Zero); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/transcode/sessions/{sessionKey}"]["delete"] - update: - x-codeSamples: - - lang: typescript - label: stopTranscodeSession - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.sessions.stopTranscodeSession("zz7llzqlx8w9vnrsbnwhbmep"); + const result = await plexAPI.playlists.deletePlaylist(216.22); // Handle the result console.log(result) @@ -442,6 +86,93 @@ actions: console.log(result) } + run(); + - target: $["paths"]["/:/unscrobble"]["get"] + update: + x-codeSamples: + - lang: typescript + label: markUnplayed + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.media.markUnplayed(59398); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/hubs"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getGlobalHubs + source: |- + import { OnlyTransient, PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.hubs.getGlobalHubs(1262.49, OnlyTransient.One); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/statistics/bandwidth"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getBandwidthStatistics + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.statistics.getBandwidthStatistics(4); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/library/sections/watchlist/{filter}"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getWatchlist + source: |- + import { PathParamFilter, PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.watchlist.getWatchlist({ + filter: PathParamFilter.Released, + xPlexToken: "", + }); + + // Handle the result + console.log(result) + } + run(); - target: $["paths"]["/photo/:/transcode"]["get"] update: @@ -472,13 +203,13 @@ actions: } run(); - - target: $["paths"]["/home"]["get"] + - target: $["paths"]["/hubs/sections/{sectionId}"]["get"] update: x-codeSamples: - lang: typescript - label: getHomeData + label: getLibraryHubs source: |- - import { PlexAPI } from "@lukehagar/plexjs"; + import { PlexAPI, QueryParamOnlyTransient } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", @@ -486,457 +217,7 @@ actions: }); async function run() { - const result = await plexAPI.plex.getHomeData(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/search"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getSearchResults - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.search.getSearchResults("110"); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/library/metadata/{ratingKey}"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getMetadata - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getMetadata(8382.31); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/updater/check"]["put"] - update: - x-codeSamples: - - lang: typescript - label: checkForUpdates - source: |- - import { Download, PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.updater.checkForUpdates(Download.One); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/updater/apply"]["put"] - update: - x-codeSamples: - - lang: typescript - label: applyUpdates - source: |- - import { PlexAPI, Skip, Tonight } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.updater.applyUpdates(Tonight.One, Skip.One); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/pins"]["post"] - update: - x-codeSamples: - - lang: typescript - label: getPin - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.plex.getPin("Postman", false, "Postman"); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/devices"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getDevices - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getDevices(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/servers"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getServerList - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getServerList(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/:/unscrobble"]["get"] - update: - x-codeSamples: - - lang: typescript - label: markUnplayed - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.media.markUnplayed(59398); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/:/timeline"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getTimeline - source: |- - import { PlexAPI, State } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.video.getTimeline({ - ratingKey: 23409, - key: "/library/metadata/23409", - state: State.Playing, - hasMDE: 1, - time: 2000, - duration: 10000, - context: "home:hub.continueWatching", - playQueueItemID: 1, - playBackTime: 2000, - row: 1, - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/butler"]["post"] - update: - x-codeSamples: - - lang: typescript - label: startAllTasks - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.butler.startAllTasks(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/hubs/search/voice"]["get"] - update: - x-codeSamples: - - lang: typescript - label: performVoiceSearch - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.search.performVoiceSearch("dead+poop", 4094.8, 5); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/status/sessions/history/all"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getSessionHistory - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.sessions.getSessionHistory(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/:/prefs"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getServerPreferences - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getServerPreferences(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/:/scrobble"]["get"] - update: - x-codeSamples: - - lang: typescript - label: markPlayed - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.media.markPlayed(59398); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/library/recentlyAdded"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getRecentlyAdded - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getRecentlyAdded(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/playlists/{playlistID}"]["delete"] - update: - x-codeSamples: - - lang: typescript - label: deletePlaylist - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.deletePlaylist(216.22); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/identity"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getServerIdentity - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getServerIdentity(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/library/sections/{sectionId}/{tag}"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getLibraryItems - source: |- - import { PlexAPI, Tag } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getLibraryItems("", Tag.Genre); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/library/onDeck"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getOnDeck - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getOnDeck(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/pins/{pinID}"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getToken - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.plex.getToken("", "Postman"); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/library/sections"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getLibraries - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getLibraries(); + const result = await plexAPI.hubs.getLibraryHubs(6728.76, 9010.22, QueryParamOnlyTransient.Zero); // Handle the result console.log(result) @@ -963,153 +244,6 @@ actions: console.log(result) } - run(); - - target: $["paths"]["/playlists/{playlistID}/items"]["put"] - update: - x-codeSamples: - - lang: typescript - label: addPlaylistContents - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.addPlaylistContents(8502.01, "server://12345/com.plexapp.plugins.library/library/metadata/1", 123); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/clients"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getAvailableClients - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getAvailableClients(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/butler"]["delete"] - update: - x-codeSamples: - - lang: typescript - label: stopAllTasks - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.butler.stopAllTasks(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/library/sections/{sectionId}"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getLibrary - source: |- - import { IncludeDetails, PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getLibrary(1000, IncludeDetails.Zero); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/statistics/media"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getStatistics - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.statistics.getStatistics(4); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/library/sections/{sectionId}"]["delete"] - update: - x-codeSamples: - - lang: typescript - label: deleteLibrary - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.deleteLibrary(1000); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getMetadataChildren - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getMetadataChildren(1539.14); - - // Handle the result - console.log(result) - } - run(); - target: $["paths"]["/playlists/{playlistID}"]["get"] update: @@ -1131,6 +265,198 @@ actions: console.log(result) } + run(); + - target: $["paths"]["/pins/{pinID}"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getToken + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.plex.getToken("", "Postman"); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/library/sections/{sectionId}/refresh"]["get"] + update: + x-codeSamples: + - lang: typescript + label: refreshLibrary + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.library.refreshLibrary(934.16); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/playlists"]["post"] + update: + x-codeSamples: + - lang: typescript + label: createPlaylist + source: |- + import { PlexAPI, QueryParamType, Smart } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.playlists.createPlaylist({ + title: "", + type: QueryParamType.Photo, + smart: Smart.One, + uri: "https://inborn-brochure.biz", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/security/resources"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getSourceConnectionInformation + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.authentication.getSourceConnectionInformation("server://client-identifier"); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/:/prefs"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getServerPreferences + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.server.getServerPreferences(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/activities"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getServerActivities + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.activities.getServerActivities(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/butler"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getButlerTasks + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.butler.getButlerTasks(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/pins"]["post"] + update: + x-codeSamples: + - lang: typescript + label: getPin + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.plex.getPin("Postman", false, "Postman"); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/library/onDeck"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getOnDeck + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.library.getOnDeck(); + + // Handle the result + console.log(result) + } + run(); - target: $["paths"]["/status/sessions"]["get"] update: @@ -1173,27 +499,6 @@ actions: console.log(result) } - run(); - - target: $["paths"]["/playlists/{playlistID}"]["put"] - update: - x-codeSamples: - - lang: typescript - label: updatePlaylist - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.updatePlaylist(3915, "", ""); - - // Handle the result - console.log(result) - } - run(); - target: $["paths"]["/playlists/{playlistID}/items"]["get"] update: @@ -1215,6 +520,185 @@ actions: console.log(result) } + run(); + - target: $["paths"]["/statistics/media"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getStatistics + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.statistics.getStatistics(4); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/status/sessions/history/all"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getSessionHistory + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.sessions.getSessionHistory("", 1, {}, 12); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/devices"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getDevices + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.server.getDevices(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/:/timeline"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getTimeline + source: |- + import { PlexAPI, State } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.video.getTimeline({ + ratingKey: 23409, + key: "/library/metadata/23409", + state: State.Playing, + hasMDE: 1, + time: 2000, + duration: 10000, + context: "home:hub.continueWatching", + playQueueItemID: 1, + playBackTime: 2000, + row: 1, + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/hubs/search/voice"]["get"] + update: + x-codeSamples: + - lang: typescript + label: performVoiceSearch + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.search.performVoiceSearch("dead+poop", 4094.8, 5); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/library/sections/{sectionId}/{tag}"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getLibraryItems + source: |- + import { PlexAPI, Tag } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.library.getLibraryItems("", Tag.Genre, 1); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/library/sections/{sectionId}"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getLibrary + source: |- + import { IncludeDetails, PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.library.getLibrary(1000, IncludeDetails.Zero); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/clients"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getAvailableClients + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.server.getAvailableClients(); + + // Handle the result + console.log(result) + } + run(); - target: $["paths"]["/transcode/sessions"]["get"] update: @@ -1237,13 +721,13 @@ actions: } run(); - - target: $["paths"]["/hubs"]["get"] + - target: $["paths"]["/updater/check"]["put"] update: x-codeSamples: - lang: typescript - label: getGlobalHubs + label: checkForUpdates source: |- - import { OnlyTransient, PlexAPI } from "@lukehagar/plexjs"; + import { Download, PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", @@ -1251,18 +735,18 @@ actions: }); async function run() { - const result = await plexAPI.hubs.getGlobalHubs(1262.49, OnlyTransient.One); + const result = await plexAPI.updater.checkForUpdates(Download.One); // Handle the result console.log(result) } run(); - - target: $["paths"]["/library/sections/{sectionId}/refresh"]["get"] + - target: $["paths"]["/video/:/transcode/universal/start.mpd"]["get"] update: x-codeSamples: - lang: typescript - label: refreshLibrary + label: startUniversalTranscode source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -1272,7 +756,486 @@ actions: }); async function run() { - const result = await plexAPI.library.refreshLibrary(934.16); + const result = await plexAPI.video.startUniversalTranscode({ + hasMDE: 1, + path: "/library/metadata/23409", + mediaIndex: 0, + partIndex: 0, + protocol: "hls", + fastSeek: 0, + directPlay: 0, + directStream: 0, + subtitleSize: 100, + subtites: "burn", + audioBoost: 100, + location: "lan", + mediaBufferSize: 102400, + session: "zvcage8b7rkioqcm8f4uns4c", + addDebugOverlay: 0, + autoAdjustQuality: 0, + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/activities/{activityUUID}"]["delete"] + update: + x-codeSamples: + - lang: typescript + label: cancelServerActivities + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.activities.cancelServerActivities("25b71ed5-0f9d-461c-baa7-d404e9e10d3e"); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/playlists/upload"]["post"] + update: + x-codeSamples: + - lang: typescript + label: uploadPlaylist + source: |- + import { Force, PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.playlists.uploadPlaylist("/home/barkley/playlist.m3u", Force.Zero); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/library/sections/{sectionId}"]["delete"] + update: + x-codeSamples: + - lang: typescript + label: deleteLibrary + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.library.deleteLibrary(1000); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/log/networked"]["get"] + update: + x-codeSamples: + - lang: typescript + label: enablePaperTrail + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.log.enablePaperTrail(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/myplex/account"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getMyPlexAccount + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.server.getMyPlexAccount(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/:/progress"]["post"] + update: + x-codeSamples: + - lang: typescript + label: updatePlayProgress + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.media.updatePlayProgress("", 90000, "played"); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/butler"]["post"] + update: + x-codeSamples: + - lang: typescript + label: startAllTasks + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.butler.startAllTasks(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/butler"]["delete"] + update: + x-codeSamples: + - lang: typescript + label: stopAllTasks + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.butler.stopAllTasks(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/search"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getSearchResults + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.search.getSearchResults("110"); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/library/hashes"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getFileHash + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.library.getFileHash("file://C:\Image.png&type=13", 4462.17); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/identity"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getServerIdentity + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.server.getServerIdentity(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/servers"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getServerList + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.server.getServerList(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/log"]["get"] + update: + x-codeSamples: + - lang: typescript + label: logLine + source: |- + import { Level, PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.log.logLine(Level.Three, "Test log message", "Postman"); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/playlists/{playlistID}/items"]["put"] + update: + x-codeSamples: + - lang: typescript + label: addPlaylistContents + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.playlists.addPlaylistContents(8502.01, "server://12345/com.plexapp.plugins.library/library/metadata/1", 123); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/home"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getHomeData + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.plex.getHomeData(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/hubs/search"]["get"] + update: + x-codeSamples: + - lang: typescript + label: performSearch + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.search.performSearch("dylan", 1516.53, 5); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/library/sections"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getLibraries + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.library.getLibraries(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/library/metadata/{ratingKey}"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getMetadata + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.library.getMetadata(8382.31); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/statistics/resources"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getResourcesStatistics + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.statistics.getResourcesStatistics(4); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/updater/apply"]["put"] + update: + x-codeSamples: + - lang: typescript + label: applyUpdates + source: |- + import { PlexAPI, Skip, Tonight } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.updater.applyUpdates(Tonight.One, Skip.One); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/butler/{taskName}"]["post"] + update: + x-codeSamples: + - lang: typescript + label: startTask + source: |- + import { PlexAPI, TaskName } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.butler.startTask(TaskName.CleanOldBundles); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/library/all/top"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getTopWatchedContent + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.library.getTopWatchedContent(505531, 1); // Handle the result console.log(result) @@ -1302,11 +1265,11 @@ actions: } run(); - - target: $["paths"]["/log/networked"]["get"] + - target: $["paths"]["/playlists/{playlistID}/items"]["delete"] update: x-codeSamples: - lang: typescript - label: enablePaperTrail + label: clearPlaylistContents source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -1316,20 +1279,20 @@ actions: }); async function run() { - const result = await plexAPI.log.enablePaperTrail(); + const result = await plexAPI.playlists.clearPlaylistContents(1893.18); // Handle the result console.log(result) } run(); - - target: $["paths"]["/playlists"]["post"] + - target: $["paths"]["/:/scrobble"]["get"] update: x-codeSamples: - lang: typescript - label: createPlaylist + label: markPlayed source: |- - import { PlexAPI, QueryParamType, Smart } from "@lukehagar/plexjs"; + import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", @@ -1337,12 +1300,112 @@ actions: }); async function run() { - const result = await plexAPI.playlists.createPlaylist({ - title: "", - type: QueryParamType.Photo, - smart: Smart.One, - uri: "https://inborn-brochure.biz", - }); + const result = await plexAPI.media.markPlayed(59398); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/butler/{taskName}"]["delete"] + update: + x-codeSamples: + - lang: typescript + label: stopTask + source: |- + import { PathParamTaskName, PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.butler.stopTask(PathParamTaskName.BackupDatabase); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/playlists/{playlistID}"]["put"] + update: + x-codeSamples: + - lang: typescript + label: updatePlaylist + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.playlists.updatePlaylist(3915, "", ""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/security/token"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getTransientToken + source: |- + import { GetTransientTokenQueryParamType, PlexAPI, Scope } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.authentication.getTransientToken(GetTransientTokenQueryParamType.Delegation, Scope.All); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/playlists"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getPlaylists + source: |- + import { PlaylistType, PlexAPI, QueryParamSmart } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.playlists.getPlaylists(PlaylistType.Audio, QueryParamSmart.Zero); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/transcode/sessions/{sessionKey}"]["delete"] + update: + x-codeSamples: + - lang: typescript + label: stopTranscodeSession + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.sessions.stopTranscodeSession("zz7llzqlx8w9vnrsbnwhbmep"); // Handle the result console.log(result) diff --git a/docs/models/filter.md b/docs/models/filter.md index 39e65cd9..6b3af5a1 100644 --- a/docs/models/filter.md +++ b/docs/models/filter.md @@ -1,12 +1,11 @@ # Filter -Filter +Filters content by field and direction/equality +(Unknown if viewedAt is the only supported column) -## Values -| Name | Value | -| ----------- | ----------- | -| `All` | all | -| `Available` | available | -| `Released` | released | \ No newline at end of file +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/getbandwidthstatisticsaccount.md b/docs/models/getbandwidthstatisticsaccount.md new file mode 100644 index 00000000..a574208b --- /dev/null +++ b/docs/models/getbandwidthstatisticsaccount.md @@ -0,0 +1,15 @@ +# GetBandwidthStatisticsAccount + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `id` | *number* | :heavy_minus_sign: | N/A | 238960586 | +| `key` | *string* | :heavy_minus_sign: | N/A | /accounts/238960586 | +| `name` | *string* | :heavy_minus_sign: | N/A | Diane | +| `defaultAudioLanguage` | *string* | :heavy_minus_sign: | N/A | en | +| `autoSelectAudio` | *boolean* | :heavy_minus_sign: | N/A | true | +| `defaultSubtitleLanguage` | *string* | :heavy_minus_sign: | N/A | en | +| `subtitleMode` | *number* | :heavy_minus_sign: | N/A | 1 | +| `thumb` | *string* | :heavy_minus_sign: | N/A | https://plex.tv/users/50d83634246da1de/avatar?c=1707110967 | \ No newline at end of file diff --git a/docs/models/getbandwidthstatisticsdevice.md b/docs/models/getbandwidthstatisticsdevice.md new file mode 100644 index 00000000..2791c67c --- /dev/null +++ b/docs/models/getbandwidthstatisticsdevice.md @@ -0,0 +1,12 @@ +# GetBandwidthStatisticsDevice + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `id` | *number* | :heavy_minus_sign: | N/A | 208 | +| `name` | *string* | :heavy_minus_sign: | N/A | Roku Express | +| `platform` | *string* | :heavy_minus_sign: | N/A | Roku | +| `clientIdentifier` | *string* | :heavy_minus_sign: | N/A | 793095d235660625108ef785cc7646e9 | +| `createdAt` | *number* | :heavy_minus_sign: | N/A | 1706470556 | \ No newline at end of file diff --git a/docs/models/getbandwidthstatisticserrors.md b/docs/models/getbandwidthstatisticserrors.md new file mode 100644 index 00000000..5fb3c4f2 --- /dev/null +++ b/docs/models/getbandwidthstatisticserrors.md @@ -0,0 +1,10 @@ +# GetBandwidthStatisticsErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `code` | *number* | :heavy_minus_sign: | N/A | 1001 | +| `message` | *string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `status` | *number* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/getbandwidthstatisticsmediacontainer.md b/docs/models/getbandwidthstatisticsmediacontainer.md new file mode 100644 index 00000000..d3122f86 --- /dev/null +++ b/docs/models/getbandwidthstatisticsmediacontainer.md @@ -0,0 +1,11 @@ +# GetBandwidthStatisticsMediaContainer + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `size` | *number* | :heavy_minus_sign: | N/A | 5497 | +| `device` | [models.GetBandwidthStatisticsDevice](../models/getbandwidthstatisticsdevice.md)[] | :heavy_minus_sign: | N/A | | +| `account` | [models.GetBandwidthStatisticsAccount](../models/getbandwidthstatisticsaccount.md)[] | :heavy_minus_sign: | N/A | | +| `statisticsBandwidth` | [models.StatisticsBandwidth](../models/statisticsbandwidth.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/getbandwidthstatisticsrequest.md b/docs/models/getbandwidthstatisticsrequest.md new file mode 100644 index 00000000..6b1d505a --- /dev/null +++ b/docs/models/getbandwidthstatisticsrequest.md @@ -0,0 +1,8 @@ +# GetBandwidthStatisticsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `timespan` | *number* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| 4 | \ No newline at end of file diff --git a/docs/models/getbandwidthstatisticsresponse.md b/docs/models/getbandwidthstatisticsresponse.md new file mode 100644 index 00000000..9f564dc4 --- /dev/null +++ b/docs/models/getbandwidthstatisticsresponse.md @@ -0,0 +1,11 @@ +# GetBandwidthStatisticsResponse + + +## 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` | [models.GetBandwidthStatisticsResponseBody](../models/getbandwidthstatisticsresponsebody.md) | :heavy_minus_sign: | Bandwidth Statistics | \ No newline at end of file diff --git a/docs/models/getbandwidthstatisticsresponsebody.md b/docs/models/getbandwidthstatisticsresponsebody.md new file mode 100644 index 00000000..daabcff5 --- /dev/null +++ b/docs/models/getbandwidthstatisticsresponsebody.md @@ -0,0 +1,10 @@ +# GetBandwidthStatisticsResponseBody + +Bandwidth Statistics + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `mediaContainer` | [models.GetBandwidthStatisticsMediaContainer](../models/getbandwidthstatisticsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/getbandwidthstatisticsstatisticsresponsebody.md b/docs/models/getbandwidthstatisticsstatisticsresponsebody.md new file mode 100644 index 00000000..73a3e529 --- /dev/null +++ b/docs/models/getbandwidthstatisticsstatisticsresponsebody.md @@ -0,0 +1,11 @@ +# GetBandwidthStatisticsStatisticsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `errors` | [models.GetBandwidthStatisticsErrors](../models/getbandwidthstatisticserrors.md)[] | :heavy_minus_sign: | N/A | +| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/getlibraryitemsmediacontainer.md b/docs/models/getlibraryitemsmediacontainer.md index 9ff17b8f..bf19803b 100644 --- a/docs/models/getlibraryitemsmediacontainer.md +++ b/docs/models/getlibraryitemsmediacontainer.md @@ -9,7 +9,7 @@ | `allowSync` | *boolean* | :heavy_minus_sign: | N/A | true | | `art` | *string* | :heavy_minus_sign: | N/A | /:/resources/movie-fanart.jpg | | `identifier` | *string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | -| `librarySectionID` | *number* | :heavy_minus_sign: | N/A | 1 | +| `librarySectionID` | *models.LibrarySectionID* | :heavy_minus_sign: | N/A | | | `librarySectionTitle` | *string* | :heavy_minus_sign: | N/A | Movies | | `librarySectionUUID` | *string* | :heavy_minus_sign: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 | | `mediaTagPrefix` | *string* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | diff --git a/docs/models/getlibraryitemsrequest.md b/docs/models/getlibraryitemsrequest.md index eb8335bb..c57c0523 100644 --- a/docs/models/getlibraryitemsrequest.md +++ b/docs/models/getlibraryitemsrequest.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `sectionId` | *any* | :heavy_check_mark: | the Id of the library to query | -| `tag` | [models.Tag](../models/tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `sectionId` | *any* | :heavy_check_mark: | the Id of the library to query | | +| `tag` | [models.Tag](../models/tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. | | +| `includeGuids` | *number* | :heavy_minus_sign: | Adds the Guids object to the response
| 1 | \ No newline at end of file diff --git a/docs/models/getmetadatachildrenrequest.md b/docs/models/getmetadatachildrenrequest.md index d3b774e9..d225a19f 100644 --- a/docs/models/getmetadatachildrenrequest.md +++ b/docs/models/getmetadatachildrenrequest.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `ratingKey` | *number* | :heavy_check_mark: | the id of the library item to return the children of. | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `ratingKey` | *number* | :heavy_check_mark: | the id of the library item to return the children of. | +| `includeElements` | *string* | :heavy_minus_sign: | Adds additional elements to the response. Supported types are (Stream)
| \ No newline at end of file diff --git a/docs/models/getpinglobals.md b/docs/models/getpinglobals.md index 16f62421..556fa77c 100644 --- a/docs/models/getpinglobals.md +++ b/docs/models/getpinglobals.md @@ -5,4 +5,4 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `xPlexClientIdentifier` | *string* | :heavy_check_mark: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| Postman | \ No newline at end of file +| `xPlexClientIdentifier` | *string* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| Postman | \ No newline at end of file diff --git a/docs/models/getpinresponsebody.md b/docs/models/getpinresponsebody.md index d99780e0..055a911b 100644 --- a/docs/models/getpinresponsebody.md +++ b/docs/models/getpinresponsebody.md @@ -18,4 +18,4 @@ The Pin | `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A | 2023-04-12 17:00:03 +0000 UTC | | `expiresAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A | 2023-04-12 17:30:03 +0000 UTC | | `authToken` | *string* | :heavy_minus_sign: | N/A | | -| `newRegistration` | *string* | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `newRegistration` | *boolean* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/getresourcesstatisticserrors.md b/docs/models/getresourcesstatisticserrors.md new file mode 100644 index 00000000..1ef29ef1 --- /dev/null +++ b/docs/models/getresourcesstatisticserrors.md @@ -0,0 +1,10 @@ +# GetResourcesStatisticsErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `code` | *number* | :heavy_minus_sign: | N/A | 1001 | +| `message` | *string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `status` | *number* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/getresourcesstatisticsmediacontainer.md b/docs/models/getresourcesstatisticsmediacontainer.md new file mode 100644 index 00000000..9e4da66e --- /dev/null +++ b/docs/models/getresourcesstatisticsmediacontainer.md @@ -0,0 +1,9 @@ +# GetResourcesStatisticsMediaContainer + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `size` | *number* | :heavy_minus_sign: | N/A | 5497 | +| `statisticsResources` | [models.StatisticsResources](../models/statisticsresources.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/getresourcesstatisticsrequest.md b/docs/models/getresourcesstatisticsrequest.md new file mode 100644 index 00000000..6c704ac1 --- /dev/null +++ b/docs/models/getresourcesstatisticsrequest.md @@ -0,0 +1,8 @@ +# GetResourcesStatisticsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `timespan` | *number* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| 4 | \ No newline at end of file diff --git a/docs/models/getresourcesstatisticsresponse.md b/docs/models/getresourcesstatisticsresponse.md new file mode 100644 index 00000000..7c4837de --- /dev/null +++ b/docs/models/getresourcesstatisticsresponse.md @@ -0,0 +1,11 @@ +# GetResourcesStatisticsResponse + + +## 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` | [models.GetResourcesStatisticsResponseBody](../models/getresourcesstatisticsresponsebody.md) | :heavy_minus_sign: | Resource Statistics | \ No newline at end of file diff --git a/docs/models/getresourcesstatisticsresponsebody.md b/docs/models/getresourcesstatisticsresponsebody.md new file mode 100644 index 00000000..e227e6a6 --- /dev/null +++ b/docs/models/getresourcesstatisticsresponsebody.md @@ -0,0 +1,10 @@ +# GetResourcesStatisticsResponseBody + +Resource Statistics + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `mediaContainer` | [models.GetResourcesStatisticsMediaContainer](../models/getresourcesstatisticsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/getresourcesstatisticsstatisticsresponsebody.md b/docs/models/getresourcesstatisticsstatisticsresponsebody.md new file mode 100644 index 00000000..4f2a5a5b --- /dev/null +++ b/docs/models/getresourcesstatisticsstatisticsresponsebody.md @@ -0,0 +1,11 @@ +# GetResourcesStatisticsStatisticsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `errors` | [models.GetResourcesStatisticsErrors](../models/getresourcesstatisticserrors.md)[] | :heavy_minus_sign: | N/A | +| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/getsessionhistoryrequest.md b/docs/models/getsessionhistoryrequest.md new file mode 100644 index 00000000..03c4bf68 --- /dev/null +++ b/docs/models/getsessionhistoryrequest.md @@ -0,0 +1,11 @@ +# GetSessionHistoryRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `sort` | *string* | :heavy_minus_sign: | Sorts the results by the specified field followed by the direction (asc, desc)
| | +| `accountId` | *number* | :heavy_minus_sign: | Filter results by those that are related to a specific users id
| 1 | +| `filter` | [models.Filter](../models/filter.md) | :heavy_minus_sign: | Filters content by field and direction/equality
(Unknown if viewedAt is the only supported column)
| {
"viewed-at-greater-than": {
"value": "viewedAt\u003e"
},
"viewed-at-greater-than-or-equal-to": {
"value": "viewedAt\u003e=\u003e"
},
"viewed-at-less-than": {
"value": "viewedAt\u003c"
}
} | +| `librarySectionID` | *number* | :heavy_minus_sign: | Filters the results based on the id of a valid library section
| 12 | \ No newline at end of file diff --git a/docs/models/getsessionsmetadata.md b/docs/models/getsessionsmetadata.md index d621cb77..2bcad40b 100644 --- a/docs/models/getsessionsmetadata.md +++ b/docs/models/getsessionsmetadata.md @@ -39,6 +39,6 @@ | `updatedAt` | *number* | :heavy_minus_sign: | N/A | 1705543314 | | `viewOffset` | *number* | :heavy_minus_sign: | N/A | 1000 | | `media` | [models.GetSessionsMedia](../models/getsessionsmedia.md)[] | :heavy_minus_sign: | N/A | | -| `user` | [models.User](../models/user.md) | :heavy_minus_sign: | N/A | | +| `user` | [models.GetSessionsUser](../models/getsessionsuser.md) | :heavy_minus_sign: | N/A | | | `player` | [models.Player](../models/player.md) | :heavy_minus_sign: | N/A | | | `session` | [models.Session](../models/session.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/getsessionsuser.md b/docs/models/getsessionsuser.md new file mode 100644 index 00000000..6f0021f2 --- /dev/null +++ b/docs/models/getsessionsuser.md @@ -0,0 +1,10 @@ +# GetSessionsUser + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | N/A | 1 | +| `thumb` | *string* | :heavy_minus_sign: | N/A | https://plex.tv/users/844780fc6f8a26b5/avatar?c=1705853661 | +| `title` | *string* | :heavy_minus_sign: | N/A | Blindkitty38 | \ No newline at end of file diff --git a/docs/models/gettokenglobals.md b/docs/models/gettokenglobals.md index df71ec7d..bd7fe3f2 100644 --- a/docs/models/gettokenglobals.md +++ b/docs/models/gettokenglobals.md @@ -5,4 +5,4 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `xPlexClientIdentifier` | *string* | :heavy_check_mark: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| Postman | \ No newline at end of file +| `xPlexClientIdentifier` | *string* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| Postman | \ No newline at end of file diff --git a/docs/models/gettopwatchedcontentcountry.md b/docs/models/gettopwatchedcontentcountry.md new file mode 100644 index 00000000..25bb1d39 --- /dev/null +++ b/docs/models/gettopwatchedcontentcountry.md @@ -0,0 +1,10 @@ +# GetTopWatchedContentCountry + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `id` | *number* | :heavy_minus_sign: | N/A | 116 | +| `filter` | *string* | :heavy_minus_sign: | N/A | country=116 | +| `tag` | *string* | :heavy_minus_sign: | N/A | United States of America | \ No newline at end of file diff --git a/docs/models/gettopwatchedcontentgenre.md b/docs/models/gettopwatchedcontentgenre.md new file mode 100644 index 00000000..920fd772 --- /dev/null +++ b/docs/models/gettopwatchedcontentgenre.md @@ -0,0 +1,10 @@ +# GetTopWatchedContentGenre + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *number* | :heavy_minus_sign: | N/A | 184 | +| `filter` | *string* | :heavy_minus_sign: | N/A | genre=184 | +| `tag` | *string* | :heavy_minus_sign: | N/A | Thriller | \ No newline at end of file diff --git a/docs/models/gettopwatchedcontentguids.md b/docs/models/gettopwatchedcontentguids.md new file mode 100644 index 00000000..0e273656 --- /dev/null +++ b/docs/models/gettopwatchedcontentguids.md @@ -0,0 +1,8 @@ +# GetTopWatchedContentGuids + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *string* | :heavy_minus_sign: | N/A | tvdb://2337 | \ No newline at end of file diff --git a/docs/models/gettopwatchedcontentmediacontainer.md b/docs/models/gettopwatchedcontentmediacontainer.md new file mode 100644 index 00000000..0c3b75a7 --- /dev/null +++ b/docs/models/gettopwatchedcontentmediacontainer.md @@ -0,0 +1,13 @@ +# GetTopWatchedContentMediaContainer + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `size` | *number* | :heavy_minus_sign: | N/A | 1 | +| `allowSync` | *boolean* | :heavy_minus_sign: | N/A | true | +| `identifier` | *string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | +| `mediaTagPrefix` | *string* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | +| `mediaTagVersion` | *number* | :heavy_minus_sign: | N/A | 1698860922 | +| `metadata` | [models.GetTopWatchedContentMetadata](../models/gettopwatchedcontentmetadata.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/gettopwatchedcontentmetadata.md b/docs/models/gettopwatchedcontentmetadata.md new file mode 100644 index 00000000..9f530ab7 --- /dev/null +++ b/docs/models/gettopwatchedcontentmetadata.md @@ -0,0 +1,39 @@ +# GetTopWatchedContentMetadata + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ratingKey` | *string* | :heavy_minus_sign: | N/A | 17 | +| `key` | *string* | :heavy_minus_sign: | N/A | /library/metadata/17 | +| `guid` | *string* | :heavy_minus_sign: | N/A | plex://movie/5d77683f6f4521001ea9dc53 | +| `slug` | *string* | :heavy_minus_sign: | N/A | waterloo-road | +| `studio` | *string* | :heavy_minus_sign: | N/A | Universal Pictures | +| `type` | *string* | :heavy_minus_sign: | N/A | movie | +| `title` | *string* | :heavy_minus_sign: | N/A | Serenity | +| `librarySectionTitle` | *string* | :heavy_minus_sign: | N/A | Movies | +| `librarySectionID` | *number* | :heavy_minus_sign: | N/A | 1 | +| `librarySectionKey` | *string* | :heavy_minus_sign: | N/A | /library/sections/1 | +| `contentRating` | *string* | :heavy_minus_sign: | N/A | PG-13 | +| `summary` | *string* | :heavy_minus_sign: | N/A | Serenity continues the story of the TV series it was based upon ("Firefly"). River Tam had a secret - one in which she's not even aware - so dangerous, no one's safe, as an Alliance operative's sent to capture her, and all others are considered irrelevant to his job. | +| `index` | *number* | :heavy_minus_sign: | N/A | 1 | +| `audienceRating` | *number* | :heavy_minus_sign: | N/A | 9.1 | +| `year` | *number* | :heavy_minus_sign: | N/A | 2005 | +| `tagline` | *string* | :heavy_minus_sign: | N/A | They aim to misbehave. | +| `thumb` | *string* | :heavy_minus_sign: | N/A | /library/metadata/17/thumb/1705637165 | +| `art` | *string* | :heavy_minus_sign: | N/A | /library/metadata/17/art/1705637165 | +| `duration` | *number* | :heavy_minus_sign: | N/A | 141417 | +| `originallyAvailableAt` | [RFCDate](../types/rfcdate.md) | :heavy_minus_sign: | N/A | 2005-09-29 00:00:00 +0000 UTC | +| `leafCount` | *number* | :heavy_minus_sign: | N/A | 222 | +| `viewedLeafCount` | *number* | :heavy_minus_sign: | N/A | 100 | +| `childCount` | *number* | :heavy_minus_sign: | N/A | 13 | +| `addedAt` | *number* | :heavy_minus_sign: | N/A | 1705637164 | +| `updatedAt` | *number* | :heavy_minus_sign: | N/A | 1705637165 | +| `globalViewCount` | *number* | :heavy_minus_sign: | N/A | 80 | +| `audienceRatingImage` | *string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | +| `genre` | [models.GetTopWatchedContentGenre](../models/gettopwatchedcontentgenre.md)[] | :heavy_minus_sign: | N/A | | +| `country` | [models.GetTopWatchedContentCountry](../models/gettopwatchedcontentcountry.md)[] | :heavy_minus_sign: | N/A | | +| `guids` | [models.GetTopWatchedContentGuids](../models/gettopwatchedcontentguids.md)[] | :heavy_minus_sign: | N/A | | +| `role` | [models.GetTopWatchedContentRole](../models/gettopwatchedcontentrole.md)[] | :heavy_minus_sign: | N/A | | +| `user` | [models.User](../models/user.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/gettopwatchedcontentrequest.md b/docs/models/gettopwatchedcontentrequest.md new file mode 100644 index 00000000..25d50339 --- /dev/null +++ b/docs/models/gettopwatchedcontentrequest.md @@ -0,0 +1,9 @@ +# GetTopWatchedContentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| `type` | *number* | :heavy_check_mark: | the library type (1 - movies, 2 - shows, 3 - music) | | +| `includeGuids` | *number* | :heavy_minus_sign: | Adds the Guids object to the response
| 1 | \ No newline at end of file diff --git a/docs/models/gettopwatchedcontentresponse.md b/docs/models/gettopwatchedcontentresponse.md new file mode 100644 index 00000000..67281683 --- /dev/null +++ b/docs/models/gettopwatchedcontentresponse.md @@ -0,0 +1,11 @@ +# GetTopWatchedContentResponse + + +## 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` | [models.GetTopWatchedContentResponseBody](../models/gettopwatchedcontentresponsebody.md) | :heavy_minus_sign: | The metadata of the library item. | \ No newline at end of file diff --git a/docs/models/gettopwatchedcontentresponsebody.md b/docs/models/gettopwatchedcontentresponsebody.md new file mode 100644 index 00000000..7c6b0f5d --- /dev/null +++ b/docs/models/gettopwatchedcontentresponsebody.md @@ -0,0 +1,10 @@ +# GetTopWatchedContentResponseBody + +The metadata of the library item. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `mediaContainer` | [models.GetTopWatchedContentMediaContainer](../models/gettopwatchedcontentmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/gettopwatchedcontentrole.md b/docs/models/gettopwatchedcontentrole.md new file mode 100644 index 00000000..590a0a88 --- /dev/null +++ b/docs/models/gettopwatchedcontentrole.md @@ -0,0 +1,13 @@ +# GetTopWatchedContentRole + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `id` | *number* | :heavy_minus_sign: | N/A | 220 | +| `filter` | *string* | :heavy_minus_sign: | N/A | actor=220 | +| `tag` | *string* | :heavy_minus_sign: | N/A | Dennis Keiffer | +| `tagKey` | *string* | :heavy_minus_sign: | N/A | 5d77683554f42c001f8c4708 | +| `role` | *string* | :heavy_minus_sign: | N/A | Bar Guy (uncredited) | +| `thumb` | *string* | :heavy_minus_sign: | N/A | https://metadata-static.plex.tv/6/people/648e9a7ea1d537bccfcd7615134b78ce.jpg | \ No newline at end of file diff --git a/docs/models/getwatchlistrequest.md b/docs/models/getwatchlistrequest.md index df1eac97..6c282947 100644 --- a/docs/models/getwatchlistrequest.md +++ b/docs/models/getwatchlistrequest.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `filter` | [models.Filter](../models/filter.md) | :heavy_check_mark: | Filter | +| `filter` | [models.PathParamFilter](../models/pathparamfilter.md) | :heavy_check_mark: | Filter | | `sort` | *string* | :heavy_minus_sign: | In the format "field:dir". Available fields are "watchlistedAt" (Added At),
"titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating).
"dir" can be "asc" or "desc"
| | `libtype` | [models.Libtype](../models/libtype.md) | :heavy_minus_sign: | The type of library to filter. Can be "movie" or "show", or all if not present.
| | `maxresults` | *number* | :heavy_minus_sign: | The number of items to return. If not specified, all items will be returned.
If the number of items exceeds the limit, the response will be paginated.
| diff --git a/docs/models/librarysectionid.md b/docs/models/librarysectionid.md new file mode 100644 index 00000000..88049fa3 --- /dev/null +++ b/docs/models/librarysectionid.md @@ -0,0 +1,17 @@ +# LibrarySectionID + + +## Supported Types + +### `number` + +```typescript +const value: number = /* values here */ +``` + +### `string` + +```typescript +const value: string = /* values here */ +``` + diff --git a/docs/models/pathparamfilter.md b/docs/models/pathparamfilter.md new file mode 100644 index 00000000..150c2a30 --- /dev/null +++ b/docs/models/pathparamfilter.md @@ -0,0 +1,12 @@ +# PathParamFilter + +Filter + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `All` | all | +| `Available` | available | +| `Released` | released | \ No newline at end of file diff --git a/docs/models/statisticsbandwidth.md b/docs/models/statisticsbandwidth.md new file mode 100644 index 00000000..7ac2060a --- /dev/null +++ b/docs/models/statisticsbandwidth.md @@ -0,0 +1,13 @@ +# StatisticsBandwidth + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `accountID` | *number* | :heavy_minus_sign: | N/A | 238960586 | +| `deviceID` | *number* | :heavy_minus_sign: | N/A | | +| `timespan` | *number* | :heavy_minus_sign: | N/A | 6 | +| `at` | *number* | :heavy_minus_sign: | N/A | 1718387650 | +| `lan` | *boolean* | :heavy_minus_sign: | N/A | true | +| `bytes` | *number* | :heavy_minus_sign: | N/A | 22 | \ No newline at end of file diff --git a/docs/models/statisticsresources.md b/docs/models/statisticsresources.md new file mode 100644 index 00000000..b37117b8 --- /dev/null +++ b/docs/models/statisticsresources.md @@ -0,0 +1,13 @@ +# StatisticsResources + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `timespan` | *number* | :heavy_minus_sign: | N/A | 6 | +| `at` | *number* | :heavy_minus_sign: | N/A | 1718384427 | +| `hostCpuUtilization` | *number* | :heavy_minus_sign: | N/A | 1.276 | +| `processCpuUtilization` | *number* | :heavy_minus_sign: | N/A | 0.025 | +| `hostMemoryUtilization` | *number* | :heavy_minus_sign: | N/A | 17.026 | +| `processMemoryUtilization` | *number* | :heavy_minus_sign: | N/A | 0.493 | \ No newline at end of file diff --git a/docs/models/user.md b/docs/models/user.md index 0e2c0615..82eee8af 100644 --- a/docs/models/user.md +++ b/docs/models/user.md @@ -3,8 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | N/A | 1 | -| `thumb` | *string* | :heavy_minus_sign: | N/A | https://plex.tv/users/844780fc6f8a26b5/avatar?c=1705853661 | -| `title` | *string* | :heavy_minus_sign: | N/A | Blindkitty38 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *number* | :heavy_minus_sign: | N/A | 220 | \ No newline at end of file diff --git a/docs/sdks/library/README.md b/docs/sdks/library/README.md index 996eed93..6e4d5210 100644 --- a/docs/sdks/library/README.md +++ b/docs/sdks/library/README.md @@ -18,6 +18,7 @@ API Calls interacting with Plex Media Server Libraries * [searchLibrary](#searchlibrary) - Search Library * [getMetadata](#getmetadata) - Get Items Metadata * [getMetadataChildren](#getmetadatachildren) - Get Items Children +* [getTopWatchedContent](#gettopwatchedcontent) - Get Top Watched Content * [getOnDeck](#getondeck) - Get On Deck ## getFileHash @@ -316,7 +317,7 @@ const plexAPI = new PlexAPI({ }); async function run() { - const result = await plexAPI.library.getLibraryItems("", Tag.Genre); + const result = await plexAPI.library.getLibraryItems("", Tag.Genre, 1); // Handle the result console.log(result) @@ -327,12 +328,13 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `sectionId` | *any* | :heavy_check_mark: | the Id of the library to query | -| `tag` | [models.Tag](../../models/tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. | -| `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. | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `sectionId` | *any* | :heavy_check_mark: | the Id of the library to query | | +| `tag` | [models.Tag](../../models/tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. | | +| `includeGuids` | *number* | :heavy_minus_sign: | Adds the Guids object to the response
| [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. | | ### Response @@ -511,7 +513,7 @@ const plexAPI = new PlexAPI({ }); async function run() { - const result = await plexAPI.library.getMetadataChildren(1539.14); + const result = await plexAPI.library.getMetadataChildren(1539.14, ""); // Handle the result console.log(result) @@ -525,6 +527,7 @@ run(); | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `ratingKey` | *number* | :heavy_check_mark: | the id of the library item to return the children of. | +| `includeElements` | *string* | :heavy_minus_sign: | Adds additional elements to the response. Supported types are (Stream)
| | `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. | @@ -539,6 +542,50 @@ run(); | models.GetMetadataChildrenLibraryResponseBody | 401 | application/json | | models.SDKError | 4xx-5xx | */* | +## getTopWatchedContent + +This endpoint will return the top watched content from libraries of a certain type + + +### Example Usage + +```typescript +import { PlexAPI } from "@lukehagar/plexjs"; + +const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", +}); + +async function run() { + const result = await plexAPI.library.getTopWatchedContent(505531, 1); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `type` | *number* | :heavy_check_mark: | the library type (1 - movies, 2 - shows, 3 - music) | | +| `includeGuids` | *number* | :heavy_minus_sign: | Adds the Guids object to the response
| [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. | | + + +### Response + +**Promise\<[models.GetTopWatchedContentResponse](../../models/gettopwatchedcontentresponse.md)\>** +### Errors + +| Error Object | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| models.SDKError | 4xx-5xx | */* | + ## getOnDeck This endpoint will return the on deck content. diff --git a/docs/sdks/server/README.md b/docs/sdks/server/README.md index cc273d37..599840f2 100644 --- a/docs/sdks/server/README.md +++ b/docs/sdks/server/README.md @@ -8,7 +8,7 @@ Operations against the Plex Media Server System. ### Available Operations -* [getServerCapabilities](#getservercapabilities) - Server Capabilities +* [getServerCapabilities](#getservercapabilities) - Get Server Capabilities * [getServerPreferences](#getserverpreferences) - Get Server Preferences * [getAvailableClients](#getavailableclients) - Get Available Clients * [getDevices](#getdevices) - Get Devices @@ -19,7 +19,7 @@ Operations against the Plex Media Server System. ## getServerCapabilities -Server Capabilities +Get Server Capabilities ### Example Usage diff --git a/docs/sdks/sessions/README.md b/docs/sdks/sessions/README.md index 399c631f..d8167542 100644 --- a/docs/sdks/sessions/README.md +++ b/docs/sdks/sessions/README.md @@ -70,7 +70,7 @@ const plexAPI = new PlexAPI({ }); async function run() { - const result = await plexAPI.sessions.getSessionHistory(); + const result = await plexAPI.sessions.getSessionHistory("", 1, {}, 12); // Handle the result console.log(result) @@ -81,10 +81,14 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `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. | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `sort` | *string* | :heavy_minus_sign: | Sorts the results by the specified field followed by the direction (asc, desc)
| | +| `accountId` | *number* | :heavy_minus_sign: | Filter results by those that are related to a specific users id
| [object Object] | +| `filter` | [models.Filter](../../models/filter.md) | :heavy_minus_sign: | Filters content by field and direction/equality
(Unknown if viewedAt is the only supported column)
| [object Object] | +| `librarySectionID` | *number* | :heavy_minus_sign: | Filters the results based on the id of a valid library section
| [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. | | ### Response diff --git a/docs/sdks/statistics/README.md b/docs/sdks/statistics/README.md index 3641c994..c1ba710b 100644 --- a/docs/sdks/statistics/README.md +++ b/docs/sdks/statistics/README.md @@ -9,6 +9,8 @@ API Calls that perform operations with Plex Media Server Statistics ### Available Operations * [getStatistics](#getstatistics) - Get Media Statistics +* [getResourcesStatistics](#getresourcesstatistics) - Get Resources Statistics +* [getBandwidthStatistics](#getbandwidthstatistics) - Get Bandwidth Statistics ## getStatistics @@ -52,3 +54,89 @@ run(); | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | | models.GetStatisticsStatisticsResponseBody | 401 | application/json | | models.SDKError | 4xx-5xx | */* | + +## getResourcesStatistics + +This will return the resources for the server + +### Example Usage + +```typescript +import { PlexAPI } from "@lukehagar/plexjs"; + +const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", +}); + +async function run() { + const result = await plexAPI.statistics.getResourcesStatistics(4); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `timespan` | *number* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| [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. | | + + +### Response + +**Promise\<[models.GetResourcesStatisticsResponse](../../models/getresourcesstatisticsresponse.md)\>** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| models.GetResourcesStatisticsStatisticsResponseBody | 401 | application/json | +| models.SDKError | 4xx-5xx | */* | + +## getBandwidthStatistics + +This will return the bandwidth statistics for the server + +### Example Usage + +```typescript +import { PlexAPI } from "@lukehagar/plexjs"; + +const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", +}); + +async function run() { + const result = await plexAPI.statistics.getBandwidthStatistics(4); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `timespan` | *number* | :heavy_minus_sign: | The timespan to retrieve statistics for
the exact meaning of this parameter is not known
| [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. | | + + +### Response + +**Promise\<[models.GetBandwidthStatisticsResponse](../../models/getbandwidthstatisticsresponse.md)\>** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| models.GetBandwidthStatisticsStatisticsResponseBody | 401 | application/json | +| models.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/watchlist/README.md b/docs/sdks/watchlist/README.md index cd1a7349..f301ece9 100644 --- a/docs/sdks/watchlist/README.md +++ b/docs/sdks/watchlist/README.md @@ -17,7 +17,7 @@ Get User Watchlist ### Example Usage ```typescript -import { Filter, PlexAPI } from "@lukehagar/plexjs"; +import { PathParamFilter, PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", @@ -26,7 +26,7 @@ const plexAPI = new PlexAPI({ async function run() { const result = await plexAPI.watchlist.getWatchlist({ - filter: Filter.Released, + filter: PathParamFilter.Released, xPlexToken: "", }); diff --git a/jsr.json b/jsr.json index 1dac3d48..2ae6e674 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@lukehagar/plexjs", - "version": "0.17.0", + "version": "0.18.0", "exports": { ".": "./src/index.ts", "./models": "./src/models/index.ts", diff --git a/package-lock.json b/package-lock.json index 98c8eb87..3b5dde0c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@lukehagar/plexjs", - "version": "0.17.0", + "version": "0.18.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@lukehagar/plexjs", - "version": "0.17.0", + "version": "0.18.0", "devDependencies": { "@types/jsonpath": "^0.2.4", "@typescript-eslint/eslint-plugin": "^7.7.1", diff --git a/package.json b/package.json index 4594d8a6..759a962c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lukehagar/plexjs", - "version": "0.17.0", + "version": "0.18.0", "author": "LukeHagar", "main": "./index.js", "sideEffects": false, diff --git a/src/hooks/hooks.ts b/src/hooks/hooks.ts index 8a3db0da..6a1e31e0 100644 --- a/src/hooks/hooks.ts +++ b/src/hooks/hooks.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { RequestInput } from "../lib/http"; +import { RequestInput } from "../lib/http.js"; import { AfterErrorContext, AfterErrorHook, @@ -15,9 +15,9 @@ import { Hooks, SDKInitHook, SDKInitOptions, -} from "./types"; +} from "./types.js"; -import { initHooks } from "./registration"; +import { initHooks } from "./registration.js"; export class SDKHooks implements Hooks { sdkInitHooks: SDKInitHook[] = []; diff --git a/src/hooks/index.ts b/src/hooks/index.ts index 3df03930..d5fdd742 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -2,5 +2,5 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -export * from "./types"; -export * from "./hooks"; +export * from "./types.js"; +export * from "./hooks.js"; diff --git a/src/hooks/types.ts b/src/hooks/types.ts index a5b367a8..dd23b024 100644 --- a/src/hooks/types.ts +++ b/src/hooks/types.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { HTTPClient, RequestInput } from "../lib/http"; +import { HTTPClient, RequestInput } from "../lib/http.js"; export type HookContext = { operationID: string; diff --git a/src/index.ts b/src/index.ts index 28893f0f..24725c46 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,8 +2,8 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -export * from "./sdk"; -export * from "./lib/config"; +export * from "./sdk/sdk.js"; +export * from "./lib/config.js"; -export * from "./models"; -export * as types from "./types"; +export * from "./models/index.js"; +export * as types from "./types/index.js"; diff --git a/src/lib/config.ts b/src/lib/config.ts index 8b088d11..ce9d3e5b 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -2,9 +2,9 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { HTTPClient } from "./http"; -import { RetryConfig } from "./retries"; -import { Params, pathToFunc } from "./url"; +import { HTTPClient } from "./http.js"; +import { RetryConfig } from "./retries.js"; +import { Params, pathToFunc } from "./url.js"; /** * Contains the list of servers available to the SDK @@ -16,9 +16,6 @@ export const ServerList = [ "{protocol}://{ip}:{port}", ] as const; -/** - * The protocol to use when connecting to your plex server. - */ export enum ServerProtocol { Http = "http", Https = "https", @@ -30,7 +27,7 @@ export type SDKOptions = { /** * Allows setting the xPlexClientIdentifier parameter for all supported operations */ - xPlexClientIdentifier?: string; + xPlexClientIdentifier?: string | undefined; httpClient?: HTTPClient; /** @@ -87,7 +84,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "0.0.3", - sdkVersion: "0.17.0", - genVersion: "2.342.6", - userAgent: "speakeasy-sdk/typescript 0.17.0 2.342.6 0.0.3 @lukehagar/plexjs", + sdkVersion: "0.18.0", + genVersion: "2.349.6", + userAgent: "speakeasy-sdk/typescript 0.18.0 2.349.6 0.0.3 @lukehagar/plexjs", } as const; diff --git a/src/lib/encodings.ts b/src/lib/encodings.ts index c28d8944..49f536b6 100644 --- a/src/lib/encodings.ts +++ b/src/lib/encodings.ts @@ -2,8 +2,8 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { bytesToBase64 } from "./base64"; -import { isPlainObject } from "./is-plain-object"; +import { bytesToBase64 } from "./base64.js"; +import { isPlainObject } from "./is-plain-object.js"; export class EncodingError extends Error { constructor(message: string) { diff --git a/src/lib/http.ts b/src/lib/http.ts index f5dc3cef..27b8aa50 100644 --- a/src/lib/http.ts +++ b/src/lib/http.ts @@ -3,9 +3,9 @@ */ import { never as znever } from "zod"; -import { parse } from "./schemas"; -import { isPlainObject } from "./is-plain-object"; -import * as models from "../models"; +import { parse } from "./schemas.js"; +import { isPlainObject } from "./is-plain-object.js"; +import { SDKError } from "../models/sdkerror.js"; export type Fetcher = (input: RequestInfo | URL, init?: RequestInit) => Promise; @@ -406,7 +406,7 @@ export class ResponseMatcher { } if (pred == null) { const responseBody = await response.text(); - throw new models.SDKError( + throw new SDKError( "Unexpected API response status or content-type", response, responseBody @@ -446,11 +446,7 @@ export class ResponseMatcher { const resultKey = pred.key || options?.resultKey; let data: unknown; if (pred.fail) { - throw new models.SDKError( - "API error occurred", - response, - typeof raw === "string" ? raw : "" - ); + throw new SDKError("API error occurred", response, typeof raw === "string" ? raw : ""); } else if (pred.err) { data = { ...options?.extraFields, diff --git a/src/lib/schemas.ts b/src/lib/schemas.ts index c2a567ae..9437c21b 100644 --- a/src/lib/schemas.ts +++ b/src/lib/schemas.ts @@ -3,7 +3,7 @@ */ import { output, ZodEffects, ZodError, ZodObject, ZodRawShape, ZodTypeAny } from "zod"; -import { SDKValidationError } from "../models/sdkvalidationerror"; +import { SDKValidationError } from "../models/sdkvalidationerror.js"; /** * Utility function that executes some code which may throw a ZodError. It diff --git a/src/lib/sdks.ts b/src/lib/sdks.ts index 9ec697e7..b6f45cfc 100644 --- a/src/lib/sdks.ts +++ b/src/lib/sdks.ts @@ -2,12 +2,13 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { ResponseMatcher, HTTPClient, matchStatusCode } from "./http"; -import { SecurityState, resolveSecurity, resolveGlobalSecurity } from "./security"; -import { pathToFunc } from "./url"; -import { encodeForm } from "./encodings"; -import { stringToBase64 } from "./base64"; -import { SDKHooks, HookContext } from "../hooks"; +import { ResponseMatcher, HTTPClient, matchStatusCode } from "./http.js"; +import { SecurityState, resolveSecurity, resolveGlobalSecurity } from "./security.js"; +import { pathToFunc } from "./url.js"; +import { encodeForm } from "./encodings.js"; +import { stringToBase64 } from "./base64.js"; +import { SDKHooks } from "../hooks/hooks.js"; +import { HookContext } from "../hooks/types.js"; export type RequestOptions = { fetchOptions?: Omit; diff --git a/src/lib/security.ts b/src/lib/security.ts index 559201f1..8556fa24 100644 --- a/src/lib/security.ts +++ b/src/lib/security.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import * as models from "../models"; +import * as models from "../models/index.js"; export enum SecurityErrorCode { Incomplete = "incomplete", diff --git a/src/models/addplaylistcontentsop.ts b/src/models/addplaylistcontentsop.ts index ac2bcce2..8dedc4f6 100644 --- a/src/models/addplaylistcontentsop.ts +++ b/src/models/addplaylistcontentsop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type AddPlaylistContentsRequest = { diff --git a/src/models/applyupdatesop.ts b/src/models/applyupdatesop.ts index b4dcf7e7..6b39ebaa 100644 --- a/src/models/applyupdatesop.ts +++ b/src/models/applyupdatesop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; /** @@ -99,14 +99,14 @@ export type ApplyUpdatesResponse = { /** @internal */ export namespace Tonight$ { - export const inboundSchema = z.nativeEnum(Tonight); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Tonight); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ export namespace Skip$ { - export const inboundSchema = z.nativeEnum(Skip); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Skip); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ diff --git a/src/models/cancelserveractivitiesop.ts b/src/models/cancelserveractivitiesop.ts index 04230f7a..1ec53b4f 100644 --- a/src/models/cancelserveractivitiesop.ts +++ b/src/models/cancelserveractivitiesop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type CancelServerActivitiesRequest = { diff --git a/src/models/checkforupdatesop.ts b/src/models/checkforupdatesop.ts index 8a3dad06..2103f0ae 100644 --- a/src/models/checkforupdatesop.ts +++ b/src/models/checkforupdatesop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; /** @@ -87,8 +87,8 @@ export type CheckForUpdatesResponse = { /** @internal */ export namespace Download$ { - export const inboundSchema = z.nativeEnum(Download); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Download); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ diff --git a/src/models/clearplaylistcontentsop.ts b/src/models/clearplaylistcontentsop.ts index 81057f00..ff7e6bed 100644 --- a/src/models/clearplaylistcontentsop.ts +++ b/src/models/clearplaylistcontentsop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type ClearPlaylistContentsRequest = { diff --git a/src/models/createplaylistop.ts b/src/models/createplaylistop.ts index 8e3b6f06..3fd4a5bf 100644 --- a/src/models/createplaylistop.ts +++ b/src/models/createplaylistop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; /** @@ -147,14 +147,15 @@ export type CreatePlaylistResponse = { /** @internal */ export namespace QueryParamType$ { - export const inboundSchema = z.nativeEnum(QueryParamType); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = + z.nativeEnum(QueryParamType); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ export namespace Smart$ { - export const inboundSchema = z.nativeEnum(Smart); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Smart); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ diff --git a/src/models/deletelibraryop.ts b/src/models/deletelibraryop.ts index 927087dd..27edfc8b 100644 --- a/src/models/deletelibraryop.ts +++ b/src/models/deletelibraryop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type DeleteLibraryRequest = { diff --git a/src/models/deleteplaylistop.ts b/src/models/deleteplaylistop.ts index 412e7504..09f9ad0d 100644 --- a/src/models/deleteplaylistop.ts +++ b/src/models/deleteplaylistop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type DeletePlaylistRequest = { diff --git a/src/models/enablepapertrailop.ts b/src/models/enablepapertrailop.ts index 600ffa1f..d6a2041d 100644 --- a/src/models/enablepapertrailop.ts +++ b/src/models/enablepapertrailop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type EnablePaperTrailErrors = { diff --git a/src/models/getavailableclientsop.ts b/src/models/getavailableclientsop.ts index dd039251..1cc87187 100644 --- a/src/models/getavailableclientsop.ts +++ b/src/models/getavailableclientsop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type GetAvailableClientsErrors = { diff --git a/src/models/getbandwidthstatisticsop.ts b/src/models/getbandwidthstatisticsop.ts new file mode 100644 index 00000000..f008473e --- /dev/null +++ b/src/models/getbandwidthstatisticsop.ts @@ -0,0 +1,464 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import { remap as remap$ } from "../lib/primitives.js"; +import * as z from "zod"; + +export type GetBandwidthStatisticsRequest = { + /** + * The timespan to retrieve statistics for + * + * @remarks + * the exact meaning of this parameter is not known + * + */ + timespan?: number | undefined; +}; + +export type GetBandwidthStatisticsErrors = { + code?: number | undefined; + message?: string | undefined; + status?: number | undefined; +}; + +/** + * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +export type GetBandwidthStatisticsStatisticsResponseBodyData = { + errors?: Array | undefined; + /** + * Raw HTTP response; suitable for custom response parsing + */ + rawResponse?: Response | undefined; +}; + +/** + * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +export class GetBandwidthStatisticsStatisticsResponseBody extends Error { + errors?: Array | undefined; + /** + * Raw HTTP response; suitable for custom response parsing + */ + rawResponse?: Response | undefined; + + /** The original data that was passed to this error instance. */ + data$: GetBandwidthStatisticsStatisticsResponseBodyData; + + constructor(err: GetBandwidthStatisticsStatisticsResponseBodyData) { + super(""); + this.data$ = err; + + if (err.errors != null) { + this.errors = err.errors; + } + if (err.rawResponse != null) { + this.rawResponse = err.rawResponse; + } + + this.message = + "message" in err && typeof err.message === "string" + ? err.message + : "API error occurred"; + + this.name = "GetBandwidthStatisticsStatisticsResponseBody"; + } +} + +export type GetBandwidthStatisticsDevice = { + id?: number | undefined; + name?: string | undefined; + platform?: string | undefined; + clientIdentifier?: string | undefined; + createdAt?: number | undefined; +}; + +export type GetBandwidthStatisticsAccount = { + id?: number | undefined; + key?: string | undefined; + name?: string | undefined; + defaultAudioLanguage?: string | undefined; + autoSelectAudio?: boolean | undefined; + defaultSubtitleLanguage?: string | undefined; + subtitleMode?: number | undefined; + thumb?: string | undefined; +}; + +export type StatisticsBandwidth = { + accountID?: number | undefined; + deviceID?: number | undefined; + timespan?: number | undefined; + at?: number | undefined; + lan?: boolean | undefined; + bytes?: number | undefined; +}; + +export type GetBandwidthStatisticsMediaContainer = { + size?: number | undefined; + device?: Array | undefined; + account?: Array | undefined; + statisticsBandwidth?: Array | undefined; +}; + +/** + * Bandwidth Statistics + */ +export type GetBandwidthStatisticsResponseBody = { + mediaContainer?: GetBandwidthStatisticsMediaContainer | undefined; +}; + +export type GetBandwidthStatisticsResponse = { + /** + * 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; + /** + * Bandwidth Statistics + */ + object?: GetBandwidthStatisticsResponseBody | undefined; +}; + +/** @internal */ +export namespace GetBandwidthStatisticsRequest$ { + export const inboundSchema: z.ZodType = z + .object({ + Timespan: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + Timespan: "timespan", + }); + }); + + export type Outbound = { + Timespan?: number | undefined; + }; + + export const outboundSchema: z.ZodType = + z + .object({ + timespan: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + timespan: "Timespan", + }); + }); +} + +/** @internal */ +export namespace GetBandwidthStatisticsErrors$ { + export const inboundSchema: z.ZodType = + z.object({ + code: z.number().optional(), + message: z.string().optional(), + status: z.number().optional(), + }); + + export type Outbound = { + code?: number | undefined; + message?: string | undefined; + status?: number | undefined; + }; + + export const outboundSchema: z.ZodType = + z.object({ + code: z.number().optional(), + message: z.string().optional(), + status: z.number().optional(), + }); +} + +/** @internal */ +export namespace GetBandwidthStatisticsStatisticsResponseBody$ { + export const inboundSchema: z.ZodType< + GetBandwidthStatisticsStatisticsResponseBody, + z.ZodTypeDef, + unknown + > = z + .object({ + errors: z.array(z.lazy(() => GetBandwidthStatisticsErrors$.inboundSchema)).optional(), + RawResponse: z.instanceof(Response).optional(), + }) + .transform((v) => { + const remapped = remap$(v, { + RawResponse: "rawResponse", + }); + + return new GetBandwidthStatisticsStatisticsResponseBody(remapped); + }); + + export type Outbound = { + errors?: Array | undefined; + RawResponse?: never | undefined; + }; + + export const outboundSchema: z.ZodType< + Outbound, + z.ZodTypeDef, + GetBandwidthStatisticsStatisticsResponseBody + > = z + .instanceof(GetBandwidthStatisticsStatisticsResponseBody) + .transform((v) => v.data$) + .pipe( + z + .object({ + errors: z + .array(z.lazy(() => GetBandwidthStatisticsErrors$.outboundSchema)) + .optional(), + rawResponse: z + .instanceof(Response) + .transform(() => { + throw new Error("Response cannot be serialized"); + }) + .optional(), + }) + .transform((v) => { + return remap$(v, { + rawResponse: "RawResponse", + }); + }) + ); +} + +/** @internal */ +export namespace GetBandwidthStatisticsDevice$ { + export const inboundSchema: z.ZodType = + z.object({ + id: z.number().int().optional(), + name: z.string().optional(), + platform: z.string().optional(), + clientIdentifier: z.string().optional(), + createdAt: z.number().int().optional(), + }); + + export type Outbound = { + id?: number | undefined; + name?: string | undefined; + platform?: string | undefined; + clientIdentifier?: string | undefined; + createdAt?: number | undefined; + }; + + export const outboundSchema: z.ZodType = + z.object({ + id: z.number().int().optional(), + name: z.string().optional(), + platform: z.string().optional(), + clientIdentifier: z.string().optional(), + createdAt: z.number().int().optional(), + }); +} + +/** @internal */ +export namespace GetBandwidthStatisticsAccount$ { + export const inboundSchema: z.ZodType = + z.object({ + id: z.number().int().optional(), + key: z.string().optional(), + name: z.string().optional(), + defaultAudioLanguage: z.string().optional(), + autoSelectAudio: z.boolean().optional(), + defaultSubtitleLanguage: z.string().optional(), + subtitleMode: z.number().int().optional(), + thumb: z.string().optional(), + }); + + export type Outbound = { + id?: number | undefined; + key?: string | undefined; + name?: string | undefined; + defaultAudioLanguage?: string | undefined; + autoSelectAudio?: boolean | undefined; + defaultSubtitleLanguage?: string | undefined; + subtitleMode?: number | undefined; + thumb?: string | undefined; + }; + + export const outboundSchema: z.ZodType = + z.object({ + id: z.number().int().optional(), + key: z.string().optional(), + name: z.string().optional(), + defaultAudioLanguage: z.string().optional(), + autoSelectAudio: z.boolean().optional(), + defaultSubtitleLanguage: z.string().optional(), + subtitleMode: z.number().int().optional(), + thumb: z.string().optional(), + }); +} + +/** @internal */ +export namespace StatisticsBandwidth$ { + export const inboundSchema: z.ZodType = z.object({ + accountID: z.number().int().optional(), + deviceID: z.number().int().optional(), + timespan: z.number().int().optional(), + at: z.number().int().optional(), + lan: z.boolean().optional(), + bytes: z.number().int().optional(), + }); + + export type Outbound = { + accountID?: number | undefined; + deviceID?: number | undefined; + timespan?: number | undefined; + at?: number | undefined; + lan?: boolean | undefined; + bytes?: number | undefined; + }; + + export const outboundSchema: z.ZodType = z.object({ + accountID: z.number().int().optional(), + deviceID: z.number().int().optional(), + timespan: z.number().int().optional(), + at: z.number().int().optional(), + lan: z.boolean().optional(), + bytes: z.number().int().optional(), + }); +} + +/** @internal */ +export namespace GetBandwidthStatisticsMediaContainer$ { + export const inboundSchema: z.ZodType< + GetBandwidthStatisticsMediaContainer, + z.ZodTypeDef, + unknown + > = z + .object({ + size: z.number().int().optional(), + Device: z.array(z.lazy(() => GetBandwidthStatisticsDevice$.inboundSchema)).optional(), + Account: z.array(z.lazy(() => GetBandwidthStatisticsAccount$.inboundSchema)).optional(), + StatisticsBandwidth: z + .array(z.lazy(() => StatisticsBandwidth$.inboundSchema)) + .optional(), + }) + .transform((v) => { + return remap$(v, { + Device: "device", + Account: "account", + StatisticsBandwidth: "statisticsBandwidth", + }); + }); + + export type Outbound = { + size?: number | undefined; + Device?: Array | undefined; + Account?: Array | undefined; + StatisticsBandwidth?: Array | undefined; + }; + + export const outboundSchema: z.ZodType< + Outbound, + z.ZodTypeDef, + GetBandwidthStatisticsMediaContainer + > = z + .object({ + size: z.number().int().optional(), + device: z.array(z.lazy(() => GetBandwidthStatisticsDevice$.outboundSchema)).optional(), + account: z + .array(z.lazy(() => GetBandwidthStatisticsAccount$.outboundSchema)) + .optional(), + statisticsBandwidth: z + .array(z.lazy(() => StatisticsBandwidth$.outboundSchema)) + .optional(), + }) + .transform((v) => { + return remap$(v, { + device: "Device", + account: "Account", + statisticsBandwidth: "StatisticsBandwidth", + }); + }); +} + +/** @internal */ +export namespace GetBandwidthStatisticsResponseBody$ { + export const inboundSchema: z.ZodType< + GetBandwidthStatisticsResponseBody, + z.ZodTypeDef, + unknown + > = z + .object({ + MediaContainer: z + .lazy(() => GetBandwidthStatisticsMediaContainer$.inboundSchema) + .optional(), + }) + .transform((v) => { + return remap$(v, { + MediaContainer: "mediaContainer", + }); + }); + + export type Outbound = { + MediaContainer?: GetBandwidthStatisticsMediaContainer$.Outbound | undefined; + }; + + export const outboundSchema: z.ZodType< + Outbound, + z.ZodTypeDef, + GetBandwidthStatisticsResponseBody + > = z + .object({ + mediaContainer: z + .lazy(() => GetBandwidthStatisticsMediaContainer$.outboundSchema) + .optional(), + }) + .transform((v) => { + return remap$(v, { + mediaContainer: "MediaContainer", + }); + }); +} + +/** @internal */ +export namespace GetBandwidthStatisticsResponse$ { + export const inboundSchema: z.ZodType = z + .object({ + ContentType: z.string(), + StatusCode: z.number().int(), + RawResponse: z.instanceof(Response), + object: z.lazy(() => GetBandwidthStatisticsResponseBody$.inboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + ContentType: "contentType", + StatusCode: "statusCode", + RawResponse: "rawResponse", + }); + }); + + export type Outbound = { + ContentType: string; + StatusCode: number; + RawResponse: never; + object?: GetBandwidthStatisticsResponseBody$.Outbound | undefined; + }; + + export const outboundSchema: z.ZodType = + z + .object({ + contentType: z.string(), + statusCode: z.number().int(), + rawResponse: z.instanceof(Response).transform(() => { + throw new Error("Response cannot be serialized"); + }), + object: z.lazy(() => GetBandwidthStatisticsResponseBody$.outboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + contentType: "ContentType", + statusCode: "StatusCode", + rawResponse: "RawResponse", + }); + }); +} diff --git a/src/models/getbutlertasksop.ts b/src/models/getbutlertasksop.ts index 1ada9c8c..fd0cdd68 100644 --- a/src/models/getbutlertasksop.ts +++ b/src/models/getbutlertasksop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type GetButlerTasksErrors = { diff --git a/src/models/getdevicesop.ts b/src/models/getdevicesop.ts index 75862da7..116baea6 100644 --- a/src/models/getdevicesop.ts +++ b/src/models/getdevicesop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type GetDevicesErrors = { diff --git a/src/models/getfilehashop.ts b/src/models/getfilehashop.ts index e19bcece..9bce0d59 100644 --- a/src/models/getfilehashop.ts +++ b/src/models/getfilehashop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type GetFileHashRequest = { diff --git a/src/models/getglobalhubsop.ts b/src/models/getglobalhubsop.ts index e5e3b52a..5b04f2bf 100644 --- a/src/models/getglobalhubsop.ts +++ b/src/models/getglobalhubsop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; /** @@ -143,8 +143,8 @@ export type GetGlobalHubsResponse = { /** @internal */ export namespace OnlyTransient$ { - export const inboundSchema = z.nativeEnum(OnlyTransient); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(OnlyTransient); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ diff --git a/src/models/gethomedataop.ts b/src/models/gethomedataop.ts index edbfd476..2cddc69e 100644 --- a/src/models/gethomedataop.ts +++ b/src/models/gethomedataop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type GetHomeDataErrors = { diff --git a/src/models/getlibrariesop.ts b/src/models/getlibrariesop.ts index 54f2dacd..1fa661c9 100644 --- a/src/models/getlibrariesop.ts +++ b/src/models/getlibrariesop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type GetLibrariesErrors = { diff --git a/src/models/getlibraryhubsop.ts b/src/models/getlibraryhubsop.ts index a63fe5fc..980d45f2 100644 --- a/src/models/getlibraryhubsop.ts +++ b/src/models/getlibraryhubsop.ts @@ -2,8 +2,8 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; -import { RFCDate } from "../types"; +import { remap as remap$ } from "../lib/primitives.js"; +import { RFCDate } from "../types/rfcdate.js"; import * as z from "zod"; /** @@ -222,8 +222,9 @@ export type GetLibraryHubsResponse = { /** @internal */ export namespace QueryParamOnlyTransient$ { - export const inboundSchema = z.nativeEnum(QueryParamOnlyTransient); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = + z.nativeEnum(QueryParamOnlyTransient); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ diff --git a/src/models/getlibraryitemsop.ts b/src/models/getlibraryitemsop.ts index f7131020..2f21b4d1 100644 --- a/src/models/getlibraryitemsop.ts +++ b/src/models/getlibraryitemsop.ts @@ -2,8 +2,8 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; -import { RFCDate } from "../types"; +import { remap as remap$ } from "../lib/primitives.js"; +import { RFCDate } from "../types/rfcdate.js"; import * as z from "zod"; /** @@ -40,6 +40,13 @@ export type GetLibraryItemsRequest = { * A key representing a specific tag within the section. */ tag: Tag; + /** + * Adds the Guids object to the response + * + * @remarks + * + */ + includeGuids?: number | undefined; }; export type GetLibraryItemsErrors = { @@ -92,6 +99,8 @@ export class GetLibraryItemsLibraryResponseBody extends Error { } } +export type LibrarySectionID = number | string; + export type GetLibraryItemsPart = { id?: number | undefined; key?: string | undefined; @@ -204,7 +213,7 @@ export type GetLibraryItemsMediaContainer = { allowSync?: boolean | undefined; art?: string | undefined; identifier?: string | undefined; - librarySectionID?: number | undefined; + librarySectionID?: number | string | undefined; librarySectionTitle?: string | undefined; librarySectionUUID?: string | undefined; mediaTagPrefix?: string | undefined; @@ -246,8 +255,8 @@ export type GetLibraryItemsResponse = { /** @internal */ export namespace Tag$ { - export const inboundSchema = z.nativeEnum(Tag); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Tag); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ @@ -256,18 +265,21 @@ export namespace GetLibraryItemsRequest$ { { sectionId: z.any().optional(), tag: Tag$.inboundSchema, + includeGuids: z.number().int().optional(), } ); export type Outbound = { sectionId?: any | undefined; tag: string; + includeGuids?: number | undefined; }; export const outboundSchema: z.ZodType = z.object({ sectionId: z.any().optional(), tag: Tag$.outboundSchema, + includeGuids: z.number().int().optional(), }); } @@ -343,6 +355,20 @@ export namespace GetLibraryItemsLibraryResponseBody$ { ); } +/** @internal */ +export namespace LibrarySectionID$ { + export const inboundSchema: z.ZodType = z.union([ + z.number().int(), + z.string(), + ]); + + export type Outbound = number | string; + export const outboundSchema: z.ZodType = z.union([ + z.number().int(), + z.string(), + ]); +} + /** @internal */ export namespace GetLibraryItemsPart$ { export const inboundSchema: z.ZodType = z.object({ @@ -744,7 +770,7 @@ export namespace GetLibraryItemsMediaContainer$ { allowSync: z.boolean().optional(), art: z.string().optional(), identifier: z.string().optional(), - librarySectionID: z.number().int().optional(), + librarySectionID: z.union([z.number().int(), z.string()]).optional(), librarySectionTitle: z.string().optional(), librarySectionUUID: z.string().optional(), mediaTagPrefix: z.string().optional(), @@ -768,7 +794,7 @@ export namespace GetLibraryItemsMediaContainer$ { allowSync?: boolean | undefined; art?: string | undefined; identifier?: string | undefined; - librarySectionID?: number | undefined; + librarySectionID?: number | string | undefined; librarySectionTitle?: string | undefined; librarySectionUUID?: string | undefined; mediaTagPrefix?: string | undefined; @@ -789,7 +815,7 @@ export namespace GetLibraryItemsMediaContainer$ { allowSync: z.boolean().optional(), art: z.string().optional(), identifier: z.string().optional(), - librarySectionID: z.number().int().optional(), + librarySectionID: z.union([z.number().int(), z.string()]).optional(), librarySectionTitle: z.string().optional(), librarySectionUUID: z.string().optional(), mediaTagPrefix: z.string().optional(), diff --git a/src/models/getlibraryop.ts b/src/models/getlibraryop.ts index d79d92f0..3ca04d2d 100644 --- a/src/models/getlibraryop.ts +++ b/src/models/getlibraryop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; /** @@ -180,8 +180,9 @@ export type GetLibraryResponse = { /** @internal */ export namespace IncludeDetails$ { - export const inboundSchema = z.nativeEnum(IncludeDetails); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = + z.nativeEnum(IncludeDetails); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ diff --git a/src/models/getmetadatachildrenop.ts b/src/models/getmetadatachildrenop.ts index b1fe60ac..a444c889 100644 --- a/src/models/getmetadatachildrenop.ts +++ b/src/models/getmetadatachildrenop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type GetMetadataChildrenRequest = { @@ -10,6 +10,13 @@ export type GetMetadataChildrenRequest = { * the id of the library item to return the children of. */ ratingKey: number; + /** + * Adds additional elements to the response. Supported types are (Stream) + * + * @remarks + * + */ + includeElements?: string | undefined; }; export type GetMetadataChildrenErrors = { @@ -157,15 +164,18 @@ export namespace GetMetadataChildrenRequest$ { export const inboundSchema: z.ZodType = z.object({ ratingKey: z.number(), + includeElements: z.string().optional(), }); export type Outbound = { ratingKey: number; + includeElements?: string | undefined; }; export const outboundSchema: z.ZodType = z.object({ ratingKey: z.number(), + includeElements: z.string().optional(), }); } diff --git a/src/models/getmetadataop.ts b/src/models/getmetadataop.ts index 1df31eb0..59702a12 100644 --- a/src/models/getmetadataop.ts +++ b/src/models/getmetadataop.ts @@ -2,8 +2,8 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; -import { RFCDate } from "../types"; +import { remap as remap$ } from "../lib/primitives.js"; +import { RFCDate } from "../types/rfcdate.js"; import * as z from "zod"; export type GetMetadataRequest = { diff --git a/src/models/getmyplexaccountop.ts b/src/models/getmyplexaccountop.ts index f6a18f37..73c88525 100644 --- a/src/models/getmyplexaccountop.ts +++ b/src/models/getmyplexaccountop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type GetMyPlexAccountErrors = { diff --git a/src/models/getondeckop.ts b/src/models/getondeckop.ts index 3db44ca6..e131dd67 100644 --- a/src/models/getondeckop.ts +++ b/src/models/getondeckop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type GetOnDeckErrors = { diff --git a/src/models/getpinop.ts b/src/models/getpinop.ts index d112d5c1..5d764a88 100644 --- a/src/models/getpinop.ts +++ b/src/models/getpinop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export const GetPinOpServerList = ["https://plex.tv/api/v2"] as const; @@ -16,7 +16,7 @@ export type GetPinGlobals = { * (UUID, serial number, or other number unique per device) * */ - xPlexClientIdentifier: string; + xPlexClientIdentifier?: string | undefined; }; export type GetPinRequest = { @@ -136,7 +136,7 @@ export type GetPinResponseBody = { createdAt?: Date | undefined; expiresAt?: Date | undefined; authToken?: string | undefined; - newRegistration?: string | undefined; + newRegistration?: boolean | null | undefined; }; export type GetPinResponse = { @@ -162,7 +162,7 @@ export type GetPinResponse = { export namespace GetPinGlobals$ { export const inboundSchema: z.ZodType = z .object({ - "X-Plex-Client-Identifier": z.string(), + "X-Plex-Client-Identifier": z.string().optional(), }) .transform((v) => { return remap$(v, { @@ -171,12 +171,12 @@ export namespace GetPinGlobals$ { }); export type Outbound = { - "X-Plex-Client-Identifier": string; + "X-Plex-Client-Identifier"?: string | undefined; }; export const outboundSchema: z.ZodType = z .object({ - xPlexClientIdentifier: z.string(), + xPlexClientIdentifier: z.string().optional(), }) .transform((v) => { return remap$(v, { @@ -367,7 +367,7 @@ export namespace GetPinResponseBody$ { .transform((v) => new Date(v)) .optional(), authToken: z.string().optional(), - newRegistration: z.string().optional(), + newRegistration: z.nullable(z.boolean()).optional(), }); export type Outbound = { @@ -382,7 +382,7 @@ export namespace GetPinResponseBody$ { createdAt?: string | undefined; expiresAt?: string | undefined; authToken?: string | undefined; - newRegistration?: string | undefined; + newRegistration?: boolean | null | undefined; }; export const outboundSchema: z.ZodType = z.object({ @@ -403,7 +403,7 @@ export namespace GetPinResponseBody$ { .transform((v) => v.toISOString()) .optional(), authToken: z.string().optional(), - newRegistration: z.string().optional(), + newRegistration: z.nullable(z.boolean()).optional(), }); } diff --git a/src/models/getplaylistcontentsop.ts b/src/models/getplaylistcontentsop.ts index 38af1d51..fea02d33 100644 --- a/src/models/getplaylistcontentsop.ts +++ b/src/models/getplaylistcontentsop.ts @@ -2,8 +2,8 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; -import { RFCDate } from "../types"; +import { remap as remap$ } from "../lib/primitives.js"; +import { RFCDate } from "../types/rfcdate.js"; import * as z from "zod"; export type GetPlaylistContentsRequest = { diff --git a/src/models/getplaylistop.ts b/src/models/getplaylistop.ts index 0eed9f72..b34ed10a 100644 --- a/src/models/getplaylistop.ts +++ b/src/models/getplaylistop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type GetPlaylistRequest = { diff --git a/src/models/getplaylistsop.ts b/src/models/getplaylistsop.ts index 440bb27d..20d4e28f 100644 --- a/src/models/getplaylistsop.ts +++ b/src/models/getplaylistsop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; /** @@ -135,14 +135,15 @@ export type GetPlaylistsResponse = { /** @internal */ export namespace PlaylistType$ { - export const inboundSchema = z.nativeEnum(PlaylistType); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(PlaylistType); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ export namespace QueryParamSmart$ { - export const inboundSchema = z.nativeEnum(QueryParamSmart); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = + z.nativeEnum(QueryParamSmart); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ diff --git a/src/models/getrecentlyaddedop.ts b/src/models/getrecentlyaddedop.ts index 03ad35aa..b154088c 100644 --- a/src/models/getrecentlyaddedop.ts +++ b/src/models/getrecentlyaddedop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type GetRecentlyAddedErrors = { diff --git a/src/models/getresizedphotoop.ts b/src/models/getresizedphotoop.ts index a31209d8..843cbb4f 100644 --- a/src/models/getresizedphotoop.ts +++ b/src/models/getresizedphotoop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; /** @@ -119,14 +119,14 @@ export type GetResizedPhotoResponse = { /** @internal */ export namespace MinSize$ { - export const inboundSchema = z.nativeEnum(MinSize); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(MinSize); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ export namespace Upscale$ { - export const inboundSchema = z.nativeEnum(Upscale); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Upscale); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ diff --git a/src/models/getresourcesstatisticsop.ts b/src/models/getresourcesstatisticsop.ts new file mode 100644 index 00000000..9720e60c --- /dev/null +++ b/src/models/getresourcesstatisticsop.ts @@ -0,0 +1,364 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import { remap as remap$ } from "../lib/primitives.js"; +import * as z from "zod"; + +export type GetResourcesStatisticsRequest = { + /** + * The timespan to retrieve statistics for + * + * @remarks + * the exact meaning of this parameter is not known + * + */ + timespan?: number | undefined; +}; + +export type GetResourcesStatisticsErrors = { + code?: number | undefined; + message?: string | undefined; + status?: number | undefined; +}; + +/** + * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +export type GetResourcesStatisticsStatisticsResponseBodyData = { + errors?: Array | undefined; + /** + * Raw HTTP response; suitable for custom response parsing + */ + rawResponse?: Response | undefined; +}; + +/** + * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +export class GetResourcesStatisticsStatisticsResponseBody extends Error { + errors?: Array | undefined; + /** + * Raw HTTP response; suitable for custom response parsing + */ + rawResponse?: Response | undefined; + + /** The original data that was passed to this error instance. */ + data$: GetResourcesStatisticsStatisticsResponseBodyData; + + constructor(err: GetResourcesStatisticsStatisticsResponseBodyData) { + super(""); + this.data$ = err; + + if (err.errors != null) { + this.errors = err.errors; + } + if (err.rawResponse != null) { + this.rawResponse = err.rawResponse; + } + + this.message = + "message" in err && typeof err.message === "string" + ? err.message + : "API error occurred"; + + this.name = "GetResourcesStatisticsStatisticsResponseBody"; + } +} + +export type StatisticsResources = { + timespan?: number | undefined; + at?: number | undefined; + hostCpuUtilization?: number | undefined; + processCpuUtilization?: number | undefined; + hostMemoryUtilization?: number | undefined; + processMemoryUtilization?: number | undefined; +}; + +export type GetResourcesStatisticsMediaContainer = { + size?: number | undefined; + statisticsResources?: Array | undefined; +}; + +/** + * Resource Statistics + */ +export type GetResourcesStatisticsResponseBody = { + mediaContainer?: GetResourcesStatisticsMediaContainer | undefined; +}; + +export type GetResourcesStatisticsResponse = { + /** + * 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; + /** + * Resource Statistics + */ + object?: GetResourcesStatisticsResponseBody | undefined; +}; + +/** @internal */ +export namespace GetResourcesStatisticsRequest$ { + export const inboundSchema: z.ZodType = z + .object({ + Timespan: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + Timespan: "timespan", + }); + }); + + export type Outbound = { + Timespan?: number | undefined; + }; + + export const outboundSchema: z.ZodType = + z + .object({ + timespan: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + timespan: "Timespan", + }); + }); +} + +/** @internal */ +export namespace GetResourcesStatisticsErrors$ { + export const inboundSchema: z.ZodType = + z.object({ + code: z.number().optional(), + message: z.string().optional(), + status: z.number().optional(), + }); + + export type Outbound = { + code?: number | undefined; + message?: string | undefined; + status?: number | undefined; + }; + + export const outboundSchema: z.ZodType = + z.object({ + code: z.number().optional(), + message: z.string().optional(), + status: z.number().optional(), + }); +} + +/** @internal */ +export namespace GetResourcesStatisticsStatisticsResponseBody$ { + export const inboundSchema: z.ZodType< + GetResourcesStatisticsStatisticsResponseBody, + z.ZodTypeDef, + unknown + > = z + .object({ + errors: z.array(z.lazy(() => GetResourcesStatisticsErrors$.inboundSchema)).optional(), + RawResponse: z.instanceof(Response).optional(), + }) + .transform((v) => { + const remapped = remap$(v, { + RawResponse: "rawResponse", + }); + + return new GetResourcesStatisticsStatisticsResponseBody(remapped); + }); + + export type Outbound = { + errors?: Array | undefined; + RawResponse?: never | undefined; + }; + + export const outboundSchema: z.ZodType< + Outbound, + z.ZodTypeDef, + GetResourcesStatisticsStatisticsResponseBody + > = z + .instanceof(GetResourcesStatisticsStatisticsResponseBody) + .transform((v) => v.data$) + .pipe( + z + .object({ + errors: z + .array(z.lazy(() => GetResourcesStatisticsErrors$.outboundSchema)) + .optional(), + rawResponse: z + .instanceof(Response) + .transform(() => { + throw new Error("Response cannot be serialized"); + }) + .optional(), + }) + .transform((v) => { + return remap$(v, { + rawResponse: "RawResponse", + }); + }) + ); +} + +/** @internal */ +export namespace StatisticsResources$ { + export const inboundSchema: z.ZodType = z.object({ + timespan: z.number().int().optional(), + at: z.number().int().optional(), + hostCpuUtilization: z.number().optional(), + processCpuUtilization: z.number().optional(), + hostMemoryUtilization: z.number().optional(), + processMemoryUtilization: z.number().optional(), + }); + + export type Outbound = { + timespan?: number | undefined; + at?: number | undefined; + hostCpuUtilization?: number | undefined; + processCpuUtilization?: number | undefined; + hostMemoryUtilization?: number | undefined; + processMemoryUtilization?: number | undefined; + }; + + export const outboundSchema: z.ZodType = z.object({ + timespan: z.number().int().optional(), + at: z.number().int().optional(), + hostCpuUtilization: z.number().optional(), + processCpuUtilization: z.number().optional(), + hostMemoryUtilization: z.number().optional(), + processMemoryUtilization: z.number().optional(), + }); +} + +/** @internal */ +export namespace GetResourcesStatisticsMediaContainer$ { + export const inboundSchema: z.ZodType< + GetResourcesStatisticsMediaContainer, + z.ZodTypeDef, + unknown + > = z + .object({ + size: z.number().int().optional(), + StatisticsResources: z + .array(z.lazy(() => StatisticsResources$.inboundSchema)) + .optional(), + }) + .transform((v) => { + return remap$(v, { + StatisticsResources: "statisticsResources", + }); + }); + + export type Outbound = { + size?: number | undefined; + StatisticsResources?: Array | undefined; + }; + + export const outboundSchema: z.ZodType< + Outbound, + z.ZodTypeDef, + GetResourcesStatisticsMediaContainer + > = z + .object({ + size: z.number().int().optional(), + statisticsResources: z + .array(z.lazy(() => StatisticsResources$.outboundSchema)) + .optional(), + }) + .transform((v) => { + return remap$(v, { + statisticsResources: "StatisticsResources", + }); + }); +} + +/** @internal */ +export namespace GetResourcesStatisticsResponseBody$ { + export const inboundSchema: z.ZodType< + GetResourcesStatisticsResponseBody, + z.ZodTypeDef, + unknown + > = z + .object({ + MediaContainer: z + .lazy(() => GetResourcesStatisticsMediaContainer$.inboundSchema) + .optional(), + }) + .transform((v) => { + return remap$(v, { + MediaContainer: "mediaContainer", + }); + }); + + export type Outbound = { + MediaContainer?: GetResourcesStatisticsMediaContainer$.Outbound | undefined; + }; + + export const outboundSchema: z.ZodType< + Outbound, + z.ZodTypeDef, + GetResourcesStatisticsResponseBody + > = z + .object({ + mediaContainer: z + .lazy(() => GetResourcesStatisticsMediaContainer$.outboundSchema) + .optional(), + }) + .transform((v) => { + return remap$(v, { + mediaContainer: "MediaContainer", + }); + }); +} + +/** @internal */ +export namespace GetResourcesStatisticsResponse$ { + export const inboundSchema: z.ZodType = z + .object({ + ContentType: z.string(), + StatusCode: z.number().int(), + RawResponse: z.instanceof(Response), + object: z.lazy(() => GetResourcesStatisticsResponseBody$.inboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + ContentType: "contentType", + StatusCode: "statusCode", + RawResponse: "rawResponse", + }); + }); + + export type Outbound = { + ContentType: string; + StatusCode: number; + RawResponse: never; + object?: GetResourcesStatisticsResponseBody$.Outbound | undefined; + }; + + export const outboundSchema: z.ZodType = + z + .object({ + contentType: z.string(), + statusCode: z.number().int(), + rawResponse: z.instanceof(Response).transform(() => { + throw new Error("Response cannot be serialized"); + }), + object: z.lazy(() => GetResourcesStatisticsResponseBody$.outboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + contentType: "ContentType", + statusCode: "StatusCode", + rawResponse: "RawResponse", + }); + }); +} diff --git a/src/models/getsearchresultsop.ts b/src/models/getsearchresultsop.ts index e27f32aa..4644d3b9 100644 --- a/src/models/getsearchresultsop.ts +++ b/src/models/getsearchresultsop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type GetSearchResultsRequest = { diff --git a/src/models/getserveractivitiesop.ts b/src/models/getserveractivitiesop.ts index fd173ce2..cca05194 100644 --- a/src/models/getserveractivitiesop.ts +++ b/src/models/getserveractivitiesop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type GetServerActivitiesErrors = { diff --git a/src/models/getservercapabilitiesop.ts b/src/models/getservercapabilitiesop.ts index cf574af6..58e468a8 100644 --- a/src/models/getservercapabilitiesop.ts +++ b/src/models/getservercapabilitiesop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type Errors = { diff --git a/src/models/getserveridentityop.ts b/src/models/getserveridentityop.ts index 4a6f15d0..19f65718 100644 --- a/src/models/getserveridentityop.ts +++ b/src/models/getserveridentityop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type GetServerIdentityErrors = { diff --git a/src/models/getserverlistop.ts b/src/models/getserverlistop.ts index ad642b50..e7a7e22d 100644 --- a/src/models/getserverlistop.ts +++ b/src/models/getserverlistop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type GetServerListErrors = { diff --git a/src/models/getserverpreferencesop.ts b/src/models/getserverpreferencesop.ts index 2944203f..a5a91d27 100644 --- a/src/models/getserverpreferencesop.ts +++ b/src/models/getserverpreferencesop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type GetServerPreferencesErrors = { diff --git a/src/models/getsessionhistoryop.ts b/src/models/getsessionhistoryop.ts index c3318d53..e3d9bbc5 100644 --- a/src/models/getsessionhistoryop.ts +++ b/src/models/getsessionhistoryop.ts @@ -2,10 +2,51 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; -import { RFCDate } from "../types"; +import { remap as remap$ } from "../lib/primitives.js"; +import { RFCDate } from "../types/rfcdate.js"; import * as z from "zod"; +/** + * Filters content by field and direction/equality + * + * @remarks + * (Unknown if viewedAt is the only supported column) + * + */ +export type Filter = {}; + +export type GetSessionHistoryRequest = { + /** + * Sorts the results by the specified field followed by the direction (asc, desc) + * + * @remarks + * + */ + sort?: string | undefined; + /** + * Filter results by those that are related to a specific users id + * + * @remarks + * + */ + accountId?: number | undefined; + /** + * Filters content by field and direction/equality + * + * @remarks + * (Unknown if viewedAt is the only supported column) + * + */ + filter?: Filter | undefined; + /** + * Filters the results based on the id of a valid library section + * + * @remarks + * + */ + librarySectionID?: number | undefined; +}; + export type GetSessionHistoryErrors = { code?: number | undefined; message?: string | undefined; @@ -109,6 +150,41 @@ export type GetSessionHistoryResponse = { object?: GetSessionHistoryResponseBody | undefined; }; +/** @internal */ +export namespace Filter$ { + export const inboundSchema: z.ZodType = z.object({}); + + export type Outbound = {}; + + export const outboundSchema: z.ZodType = z.object({}); +} + +/** @internal */ +export namespace GetSessionHistoryRequest$ { + export const inboundSchema: z.ZodType = + z.object({ + sort: z.string().optional(), + accountId: z.number().int().optional(), + filter: z.lazy(() => Filter$.inboundSchema).optional(), + librarySectionID: z.number().int().optional(), + }); + + export type Outbound = { + sort?: string | undefined; + accountId?: number | undefined; + filter?: Filter$.Outbound | undefined; + librarySectionID?: number | undefined; + }; + + export const outboundSchema: z.ZodType = + z.object({ + sort: z.string().optional(), + accountId: z.number().int().optional(), + filter: z.lazy(() => Filter$.outboundSchema).optional(), + librarySectionID: z.number().int().optional(), + }); +} + /** @internal */ export namespace GetSessionHistoryErrors$ { export const inboundSchema: z.ZodType = diff --git a/src/models/getsessionsop.ts b/src/models/getsessionsop.ts index ccec3e9f..0d79cedd 100644 --- a/src/models/getsessionsop.ts +++ b/src/models/getsessionsop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type GetSessionsErrors = { @@ -102,7 +102,7 @@ export type GetSessionsMedia = { part?: Array | undefined; }; -export type User = { +export type GetSessionsUser = { id?: string | undefined; thumb?: string | undefined; title?: string | undefined; @@ -167,7 +167,7 @@ export type GetSessionsMetadata = { updatedAt?: number | undefined; viewOffset?: number | undefined; media?: Array | undefined; - user?: User | undefined; + user?: GetSessionsUser | undefined; player?: Player | undefined; session?: Session | undefined; }; @@ -446,8 +446,8 @@ export namespace GetSessionsMedia$ { } /** @internal */ -export namespace User$ { - export const inboundSchema: z.ZodType = z.object({ +export namespace GetSessionsUser$ { + export const inboundSchema: z.ZodType = z.object({ id: z.string().optional(), thumb: z.string().optional(), title: z.string().optional(), @@ -459,7 +459,7 @@ export namespace User$ { title?: string | undefined; }; - export const outboundSchema: z.ZodType = z.object({ + export const outboundSchema: z.ZodType = z.object({ id: z.string().optional(), thumb: z.string().optional(), title: z.string().optional(), @@ -582,7 +582,7 @@ export namespace GetSessionsMetadata$ { updatedAt: z.number().int().optional(), viewOffset: z.number().int().optional(), Media: z.array(z.lazy(() => GetSessionsMedia$.inboundSchema)).optional(), - User: z.lazy(() => User$.inboundSchema).optional(), + User: z.lazy(() => GetSessionsUser$.inboundSchema).optional(), Player: z.lazy(() => Player$.inboundSchema).optional(), Session: z.lazy(() => Session$.inboundSchema).optional(), }) @@ -630,7 +630,7 @@ export namespace GetSessionsMetadata$ { updatedAt?: number | undefined; viewOffset?: number | undefined; Media?: Array | undefined; - User?: User$.Outbound | undefined; + User?: GetSessionsUser$.Outbound | undefined; Player?: Player$.Outbound | undefined; Session?: Session$.Outbound | undefined; }; @@ -671,7 +671,7 @@ export namespace GetSessionsMetadata$ { updatedAt: z.number().int().optional(), viewOffset: z.number().int().optional(), media: z.array(z.lazy(() => GetSessionsMedia$.outboundSchema)).optional(), - user: z.lazy(() => User$.outboundSchema).optional(), + user: z.lazy(() => GetSessionsUser$.outboundSchema).optional(), player: z.lazy(() => Player$.outboundSchema).optional(), session: z.lazy(() => Session$.outboundSchema).optional(), }) diff --git a/src/models/getsourceconnectioninformationop.ts b/src/models/getsourceconnectioninformationop.ts index 4b6dc0f6..8f68e435 100644 --- a/src/models/getsourceconnectioninformationop.ts +++ b/src/models/getsourceconnectioninformationop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type GetSourceConnectionInformationRequest = { diff --git a/src/models/getstatisticsop.ts b/src/models/getstatisticsop.ts index 0147a325..13501df2 100644 --- a/src/models/getstatisticsop.ts +++ b/src/models/getstatisticsop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type GetStatisticsRequest = { diff --git a/src/models/gettimelineop.ts b/src/models/gettimelineop.ts index fe964ff9..edbb916f 100644 --- a/src/models/gettimelineop.ts +++ b/src/models/gettimelineop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; /** @@ -124,8 +124,8 @@ export type GetTimelineResponse = { /** @internal */ export namespace State$ { - export const inboundSchema = z.nativeEnum(State); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(State); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ diff --git a/src/models/gettokenop.ts b/src/models/gettokenop.ts index 038a6444..6f57dfea 100644 --- a/src/models/gettokenop.ts +++ b/src/models/gettokenop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export const GetTokenOpServerList = ["https://plex.tv/api/v2"] as const; @@ -16,7 +16,7 @@ export type GetTokenGlobals = { * (UUID, serial number, or other number unique per device) * */ - xPlexClientIdentifier: string; + xPlexClientIdentifier?: string | undefined; }; export type GetTokenRequest = { @@ -150,7 +150,7 @@ export type GetTokenResponse = { export namespace GetTokenGlobals$ { export const inboundSchema: z.ZodType = z .object({ - "X-Plex-Client-Identifier": z.string(), + "X-Plex-Client-Identifier": z.string().optional(), }) .transform((v) => { return remap$(v, { @@ -159,12 +159,12 @@ export namespace GetTokenGlobals$ { }); export type Outbound = { - "X-Plex-Client-Identifier": string; + "X-Plex-Client-Identifier"?: string | undefined; }; export const outboundSchema: z.ZodType = z .object({ - xPlexClientIdentifier: z.string(), + xPlexClientIdentifier: z.string().optional(), }) .transform((v) => { return remap$(v, { diff --git a/src/models/gettopwatchedcontentop.ts b/src/models/gettopwatchedcontentop.ts new file mode 100644 index 00000000..f7dda6fc --- /dev/null +++ b/src/models/gettopwatchedcontentop.ts @@ -0,0 +1,512 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import { remap as remap$ } from "../lib/primitives.js"; +import { RFCDate } from "../types/rfcdate.js"; +import * as z from "zod"; + +export type GetTopWatchedContentRequest = { + /** + * the library type (1 - movies, 2 - shows, 3 - music) + */ + type: number; + /** + * Adds the Guids object to the response + * + * @remarks + * + */ + includeGuids?: number | undefined; +}; + +export type GetTopWatchedContentGenre = { + id?: number | undefined; + filter?: string | undefined; + tag?: string | undefined; +}; + +export type GetTopWatchedContentCountry = { + id?: number | undefined; + filter?: string | undefined; + tag?: string | undefined; +}; + +export type GetTopWatchedContentGuids = { + id?: string | undefined; +}; + +export type GetTopWatchedContentRole = { + id?: number | undefined; + filter?: string | undefined; + tag?: string | undefined; + tagKey?: string | undefined; + role?: string | undefined; + thumb?: string | undefined; +}; + +export type User = { + id?: number | undefined; +}; + +export type GetTopWatchedContentMetadata = { + ratingKey?: string | undefined; + key?: string | undefined; + guid?: string | undefined; + slug?: string | undefined; + studio?: string | undefined; + type?: string | undefined; + title?: string | undefined; + librarySectionTitle?: string | undefined; + librarySectionID?: number | undefined; + librarySectionKey?: string | undefined; + contentRating?: string | undefined; + summary?: string | undefined; + index?: number | undefined; + audienceRating?: number | undefined; + year?: number | undefined; + tagline?: string | undefined; + thumb?: string | undefined; + art?: string | undefined; + duration?: number | undefined; + originallyAvailableAt?: RFCDate | undefined; + leafCount?: number | undefined; + viewedLeafCount?: number | undefined; + childCount?: number | undefined; + addedAt?: number | undefined; + updatedAt?: number | undefined; + globalViewCount?: number | undefined; + audienceRatingImage?: string | undefined; + genre?: Array | undefined; + country?: Array | undefined; + guids?: Array | undefined; + role?: Array | undefined; + user?: Array | undefined; +}; + +export type GetTopWatchedContentMediaContainer = { + size?: number | undefined; + allowSync?: boolean | undefined; + identifier?: string | undefined; + mediaTagPrefix?: string | undefined; + mediaTagVersion?: number | undefined; + metadata?: Array | undefined; +}; + +/** + * The metadata of the library item. + */ +export type GetTopWatchedContentResponseBody = { + mediaContainer?: GetTopWatchedContentMediaContainer | undefined; +}; + +export type GetTopWatchedContentResponse = { + /** + * 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 metadata of the library item. + */ + object?: GetTopWatchedContentResponseBody | undefined; +}; + +/** @internal */ +export namespace GetTopWatchedContentRequest$ { + export const inboundSchema: z.ZodType = + z.object({ + type: z.number().int(), + includeGuids: z.number().int().optional(), + }); + + export type Outbound = { + type: number; + includeGuids?: number | undefined; + }; + + export const outboundSchema: z.ZodType = + z.object({ + type: z.number().int(), + includeGuids: z.number().int().optional(), + }); +} + +/** @internal */ +export namespace GetTopWatchedContentGenre$ { + export const inboundSchema: z.ZodType = + z.object({ + id: z.number().int().optional(), + filter: z.string().optional(), + tag: z.string().optional(), + }); + + export type Outbound = { + id?: number | undefined; + filter?: string | undefined; + tag?: string | undefined; + }; + + export const outboundSchema: z.ZodType = + z.object({ + id: z.number().int().optional(), + filter: z.string().optional(), + tag: z.string().optional(), + }); +} + +/** @internal */ +export namespace GetTopWatchedContentCountry$ { + export const inboundSchema: z.ZodType = + z.object({ + id: z.number().int().optional(), + filter: z.string().optional(), + tag: z.string().optional(), + }); + + export type Outbound = { + id?: number | undefined; + filter?: string | undefined; + tag?: string | undefined; + }; + + export const outboundSchema: z.ZodType = + z.object({ + id: z.number().int().optional(), + filter: z.string().optional(), + tag: z.string().optional(), + }); +} + +/** @internal */ +export namespace GetTopWatchedContentGuids$ { + export const inboundSchema: z.ZodType = + z.object({ + id: z.string().optional(), + }); + + export type Outbound = { + id?: string | undefined; + }; + + export const outboundSchema: z.ZodType = + z.object({ + id: z.string().optional(), + }); +} + +/** @internal */ +export namespace GetTopWatchedContentRole$ { + export const inboundSchema: z.ZodType = + z.object({ + id: z.number().int().optional(), + filter: z.string().optional(), + tag: z.string().optional(), + tagKey: z.string().optional(), + role: z.string().optional(), + thumb: z.string().optional(), + }); + + export type Outbound = { + id?: number | undefined; + filter?: string | undefined; + tag?: string | undefined; + tagKey?: string | undefined; + role?: string | undefined; + thumb?: string | undefined; + }; + + export const outboundSchema: z.ZodType = + z.object({ + id: z.number().int().optional(), + filter: z.string().optional(), + tag: z.string().optional(), + tagKey: z.string().optional(), + role: z.string().optional(), + thumb: z.string().optional(), + }); +} + +/** @internal */ +export namespace User$ { + export const inboundSchema: z.ZodType = z.object({ + id: z.number().int().optional(), + }); + + export type Outbound = { + id?: number | undefined; + }; + + export const outboundSchema: z.ZodType = z.object({ + id: z.number().int().optional(), + }); +} + +/** @internal */ +export namespace GetTopWatchedContentMetadata$ { + export const inboundSchema: z.ZodType = z + .object({ + ratingKey: z.string().optional(), + key: z.string().optional(), + guid: z.string().optional(), + slug: z.string().optional(), + studio: z.string().optional(), + type: z.string().optional(), + title: z.string().optional(), + librarySectionTitle: z.string().optional(), + librarySectionID: z.number().int().optional(), + librarySectionKey: z.string().optional(), + contentRating: z.string().optional(), + summary: z.string().optional(), + index: z.number().int().optional(), + audienceRating: z.number().optional(), + year: z.number().int().optional(), + tagline: z.string().optional(), + thumb: z.string().optional(), + art: z.string().optional(), + duration: z.number().int().optional(), + originallyAvailableAt: z + .string() + .transform((v) => new RFCDate(v)) + .optional(), + leafCount: z.number().int().optional(), + viewedLeafCount: z.number().int().optional(), + childCount: z.number().int().optional(), + addedAt: z.number().int().optional(), + updatedAt: z.number().int().optional(), + globalViewCount: z.number().int().optional(), + audienceRatingImage: z.string().optional(), + Genre: z.array(z.lazy(() => GetTopWatchedContentGenre$.inboundSchema)).optional(), + Country: z.array(z.lazy(() => GetTopWatchedContentCountry$.inboundSchema)).optional(), + guids: z.array(z.lazy(() => GetTopWatchedContentGuids$.inboundSchema)).optional(), + Role: z.array(z.lazy(() => GetTopWatchedContentRole$.inboundSchema)).optional(), + User: z.array(z.lazy(() => User$.inboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + Genre: "genre", + Country: "country", + Role: "role", + User: "user", + }); + }); + + export type Outbound = { + ratingKey?: string | undefined; + key?: string | undefined; + guid?: string | undefined; + slug?: string | undefined; + studio?: string | undefined; + type?: string | undefined; + title?: string | undefined; + librarySectionTitle?: string | undefined; + librarySectionID?: number | undefined; + librarySectionKey?: string | undefined; + contentRating?: string | undefined; + summary?: string | undefined; + index?: number | undefined; + audienceRating?: number | undefined; + year?: number | undefined; + tagline?: string | undefined; + thumb?: string | undefined; + art?: string | undefined; + duration?: number | undefined; + originallyAvailableAt?: string | undefined; + leafCount?: number | undefined; + viewedLeafCount?: number | undefined; + childCount?: number | undefined; + addedAt?: number | undefined; + updatedAt?: number | undefined; + globalViewCount?: number | undefined; + audienceRatingImage?: string | undefined; + Genre?: Array | undefined; + Country?: Array | undefined; + guids?: Array | undefined; + Role?: Array | undefined; + User?: Array | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + ratingKey: z.string().optional(), + key: z.string().optional(), + guid: z.string().optional(), + slug: z.string().optional(), + studio: z.string().optional(), + type: z.string().optional(), + title: z.string().optional(), + librarySectionTitle: z.string().optional(), + librarySectionID: z.number().int().optional(), + librarySectionKey: z.string().optional(), + contentRating: z.string().optional(), + summary: z.string().optional(), + index: z.number().int().optional(), + audienceRating: z.number().optional(), + year: z.number().int().optional(), + tagline: z.string().optional(), + thumb: z.string().optional(), + art: z.string().optional(), + duration: z.number().int().optional(), + originallyAvailableAt: z + .instanceof(RFCDate) + .transform((v) => v.toString()) + .optional(), + leafCount: z.number().int().optional(), + viewedLeafCount: z.number().int().optional(), + childCount: z.number().int().optional(), + addedAt: z.number().int().optional(), + updatedAt: z.number().int().optional(), + globalViewCount: z.number().int().optional(), + audienceRatingImage: z.string().optional(), + genre: z.array(z.lazy(() => GetTopWatchedContentGenre$.outboundSchema)).optional(), + country: z.array(z.lazy(() => GetTopWatchedContentCountry$.outboundSchema)).optional(), + guids: z.array(z.lazy(() => GetTopWatchedContentGuids$.outboundSchema)).optional(), + role: z.array(z.lazy(() => GetTopWatchedContentRole$.outboundSchema)).optional(), + user: z.array(z.lazy(() => User$.outboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + genre: "Genre", + country: "Country", + role: "Role", + user: "User", + }); + }); +} + +/** @internal */ +export namespace GetTopWatchedContentMediaContainer$ { + export const inboundSchema: z.ZodType< + GetTopWatchedContentMediaContainer, + z.ZodTypeDef, + unknown + > = z + .object({ + size: z.number().int().optional(), + allowSync: z.boolean().optional(), + identifier: z.string().optional(), + mediaTagPrefix: z.string().optional(), + mediaTagVersion: z.number().int().optional(), + Metadata: z.array(z.lazy(() => GetTopWatchedContentMetadata$.inboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + Metadata: "metadata", + }); + }); + + export type Outbound = { + size?: number | undefined; + allowSync?: boolean | undefined; + identifier?: string | undefined; + mediaTagPrefix?: string | undefined; + mediaTagVersion?: number | undefined; + Metadata?: Array | undefined; + }; + + export const outboundSchema: z.ZodType< + Outbound, + z.ZodTypeDef, + GetTopWatchedContentMediaContainer + > = z + .object({ + size: z.number().int().optional(), + allowSync: z.boolean().optional(), + identifier: z.string().optional(), + mediaTagPrefix: z.string().optional(), + mediaTagVersion: z.number().int().optional(), + metadata: z + .array(z.lazy(() => GetTopWatchedContentMetadata$.outboundSchema)) + .optional(), + }) + .transform((v) => { + return remap$(v, { + metadata: "Metadata", + }); + }); +} + +/** @internal */ +export namespace GetTopWatchedContentResponseBody$ { + export const inboundSchema: z.ZodType = + z + .object({ + MediaContainer: z + .lazy(() => GetTopWatchedContentMediaContainer$.inboundSchema) + .optional(), + }) + .transform((v) => { + return remap$(v, { + MediaContainer: "mediaContainer", + }); + }); + + export type Outbound = { + MediaContainer?: GetTopWatchedContentMediaContainer$.Outbound | undefined; + }; + + export const outboundSchema: z.ZodType< + Outbound, + z.ZodTypeDef, + GetTopWatchedContentResponseBody + > = z + .object({ + mediaContainer: z + .lazy(() => GetTopWatchedContentMediaContainer$.outboundSchema) + .optional(), + }) + .transform((v) => { + return remap$(v, { + mediaContainer: "MediaContainer", + }); + }); +} + +/** @internal */ +export namespace GetTopWatchedContentResponse$ { + export const inboundSchema: z.ZodType = z + .object({ + ContentType: z.string(), + StatusCode: z.number().int(), + RawResponse: z.instanceof(Response), + object: z.lazy(() => GetTopWatchedContentResponseBody$.inboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + ContentType: "contentType", + StatusCode: "statusCode", + RawResponse: "rawResponse", + }); + }); + + export type Outbound = { + ContentType: string; + StatusCode: number; + RawResponse: never; + object?: GetTopWatchedContentResponseBody$.Outbound | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + contentType: z.string(), + statusCode: z.number().int(), + rawResponse: z.instanceof(Response).transform(() => { + throw new Error("Response cannot be serialized"); + }), + object: z.lazy(() => GetTopWatchedContentResponseBody$.outboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + contentType: "ContentType", + statusCode: "StatusCode", + rawResponse: "RawResponse", + }); + }); +} diff --git a/src/models/gettranscodesessionsop.ts b/src/models/gettranscodesessionsop.ts index facb354a..31d9acd5 100644 --- a/src/models/gettranscodesessionsop.ts +++ b/src/models/gettranscodesessionsop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type GetTranscodeSessionsErrors = { diff --git a/src/models/gettransienttokenop.ts b/src/models/gettransienttokenop.ts index 71fec670..978fbea6 100644 --- a/src/models/gettransienttokenop.ts +++ b/src/models/gettransienttokenop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; /** @@ -97,14 +97,16 @@ export type GetTransientTokenResponse = { /** @internal */ export namespace GetTransientTokenQueryParamType$ { - export const inboundSchema = z.nativeEnum(GetTransientTokenQueryParamType); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = + z.nativeEnum(GetTransientTokenQueryParamType); + export const outboundSchema: z.ZodNativeEnum = + inboundSchema; } /** @internal */ export namespace Scope$ { - export const inboundSchema = z.nativeEnum(Scope); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Scope); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ diff --git a/src/models/getupdatestatusop.ts b/src/models/getupdatestatusop.ts index 3c898e55..0370159a 100644 --- a/src/models/getupdatestatusop.ts +++ b/src/models/getupdatestatusop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type GetUpdateStatusErrors = { diff --git a/src/models/getwatchlistop.ts b/src/models/getwatchlistop.ts index 2127baa4..2586efca 100644 --- a/src/models/getwatchlistop.ts +++ b/src/models/getwatchlistop.ts @@ -2,8 +2,8 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; -import { RFCDate } from "../types"; +import { remap as remap$ } from "../lib/primitives.js"; +import { RFCDate } from "../types/rfcdate.js"; import * as z from "zod"; export const GetWatchlistOpServerList = [ @@ -16,7 +16,7 @@ export const GetWatchlistOpServerList = [ /** * Filter */ -export enum Filter { +export enum PathParamFilter { All = "all", Available = "available", Released = "released", @@ -59,7 +59,7 @@ export type GetWatchlistRequest = { /** * Filter */ - filter: Filter; + filter: PathParamFilter; /** * In the format "field:dir". Available fields are "watchlistedAt" (Added At), * @@ -247,34 +247,37 @@ export type GetWatchlistResponse = { }; /** @internal */ -export namespace Filter$ { - export const inboundSchema = z.nativeEnum(Filter); - export const outboundSchema = inboundSchema; +export namespace PathParamFilter$ { + export const inboundSchema: z.ZodNativeEnum = + z.nativeEnum(PathParamFilter); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ export namespace Libtype$ { - export const inboundSchema = z.nativeEnum(Libtype); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Libtype); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ export namespace IncludeCollections$ { - export const inboundSchema = z.nativeEnum(IncludeCollections); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = + z.nativeEnum(IncludeCollections); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ export namespace IncludeExternalMedia$ { - export const inboundSchema = z.nativeEnum(IncludeExternalMedia); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = + z.nativeEnum(IncludeExternalMedia); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ export namespace GetWatchlistRequest$ { export const inboundSchema: z.ZodType = z .object({ - filter: Filter$.inboundSchema, + filter: PathParamFilter$.inboundSchema, sort: z.string().optional(), libtype: Libtype$.inboundSchema.optional(), maxresults: z.number().int().optional(), @@ -306,7 +309,7 @@ export namespace GetWatchlistRequest$ { export const outboundSchema: z.ZodType = z .object({ - filter: Filter$.outboundSchema, + filter: PathParamFilter$.outboundSchema, sort: z.string().optional(), libtype: Libtype$.outboundSchema.optional(), maxresults: z.number().int().optional(), diff --git a/src/models/index.ts b/src/models/index.ts index bc51c9e7..049b0bfe 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -2,68 +2,71 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -export * from "./addplaylistcontentsop"; -export * from "./applyupdatesop"; -export * from "./cancelserveractivitiesop"; -export * from "./checkforupdatesop"; -export * from "./clearplaylistcontentsop"; -export * from "./createplaylistop"; -export * from "./deletelibraryop"; -export * from "./deleteplaylistop"; -export * from "./enablepapertrailop"; -export * from "./getavailableclientsop"; -export * from "./getbutlertasksop"; -export * from "./getdevicesop"; -export * from "./getfilehashop"; -export * from "./getglobalhubsop"; -export * from "./gethomedataop"; -export * from "./getlibrariesop"; -export * from "./getlibraryhubsop"; -export * from "./getlibraryitemsop"; -export * from "./getlibraryop"; -export * from "./getmetadatachildrenop"; -export * from "./getmetadataop"; -export * from "./getmyplexaccountop"; -export * from "./getondeckop"; -export * from "./getpinop"; -export * from "./getplaylistcontentsop"; -export * from "./getplaylistop"; -export * from "./getplaylistsop"; -export * from "./getrecentlyaddedop"; -export * from "./getresizedphotoop"; -export * from "./getsearchresultsop"; -export * from "./getserveractivitiesop"; -export * from "./getservercapabilitiesop"; -export * from "./getserveridentityop"; -export * from "./getserverlistop"; -export * from "./getserverpreferencesop"; -export * from "./getsessionhistoryop"; -export * from "./getsessionsop"; -export * from "./getsourceconnectioninformationop"; -export * from "./getstatisticsop"; -export * from "./gettimelineop"; -export * from "./gettokenop"; -export * from "./gettranscodesessionsop"; -export * from "./gettransienttokenop"; -export * from "./getupdatestatusop"; -export * from "./getwatchlistop"; -export * from "./loglineop"; -export * from "./logmultilineop"; -export * from "./markplayedop"; -export * from "./markunplayedop"; -export * from "./performsearchop"; -export * from "./performvoicesearchop"; -export * from "./refreshlibraryop"; -export * from "./sdkerror"; -export * from "./sdkvalidationerror"; -export * from "./searchlibraryop"; -export * from "./security"; -export * from "./startalltasksop"; -export * from "./starttaskop"; -export * from "./startuniversaltranscodeop"; -export * from "./stopalltasksop"; -export * from "./stoptaskop"; -export * from "./stoptranscodesessionop"; -export * from "./updateplaylistop"; -export * from "./updateplayprogressop"; -export * from "./uploadplaylistop"; +export * from "./addplaylistcontentsop.js"; +export * from "./applyupdatesop.js"; +export * from "./cancelserveractivitiesop.js"; +export * from "./checkforupdatesop.js"; +export * from "./clearplaylistcontentsop.js"; +export * from "./createplaylistop.js"; +export * from "./deletelibraryop.js"; +export * from "./deleteplaylistop.js"; +export * from "./enablepapertrailop.js"; +export * from "./getavailableclientsop.js"; +export * from "./getbandwidthstatisticsop.js"; +export * from "./getbutlertasksop.js"; +export * from "./getdevicesop.js"; +export * from "./getfilehashop.js"; +export * from "./getglobalhubsop.js"; +export * from "./gethomedataop.js"; +export * from "./getlibrariesop.js"; +export * from "./getlibraryhubsop.js"; +export * from "./getlibraryitemsop.js"; +export * from "./getlibraryop.js"; +export * from "./getmetadatachildrenop.js"; +export * from "./getmetadataop.js"; +export * from "./getmyplexaccountop.js"; +export * from "./getondeckop.js"; +export * from "./getpinop.js"; +export * from "./getplaylistcontentsop.js"; +export * from "./getplaylistop.js"; +export * from "./getplaylistsop.js"; +export * from "./getrecentlyaddedop.js"; +export * from "./getresizedphotoop.js"; +export * from "./getresourcesstatisticsop.js"; +export * from "./getsearchresultsop.js"; +export * from "./getserveractivitiesop.js"; +export * from "./getservercapabilitiesop.js"; +export * from "./getserveridentityop.js"; +export * from "./getserverlistop.js"; +export * from "./getserverpreferencesop.js"; +export * from "./getsessionhistoryop.js"; +export * from "./getsessionsop.js"; +export * from "./getsourceconnectioninformationop.js"; +export * from "./getstatisticsop.js"; +export * from "./gettimelineop.js"; +export * from "./gettokenop.js"; +export * from "./gettopwatchedcontentop.js"; +export * from "./gettranscodesessionsop.js"; +export * from "./gettransienttokenop.js"; +export * from "./getupdatestatusop.js"; +export * from "./getwatchlistop.js"; +export * from "./loglineop.js"; +export * from "./logmultilineop.js"; +export * from "./markplayedop.js"; +export * from "./markunplayedop.js"; +export * from "./performsearchop.js"; +export * from "./performvoicesearchop.js"; +export * from "./refreshlibraryop.js"; +export * from "./sdkerror.js"; +export * from "./sdkvalidationerror.js"; +export * from "./searchlibraryop.js"; +export * from "./security.js"; +export * from "./startalltasksop.js"; +export * from "./starttaskop.js"; +export * from "./startuniversaltranscodeop.js"; +export * from "./stopalltasksop.js"; +export * from "./stoptaskop.js"; +export * from "./stoptranscodesessionop.js"; +export * from "./updateplaylistop.js"; +export * from "./updateplayprogressop.js"; +export * from "./uploadplaylistop.js"; diff --git a/src/models/loglineop.ts b/src/models/loglineop.ts index 4d02ccfa..b86c5d45 100644 --- a/src/models/loglineop.ts +++ b/src/models/loglineop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; /** @@ -114,8 +114,8 @@ export type LogLineResponse = { /** @internal */ export namespace Level$ { - export const inboundSchema = z.nativeEnum(Level); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Level); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ diff --git a/src/models/logmultilineop.ts b/src/models/logmultilineop.ts index 20ce857d..a830feae 100644 --- a/src/models/logmultilineop.ts +++ b/src/models/logmultilineop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type LogMultiLineErrors = { diff --git a/src/models/markplayedop.ts b/src/models/markplayedop.ts index 576e7cb4..f07c0d74 100644 --- a/src/models/markplayedop.ts +++ b/src/models/markplayedop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type MarkPlayedRequest = { diff --git a/src/models/markunplayedop.ts b/src/models/markunplayedop.ts index 07a164d3..532fc02f 100644 --- a/src/models/markunplayedop.ts +++ b/src/models/markunplayedop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type MarkUnplayedRequest = { diff --git a/src/models/performsearchop.ts b/src/models/performsearchop.ts index 645abec1..69e6989c 100644 --- a/src/models/performsearchop.ts +++ b/src/models/performsearchop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type PerformSearchRequest = { diff --git a/src/models/performvoicesearchop.ts b/src/models/performvoicesearchop.ts index e9cc65a7..d2bfc81a 100644 --- a/src/models/performvoicesearchop.ts +++ b/src/models/performvoicesearchop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type PerformVoiceSearchRequest = { diff --git a/src/models/refreshlibraryop.ts b/src/models/refreshlibraryop.ts index 7e6e52f7..d2897579 100644 --- a/src/models/refreshlibraryop.ts +++ b/src/models/refreshlibraryop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type RefreshLibraryRequest = { diff --git a/src/models/searchlibraryop.ts b/src/models/searchlibraryop.ts index 16fb995f..35bfd133 100644 --- a/src/models/searchlibraryop.ts +++ b/src/models/searchlibraryop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; /** @@ -143,8 +143,8 @@ export type SearchLibraryResponse = { /** @internal */ export namespace Type$ { - export const inboundSchema = z.nativeEnum(Type); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Type); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ diff --git a/src/models/startalltasksop.ts b/src/models/startalltasksop.ts index 98d25979..86927b00 100644 --- a/src/models/startalltasksop.ts +++ b/src/models/startalltasksop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type StartAllTasksErrors = { diff --git a/src/models/starttaskop.ts b/src/models/starttaskop.ts index 1d3093b6..8eeca1fb 100644 --- a/src/models/starttaskop.ts +++ b/src/models/starttaskop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; /** @@ -99,8 +99,8 @@ export type StartTaskResponse = { /** @internal */ export namespace TaskName$ { - export const inboundSchema = z.nativeEnum(TaskName); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(TaskName); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ diff --git a/src/models/startuniversaltranscodeop.ts b/src/models/startuniversaltranscodeop.ts index 64ceeb03..77c3e11b 100644 --- a/src/models/startuniversaltranscodeop.ts +++ b/src/models/startuniversaltranscodeop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type StartUniversalTranscodeRequest = { diff --git a/src/models/stopalltasksop.ts b/src/models/stopalltasksop.ts index c7d3b91b..679bbbee 100644 --- a/src/models/stopalltasksop.ts +++ b/src/models/stopalltasksop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type StopAllTasksErrors = { diff --git a/src/models/stoptaskop.ts b/src/models/stoptaskop.ts index fef7b0c6..086d6ad3 100644 --- a/src/models/stoptaskop.ts +++ b/src/models/stoptaskop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; /** @@ -99,8 +99,9 @@ export type StopTaskResponse = { /** @internal */ export namespace PathParamTaskName$ { - export const inboundSchema = z.nativeEnum(PathParamTaskName); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = + z.nativeEnum(PathParamTaskName); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ diff --git a/src/models/stoptranscodesessionop.ts b/src/models/stoptranscodesessionop.ts index 77a60851..ac28e289 100644 --- a/src/models/stoptranscodesessionop.ts +++ b/src/models/stoptranscodesessionop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type StopTranscodeSessionRequest = { diff --git a/src/models/updateplaylistop.ts b/src/models/updateplaylistop.ts index 17d42f55..dc4fe184 100644 --- a/src/models/updateplaylistop.ts +++ b/src/models/updateplaylistop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type UpdatePlaylistRequest = { diff --git a/src/models/updateplayprogressop.ts b/src/models/updateplayprogressop.ts index cfd4a447..01534893 100644 --- a/src/models/updateplayprogressop.ts +++ b/src/models/updateplayprogressop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; export type UpdatePlayProgressRequest = { diff --git a/src/models/uploadplaylistop.ts b/src/models/uploadplaylistop.ts index 939c7114..e329ff43 100644 --- a/src/models/uploadplaylistop.ts +++ b/src/models/uploadplaylistop.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { remap as remap$ } from "../lib/primitives"; +import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; /** @@ -111,8 +111,8 @@ export type UploadPlaylistResponse = { /** @internal */ export namespace Force$ { - export const inboundSchema = z.nativeEnum(Force); - export const outboundSchema = inboundSchema; + export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Force); + export const outboundSchema: z.ZodNativeEnum = inboundSchema; } /** @internal */ diff --git a/src/sdk/activities.ts b/src/sdk/activities.ts index 7b32dfed..ea411d32 100644 --- a/src/sdk/activities.ts +++ b/src/sdk/activities.ts @@ -2,13 +2,13 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { SDKHooks } from "../hooks"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; -import { encodeSimple as encodeSimple$ } from "../lib/encodings"; -import { HTTPClient } from "../lib/http"; -import * as schemas$ from "../lib/schemas"; -import { ClientSDK, RequestOptions } from "../lib/sdks"; -import * as models from "../models"; +import { SDKHooks } from "../hooks/hooks.js"; +import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import { HTTPClient } from "../lib/http.js"; +import * as schemas$ from "../lib/schemas.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as models from "../models/index.js"; export class Activities extends ClientSDK { private readonly options$: SDKOptions & { hooks?: SDKHooks }; diff --git a/src/sdk/authentication.ts b/src/sdk/authentication.ts index f24de4d5..cb63c3bb 100644 --- a/src/sdk/authentication.ts +++ b/src/sdk/authentication.ts @@ -2,13 +2,13 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { SDKHooks } from "../hooks"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings"; -import { HTTPClient } from "../lib/http"; -import * as schemas$ from "../lib/schemas"; -import { ClientSDK, RequestOptions } from "../lib/sdks"; -import * as models from "../models"; +import { SDKHooks } from "../hooks/hooks.js"; +import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import { HTTPClient } from "../lib/http.js"; +import * as schemas$ from "../lib/schemas.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as models from "../models/index.js"; export class Authentication extends ClientSDK { private readonly options$: SDKOptions & { hooks?: SDKHooks }; diff --git a/src/sdk/butler.ts b/src/sdk/butler.ts index 046ffc9c..206b6737 100644 --- a/src/sdk/butler.ts +++ b/src/sdk/butler.ts @@ -2,13 +2,13 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { SDKHooks } from "../hooks"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; -import { encodeSimple as encodeSimple$ } from "../lib/encodings"; -import { HTTPClient } from "../lib/http"; -import * as schemas$ from "../lib/schemas"; -import { ClientSDK, RequestOptions } from "../lib/sdks"; -import * as models from "../models"; +import { SDKHooks } from "../hooks/hooks.js"; +import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import { HTTPClient } from "../lib/http.js"; +import * as schemas$ from "../lib/schemas.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as models from "../models/index.js"; export class Butler extends ClientSDK { private readonly options$: SDKOptions & { hooks?: SDKHooks }; diff --git a/src/sdk/hubs.ts b/src/sdk/hubs.ts index 80d92372..7f847b16 100644 --- a/src/sdk/hubs.ts +++ b/src/sdk/hubs.ts @@ -2,16 +2,16 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { SDKHooks } from "../hooks"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; +import { SDKHooks } from "../hooks/hooks.js"; +import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; import { encodeFormQuery as encodeFormQuery$, encodeSimple as encodeSimple$, -} from "../lib/encodings"; -import { HTTPClient } from "../lib/http"; -import * as schemas$ from "../lib/schemas"; -import { ClientSDK, RequestOptions } from "../lib/sdks"; -import * as models from "../models"; +} from "../lib/encodings.js"; +import { HTTPClient } from "../lib/http.js"; +import * as schemas$ from "../lib/schemas.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as models from "../models/index.js"; export class Hubs extends ClientSDK { private readonly options$: SDKOptions & { hooks?: SDKHooks }; diff --git a/src/sdk/index.ts b/src/sdk/index.ts index 31303148..34a84fc2 100644 --- a/src/sdk/index.ts +++ b/src/sdk/index.ts @@ -2,4 +2,4 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -export * from "./sdk"; +export * from "./sdk.js"; diff --git a/src/sdk/library.ts b/src/sdk/library.ts index 129e111c..5ff32db8 100644 --- a/src/sdk/library.ts +++ b/src/sdk/library.ts @@ -2,16 +2,16 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { SDKHooks } from "../hooks"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; +import { SDKHooks } from "../hooks/hooks.js"; +import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; import { encodeFormQuery as encodeFormQuery$, encodeSimple as encodeSimple$, -} from "../lib/encodings"; -import { HTTPClient } from "../lib/http"; -import * as schemas$ from "../lib/schemas"; -import { ClientSDK, RequestOptions } from "../lib/sdks"; -import * as models from "../models"; +} from "../lib/encodings.js"; +import { HTTPClient } from "../lib/http.js"; +import * as schemas$ from "../lib/schemas.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as models from "../models/index.js"; export class Library extends ClientSDK { private readonly options$: SDKOptions & { hooks?: SDKHooks }; @@ -483,11 +483,13 @@ export class Library extends ClientSDK { async getLibraryItems( sectionId: any, tag: models.Tag, + includeGuids?: number | undefined, options?: RequestOptions ): Promise { const input$: models.GetLibraryItemsRequest = { sectionId: sectionId, tag: tag, + includeGuids: includeGuids, }; const headers$ = new Headers(); headers$.set("user-agent", SDK_METADATA.userAgent); @@ -509,7 +511,9 @@ export class Library extends ClientSDK { }; const path$ = this.templateURLComponent("/library/sections/{sectionId}/{tag}")(pathParams$); - const query$ = ""; + const query$ = encodeFormQuery$({ + includeGuids: payload$.includeGuids, + }); let security$; if (typeof this.options$.accessToken === "function") { @@ -838,10 +842,12 @@ export class Library extends ClientSDK { */ async getMetadataChildren( ratingKey: number, + includeElements?: string | undefined, options?: RequestOptions ): Promise { const input$: models.GetMetadataChildrenRequest = { ratingKey: ratingKey, + includeElements: includeElements, }; const headers$ = new Headers(); headers$.set("user-agent", SDK_METADATA.userAgent); @@ -864,7 +870,9 @@ export class Library extends ClientSDK { pathParams$ ); - const query$ = ""; + const query$ = encodeFormQuery$({ + includeElements: payload$.includeElements, + }); let security$; if (typeof this.options$.accessToken === "function") { @@ -913,6 +921,86 @@ export class Library extends ClientSDK { return result$; } + /** + * Get Top Watched Content + * + * @remarks + * This endpoint will return the top watched content from libraries of a certain type + * + */ + async getTopWatchedContent( + type: number, + includeGuids?: number | undefined, + options?: RequestOptions + ): Promise { + const input$: models.GetTopWatchedContentRequest = { + type: type, + includeGuids: includeGuids, + }; + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input$, + (value$) => models.GetTopWatchedContentRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = null; + + const path$ = this.templateURLComponent("/library/all/top")(); + + const query$ = encodeFormQuery$({ + includeGuids: payload$.includeGuids, + type: payload$.type, + }); + + let security$; + if (typeof this.options$.accessToken === "function") { + security$ = { accessToken: await this.options$.accessToken() }; + } else if (this.options$.accessToken) { + security$ = { accessToken: this.options$.accessToken }; + } else { + security$ = {}; + } + const context = { + operationID: "getTopWatchedContent", + oAuth2Scopes: [], + securitySource: this.options$.accessToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { context, errorCodes: ["4XX", "5XX"] }; + const request$ = this.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request$, doOptions); + + const responseFields$ = { + ContentType: response.headers.get("content-type") ?? "application/octet-stream", + StatusCode: response.status, + RawResponse: response, + Headers: {}, + }; + + const [result$] = await this.matcher() + .json(200, models.GetTopWatchedContentResponse$, { key: "object" }) + .fail(["4XX", "5XX"]) + .match(response, { extraFields: responseFields$ }); + + return result$; + } + /** * Get On Deck * diff --git a/src/sdk/log.ts b/src/sdk/log.ts index f55bde8e..0121dcf5 100644 --- a/src/sdk/log.ts +++ b/src/sdk/log.ts @@ -2,13 +2,13 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { SDKHooks } from "../hooks"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings"; -import { HTTPClient } from "../lib/http"; -import * as schemas$ from "../lib/schemas"; -import { ClientSDK, RequestOptions } from "../lib/sdks"; -import * as models from "../models"; +import { SDKHooks } from "../hooks/hooks.js"; +import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import { HTTPClient } from "../lib/http.js"; +import * as schemas$ from "../lib/schemas.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as models from "../models/index.js"; import * as z from "zod"; export class Log extends ClientSDK { diff --git a/src/sdk/media.ts b/src/sdk/media.ts index ea8828d4..3fe2a3e4 100644 --- a/src/sdk/media.ts +++ b/src/sdk/media.ts @@ -2,13 +2,13 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { SDKHooks } from "../hooks"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings"; -import { HTTPClient } from "../lib/http"; -import * as schemas$ from "../lib/schemas"; -import { ClientSDK, RequestOptions } from "../lib/sdks"; -import * as models from "../models"; +import { SDKHooks } from "../hooks/hooks.js"; +import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import { HTTPClient } from "../lib/http.js"; +import * as schemas$ from "../lib/schemas.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as models from "../models/index.js"; export class Media extends ClientSDK { private readonly options$: SDKOptions & { hooks?: SDKHooks }; diff --git a/src/sdk/playlists.ts b/src/sdk/playlists.ts index 9c841275..ff682c57 100644 --- a/src/sdk/playlists.ts +++ b/src/sdk/playlists.ts @@ -2,16 +2,16 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { SDKHooks } from "../hooks"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; +import { SDKHooks } from "../hooks/hooks.js"; +import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; import { encodeFormQuery as encodeFormQuery$, encodeSimple as encodeSimple$, -} from "../lib/encodings"; -import { HTTPClient } from "../lib/http"; -import * as schemas$ from "../lib/schemas"; -import { ClientSDK, RequestOptions } from "../lib/sdks"; -import * as models from "../models"; +} from "../lib/encodings.js"; +import { HTTPClient } from "../lib/http.js"; +import * as schemas$ from "../lib/schemas.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as models from "../models/index.js"; export class Playlists extends ClientSDK { private readonly options$: SDKOptions & { hooks?: SDKHooks }; @@ -359,7 +359,7 @@ export class Playlists extends ClientSDK { }; const [result$] = await this.matcher() - .void(200, models.DeletePlaylistResponse$) + .void(204, models.DeletePlaylistResponse$) .fail([400, "4XX", "5XX"]) .json(401, models.DeletePlaylistResponseBody$, { err: true }) .match(response, { extraFields: responseFields$ }); diff --git a/src/sdk/plex.ts b/src/sdk/plex.ts index 166fd139..2fe0f52b 100644 --- a/src/sdk/plex.ts +++ b/src/sdk/plex.ts @@ -2,16 +2,18 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { SDKHooks } from "../hooks"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; +import { SDKHooks } from "../hooks/hooks.js"; +import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; import { encodeFormQuery as encodeFormQuery$, encodeSimple as encodeSimple$, -} from "../lib/encodings"; -import { HTTPClient } from "../lib/http"; -import * as schemas$ from "../lib/schemas"; -import { ClientSDK, RequestOptions } from "../lib/sdks"; -import * as models from "../models"; +} from "../lib/encodings.js"; +import { HTTPClient } from "../lib/http.js"; +import * as schemas$ from "../lib/schemas.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import { GetPinOpServerList } from "../models/getpinop.js"; +import { GetTokenOpServerList } from "../models/gettokenop.js"; +import * as models from "../models/index.js"; export class Plex extends ClientSDK { private readonly options$: SDKOptions & { hooks?: SDKHooks }; @@ -130,7 +132,7 @@ export class Plex extends ClientSDK { const body$ = null; const baseURL$ = options?.serverURL || - this.templateURLComponent(models.GetPinOpServerList[0], { charEncoding: "percent" })(); + this.templateURLComponent(GetPinOpServerList[0], { charEncoding: "percent" })(); const path$ = this.templateURLComponent("/pins")(); @@ -214,9 +216,7 @@ export class Plex extends ClientSDK { const body$ = null; const baseURL$ = options?.serverURL || - this.templateURLComponent(models.GetTokenOpServerList[0], { - charEncoding: "percent", - })(); + this.templateURLComponent(GetTokenOpServerList[0], { charEncoding: "percent" })(); const pathParams$ = { pinID: encodeSimple$("pinID", payload$.pinID, { diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 855e9296..47d89fdc 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -2,26 +2,26 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { SDKHooks } from "../hooks"; -import { SDKOptions, serverURLFromOptions } from "../lib/config"; -import { HTTPClient } from "../lib/http"; -import { ClientSDK } from "../lib/sdks"; -import { Activities } from "./activities"; -import { Authentication } from "./authentication"; -import { Butler } from "./butler"; -import { Hubs } from "./hubs"; -import { Library } from "./library"; -import { Log } from "./log"; -import { Media } from "./media"; -import { Playlists } from "./playlists"; -import { Plex } from "./plex"; -import { Search } from "./search"; -import { Server } from "./server"; -import { Sessions } from "./sessions"; -import { Statistics } from "./statistics"; -import { Updater } from "./updater"; -import { Video } from "./video"; -import { Watchlist } from "./watchlist"; +import { SDKHooks } from "../hooks/hooks.js"; +import { SDKOptions, serverURLFromOptions } from "../lib/config.js"; +import { HTTPClient } from "../lib/http.js"; +import { ClientSDK } from "../lib/sdks.js"; +import { Activities } from "./activities.js"; +import { Authentication } from "./authentication.js"; +import { Butler } from "./butler.js"; +import { Hubs } from "./hubs.js"; +import { Library } from "./library.js"; +import { Log } from "./log.js"; +import { Media } from "./media.js"; +import { Playlists } from "./playlists.js"; +import { Plex } from "./plex.js"; +import { Search } from "./search.js"; +import { Server } from "./server.js"; +import { Sessions } from "./sessions.js"; +import { Statistics } from "./statistics.js"; +import { Updater } from "./updater.js"; +import { Video } from "./video.js"; +import { Watchlist } from "./watchlist.js"; export class PlexAPI extends ClientSDK { private readonly options$: SDKOptions & { hooks?: SDKHooks }; diff --git a/src/sdk/search.ts b/src/sdk/search.ts index 6ad0af77..ff688524 100644 --- a/src/sdk/search.ts +++ b/src/sdk/search.ts @@ -2,13 +2,13 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { SDKHooks } from "../hooks"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings"; -import { HTTPClient } from "../lib/http"; -import * as schemas$ from "../lib/schemas"; -import { ClientSDK, RequestOptions } from "../lib/sdks"; -import * as models from "../models"; +import { SDKHooks } from "../hooks/hooks.js"; +import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import { HTTPClient } from "../lib/http.js"; +import * as schemas$ from "../lib/schemas.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as models from "../models/index.js"; export class Search extends ClientSDK { private readonly options$: SDKOptions & { hooks?: SDKHooks }; diff --git a/src/sdk/server.ts b/src/sdk/server.ts index ed1c76b1..53d4aa25 100644 --- a/src/sdk/server.ts +++ b/src/sdk/server.ts @@ -2,13 +2,13 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { SDKHooks } from "../hooks"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings"; -import { HTTPClient } from "../lib/http"; -import * as schemas$ from "../lib/schemas"; -import { ClientSDK, RequestOptions } from "../lib/sdks"; -import * as models from "../models"; +import { SDKHooks } from "../hooks/hooks.js"; +import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import { HTTPClient } from "../lib/http.js"; +import * as schemas$ from "../lib/schemas.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as models from "../models/index.js"; export class Server extends ClientSDK { private readonly options$: SDKOptions & { hooks?: SDKHooks }; @@ -38,10 +38,10 @@ export class Server extends ClientSDK { } /** - * Server Capabilities + * Get Server Capabilities * * @remarks - * Server Capabilities + * Get Server Capabilities */ async getServerCapabilities( options?: RequestOptions diff --git a/src/sdk/sessions.ts b/src/sdk/sessions.ts index 461e1c98..ae8b34cd 100644 --- a/src/sdk/sessions.ts +++ b/src/sdk/sessions.ts @@ -2,13 +2,16 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { SDKHooks } from "../hooks"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; -import { encodeSimple as encodeSimple$ } from "../lib/encodings"; -import { HTTPClient } from "../lib/http"; -import * as schemas$ from "../lib/schemas"; -import { ClientSDK, RequestOptions } from "../lib/sdks"; -import * as models from "../models"; +import { SDKHooks } from "../hooks/hooks.js"; +import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import { HTTPClient } from "../lib/http.js"; +import * as schemas$ from "../lib/schemas.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as models from "../models/index.js"; export class Sessions extends ClientSDK { private readonly options$: SDKOptions & { hooks?: SDKHooks }; @@ -104,14 +107,38 @@ export class Sessions extends ClientSDK { * @remarks * This will Retrieve a listing of all history views. */ - async getSessionHistory(options?: RequestOptions): Promise { + async getSessionHistory( + sort?: string | undefined, + accountId?: number | undefined, + filter?: models.Filter | undefined, + librarySectionID?: number | undefined, + options?: RequestOptions + ): Promise { + const input$: models.GetSessionHistoryRequest = { + sort: sort, + accountId: accountId, + filter: filter, + librarySectionID: librarySectionID, + }; const headers$ = new Headers(); headers$.set("user-agent", SDK_METADATA.userAgent); headers$.set("Accept", "application/json"); + const payload$ = schemas$.parse( + input$, + (value$) => models.GetSessionHistoryRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = null; + const path$ = this.templateURLComponent("/status/sessions/history/all")(); - const query$ = ""; + const query$ = encodeFormQuery$({ + accountId: payload$.accountId, + filter: payload$.filter, + librarySectionID: payload$.librarySectionID, + sort: payload$.sort, + }); let security$; if (typeof this.options$.accessToken === "function") { @@ -137,6 +164,7 @@ export class Sessions extends ClientSDK { path: path$, headers: headers$, query: query$, + body: body$, }, options ); diff --git a/src/sdk/statistics.ts b/src/sdk/statistics.ts index acfed0bd..d6282083 100644 --- a/src/sdk/statistics.ts +++ b/src/sdk/statistics.ts @@ -2,13 +2,13 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { SDKHooks } from "../hooks"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings"; -import { HTTPClient } from "../lib/http"; -import * as schemas$ from "../lib/schemas"; -import { ClientSDK, RequestOptions } from "../lib/sdks"; -import * as models from "../models"; +import { SDKHooks } from "../hooks/hooks.js"; +import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import { HTTPClient } from "../lib/http.js"; +import * as schemas$ from "../lib/schemas.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as models from "../models/index.js"; export class Statistics extends ClientSDK { private readonly options$: SDKOptions & { hooks?: SDKHooks }; @@ -113,4 +113,158 @@ export class Statistics extends ClientSDK { return result$; } + + /** + * Get Resources Statistics + * + * @remarks + * This will return the resources for the server + */ + async getResourcesStatistics( + timespan?: number | undefined, + options?: RequestOptions + ): Promise { + const input$: models.GetResourcesStatisticsRequest = { + timespan: timespan, + }; + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input$, + (value$) => models.GetResourcesStatisticsRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = null; + + const path$ = this.templateURLComponent("/statistics/resources")(); + + const query$ = encodeFormQuery$({ + Timespan: payload$.Timespan, + }); + + let security$; + if (typeof this.options$.accessToken === "function") { + security$ = { accessToken: await this.options$.accessToken() }; + } else if (this.options$.accessToken) { + security$ = { accessToken: this.options$.accessToken }; + } else { + security$ = {}; + } + const context = { + operationID: "getResourcesStatistics", + oAuth2Scopes: [], + securitySource: this.options$.accessToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { context, errorCodes: ["400", "401", "4XX", "5XX"] }; + const request$ = this.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request$, doOptions); + + const responseFields$ = { + ContentType: response.headers.get("content-type") ?? "application/octet-stream", + StatusCode: response.status, + RawResponse: response, + Headers: {}, + }; + + const [result$] = await this.matcher() + .json(200, models.GetResourcesStatisticsResponse$, { key: "object" }) + .fail([400, "4XX", "5XX"]) + .json(401, models.GetResourcesStatisticsStatisticsResponseBody$, { err: true }) + .match(response, { extraFields: responseFields$ }); + + return result$; + } + + /** + * Get Bandwidth Statistics + * + * @remarks + * This will return the bandwidth statistics for the server + */ + async getBandwidthStatistics( + timespan?: number | undefined, + options?: RequestOptions + ): Promise { + const input$: models.GetBandwidthStatisticsRequest = { + timespan: timespan, + }; + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input$, + (value$) => models.GetBandwidthStatisticsRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = null; + + const path$ = this.templateURLComponent("/statistics/bandwidth")(); + + const query$ = encodeFormQuery$({ + Timespan: payload$.Timespan, + }); + + let security$; + if (typeof this.options$.accessToken === "function") { + security$ = { accessToken: await this.options$.accessToken() }; + } else if (this.options$.accessToken) { + security$ = { accessToken: this.options$.accessToken }; + } else { + security$ = {}; + } + const context = { + operationID: "getBandwidthStatistics", + oAuth2Scopes: [], + securitySource: this.options$.accessToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { context, errorCodes: ["400", "401", "4XX", "5XX"] }; + const request$ = this.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request$, doOptions); + + const responseFields$ = { + ContentType: response.headers.get("content-type") ?? "application/octet-stream", + StatusCode: response.status, + RawResponse: response, + Headers: {}, + }; + + const [result$] = await this.matcher() + .json(200, models.GetBandwidthStatisticsResponse$, { key: "object" }) + .fail([400, "4XX", "5XX"]) + .json(401, models.GetBandwidthStatisticsStatisticsResponseBody$, { err: true }) + .match(response, { extraFields: responseFields$ }); + + return result$; + } } diff --git a/src/sdk/updater.ts b/src/sdk/updater.ts index 7836cf7a..fde9335b 100644 --- a/src/sdk/updater.ts +++ b/src/sdk/updater.ts @@ -2,13 +2,13 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { SDKHooks } from "../hooks"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings"; -import { HTTPClient } from "../lib/http"; -import * as schemas$ from "../lib/schemas"; -import { ClientSDK, RequestOptions } from "../lib/sdks"; -import * as models from "../models"; +import { SDKHooks } from "../hooks/hooks.js"; +import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import { HTTPClient } from "../lib/http.js"; +import * as schemas$ from "../lib/schemas.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as models from "../models/index.js"; export class Updater extends ClientSDK { private readonly options$: SDKOptions & { hooks?: SDKHooks }; diff --git a/src/sdk/video.ts b/src/sdk/video.ts index 707d360d..57cb887e 100644 --- a/src/sdk/video.ts +++ b/src/sdk/video.ts @@ -2,13 +2,13 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { SDKHooks } from "../hooks"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings"; -import { HTTPClient } from "../lib/http"; -import * as schemas$ from "../lib/schemas"; -import { ClientSDK, RequestOptions } from "../lib/sdks"; -import * as models from "../models"; +import { SDKHooks } from "../hooks/hooks.js"; +import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import { HTTPClient } from "../lib/http.js"; +import * as schemas$ from "../lib/schemas.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as models from "../models/index.js"; export class Video extends ClientSDK { private readonly options$: SDKOptions & { hooks?: SDKHooks }; diff --git a/src/sdk/watchlist.ts b/src/sdk/watchlist.ts index dbeda109..f449508e 100644 --- a/src/sdk/watchlist.ts +++ b/src/sdk/watchlist.ts @@ -2,16 +2,17 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -import { SDKHooks } from "../hooks"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; +import { SDKHooks } from "../hooks/hooks.js"; +import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; import { encodeFormQuery as encodeFormQuery$, encodeSimple as encodeSimple$, -} from "../lib/encodings"; -import { HTTPClient } from "../lib/http"; -import * as schemas$ from "../lib/schemas"; -import { ClientSDK, RequestOptions } from "../lib/sdks"; -import * as models from "../models"; +} from "../lib/encodings.js"; +import { HTTPClient } from "../lib/http.js"; +import * as schemas$ from "../lib/schemas.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import { GetWatchlistOpServerList } from "../models/getwatchlistop.js"; +import * as models from "../models/index.js"; export class Watchlist extends ClientSDK { private readonly options$: SDKOptions & { hooks?: SDKHooks }; @@ -63,9 +64,7 @@ export class Watchlist extends ClientSDK { const body$ = null; const baseURL$ = options?.serverURL || - this.templateURLComponent(models.GetWatchlistOpServerList[0], { - charEncoding: "percent", - })(); + this.templateURLComponent(GetWatchlistOpServerList[0], { charEncoding: "percent" })(); const pathParams$ = { filter: encodeSimple$("filter", payload$.filter, { diff --git a/src/types/index.ts b/src/types/index.ts index 42fcfd24..374373e9 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -2,9 +2,9 @@ * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. */ -export { RFCDate } from "./rfcdate"; -export { blobLikeSchema, isBlobLike } from "./blobs"; -export type { Paginator, PageIterator } from "./operations"; -export { createPageIterator } from "./operations"; -export { catchUnrecognizedEnum } from "./enums"; -export type { OpenEnum, ClosedEnum, Unrecognized } from "./enums"; +export { RFCDate } from "./rfcdate.js"; +export { blobLikeSchema, isBlobLike } from "./blobs.js"; +export type { Paginator, PageIterator } from "./operations.js"; +export { createPageIterator } from "./operations.js"; +export { catchUnrecognizedEnum } from "./enums.js"; +export type { OpenEnum, ClosedEnum, Unrecognized } from "./enums.js";