From 5e8618aa6f51a1f73d8f9b6ff49b44f7d77152da Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 28 Jun 2024 00:01:31 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.322.1 --- .speakeasy/workflow.lock | 10 +- RELEASES.md | 10 + codeSamples.yaml | 1662 +++++++++++++++++++------------------- 3 files changed, 846 insertions(+), 836 deletions(-) diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 92c0aae5..b6fa82a8 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.321.0 +speakeasyVersion: 1.322.1 sources: my-source: sourceNamespace: my-source - sourceRevisionDigest: sha256:5758e21e89f872ed52663d598badd275255cca6b21e5a903ce406cf5924e7965 - sourceBlobDigest: sha256:669044232406f6e199fe72bd88042134c31b46046c0eed7ed23a99f7ee779cdb + sourceRevisionDigest: sha256:617b231ec06784c7c429722a89113688d8f1bbf52cbe90b317a9f0d2d6187954 + sourceBlobDigest: sha256:411c26e39b0d81232853f6d2a5a4ad0945f830f96346cb58b3b8d41c15bc243b tags: - latest - main @@ -11,8 +11,8 @@ targets: plexjs: source: my-source sourceNamespace: my-source - sourceRevisionDigest: sha256:5758e21e89f872ed52663d598badd275255cca6b21e5a903ce406cf5924e7965 - sourceBlobDigest: sha256:669044232406f6e199fe72bd88042134c31b46046c0eed7ed23a99f7ee779cdb + sourceRevisionDigest: sha256:617b231ec06784c7c429722a89113688d8f1bbf52cbe90b317a9f0d2d6187954 + sourceBlobDigest: sha256:411c26e39b0d81232853f6d2a5a4ad0945f830f96346cb58b3b8d41c15bc243b outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/RELEASES.md b/RELEASES.md index 55b275d7..9d07ba28 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -868,4 +868,14 @@ Based on: ### Generated - [typescript v0.18.0] . ### Releases +- [NPM v0.18.0] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.18.0 - . + +## 2024-06-28 00:01:08 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.322.1 (2.354.2) 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 e7f28e89..dd040dca 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"]["/devices"]["get"] + - target: $["paths"]["/status/sessions"]["get"] update: x-codeSamples: - lang: typescript - label: getDevices + label: getSessions source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -17,18 +17,18 @@ actions: }); async function run() { - const result = await plexAPI.server.getDevices(); + const result = await plexAPI.sessions.getSessions(); // Handle the result console.log(result) } run(); - - target: $["paths"]["/:/scrobble"]["get"] + - target: $["paths"]["/"]["get"] update: x-codeSamples: - lang: typescript - label: markPlayed + label: getServerCapabilities source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -38,524 +38,7 @@ actions: }); async function run() { - const result = await plexAPI.media.markPlayed(59398); - - // 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"]["/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"]["/updater/status"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getUpdateStatus - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.updater.getUpdateStatus(); - - // 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"]["/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"]["/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"]["/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"]["/playlists/{playlistID}"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getPlaylist - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.getPlaylist(4109.48); - - // 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"]["/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"]["/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"]["/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"]["/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"]["/:/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"]["/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"]["/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/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"]["/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"]["/playlists/{playlistID}/items"]["delete"] - update: - x-codeSamples: - - lang: typescript - label: clearPlaylistContents - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.clearPlaylistContents(1893.18); - - // 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/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"]["/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"]["/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"]["/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, "", ""); + const result = await plexAPI.server.getServerCapabilities(); // Handle the result console.log(result) @@ -600,32 +83,11 @@ actions: } run(); - - target: $["paths"]["/hubs/sections/{sectionId}"]["get"] + - target: $["paths"]["/home"]["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"]["/search"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getSearchResults + label: getHomeData source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -635,7 +97,7 @@ actions: }); async function run() { - const result = await plexAPI.search.getSearchResults("110"); + const result = await plexAPI.plex.getHomeData(); // Handle the result console.log(result) @@ -688,48 +150,6 @@ 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"]["/:/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: @@ -751,6 +171,341 @@ actions: 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"]["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"]["/playlists/{playlistID}"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getPlaylist + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.playlists.getPlaylist(4109.48); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/updater/status"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getUpdateStatus + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.updater.getUpdateStatus(); + + // 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"]["/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"]["/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"]["/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"]["/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"]["/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"]["/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"]["/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"]["/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"]["/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"]["/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"]["/pins/{pinID}"]["get"] update: @@ -793,11 +548,32 @@ actions: } run(); - - target: $["paths"]["/library/sections/{sectionId}"]["delete"] + - target: $["paths"]["/library/sections/{sectionId}"]["get"] update: x-codeSamples: - lang: typescript - label: deleteLibrary + 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"]["/library/all/top"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getTopWatchedContent source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -807,18 +583,18 @@ actions: }); async function run() { - const result = await plexAPI.library.deleteLibrary(1000); + const result = await plexAPI.library.getTopWatchedContent(505531, 1); // Handle the result console.log(result) } run(); - - target: $["paths"]["/playlists/{playlistID}"]["delete"] + - target: $["paths"]["/library/onDeck"]["get"] update: x-codeSamples: - lang: typescript - label: deletePlaylist + label: getOnDeck source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -828,18 +604,18 @@ actions: }); async function run() { - const result = await plexAPI.playlists.deletePlaylist(216.22); + const result = await plexAPI.library.getOnDeck(); // Handle the result console.log(result) } run(); - - target: $["paths"]["/"]["get"] + - target: $["paths"]["/:/scrobble"]["get"] update: x-codeSamples: - lang: typescript - label: getServerCapabilities + label: markPlayed source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -849,18 +625,39 @@ actions: }); async function run() { - const result = await plexAPI.server.getServerCapabilities(); + const result = await plexAPI.media.markPlayed(59398); // Handle the result console.log(result) } run(); - - target: $["paths"]["/:/unscrobble"]["get"] + - target: $["paths"]["/butler/{taskName}"]["post"] update: x-codeSamples: - lang: typescript - label: markUnplayed + 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"]["/playlists/{playlistID}/items"]["delete"] + update: + x-codeSamples: + - lang: typescript + label: clearPlaylistContents source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -870,18 +667,39 @@ actions: }); async function run() { - const result = await plexAPI.media.markUnplayed(59398); + const result = await plexAPI.playlists.clearPlaylistContents(1893.18); // Handle the result console.log(result) } run(); - - target: $["paths"]["/hubs/search"]["get"] + - target: $["paths"]["/playlists/upload"]["post"] update: x-codeSamples: - lang: typescript - label: performSearch + 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"]["/identity"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getServerIdentity source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -891,18 +709,60 @@ actions: }); async function run() { - const result = await plexAPI.search.performSearch("dylan", 1516.53, 5); + const result = await plexAPI.server.getServerIdentity(); // Handle the result console.log(result) } run(); - - target: $["paths"]["/playlists/{playlistID}/items"]["get"] + - target: $["paths"]["/library/sections/{sectionId}/{tag}"]["get"] update: x-codeSamples: - lang: typescript - label: getPlaylistContents + 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"]["/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"; @@ -912,39 +772,18 @@ actions: }); async function run() { - const result = await plexAPI.playlists.getPlaylistContents(5004.46, 9403.59); + 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"]["/updater/check"]["put"] + - target: $["paths"]["/statistics/media"]["get"] 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"]["/statistics/bandwidth"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getBandwidthStatistics + label: getStatistics source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -954,20 +793,20 @@ actions: }); async function run() { - const result = await plexAPI.statistics.getBandwidthStatistics(4); + const result = await plexAPI.statistics.getStatistics(4); // Handle the result console.log(result) } run(); - - target: $["paths"]["/status/sessions/history/all"]["get"] + - target: $["paths"]["/library/sections/watchlist/{filter}"]["get"] update: x-codeSamples: - lang: typescript - label: getSessionHistory + label: getWatchlist source: |- - import { PlexAPI } from "@lukehagar/plexjs"; + import { PathParamFilter, PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", @@ -975,7 +814,10 @@ actions: }); async function run() { - const result = await plexAPI.sessions.getSessionHistory("", 1, {}, 12); + const result = await plexAPI.watchlist.getWatchlist({ + filter: PathParamFilter.Released, + xPlexToken: "", + }); // Handle the result console.log(result) @@ -1011,11 +853,11 @@ actions: } run(); - - target: $["paths"]["/:/progress"]["post"] + - target: $["paths"]["/library/sections/{sectionId}/refresh"]["get"] update: x-codeSamples: - lang: typescript - label: updatePlayProgress + label: refreshLibrary source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -1025,70 +867,7 @@ actions: }); async function run() { - const result = await plexAPI.media.updatePlayProgress("", 90000, "played"); - - // 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"]["/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"]["/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"); + const result = await plexAPI.library.refreshLibrary(934.16); // Handle the result console.log(result) @@ -1118,13 +897,13 @@ actions: } run(); - - target: $["paths"]["/updater/apply"]["put"] + - target: $["paths"]["/:/timeline"]["get"] update: x-codeSamples: - lang: typescript - label: applyUpdates + label: getTimeline source: |- - import { PlexAPI, Skip, Tonight } from "@lukehagar/plexjs"; + import { PlexAPI, State } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", @@ -1132,18 +911,29 @@ actions: }); async function run() { - const result = await plexAPI.updater.applyUpdates(Tonight.One, Skip.One); + 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"] + - target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"] update: x-codeSamples: - lang: typescript - label: startAllTasks + label: getMetadataChildren source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -1153,18 +943,18 @@ actions: }); async function run() { - const result = await plexAPI.butler.startAllTasks(); + const result = await plexAPI.library.getMetadataChildren(1539.14, ""); // Handle the result console.log(result) } run(); - - target: $["paths"]["/library/metadata/{ratingKey}"]["get"] + - target: $["paths"]["/:/progress"]["post"] update: x-codeSamples: - lang: typescript - label: getMetadata + label: updatePlayProgress source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -1174,18 +964,39 @@ actions: }); async function run() { - const result = await plexAPI.library.getMetadata(8382.31); + const result = await plexAPI.media.updatePlayProgress("", 90000, "played"); // Handle the result console.log(result) } run(); - - target: $["paths"]["/library/hashes"]["get"] + - target: $["paths"]["/hubs/sections/{sectionId}"]["get"] update: x-codeSamples: - lang: typescript - label: getFileHash + 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/{playlistID}/items"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getPlaylistContents source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -1195,18 +1006,18 @@ actions: }); async function run() { - const result = await plexAPI.library.getFileHash("file://C:\Image.png&type=13", 4462.17); + const result = await plexAPI.playlists.getPlaylistContents(5004.46, 9403.59); // Handle the result console.log(result) } run(); - - target: $["paths"]["/library/all/top"]["get"] + - target: $["paths"]["/:/prefs"]["get"] update: x-codeSamples: - lang: typescript - label: getTopWatchedContent + label: getServerPreferences source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -1216,18 +1027,18 @@ actions: }); async function run() { - const result = await plexAPI.library.getTopWatchedContent(505531, 1); + const result = await plexAPI.server.getServerPreferences(); // Handle the result console.log(result) } run(); - - target: $["paths"]["/transcode/sessions"]["get"] + - target: $["paths"]["/library/recentlyAdded"]["get"] update: x-codeSamples: - lang: typescript - label: getTranscodeSessions + label: getRecentlyAdded source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -1237,18 +1048,18 @@ actions: }); async function run() { - const result = await plexAPI.sessions.getTranscodeSessions(); + const result = await plexAPI.library.getRecentlyAdded(); // Handle the result console.log(result) } run(); - - target: $["paths"]["/butler"]["get"] + - target: $["paths"]["/activities/{activityUUID}"]["delete"] update: x-codeSamples: - lang: typescript - label: getButlerTasks + label: cancelServerActivities source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -1258,39 +1069,18 @@ actions: }); async function run() { - const result = await plexAPI.butler.getButlerTasks(); + const result = await plexAPI.activities.cancelServerActivities("25b71ed5-0f9d-461c-baa7-d404e9e10d3e"); // Handle the result console.log(result) } run(); - - target: $["paths"]["/butler/{taskName}"]["delete"] + - target: $["paths"]["/library/sections/{sectionId}"]["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"]["/status/sessions"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getSessions + label: deleteLibrary source: |- import { PlexAPI } from "@lukehagar/plexjs"; @@ -1300,91 +1090,7 @@ actions: }); async function run() { - const result = await plexAPI.sessions.getSessions(); - - // 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"]["/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/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}/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); + const result = await plexAPI.library.deleteLibrary(1000); // Handle the result console.log(result) @@ -1411,4 +1117,298 @@ 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"]["/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"]["/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"]["/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"]["/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"]["/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"]["/transcode/sessions"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getTranscodeSessions + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "Postman", + }); + + async function run() { + const result = await plexAPI.sessions.getTranscodeSessions(); + + // 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"]["/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"]["/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/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/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"]["/:/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"]["/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();