From ead0a8773c5cf4456b3bd0687e87199fb9020030 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 1 Oct 2024 00:12:18 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.6 --- .speakeasy/gen.lock | 198 +- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 12 +- FUNCTIONS.md | 8 +- README.md | 131 +- RELEASES.md | 12 +- USAGE.md | 6 +- codeSamples.yaml | 1706 +++++++++++- .../errors/getrecentlyaddedbadrequest.md | 18 - .../models/errors/getrecentlyaddederrors.md | 21 - ...d => getrecentlyaddedlibrarybadrequest.md} | 6 +- .../errors/getrecentlyaddedlibraryerrors.md | 16 +- .../getrecentlyaddedlibrarylibraryerrors.md | 21 + .../getrecentlyaddedlibraryunauthorized.md | 18 + docs/sdk/models/operations/action.md | 19 + docs/sdk/models/operations/activedirection.md | 19 + .../operations/addplaylistcontentsrequest.md | 2 +- .../operations/addplaylistcontentsresponse.md | 2 +- .../models/operations/applyupdatesresponse.md | 2 +- .../models/operations/autoselectsubtitle.md | 10 +- docs/sdk/models/operations/billing.md | 2 +- .../cancelserveractivitiesresponse.md | 2 +- .../operations/checkforupdatesresponse.md | 2 +- .../clearplaylistcontentsrequest.md | 2 +- .../clearplaylistcontentsresponse.md | 2 +- docs/sdk/models/operations/collection.md | 17 + docs/sdk/models/operations/connections.md | 28 +- .../operations/createplaylistrequest.md | 4 +- .../operations/createplaylistresponse.md | 2 +- .../sdk/models/operations/defaultdirection.md | 19 + .../defaultsubtitleaccessibility.md | 12 +- .../operations/defaultsubtitleforced.md | 10 +- .../operations/deletelibraryresponse.md | 2 +- .../operations/deleteplaylistrequest.md | 2 +- .../operations/deleteplaylistresponse.md | 2 +- docs/sdk/models/operations/director.md | 4 +- .../operations/enablepapertrailresponse.md | 2 +- docs/sdk/models/operations/feature.md | 27 +- docs/sdk/models/operations/features.md | 43 +- docs/sdk/models/operations/field.md | 16 +- docs/sdk/models/operations/fieldtype.md | 6 +- docs/sdk/models/operations/filter.md | 2 +- docs/sdk/models/operations/flattenseasons.md | 16 + docs/sdk/models/operations/force.md | 2 +- docs/sdk/models/operations/genre.md | 4 +- docs/sdk/models/operations/geodata.md | 4 +- .../operations/getalllibrariesdirectory.md | 44 +- .../getalllibrariesmediacontainer.md | 4 +- .../operations/getalllibrariesresponse.md | 4 +- .../operations/getalllibrariesresponsebody.md | 4 +- .../operations/getavailableclientsresponse.md | 2 +- .../getbandwidthstatisticsresponse.md | 2 +- .../operations/getbutlertasksresponse.md | 2 +- .../operations/getcompanionsdataresponse.md | 2 +- .../models/operations/getdevicesresponse.md | 2 +- .../models/operations/getfilehashresponse.md | 2 +- .../models/operations/getgeodatageodata.md | 4 +- .../models/operations/getgeodataresponse.md | 4 +- .../operations/getglobalhubsresponse.md | 2 +- .../models/operations/gethomedataresponse.md | 2 +- .../operations/getlibrarydetailsfield.md | 23 + .../operations/getlibrarydetailsfieldtype.md | 24 + .../getlibrarydetailsmediacontainer.md | 2 +- .../operations/getlibrarydetailsoperator.md | 19 + .../operations/getlibrarydetailsresponse.md | 2 +- .../operations/getlibrarydetailssort.md | 27 + .../operations/getlibrarydetailstype.md | 4 +- .../operations/getlibraryhubsrequest.md | 2 +- .../operations/getlibraryhubsresponse.md | 2 +- .../getlibraryitemsactivedirection.md | 20 + .../operations/getlibraryitemscollection.md | 17 + .../getlibraryitemsdefaultdirection.md | 20 + .../models/operations/getlibraryitemsfield.md | 23 + .../operations/getlibraryitemsfieldtype.md | 24 + .../operations/getlibraryitemsfilter.md | 25 + .../getlibraryitemsflattenseasons.md | 16 + .../operations/getlibraryitemshasthumbnail.md | 16 + .../models/operations/getlibraryitemsimage.md | 21 + .../getlibraryitemslibraryactivedirection.md | 20 + .../getlibraryitemslibrarydefaultdirection.md | 20 + .../operations/getlibraryitemslibraryfield.md | 23 + .../getlibraryitemslibraryfieldtype.md | 24 + .../getlibraryitemslibraryfilter.md | 25 + .../getlibraryitemslibraryoperator.md | 19 + .../getlibraryitemslibraryresponse200type.md | 19 + .../getlibraryitemslibraryresponsetype.md | 59 + .../operations/getlibraryitemslibrarysort.md | 35 + .../operations/getlibraryitemslibrarytype.md | 21 + .../models/operations/getlibraryitemsmedia.md | 93 +- .../getlibraryitemsmediacontainer.md | 269 +- .../operations/getlibraryitemsmediaguid.md | 17 + .../models/operations/getlibraryitemsmeta.md | 72 + .../operations/getlibraryitemsmetadata.md | 152 +- .../getlibraryitemsmetadatarating.md | 21 + .../operations/getlibraryitemsoperator.md | 19 + .../getlibraryitemsoptimizedforstreaming.md | 17 + .../models/operations/getlibraryitemspart.md | 69 +- .../getlibraryitemsqueryparamincludemeta.md | 20 + .../getlibraryitemsqueryparamtype.md | 26 + .../operations/getlibraryitemsrequest.md | 20 +- .../operations/getlibraryitemsresponse.md | 228 +- .../operations/getlibraryitemsresponsebody.md | 224 +- .../models/operations/getlibraryitemsrole.md | 19 +- .../operations/getlibraryitemsshowordering.md | 27 + .../models/operations/getlibraryitemssort.md | 35 + .../operations/getlibraryitemsstream.md | 91 + .../models/operations/getlibraryitemstype.md | 59 + .../getlibraryitemsultrablurcolors.md | 23 + .../getmediaprovidersmediacontainer.md | 21 +- .../operations/getmediaprovidersresponse.md | 24 +- .../getmediaprovidersresponsebody.md | 23 +- .../operations/getmetadatabyratingkeypart.md | 26 +- .../getmetadatabyratingkeyresponse.md | 2 +- .../getmetadatabyratingkeystream.md | 79 + .../operations/getmetadatachildrenrequest.md | 2 +- .../operations/getmetadatachildrenresponse.md | 2 +- .../operations/getmyplexaccountresponse.md | 2 +- .../models/operations/getondeckresponse.md | 2 +- .../operations/getpinauthpincontainer.md | 8 +- docs/sdk/models/operations/getpinglobals.md | 10 +- docs/sdk/models/operations/getpinrequest.md | 17 +- docs/sdk/models/operations/getpinresponse.md | 4 +- .../getplaylistcontentsqueryparamtype.md | 14 +- .../operations/getplaylistcontentsrequest.md | 4 +- .../operations/getplaylistcontentsresponse.md | 2 +- .../models/operations/getplaylistrequest.md | 2 +- .../models/operations/getplaylistresponse.md | 2 +- .../models/operations/getplaylistsresponse.md | 2 +- .../getrecentlyaddedactivedirection.md | 20 + .../getrecentlyaddeddefaultdirection.md | 20 + .../operations/getrecentlyaddedfield.md | 23 + .../operations/getrecentlyaddedfieldtype.md | 24 + .../operations/getrecentlyaddedfilter.md | 25 + .../getrecentlyaddedhubsresponsetype.md | 19 + .../operations/getrecentlyaddedhubstype.md | 21 + .../operations/getrecentlyaddedimage.md | 21 + .../getrecentlyaddedlibrarycountry.md | 17 + .../getrecentlyaddedlibrarydirector.md | 17 + .../getrecentlyaddedlibraryfilter.md | 25 + .../getrecentlyaddedlibrarygenre.md | 17 + .../getrecentlyaddedlibrarymedia.md | 58 + .../getrecentlyaddedlibrarymediacontainer.md | 165 ++ .../getrecentlyaddedlibrarymetadata.md | 129 + .../operations/getrecentlyaddedlibrarypart.md | 34 + .../getrecentlyaddedlibraryrequest.md | 42 + .../getrecentlyaddedlibraryresponse.md | 166 ++ .../getrecentlyaddedlibraryresponsebody.md | 158 ++ .../operations/getrecentlyaddedlibraryrole.md | 17 + .../operations/getrecentlyaddedlibrarytype.md | 55 + .../getrecentlyaddedlibrarywriter.md | 17 + .../getrecentlyaddedmediacontainer.md | 303 ++- .../operations/getrecentlyaddedmetadata.md | 348 ++- .../operations/getrecentlyaddedoperator.md | 19 + .../operations/getrecentlyaddedrequest.md | 11 +- .../operations/getrecentlyaddedresponse.md | 297 +- .../getrecentlyaddedresponsebody.md | 295 +- .../models/operations/getrecentlyaddedsort.md | 35 + .../models/operations/getrecentlyaddedtype.md | 59 + .../getrefreshlibrarymetadatarequest.md | 2 +- .../getrefreshlibrarymetadataresponse.md | 2 +- .../operations/getresizedphotorequest.md | 4 +- .../operations/getresizedphotoresponse.md | 2 +- .../getresourcesstatisticsresponse.md | 2 +- .../getsearchlibraryqueryparamtype.md | 27 + .../operations/getsearchlibraryrequest.md | 6 +- .../operations/getsearchlibraryresponse.md | 2 +- .../operations/getsearchresultsresponse.md | 2 +- .../operations/getserveractivitiesresponse.md | 2 +- .../getservercapabilitiesresponse.md | 2 +- .../operations/getserveridentityresponse.md | 2 +- .../operations/getserverlistresponse.md | 2 +- .../getserverpreferencesresponse.md | 2 +- .../operations/getserverresourcesglobals.md | 6 +- .../operations/getserverresourcesrequest.md | 18 +- .../operations/getserverresourcesresponse.md | 42 +- .../operations/getsessionhistoryresponse.md | 2 +- .../models/operations/getsessionsresponse.md | 2 +- .../getsourceconnectioninformationresponse.md | 2 +- .../operations/getstatisticsresponse.md | 2 +- .../models/operations/gettimelineresponse.md | 2 +- .../gettokenbypinidauthpincontainer.md | 8 +- .../operations/gettokenbypinidgeodata.md | 4 +- .../operations/gettokenbypinidglobals.md | 10 +- .../operations/gettokenbypinidrequest.md | 14 +- .../operations/gettokenbypinidresponse.md | 4 +- .../operations/gettokendetailsfeatures.md | 43 +- .../operations/gettokendetailsresponse.md | 15 +- .../gettokendetailsuserplexaccount.md | 20 +- .../gettopwatchedcontentqueryparamtype.md | 14 +- .../operations/gettopwatchedcontentrequest.md | 2 +- .../gettopwatchedcontentresponse.md | 2 +- .../gettranscodesessionsresponse.md | 2 +- .../operations/gettransienttokenresponse.md | 2 +- .../operations/getupdatestatusresponse.md | 2 +- .../operations/getuserfriendsresponse.md | 2 +- .../models/operations/getwatchlistrequest.md | 2 +- .../models/operations/getwatchlistresponse.md | 2 +- docs/sdk/models/operations/hasthumbnail.md | 16 + docs/sdk/models/operations/includedetails.md | 2 +- .../models/operations/includeexternalmedia.md | 2 +- docs/sdk/models/operations/includeguids.md | 10 +- docs/sdk/models/operations/includehttps.md | 10 +- docs/sdk/models/operations/includeipv6.md | 10 +- docs/sdk/models/operations/includemeta.md | 10 +- docs/sdk/models/operations/includerelay.md | 10 +- docs/sdk/models/operations/level.md | 2 +- .../sdk/models/operations/librarysectionid.md | 24 - docs/sdk/models/operations/libtype.md | 2 +- docs/sdk/models/operations/location.md | 4 +- docs/sdk/models/operations/loglineresponse.md | 2 +- .../models/operations/logmultilineresponse.md | 2 +- .../models/operations/mailingliststatus.md | 4 +- .../models/operations/markplayedresponse.md | 2 +- .../models/operations/markunplayedresponse.md | 2 +- docs/sdk/models/operations/media.md | 129 +- docs/sdk/models/operations/mediaguid.md | 17 + docs/sdk/models/operations/mediaprovider.md | 17 +- .../operations/mediareviewsvisibility.md | 12 +- docs/sdk/models/operations/meta.md | 68 + docs/sdk/models/operations/metadatarating.md | 21 + docs/sdk/models/operations/operator.md | 4 +- .../operations/optimizedforstreaming.md | 16 + docs/sdk/models/operations/part.md | 91 +- .../sdk/models/operations/pastsubscription.md | 2 +- .../models/operations/pathparamtaskname.md | 2 +- .../operations/performsearchresponse.md | 2 +- .../operations/performvoicesearchresponse.md | 2 +- docs/sdk/models/operations/plexdevice.md | 72 +- ...stuserssignindataauthenticationfeatures.md | 43 +- .../postuserssignindataautoselectsubtitle.md | 10 +- ...ssignindatadefaultsubtitleaccessibility.md | 12 +- ...ostuserssignindatadefaultsubtitleforced.md | 10 +- .../operations/postuserssignindatafeatures.md | 43 +- .../operations/postuserssignindataglobals.md | 10 +- .../postuserssignindatamailingliststatus.md | 2 +- ...stuserssignindatamediareviewsvisibility.md | 12 +- .../operations/postuserssignindatarequest.md | 12 +- .../operations/postuserssignindataresponse.md | 17 +- .../postuserssignindatauserplexaccount.md | 20 +- .../postuserssignindatauserprofile.md | 30 +- .../postuserssignindatawatchedindicator.md | 12 +- docs/sdk/models/operations/protocol.md | 18 + docs/sdk/models/operations/queryparamforce.md | 2 +- .../operations/queryparamincludemeta.md | 19 + .../operations/queryparamonlytransient.md | 2 +- docs/sdk/models/operations/queryparamtype.md | 14 +- docs/sdk/models/operations/role.md | 19 +- docs/sdk/models/operations/showordering.md | 27 + docs/sdk/models/operations/sort.md | 32 +- .../operations/startalltasksresponse.md | 2 +- .../sdk/models/operations/starttaskrequest.md | 2 +- .../models/operations/starttaskresponse.md | 2 +- .../startuniversaltranscoderesponse.md | 2 +- .../models/operations/stopalltasksresponse.md | 2 +- .../sdk/models/operations/stoptaskresponse.md | 2 +- .../stoptranscodesessionresponse.md | 2 +- docs/sdk/models/operations/stream.md | 114 +- docs/sdk/models/operations/taskname.md | 2 +- docs/sdk/models/operations/type.md | 14 +- docs/sdk/models/operations/ultrablurcolors.md | 23 + .../operations/updateplaylistrequest.md | 2 +- .../operations/updateplaylistresponse.md | 2 +- .../operations/updateplayprogressresponse.md | 2 +- .../operations/uploadplaylistrequest.md | 6 +- .../operations/uploadplaylistresponse.md | 2 +- docs/sdk/models/operations/userprofile.md | 30 +- .../sdk/models/operations/watchedindicator.md | 12 +- docs/sdk/models/operations/writer.md | 4 +- docs/sdks/activities/README.md | 45 +- docs/sdks/authentication/README.md | 130 +- docs/sdks/butler/README.md | 114 +- docs/sdks/hubs/README.md | 143 +- docs/sdks/library/README.md | 392 ++- docs/sdks/log/README.md | 68 +- docs/sdks/media/README.md | 114 +- docs/sdks/playlists/README.md | 215 +- docs/sdks/plex/README.md | 211 +- docs/sdks/plexapi/README.md | 25 +- docs/sdks/search/README.md | 68 +- docs/sdks/server/README.md | 212 +- docs/sdks/sessions/README.md | 91 +- docs/sdks/statistics/README.md | 68 +- docs/sdks/updater/README.md | 68 +- docs/sdks/video/README.md | 45 +- docs/sdks/watchlist/README.md | 22 +- jsr.json | 2 +- package-lock.json | 4 +- package.json | 2 +- src/funcs/activitiesCancelServerActivities.ts | 80 +- src/funcs/activitiesGetServerActivities.ts | 52 +- ...nticationGetSourceConnectionInformation.ts | 85 +- src/funcs/authenticationGetTokenDetails.ts | 56 +- src/funcs/authenticationGetTransientToken.ts | 83 +- .../authenticationPostUsersSignInData.ts | 97 +- src/funcs/butlerGetButlerTasks.ts | 52 +- src/funcs/butlerStartAllTasks.ts | 52 +- src/funcs/butlerStartTask.ts | 78 +- src/funcs/butlerStopAllTasks.ts | 52 +- src/funcs/butlerStopTask.ts | 78 +- src/funcs/hubsGetGlobalHubs.ts | 82 +- src/funcs/hubsGetLibraryHubs.ts | 89 +- src/funcs/hubsGetRecentlyAdded.ts | 138 + src/funcs/libraryDeleteLibrary.ts | 78 +- src/funcs/libraryGetAllLibraries.ts | 52 +- src/funcs/libraryGetFileHash.ts | 82 +- src/funcs/libraryGetLibraryDetails.ts | 88 +- src/funcs/libraryGetLibraryItems.ts | 97 +- src/funcs/libraryGetMetaDataByRatingKey.ts | 80 +- src/funcs/libraryGetMetadataChildren.ts | 91 +- src/funcs/libraryGetOnDeck.ts | 52 +- src/funcs/libraryGetRecentlyAdded.ts | 144 - src/funcs/libraryGetRecentlyAddedLibrary.ts | 146 + src/funcs/libraryGetRefreshLibraryMetadata.ts | 91 +- src/funcs/libraryGetSearchLibrary.ts | 91 +- src/funcs/libraryGetTopWatchedContent.ts | 84 +- src/funcs/logEnablePaperTrail.ts | 52 +- src/funcs/logLogLine.ts | 84 +- src/funcs/logLogMultiLine.ts | 72 +- src/funcs/mediaGetBannerImage.ts | 95 +- src/funcs/mediaGetThumbImage.ts | 95 +- src/funcs/mediaMarkPlayed.ts | 80 +- src/funcs/mediaMarkUnplayed.ts | 80 +- src/funcs/mediaUpdatePlayProgress.ts | 85 +- src/funcs/playlistsAddPlaylistContents.ts | 91 +- src/funcs/playlistsClearPlaylistContents.ts | 80 +- src/funcs/playlistsCreatePlaylist.ts | 88 +- src/funcs/playlistsDeletePlaylist.ts | 78 +- src/funcs/playlistsGetPlaylist.ts | 78 +- src/funcs/playlistsGetPlaylistContents.ts | 89 +- src/funcs/playlistsGetPlaylists.ts | 82 +- src/funcs/playlistsUpdatePlaylist.ts | 89 +- src/funcs/playlistsUploadPlaylist.ts | 81 +- src/funcs/plexGetCompanionsData.ts | 56 +- src/funcs/plexGetGeoData.ts | 46 +- src/funcs/plexGetHomeData.ts | 52 +- src/funcs/plexGetPin.ts | 95 +- src/funcs/plexGetServerResources.ts | 97 +- src/funcs/plexGetTokenByPinId.ts | 97 +- src/funcs/plexGetUserFriends.ts | 56 +- src/funcs/searchGetSearchResults.ts | 78 +- src/funcs/searchPerformSearch.ts | 82 +- src/funcs/searchPerformVoiceSearch.ts | 83 +- src/funcs/serverGetAvailableClients.ts | 52 +- src/funcs/serverGetDevices.ts | 54 +- src/funcs/serverGetMediaProviders.ts | 81 +- src/funcs/serverGetMyPlexAccount.ts | 52 +- src/funcs/serverGetResizedPhoto.ts | 92 +- src/funcs/serverGetServerCapabilities.ts | 52 +- src/funcs/serverGetServerIdentity.ts | 40 +- src/funcs/serverGetServerList.ts | 52 +- src/funcs/serverGetServerPreferences.ts | 52 +- src/funcs/sessionsGetSessionHistory.ts | 87 +- src/funcs/sessionsGetSessions.ts | 52 +- src/funcs/sessionsGetTranscodeSessions.ts | 52 +- src/funcs/sessionsStopTranscodeSession.ts | 80 +- src/funcs/statisticsGetBandwidthStatistics.ts | 82 +- src/funcs/statisticsGetResourcesStatistics.ts | 82 +- src/funcs/statisticsGetStatistics.ts | 80 +- src/funcs/updaterApplyUpdates.ts | 82 +- src/funcs/updaterCheckForUpdates.ts | 80 +- src/funcs/updaterGetUpdateStatus.ts | 52 +- src/funcs/videoGetTimeline.ts | 98 +- src/funcs/videoStartUniversalTranscode.ts | 112 +- src/funcs/watchlistGetWatchList.ts | 105 +- src/lib/config.ts | 30 +- src/lib/sdks.ts | 48 +- src/lib/security.ts | 2 +- src/sdk/authentication.ts | 6 +- src/sdk/hubs.ts | 18 + src/sdk/library.ts | 16 +- ...tlyadded.ts => getrecentlyaddedlibrary.ts} | 313 +-- src/sdk/models/errors/index.ts | 2 +- src/sdk/models/operations/getalllibraries.ts | 213 +- .../models/operations/getcompanionsdata.ts | 2 +- src/sdk/models/operations/getgeodata.ts | 10 +- .../models/operations/getlibrarydetails.ts | 194 +- src/sdk/models/operations/getlibraryitems.ts | 2382 +++++++++++++++-- .../models/operations/getmediaproviders.ts | 67 +- .../operations/getmetadatabyratingkey.ts | 107 +- src/sdk/models/operations/getpin.ts | 108 +- .../models/operations/getplaylistcontents.ts | 8 +- src/sdk/models/operations/getrecentlyadded.ts | 1974 ++++++++++++-- .../operations/getrecentlyaddedlibrary.ts | 1420 ++++++++++ src/sdk/models/operations/getsearchlibrary.ts | 38 +- .../models/operations/getserverresources.ts | 118 +- src/sdk/models/operations/gettokenbypinid.ts | 106 +- src/sdk/models/operations/gettokendetails.ts | 219 +- .../models/operations/gettopwatchedcontent.ts | 8 +- src/sdk/models/operations/getuserfriends.ts | 2 +- src/sdk/models/operations/index.ts | 1 + .../models/operations/postuserssignindata.ts | 307 ++- src/sdk/models/operations/uploadplaylist.ts | 7 + src/sdk/playlists.ts | 2 + src/sdk/plex.ts | 20 +- src/sdk/sdk.ts | 32 +- 395 files changed, 18599 insertions(+), 5928 deletions(-) delete mode 100644 docs/sdk/models/errors/getrecentlyaddedbadrequest.md delete mode 100644 docs/sdk/models/errors/getrecentlyaddederrors.md rename docs/sdk/models/errors/{getrecentlyaddedunauthorized.md => getrecentlyaddedlibrarybadrequest.md} (89%) create mode 100644 docs/sdk/models/errors/getrecentlyaddedlibrarylibraryerrors.md create mode 100644 docs/sdk/models/errors/getrecentlyaddedlibraryunauthorized.md create mode 100644 docs/sdk/models/operations/action.md create mode 100644 docs/sdk/models/operations/activedirection.md create mode 100644 docs/sdk/models/operations/collection.md create mode 100644 docs/sdk/models/operations/defaultdirection.md create mode 100644 docs/sdk/models/operations/flattenseasons.md create mode 100644 docs/sdk/models/operations/getlibrarydetailsfield.md create mode 100644 docs/sdk/models/operations/getlibrarydetailsfieldtype.md create mode 100644 docs/sdk/models/operations/getlibrarydetailsoperator.md create mode 100644 docs/sdk/models/operations/getlibrarydetailssort.md create mode 100644 docs/sdk/models/operations/getlibraryitemsactivedirection.md create mode 100644 docs/sdk/models/operations/getlibraryitemscollection.md create mode 100644 docs/sdk/models/operations/getlibraryitemsdefaultdirection.md create mode 100644 docs/sdk/models/operations/getlibraryitemsfield.md create mode 100644 docs/sdk/models/operations/getlibraryitemsfieldtype.md create mode 100644 docs/sdk/models/operations/getlibraryitemsfilter.md create mode 100644 docs/sdk/models/operations/getlibraryitemsflattenseasons.md create mode 100644 docs/sdk/models/operations/getlibraryitemshasthumbnail.md create mode 100644 docs/sdk/models/operations/getlibraryitemsimage.md create mode 100644 docs/sdk/models/operations/getlibraryitemslibraryactivedirection.md create mode 100644 docs/sdk/models/operations/getlibraryitemslibrarydefaultdirection.md create mode 100644 docs/sdk/models/operations/getlibraryitemslibraryfield.md create mode 100644 docs/sdk/models/operations/getlibraryitemslibraryfieldtype.md create mode 100644 docs/sdk/models/operations/getlibraryitemslibraryfilter.md create mode 100644 docs/sdk/models/operations/getlibraryitemslibraryoperator.md create mode 100644 docs/sdk/models/operations/getlibraryitemslibraryresponse200type.md create mode 100644 docs/sdk/models/operations/getlibraryitemslibraryresponsetype.md create mode 100644 docs/sdk/models/operations/getlibraryitemslibrarysort.md create mode 100644 docs/sdk/models/operations/getlibraryitemslibrarytype.md create mode 100644 docs/sdk/models/operations/getlibraryitemsmediaguid.md create mode 100644 docs/sdk/models/operations/getlibraryitemsmeta.md create mode 100644 docs/sdk/models/operations/getlibraryitemsmetadatarating.md create mode 100644 docs/sdk/models/operations/getlibraryitemsoperator.md create mode 100644 docs/sdk/models/operations/getlibraryitemsoptimizedforstreaming.md create mode 100644 docs/sdk/models/operations/getlibraryitemsqueryparamincludemeta.md create mode 100644 docs/sdk/models/operations/getlibraryitemsqueryparamtype.md create mode 100644 docs/sdk/models/operations/getlibraryitemsshowordering.md create mode 100644 docs/sdk/models/operations/getlibraryitemssort.md create mode 100644 docs/sdk/models/operations/getlibraryitemsstream.md create mode 100644 docs/sdk/models/operations/getlibraryitemstype.md create mode 100644 docs/sdk/models/operations/getlibraryitemsultrablurcolors.md create mode 100644 docs/sdk/models/operations/getmetadatabyratingkeystream.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedactivedirection.md create mode 100644 docs/sdk/models/operations/getrecentlyaddeddefaultdirection.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedfield.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedfieldtype.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedfilter.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedhubsresponsetype.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedhubstype.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedimage.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedlibrarycountry.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedlibrarydirector.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedlibraryfilter.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedlibrarygenre.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedlibrarymedia.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedlibrarymediacontainer.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedlibrarymetadata.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedlibrarypart.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedlibraryrequest.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedlibraryresponse.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedlibraryresponsebody.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedlibraryrole.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedlibrarytype.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedlibrarywriter.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedoperator.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedsort.md create mode 100644 docs/sdk/models/operations/getrecentlyaddedtype.md create mode 100644 docs/sdk/models/operations/getsearchlibraryqueryparamtype.md create mode 100644 docs/sdk/models/operations/hasthumbnail.md delete mode 100644 docs/sdk/models/operations/librarysectionid.md create mode 100644 docs/sdk/models/operations/mediaguid.md create mode 100644 docs/sdk/models/operations/meta.md create mode 100644 docs/sdk/models/operations/metadatarating.md create mode 100644 docs/sdk/models/operations/optimizedforstreaming.md create mode 100644 docs/sdk/models/operations/protocol.md create mode 100644 docs/sdk/models/operations/queryparamincludemeta.md create mode 100644 docs/sdk/models/operations/showordering.md create mode 100644 docs/sdk/models/operations/ultrablurcolors.md create mode 100644 src/funcs/hubsGetRecentlyAdded.ts delete mode 100644 src/funcs/libraryGetRecentlyAdded.ts create mode 100644 src/funcs/libraryGetRecentlyAddedLibrary.ts rename src/sdk/models/errors/{getrecentlyadded.ts => getrecentlyaddedlibrary.ts} (60%) create mode 100644 src/sdk/models/operations/getrecentlyaddedlibrary.ts diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 5a5c146a..e4c7919e 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: a6fee1797b2da7ccbaf7743772a40b56 + docChecksum: f12b653820ae77ca3b2820bc9459d866 docVersion: 0.0.3 - speakeasyVersion: 1.398.0 - generationVersion: 2.415.8 - releaseVersion: 0.23.5 - configChecksum: ead0f7037e3e89a0067174419516950a + speakeasyVersion: 1.405.6 + generationVersion: 2.428.1 + releaseVersion: 0.24.0 + configChecksum: 12acbc7182c6906e6ba67c064cf39c2c repoURL: https://github.com/LukeHagar/plexjs.git repoSubDirectory: . installationURL: https://github.com/LukeHagar/plexjs @@ -15,13 +15,14 @@ features: typescript: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.11 - core: 3.17.3 + core: 3.18.1 defaultEnabledRetries: 0.1.0 deprecations: 2.81.1 downloadStreams: 0.1.1 enumUnions: 0.1.0 + enums: 2.82.1 envVarSecurityUsage: 0.1.1 - errors: 2.82.2 + errors: 2.82.3 flattening: 2.81.1 globalSecurity: 2.82.11 globalSecurityCallbacks: 0.1.0 @@ -31,10 +32,10 @@ features: methodServerURLs: 2.82.1 nameOverrides: 2.81.2 nullables: 0.1.0 + openEnums: 0.1.1 responseFormat: 0.2.3 retries: 2.83.0 sdkHooks: 0.1.0 - unions: 2.85.7 generatedFiles: - .eslintrc.cjs - .gitattributes @@ -171,10 +172,10 @@ generatedFiles: - docs/sdk/models/errors/getplaylistsplaylistserrors.md - docs/sdk/models/errors/getplaylistsunauthorized.md - docs/sdk/models/errors/getplaylistunauthorized.md - - docs/sdk/models/errors/getrecentlyaddedbadrequest.md - - docs/sdk/models/errors/getrecentlyaddederrors.md + - docs/sdk/models/errors/getrecentlyaddedlibrarybadrequest.md - docs/sdk/models/errors/getrecentlyaddedlibraryerrors.md - - docs/sdk/models/errors/getrecentlyaddedunauthorized.md + - docs/sdk/models/errors/getrecentlyaddedlibrarylibraryerrors.md + - docs/sdk/models/errors/getrecentlyaddedlibraryunauthorized.md - docs/sdk/models/errors/getrefreshlibrarymetadatabadrequest.md - docs/sdk/models/errors/getrefreshlibrarymetadataerrors.md - docs/sdk/models/errors/getrefreshlibrarymetadatalibraryerrors.md @@ -336,6 +337,8 @@ generatedFiles: - docs/sdk/models/errors/uploadplaylistplaylistserrors.md - docs/sdk/models/errors/uploadplaylistunauthorized.md - docs/sdk/models/operations/account.md + - docs/sdk/models/operations/action.md + - docs/sdk/models/operations/activedirection.md - docs/sdk/models/operations/activity.md - docs/sdk/models/operations/addplaylistcontentsmediacontainer.md - docs/sdk/models/operations/addplaylistcontentsmetadata.md @@ -354,6 +357,7 @@ generatedFiles: - docs/sdk/models/operations/checkforupdatesresponse.md - docs/sdk/models/operations/clearplaylistcontentsrequest.md - docs/sdk/models/operations/clearplaylistcontentsresponse.md + - docs/sdk/models/operations/collection.md - docs/sdk/models/operations/connections.md - docs/sdk/models/operations/context.md - docs/sdk/models/operations/country.md @@ -363,6 +367,7 @@ generatedFiles: - docs/sdk/models/operations/createplaylistrequest.md - docs/sdk/models/operations/createplaylistresponse.md - docs/sdk/models/operations/createplaylistresponsebody.md + - docs/sdk/models/operations/defaultdirection.md - docs/sdk/models/operations/defaultsubtitleaccessibility.md - docs/sdk/models/operations/defaultsubtitleforced.md - docs/sdk/models/operations/deletelibraryrequest.md @@ -379,6 +384,7 @@ generatedFiles: - docs/sdk/models/operations/field.md - docs/sdk/models/operations/fieldtype.md - docs/sdk/models/operations/filter.md + - docs/sdk/models/operations/flattenseasons.md - docs/sdk/models/operations/force.md - docs/sdk/models/operations/friend.md - docs/sdk/models/operations/genre.md @@ -416,11 +422,15 @@ generatedFiles: - docs/sdk/models/operations/gethomedataresponse.md - docs/sdk/models/operations/gethomedataresponsebody.md - docs/sdk/models/operations/getlibrarydetailsdirectory.md + - docs/sdk/models/operations/getlibrarydetailsfield.md + - docs/sdk/models/operations/getlibrarydetailsfieldtype.md - docs/sdk/models/operations/getlibrarydetailsfilter.md - docs/sdk/models/operations/getlibrarydetailsmediacontainer.md + - docs/sdk/models/operations/getlibrarydetailsoperator.md - docs/sdk/models/operations/getlibrarydetailsrequest.md - docs/sdk/models/operations/getlibrarydetailsresponse.md - docs/sdk/models/operations/getlibrarydetailsresponsebody.md + - docs/sdk/models/operations/getlibrarydetailssort.md - docs/sdk/models/operations/getlibrarydetailstype.md - docs/sdk/models/operations/getlibraryhubscountry.md - docs/sdk/models/operations/getlibraryhubsdirector.md @@ -435,17 +445,48 @@ generatedFiles: - docs/sdk/models/operations/getlibraryhubsresponsebody.md - docs/sdk/models/operations/getlibraryhubsrole.md - docs/sdk/models/operations/getlibraryhubswriter.md + - docs/sdk/models/operations/getlibraryitemsactivedirection.md + - docs/sdk/models/operations/getlibraryitemscollection.md - docs/sdk/models/operations/getlibraryitemscountry.md + - docs/sdk/models/operations/getlibraryitemsdefaultdirection.md - docs/sdk/models/operations/getlibraryitemsdirector.md + - docs/sdk/models/operations/getlibraryitemsfield.md + - docs/sdk/models/operations/getlibraryitemsfieldtype.md + - docs/sdk/models/operations/getlibraryitemsfilter.md + - docs/sdk/models/operations/getlibraryitemsflattenseasons.md - docs/sdk/models/operations/getlibraryitemsgenre.md + - docs/sdk/models/operations/getlibraryitemshasthumbnail.md + - docs/sdk/models/operations/getlibraryitemsimage.md + - docs/sdk/models/operations/getlibraryitemslibraryactivedirection.md + - docs/sdk/models/operations/getlibraryitemslibrarydefaultdirection.md + - docs/sdk/models/operations/getlibraryitemslibraryfield.md + - docs/sdk/models/operations/getlibraryitemslibraryfieldtype.md + - docs/sdk/models/operations/getlibraryitemslibraryfilter.md + - docs/sdk/models/operations/getlibraryitemslibraryoperator.md + - docs/sdk/models/operations/getlibraryitemslibraryresponse200type.md + - docs/sdk/models/operations/getlibraryitemslibraryresponsetype.md + - docs/sdk/models/operations/getlibraryitemslibrarysort.md + - docs/sdk/models/operations/getlibraryitemslibrarytype.md - docs/sdk/models/operations/getlibraryitemsmedia.md - docs/sdk/models/operations/getlibraryitemsmediacontainer.md + - docs/sdk/models/operations/getlibraryitemsmediaguid.md + - docs/sdk/models/operations/getlibraryitemsmeta.md - docs/sdk/models/operations/getlibraryitemsmetadata.md + - docs/sdk/models/operations/getlibraryitemsmetadatarating.md + - docs/sdk/models/operations/getlibraryitemsoperator.md + - docs/sdk/models/operations/getlibraryitemsoptimizedforstreaming.md - docs/sdk/models/operations/getlibraryitemspart.md + - docs/sdk/models/operations/getlibraryitemsqueryparamincludemeta.md + - docs/sdk/models/operations/getlibraryitemsqueryparamtype.md - docs/sdk/models/operations/getlibraryitemsrequest.md - docs/sdk/models/operations/getlibraryitemsresponse.md - docs/sdk/models/operations/getlibraryitemsresponsebody.md - docs/sdk/models/operations/getlibraryitemsrole.md + - docs/sdk/models/operations/getlibraryitemsshowordering.md + - docs/sdk/models/operations/getlibraryitemssort.md + - docs/sdk/models/operations/getlibraryitemsstream.md + - docs/sdk/models/operations/getlibraryitemstype.md + - docs/sdk/models/operations/getlibraryitemsultrablurcolors.md - docs/sdk/models/operations/getlibraryitemswriter.md - docs/sdk/models/operations/getmediaprovidersdirectory.md - docs/sdk/models/operations/getmediaprovidersmediacontainer.md @@ -463,6 +504,7 @@ generatedFiles: - docs/sdk/models/operations/getmetadatabyratingkeyresponse.md - docs/sdk/models/operations/getmetadatabyratingkeyresponsebody.md - docs/sdk/models/operations/getmetadatabyratingkeyrole.md + - docs/sdk/models/operations/getmetadatabyratingkeystream.md - docs/sdk/models/operations/getmetadatabyratingkeywriter.md - docs/sdk/models/operations/getmetadatachildrendirectory.md - docs/sdk/models/operations/getmetadatachildrenmediacontainer.md @@ -507,11 +549,36 @@ generatedFiles: - docs/sdk/models/operations/getplaylistsrequest.md - docs/sdk/models/operations/getplaylistsresponse.md - docs/sdk/models/operations/getplaylistsresponsebody.md + - docs/sdk/models/operations/getrecentlyaddedactivedirection.md + - docs/sdk/models/operations/getrecentlyaddeddefaultdirection.md + - docs/sdk/models/operations/getrecentlyaddedfield.md + - docs/sdk/models/operations/getrecentlyaddedfieldtype.md + - docs/sdk/models/operations/getrecentlyaddedfilter.md + - docs/sdk/models/operations/getrecentlyaddedhubsresponsetype.md + - docs/sdk/models/operations/getrecentlyaddedhubstype.md + - docs/sdk/models/operations/getrecentlyaddedimage.md + - docs/sdk/models/operations/getrecentlyaddedlibrarycountry.md + - docs/sdk/models/operations/getrecentlyaddedlibrarydirector.md + - docs/sdk/models/operations/getrecentlyaddedlibraryfilter.md + - docs/sdk/models/operations/getrecentlyaddedlibrarygenre.md + - docs/sdk/models/operations/getrecentlyaddedlibrarymedia.md + - docs/sdk/models/operations/getrecentlyaddedlibrarymediacontainer.md + - docs/sdk/models/operations/getrecentlyaddedlibrarymetadata.md + - docs/sdk/models/operations/getrecentlyaddedlibrarypart.md + - docs/sdk/models/operations/getrecentlyaddedlibraryrequest.md + - docs/sdk/models/operations/getrecentlyaddedlibraryresponse.md + - docs/sdk/models/operations/getrecentlyaddedlibraryresponsebody.md + - docs/sdk/models/operations/getrecentlyaddedlibraryrole.md + - docs/sdk/models/operations/getrecentlyaddedlibrarytype.md + - docs/sdk/models/operations/getrecentlyaddedlibrarywriter.md - docs/sdk/models/operations/getrecentlyaddedmediacontainer.md - docs/sdk/models/operations/getrecentlyaddedmetadata.md + - docs/sdk/models/operations/getrecentlyaddedoperator.md - docs/sdk/models/operations/getrecentlyaddedrequest.md - docs/sdk/models/operations/getrecentlyaddedresponse.md - docs/sdk/models/operations/getrecentlyaddedresponsebody.md + - docs/sdk/models/operations/getrecentlyaddedsort.md + - docs/sdk/models/operations/getrecentlyaddedtype.md - docs/sdk/models/operations/getrefreshlibrarymetadatarequest.md - docs/sdk/models/operations/getrefreshlibrarymetadataresponse.md - docs/sdk/models/operations/getresizedphotorequest.md @@ -522,6 +589,7 @@ generatedFiles: - docs/sdk/models/operations/getresourcesstatisticsresponsebody.md - docs/sdk/models/operations/getsearchlibrarymediacontainer.md - docs/sdk/models/operations/getsearchlibrarymetadata.md + - docs/sdk/models/operations/getsearchlibraryqueryparamtype.md - docs/sdk/models/operations/getsearchlibraryrequest.md - docs/sdk/models/operations/getsearchlibraryresponse.md - docs/sdk/models/operations/getsearchlibraryresponsebody.md @@ -615,6 +683,7 @@ generatedFiles: - docs/sdk/models/operations/getwatchlistresponse.md - docs/sdk/models/operations/getwatchlistresponsebody.md - docs/sdk/models/operations/guids.md + - docs/sdk/models/operations/hasthumbnail.md - docs/sdk/models/operations/hub.md - docs/sdk/models/operations/image.md - docs/sdk/models/operations/includecollections.md @@ -627,7 +696,6 @@ generatedFiles: - docs/sdk/models/operations/includerelay.md - docs/sdk/models/operations/internalpaymentmethod.md - docs/sdk/models/operations/level.md - - docs/sdk/models/operations/librarysectionid.md - docs/sdk/models/operations/libtype.md - docs/sdk/models/operations/location.md - docs/sdk/models/operations/loglinerequest.md @@ -640,13 +708,17 @@ generatedFiles: - docs/sdk/models/operations/markunplayedresponse.md - docs/sdk/models/operations/media.md - docs/sdk/models/operations/mediacontainer.md + - docs/sdk/models/operations/mediaguid.md - docs/sdk/models/operations/mediaprovider.md - docs/sdk/models/operations/mediareviewsvisibility.md + - docs/sdk/models/operations/meta.md - docs/sdk/models/operations/metadata.md + - docs/sdk/models/operations/metadatarating.md - docs/sdk/models/operations/minsize.md - docs/sdk/models/operations/myplex.md - docs/sdk/models/operations/onlytransient.md - docs/sdk/models/operations/operator.md + - docs/sdk/models/operations/optimizedforstreaming.md - docs/sdk/models/operations/part.md - docs/sdk/models/operations/pastsubscription.md - docs/sdk/models/operations/pathparamtaskname.md @@ -680,9 +752,11 @@ generatedFiles: - docs/sdk/models/operations/postuserssignindatauserprofile.md - docs/sdk/models/operations/postuserssignindatawatchedindicator.md - docs/sdk/models/operations/producer.md + - docs/sdk/models/operations/protocol.md - docs/sdk/models/operations/provider.md - docs/sdk/models/operations/queryparamfilter.md - docs/sdk/models/operations/queryparamforce.md + - docs/sdk/models/operations/queryparamincludemeta.md - docs/sdk/models/operations/queryparamonlytransient.md - docs/sdk/models/operations/queryparamsmart.md - docs/sdk/models/operations/queryparamtype.md @@ -697,6 +771,7 @@ generatedFiles: - docs/sdk/models/operations/setting.md - docs/sdk/models/operations/sharedservers.md - docs/sdk/models/operations/sharedsources.md + - docs/sdk/models/operations/showordering.md - docs/sdk/models/operations/skip.md - docs/sdk/models/operations/smart.md - docs/sdk/models/operations/sort.md @@ -723,6 +798,7 @@ generatedFiles: - docs/sdk/models/operations/transcodesession.md - docs/sdk/models/operations/trials.md - docs/sdk/models/operations/type.md + - docs/sdk/models/operations/ultrablurcolors.md - docs/sdk/models/operations/updateplaylistrequest.md - docs/sdk/models/operations/updateplaylistresponse.md - docs/sdk/models/operations/updateplayprogressrequest.md @@ -769,6 +845,7 @@ generatedFiles: - src/funcs/butlerStopTask.ts - src/funcs/hubsGetGlobalHubs.ts - src/funcs/hubsGetLibraryHubs.ts + - src/funcs/hubsGetRecentlyAdded.ts - src/funcs/libraryDeleteLibrary.ts - src/funcs/libraryGetAllLibraries.ts - src/funcs/libraryGetFileHash.ts @@ -777,7 +854,7 @@ generatedFiles: - src/funcs/libraryGetMetaDataByRatingKey.ts - src/funcs/libraryGetMetadataChildren.ts - src/funcs/libraryGetOnDeck.ts - - src/funcs/libraryGetRecentlyAdded.ts + - src/funcs/libraryGetRecentlyAddedLibrary.ts - src/funcs/libraryGetRefreshLibraryMetadata.ts - src/funcs/libraryGetSearchLibrary.ts - src/funcs/libraryGetTopWatchedContent.ts @@ -889,7 +966,7 @@ generatedFiles: - src/sdk/models/errors/getplaylist.ts - src/sdk/models/errors/getplaylistcontents.ts - src/sdk/models/errors/getplaylists.ts - - src/sdk/models/errors/getrecentlyadded.ts + - src/sdk/models/errors/getrecentlyaddedlibrary.ts - src/sdk/models/errors/getrefreshlibrarymetadata.ts - src/sdk/models/errors/getresizedphoto.ts - src/sdk/models/errors/getresourcesstatistics.ts @@ -968,6 +1045,7 @@ generatedFiles: - src/sdk/models/operations/getplaylistcontents.ts - src/sdk/models/operations/getplaylists.ts - src/sdk/models/operations/getrecentlyadded.ts + - src/sdk/models/operations/getrecentlyaddedlibrary.ts - src/sdk/models/operations/getrefreshlibrarymetadata.ts - src/sdk/models/operations/getresizedphoto.ts - src/sdk/models/operations/getresourcesstatistics.ts @@ -1090,7 +1168,7 @@ examples: width: 110 height: 165 opacity: 100 - blur: 20 + blur: 0 minSize: 1 upscale: 0 url: "/library/metadata/49564/thumb/1654258204" @@ -1107,7 +1185,8 @@ examples: responses: "401": application/json: {"errors": []} - "200": {} + "200": + application/json: {"MediaContainer": {"MediaProvider": [{"Feature": [{"type": "", "flavor": "global", "scrobbleKey": "/:/scrobble/new", "unscrobbleKey": "/:/unscrobble/new", "Action": []}, {"type": "", "flavor": "global", "scrobbleKey": "/:/scrobble/new", "unscrobbleKey": "/:/unscrobble/new", "Action": [{"id": "addToContinueWatching", "key": "/actions/addToContinueWatching"}, {"id": "addToContinueWatching", "key": "/actions/addToContinueWatching"}]}, {"type": "", "flavor": "global", "scrobbleKey": "/:/scrobble/new", "unscrobbleKey": "/:/unscrobble/new", "Action": [{"id": "addToContinueWatching", "key": "/actions/addToContinueWatching"}, {"id": "addToContinueWatching", "key": "/actions/addToContinueWatching"}]}]}]}} "400": application/json: {"errors": []} getServerList: @@ -1312,7 +1391,7 @@ examples: speakeasy-default-get-geo-data: responses: "200": - application/json: {"code": "VI", "continent_code": "NA", "country": "United States Virgin Islands", "city": "Amsterdam", "european_union_member": true, "time_zone": "America/St_Thomas", "postal_code": 802, "in_privacy_restricted_country": true, "in_privacy_restricted_region": true, "subdivisions": "Saint Thomas", "coordinates": "18.3381, -64.8941"} + application/json: {"code": "VI", "continent_code": "NA", "country": "United States Virgin Islands", "city": "Amsterdam", "european_union_member": true, "time_zone": "America/St_Thomas", "postal_code": "802", "in_privacy_restricted_country": true, "in_privacy_restricted_region": true, "subdivisions": "Saint Thomas", "coordinates": "18.3381, -64.8941"} "401": application/json: {"errors": []} "400": @@ -1334,6 +1413,7 @@ examples: includeHttps: 1 includeRelay: 1 includeIPv6: 1 + X-Plex-Client-Identifier: "gcgzw5rz2xovp84b4vha3a40" responses: "401": application/json: {"errors": []} @@ -1346,17 +1426,28 @@ examples: parameters: query: X-Plex-Product: "Plex Web" + X-Plex-Client-Identifier: "gcgzw5rz2xovp84b4vha3a40" + X-Plex-Device: "Linux" + X-Plex-Version: "4.133.0" + X-Plex-Platform: "Chrome" responses: "200": application/json: {"id": 308667304, "code": "7RQZ", "product": "0", "trusted": false, "qr": "https://plex.tv/api/v2/pins/qr/7RQZ", "clientIdentifier": "string", "location": {"code": "VI", "continent_code": "NA", "country": "United States Virgin Islands", "city": "Amsterdam", "european_union_member": true, "time_zone": "America/St_Thomas", "postal_code": 802, "in_privacy_restricted_country": true, "in_privacy_restricted_region": true, "subdivisions": "Saint Thomas", "coordinates": "18.3381, -64.8941"}, "expiresIn": 876, "createdAt": "2024-07-16T17:03:05Z", "expiresAt": "2024-07-16T17:18:05Z", "authToken": null, "newRegistration": null} "400": application/json: {"errors": []} + "201": + application/json: {"id": 308667304, "code": "7RQZ", "product": "0", "trusted": false, "qr": "https://plex.tv/api/v2/pins/qr/7RQZ", "clientIdentifier": "string", "location": {"code": "VI", "continent_code": "NA", "country": "United States Virgin Islands", "city": "Amsterdam", "european_union_member": true, "time_zone": "America/St_Thomas", "postal_code": "802", "in_privacy_restricted_country": true, "in_privacy_restricted_region": true, "subdivisions": "Saint Thomas", "coordinates": "18.3381, -64.8941"}, "expiresIn": 876, "createdAt": "2024-07-16T17:03:05Z", "expiresAt": "2024-07-16T17:18:05Z", "authToken": null, "newRegistration": null} getTokenByPinId: "": parameters: path: pinID: 408895 - query: {} + query: + X-Plex-Client-Identifier: "gcgzw5rz2xovp84b4vha3a40" + X-Plex-Product: "Plex Web" + X-Plex-Device: "Linux" + X-Plex-Version: "4.133.0" + X-Plex-Platform: "Chrome" responses: "200": application/json: {"id": 308667304, "code": "7RQZ", "product": "0", "trusted": false, "qr": "https://plex.tv/api/v2/pins/qr/7RQZ", "clientIdentifier": "string", "location": {"code": "VI", "continent_code": "NA", "country": "United States Virgin Islands", "city": "Amsterdam", "european_union_member": true, "time_zone": "America/St_Thomas", "postal_code": 802, "in_privacy_restricted_country": true, "in_privacy_restricted_region": true, "subdivisions": "Saint Thomas", "coordinates": "18.3381, -64.8941"}, "expiresIn": 876, "createdAt": "2024-07-16T17:03:05Z", "expiresAt": "2024-07-16T17:18:05Z", "authToken": null, "newRegistration": null} @@ -1494,6 +1585,24 @@ examples: application/json: {"errors": []} "400": application/json: {"errors": []} + speakeasy-default-get-library-items: + parameters: + path: + sectionKey: 9518 + tag: "edition" + query: + includeGuids: 1 + type: 2 + includeMeta: 1 + X-Plex-Container-Start: 0 + X-Plex-Container-Size: 50 + responses: + "200": + application/json: {"MediaContainer": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}], "size": 70, "totalSize": 170, "offset": 0, "content": "secondary", "allowSync": true, "nocache": true, "art": "/:/resources/movie-fanart.jpg", "identifier": "com.plexapp.plugins.library", "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionUUID": "322a231a-b7f7-49f5-920f-14c61199cd30", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1701731894, "thumb": "/:/resources/movie.png", "title1": "Movies", "title2": "Recently Released", "viewGroup": "movie", "viewMode": 65592, "mixedParents": true, "Metadata": [{"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": []}]}], "Genre": [{"tag": "Adventure"}], "Country": [{"tag": "United States of America"}, {"tag": "United States of America"}, {"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}, {"tag": "James Cameron"}, {"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Guid": [], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}], "Meta": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}]}}} + "400": + application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} + "401": + application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} get-refresh-library-metadata: speakeasy-default-get-refresh-library-metadata: parameters: @@ -1739,6 +1848,7 @@ examples: query: path: "/home/barkley/playlist.m3u" force: 0 + sectionID: 1 responses: "401": application/json: {"errors": []} @@ -1759,7 +1869,7 @@ examples: speakeasy-default-get-source-connection-information: parameters: query: - source: "server://client-identifier" + source: "provider://provider-identifier" responses: "401": application/json: {"errors": []} @@ -1788,6 +1898,23 @@ examples: application/json: {"errors": []} "400": application/json: {"errors": []} + "": + parameters: + query: + X-Plex-Client-Identifier: "gcgzw5rz2xovp84b4vha3a40" + X-Plex-Product: "Plex Web" + X-Plex-Device: "Linux" + X-Plex-Version: "4.133.0" + X-Plex-Platform: "Chrome" + requestBody: + application/x-www-form-urlencoded: {"login": "username@email.com", "password": "password123", "verificationCode": "123456"} + responses: + "201": + application/json: {"adsConsent": true, "adsConsentReminderAt": "2019-08-24T14:15:22Z", "adsConsentSetAt": "2019-08-24T14:15:22Z", "anonymous": false, "authToken": "CxoUzBTSV5hsxjTpFKaf", "backupCodesCreated": false, "confirmed": false, "country": "US", "email": "username@email.com", "emailOnlyAuth": false, "experimentalFeatures": false, "friendlyName": "friendlyUsername", "entitlements": [], "guest": false, "hasPassword": true, "home": false, "homeAdmin": false, "homeSize": 1, "id": 13692262, "joinedAt": 1721154902, "locale": null, "mailingListActive": false, "mailingListStatus": "unsubscribed", "maxHomeSize": 15, "pin": "string", "profile": {"autoSelectAudio": true, "defaultAudioLanguage": "ja", "defaultSubtitleLanguage": "en", "autoSelectSubtitle": 1, "defaultSubtitleAccessibility": 1, "defaultSubtitleForced": 1, "watchedIndicator": 1, "mediaReviewsVisibility": 1}, "protected": false, "rememberExpiresAt": 1722364046, "restricted": false, "roles": ["string"], "scrobbleTypes": "", "services": [{"identifier": "metadata-dev", "endpoint": "https://epg.provider.plex.tv", "token": "DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv", "secret": "string", "status": "online"}], "subscription": {"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}, "subscriptionDescription": "string", "subscriptions": [{"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}], "thumb": "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101", "title": "UsernameTitle", "twoFactorEnabled": false, "username": "Username", "uuid": "dae343c1f45beb4f", "attributionPartner": null, "pastSubscriptions": [{"id": "string", "mode": "string", "renewsAt": "string", "endsAt": "1556281940", "canceled": "0", "gracePeriod": "0", "onHold": "0", "canReactivate": "0", "canUpgrade": "0", "canDowngrade": "0", "canConvert": "0", "type": "plexpass", "transfer": "string", "state": "ended", "billing": {"paymentMethodId": 481656}}], "trials": [{}]} + "400": + application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} + "401": + application/json: {"errors": []} getStatistics: "": parameters: @@ -1964,8 +2091,39 @@ examples: speakeasy-default-get-token-details: responses: "200": - application/json: {"adsConsent": true, "adsConsentReminderAt": "2019-08-24T14:15:22Z", "adsConsentSetAt": "2019-08-24T14:15:22Z", "anonymous": false, "authToken": "CxoUzBTSV5hsxjTpFKaf", "backupCodesCreated": false, "confirmed": false, "country": "US", "email": "username@email.com", "emailOnlyAuth": false, "experimentalFeatures": false, "friendlyName": "friendlyUsername", "entitlements": [], "guest": false, "hasPassword": true, "home": false, "homeAdmin": false, "homeSize": 1, "id": 13692262, "joinedAt": 1721154902, "locale": null, "mailingListActive": false, "mailingListStatus": "unsubscribed", "maxHomeSize": 15, "pin": "string", "profile": {"autoSelectAudio": true, "defaultAudioLanguage": "ja", "defaultSubtitleLanguage": "en", "autoSelectSubtitle": "1", "defaultSubtitleAccessibility": "1", "defaultSubtitleForced": "0", "watchedIndicator": "1", "mediaReviewsVisibility": 0}, "protected": false, "rememberExpiresAt": 1722364046, "restricted": false, "roles": ["string"], "scrobbleTypes": "", "services": [{"identifier": "metadata-dev", "endpoint": "https://epg.provider.plex.tv", "token": "DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv", "secret": "string", "status": "online"}], "subscription": {"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}, "subscriptionDescription": "string", "subscriptions": [{"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}], "thumb": "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101", "title": "UsernameTitle", "twoFactorEnabled": false, "username": "Username", "uuid": "dae343c1f45beb4f"} + application/json: {"adsConsent": true, "adsConsentReminderAt": "2019-08-24T14:15:22Z", "adsConsentSetAt": "2019-08-24T14:15:22Z", "anonymous": false, "authToken": "CxoUzBTSV5hsxjTpFKaf", "backupCodesCreated": false, "confirmed": false, "country": "US", "email": "username@email.com", "emailOnlyAuth": false, "experimentalFeatures": false, "friendlyName": "friendlyUsername", "entitlements": ["[]"], "guest": false, "hasPassword": true, "home": false, "homeAdmin": false, "homeSize": 1, "id": 13692262, "joinedAt": 1556281940, "locale": null, "mailingListActive": false, "mailingListStatus": "active", "maxHomeSize": 15, "pin": "string", "profile": {"autoSelectAudio": true, "defaultAudioLanguage": "ja", "defaultSubtitleLanguage": "en", "autoSelectSubtitle": 1, "defaultSubtitleAccessibility": 1, "defaultSubtitleForced": 1, "watchedIndicator": 1, "mediaReviewsVisibility": 1}, "protected": false, "rememberExpiresAt": 1556281940, "restricted": false, "roles": ["string"], "scrobbleTypes": "", "services": [{"identifier": "metadata-dev", "endpoint": "https://epg.provider.plex.tv", "token": "DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv", "secret": "string", "status": "online"}], "subscription": {"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}, "subscriptionDescription": "string", "subscriptions": [{"features": ["Android - Dolby Vision"], "active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive", "paymentService": "string", "plan": "string"}], "thumb": "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101", "title": "UsernameTitle", "twoFactorEnabled": false, "username": "Username", "uuid": "dae343c1f45beb4f", "attributionPartner": null} "400": application/json: {"errors": []} "401": application/json: {"errors": []} + get-recently-added: + speakeasy-default-get-recently-added: + parameters: + query: + contentDirectoryID: 470161 + sectionID: 2 + type: 2 + includeMeta: 1 + X-Plex-Container-Start: 0 + X-Plex-Container-Size: 50 + responses: + "200": + application/json: {"MediaContainer": {"size": 50, "identifier": "com.plexapp.plugins.library", "Meta": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}]}, {"type": "tag", "Operator": []}, {"type": "tag", "Operator": []}]}, "Metadata": [{"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": []}]}], "Genre": [{"tag": "Adventure"}], "Country": [], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [], "Collection": [], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Guid": [{"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}]}} + get-recently-added-library: + speakeasy-default-get-recently-added-library: + parameters: + query: + contentDirectoryID: 2 + pinnedContentDirectoryID: [3, 5, 7, 13, 12, 1, 6, 14, 2, 10, 16, 17] + sectionID: 2 + type: 2 + includeMeta: 1 + X-Plex-Container-Start: 0 + X-Plex-Container-Size: 50 + responses: + "200": + application/json: {"MediaContainer": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [], "size": 50, "identifier": "com.plexapp.plugins.library", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1680021154, "Metadata": [{"librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionUUID": "322a231a-b7f7-49f5-920f-14c61199cd30", "ratingKey": 59398, "key": "/library/metadata/59398", "guid": "plex://movie/5e161a83bea6ac004126e148", "studio": "Marvel Studios", "type": "movie", "title": "Ant-Man and the Wasp: Quantumania", "contentRating": "PG-13", "summary": "Scott Lang and Hope Van Dyne along with Hank Pym and Janet Van Dyne explore the Quantum Realm where they interact with strange creatures and embark on an adventure that goes beyond the limits of what they thought was possible.", "rating": 4.7, "audienceRating": 8.3, "year": 2023, "tagline": "Witness the beginning of a new dynasty.", "thumb": "/library/metadata/59398/thumb/1681888010", "art": "/library/metadata/59398/art/1681888010", "duration": 7474422, "originallyAvailableAt": "2023-02-15T00:00:00Z", "addedAt": 1681803215, "updatedAt": 1681888010, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/59399", "ratingImage": "rottentomatoes://image.rating.rotten", "Media": [{"id": 120345, "duration": 7474422, "bitrate": 3623, "width": 1920, "height": 804, "aspectRatio": 2.35, "audioChannels": 6, "audioCodec": "ac3", "videoCodec": "h264", "videoResolution": 1080, "container": "mp4", "videoFrameRate": "24p", "optimizedForStreaming": 0, "videoProfile": "high", "Part": []}], "Genre": [], "Director": [{"tag": "Peyton Reed"}], "Writer": [], "Country": [], "Role": [{"tag": "Paul Rudd"}, {"tag": "Paul Rudd"}, {"tag": "Paul Rudd"}]}]}} + "400": + application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} + "401": + application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}]} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 637f394f..36542b04 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true typescript: - version: 0.23.5 + version: 0.24.0 additionalDependencies: dependencies: {} devDependencies: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index d2912a54..127a277d 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.398.0 +speakeasyVersion: 1.405.6 sources: my-source: sourceNamespace: my-source @@ -9,8 +9,8 @@ sources: - main plexapi: sourceNamespace: plexapi - sourceRevisionDigest: sha256:533fe97486e3fe2d84e890b7bbcdba4543d415e45181386154e011861f6da36f - sourceBlobDigest: sha256:f7e2709f52370dff16c1851a7a4e44a89f2e978e9cae335bffc10625950b3bd9 + sourceRevisionDigest: sha256:c52cde0b8d51e160f7b9f1a3d3ea4dbb1aca6d5caad714e549201fb757fadd57 + sourceBlobDigest: sha256:f417b03ff71356808554313f24c3d06d670474bf51bc9a0631de1ad49c13a361 tags: - latest - main @@ -18,10 +18,10 @@ targets: plexjs: source: plexapi sourceNamespace: plexapi - sourceRevisionDigest: sha256:533fe97486e3fe2d84e890b7bbcdba4543d415e45181386154e011861f6da36f - sourceBlobDigest: sha256:f7e2709f52370dff16c1851a7a4e44a89f2e978e9cae335bffc10625950b3bd9 + sourceRevisionDigest: sha256:c52cde0b8d51e160f7b9f1a3d3ea4dbb1aca6d5caad714e549201fb757fadd57 + sourceBlobDigest: sha256:f417b03ff71356808554313f24c3d06d670474bf51bc9a0631de1ad49c13a361 codeSamplesNamespace: code-samples-typescript-plexjs - codeSamplesRevisionDigest: sha256:405a1cc4f3cd4f6dbfe96c59b195c73b5bfaea6b03e101aec97a1b615fbc4937 + codeSamplesRevisionDigest: sha256:0f48dbf8695dfd00a5ebd3fec72c0d71282b0d395790fe53811866c2756be38d workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/FUNCTIONS.md b/FUNCTIONS.md index 47ee5437..a5259b6e 100644 --- a/FUNCTIONS.md +++ b/FUNCTIONS.md @@ -27,7 +27,11 @@ import { SDKValidationError } from "@lukehagar/plexjs/sdk/models/errors/sdkvalid // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -53,7 +57,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); diff --git a/README.md b/README.md index bf72d569..1fde5c45 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,31 @@ ## Summary Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server + +# Plex Media Server OpenAPI Specification + +An Open Source OpenAPI Specification for Plex Media Server + +Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/) + +## Documentation + +[API Documentation](https://plexapi.dev) + +## SDKs + +The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the [main specification Repository](https://github.com/LukeHagar/plex-api-spec). + +| Language | Repository | Releases | Other | +| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- | +| Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - | +| JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - | +| Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) | +| Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - | +| Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - | +| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - | +| Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - | +| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | - @@ -73,7 +98,11 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -117,12 +146,13 @@ run(); ### [hubs](docs/sdks/hubs/README.md) * [getGlobalHubs](docs/sdks/hubs/README.md#getglobalhubs) - Get Global Hubs +* [getRecentlyAdded](docs/sdks/hubs/README.md#getrecentlyadded) - Get Recently Added * [getLibraryHubs](docs/sdks/hubs/README.md#getlibraryhubs) - Get library specific hubs ### [library](docs/sdks/library/README.md) * [getFileHash](docs/sdks/library/README.md#getfilehash) - Get Hash Value -* [getRecentlyAdded](docs/sdks/library/README.md#getrecentlyadded) - Get Recently Added +* [getRecentlyAddedLibrary](docs/sdks/library/README.md#getrecentlyaddedlibrary) - Get Recently Added * [getAllLibraries](docs/sdks/library/README.md#getalllibraries) - Get All Libraries * [getLibraryDetails](docs/sdks/library/README.md#getlibrarydetails) - Get Library Details * [deleteLibrary](docs/sdks/library/README.md#deletelibrary) - Delete Library Section @@ -223,16 +253,25 @@ run(); ## Error Handling -All SDK methods return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type. +All SDK methods return a response object or throw an error. By default, an API error will throw a `errors.SDKError`. -| Error Object | Status Code | Content Type | +If a HTTP request fails, an operation my also throw an error from the `sdk/models/errors/httpclienterrors.ts` module: + +| HTTP Client Error | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | +| RequestAbortedError | HTTP request was aborted by the client | +| RequestTimeoutError | HTTP request timed out due to an AbortSignal signal | +| ConnectionError | HTTP client was unable to make a request to a server | +| InvalidRequestError | Any input used to create a request is invalid | +| UnexpectedClientError | Unrecognised or unexpected error | + +In addition, when custom error responses are specified for an operation, the SDK may throw their associated Error type. You can refer to respective *Errors* tables in SDK docs for more details on possible error types for each operation. For example, the `getServerCapabilities` method may throw the following errors: + +| Error Type | Status Code | Content Type | | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | | errors.GetServerCapabilitiesBadRequest | 400 | application/json | | errors.GetServerCapabilitiesUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - -Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted string since validation errors can list many issues and the plain error string may be difficult read when debugging. - +| errors.SDKError | 4XX, 5XX | \*/\* | ```typescript import { PlexAPI } from "@lukehagar/plexjs"; @@ -244,7 +283,11 @@ import { const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -283,6 +326,8 @@ async function run() { run(); ``` + +Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted string since validation errors can list many issues and the plain error string may be difficult read when debugging. @@ -302,7 +347,11 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ serverIdx: 0, accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -333,7 +382,11 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ serverURL: "{protocol}://{ip}:{port}", accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -355,12 +408,16 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.plex.getCompanionsData({ - serverURL: "https://plex.tv/api/v2/", + serverURL: "https://plex.tv/api/v2", }); // Handle the result @@ -438,7 +495,11 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -487,6 +548,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [butlerStopTask](docs/sdks/butler/README.md#stoptask) - [hubsGetGlobalHubs](docs/sdks/hubs/README.md#getglobalhubs) - [hubsGetLibraryHubs](docs/sdks/hubs/README.md#getlibraryhubs) +- [hubsGetRecentlyAdded](docs/sdks/hubs/README.md#getrecentlyadded) - [libraryDeleteLibrary](docs/sdks/library/README.md#deletelibrary) - [libraryGetAllLibraries](docs/sdks/library/README.md#getalllibraries) - [libraryGetFileHash](docs/sdks/library/README.md#getfilehash) @@ -495,7 +557,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [libraryGetMetaDataByRatingKey](docs/sdks/library/README.md#getmetadatabyratingkey) - [libraryGetMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - [libraryGetOnDeck](docs/sdks/library/README.md#getondeck) -- [libraryGetRecentlyAdded](docs/sdks/library/README.md#getrecentlyadded) +- [libraryGetRecentlyAddedLibrary](docs/sdks/library/README.md#getrecentlyaddedlibrary) - [libraryGetRefreshLibraryMetadata](docs/sdks/library/README.md#getrefreshlibrarymetadata) - [libraryGetSearchLibrary](docs/sdks/library/README.md#getsearchlibrary) - [libraryGetTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) @@ -556,21 +618,22 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). ## Global Parameters -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. +Certain parameters are configured globally. These parameters may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, These global values will be used as defaults on the operations that use them. 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 `"gcgzw5rz2xovp84b4vha3a40"` at SDK initialization and then you do not have to pass the same value on calls to operations like `getServerResources`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration. +For example, you can set `ClientID` to `"gcgzw5rz2xovp84b4vha3a40"` at SDK initialization and then you do not have to pass the same value on calls to operations like `getServerResources`. 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 following global parameters are available. | Name | Type | Required | Description | | ---- | ---- |:--------:| ----------- | -| 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) - | +| clientID | 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) | +| clientName | string | | The clientName parameter. | +| clientVersion | string | | The clientVersion parameter. | +| clientPlatform | string | | The clientPlatform parameter. | +| deviceName | string | | The deviceName parameter. | ### Example @@ -585,15 +648,19 @@ import { const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.plex.getServerResources( + IncludeHttps.Enable, + IncludeRelay.Enable, + IncludeIPv6.Enable, "gcgzw5rz2xovp84b4vha3a40", - IncludeHttps.One, - IncludeRelay.One, - IncludeIPv6.One, ); // Handle the result @@ -616,7 +683,11 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -657,7 +728,11 @@ const plexAPI = new PlexAPI({ retryConnectionErrors: false, }, accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { diff --git a/RELEASES.md b/RELEASES.md index 3229fc18..4e446087 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1068,4 +1068,14 @@ Based on: ### Generated - [typescript v0.23.5] . ### Releases -- [NPM v0.23.5] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.23.5 - . \ No newline at end of file +- [NPM v0.23.5] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.23.5 - . + +## 2024-10-01 00:10:47 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.405.6 (2.428.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.24.0] . +### Releases +- [NPM v0.24.0] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.24.0 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 6c40d0c4..07ed5530 100644 --- a/USAGE.md +++ b/USAGE.md @@ -4,7 +4,11 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { diff --git a/codeSamples.yaml b/codeSamples.yaml index dc563996..95785c7f 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -8,442 +8,1998 @@ actions: x-codeSamples: - lang: typescript label: getServerCapabilities - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.server.getServerCapabilities();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.server.getServerCapabilities(); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/:/prefs"]["get"] update: x-codeSamples: - lang: typescript label: getServerPreferences - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.server.getServerPreferences();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.server.getServerPreferences(); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/:/progress"]["post"] update: x-codeSamples: - lang: typescript label: updatePlayProgress - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.media.updatePlayProgress(\"\", 90000, \"played\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.media.updatePlayProgress("", 90000, "played"); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/:/scrobble"]["get"] update: x-codeSamples: - lang: typescript label: markPlayed - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.media.markPlayed(59398);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.media.markPlayed(59398); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/:/timeline"]["get"] update: x-codeSamples: - lang: typescript label: getTimeline - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\nimport { State } from \"@lukehagar/plexjs/sdk/models/operations\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.video.getTimeline({\n ratingKey: 23409,\n key: \"/library/metadata/23409\",\n state: State.Playing,\n hasMDE: 1,\n time: 2000,\n duration: 10000,\n context: \"home:hub.continueWatching\",\n playQueueItemID: 1,\n playBackTime: 2000,\n row: 1,\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + import { State } from "@lukehagar/plexjs/sdk/models/operations"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + 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"]["/:/unscrobble"]["get"] update: x-codeSamples: - lang: typescript label: markUnplayed - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.media.markUnplayed(59398);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.media.markUnplayed(59398); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/activities"]["get"] update: x-codeSamples: - lang: typescript label: getServerActivities - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.activities.getServerActivities();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.activities.cancelServerActivities(\"25b71ed5-0f9d-461c-baa7-d404e9e10d3e\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.activities.cancelServerActivities("25b71ed5-0f9d-461c-baa7-d404e9e10d3e"); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/butler"]["delete"] update: x-codeSamples: - lang: typescript label: stopAllTasks - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.butler.stopAllTasks();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.butler.stopAllTasks(); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/butler"]["get"] update: x-codeSamples: - lang: typescript label: getButlerTasks - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.butler.getButlerTasks();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.butler.getButlerTasks(); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/butler"]["post"] update: x-codeSamples: - lang: typescript label: startAllTasks - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.butler.startAllTasks();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.butler.startAllTasks(); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/butler/{taskName}"]["delete"] update: x-codeSamples: - lang: typescript label: stopTask - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\nimport { PathParamTaskName } from \"@lukehagar/plexjs/sdk/models/operations\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.butler.stopTask(PathParamTaskName.BackupDatabase);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + import { PathParamTaskName } from "@lukehagar/plexjs/sdk/models/operations"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.butler.stopTask(PathParamTaskName.BackupDatabase); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/butler/{taskName}"]["post"] update: x-codeSamples: - lang: typescript label: startTask - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\nimport { TaskName } from \"@lukehagar/plexjs/sdk/models/operations\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.butler.startTask(TaskName.CleanOldBundles);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + import { TaskName } from "@lukehagar/plexjs/sdk/models/operations"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.butler.startTask(TaskName.CleanOldBundles); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/clients"]["get"] update: x-codeSamples: - lang: typescript label: getAvailableClients - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.server.getAvailableClients();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.server.getAvailableClients(); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/companions"]["get"] update: x-codeSamples: - lang: typescript label: getCompanionsData - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.plex.getCompanionsData();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.plex.getCompanionsData(); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/devices"]["get"] update: x-codeSamples: - lang: typescript label: getDevices - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.server.getDevices();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.server.getDevices(); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/friends"]["get"] update: x-codeSamples: - lang: typescript label: getUserFriends - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.plex.getUserFriends();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.plex.getUserFriends(); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/geoip"]["get"] update: x-codeSamples: - lang: typescript label: getGeoData - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.plex.getGeoData();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.plex.getGeoData(); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/home"]["get"] update: x-codeSamples: - lang: typescript label: getHomeData - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.plex.getHomeData();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.plex.getHomeData(); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/hubs"]["get"] update: x-codeSamples: - lang: typescript label: getGlobalHubs - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.hubs.getGlobalHubs();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.hubs.getGlobalHubs(); + + // Handle the result + console.log(result); + } + + run(); + - target: $["paths"]["/hubs/home/recentlyAdded"]["get"] + update: + x-codeSamples: + - lang: typescript + label: added + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + import { IncludeMeta, Type } from "@lukehagar/plexjs/sdk/models/operations"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.hubs.getRecentlyAdded({ + contentDirectoryID: 470161, + sectionID: 2, + type: Type.TvShow, + includeMeta: IncludeMeta.Enable, + xPlexContainerStart: 0, + xPlexContainerSize: 50, + }); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.search.performSearch(\"dylan\", 5);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.search.performSearch("dylan", 5); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.search.performVoiceSearch(\"dead+poop\", 5);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.search.performVoiceSearch("dead+poop", 5); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/hubs/sections/{sectionId}"]["get"] update: x-codeSamples: - lang: typescript label: getLibraryHubs - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.hubs.getLibraryHubs(6728.76);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.hubs.getLibraryHubs(6728.76); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/identity"]["get"] update: x-codeSamples: - lang: typescript label: identity - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.server.getServerIdentity();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.server.getServerIdentity(); + + // 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\";\nimport { GetTopWatchedContentQueryParamType } from \"@lukehagar/plexjs/sdk/models/operations\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getTopWatchedContent(GetTopWatchedContentQueryParamType.Two, 1);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + import { GetTopWatchedContentQueryParamType } from "@lukehagar/plexjs/sdk/models/operations"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.library.getTopWatchedContent(GetTopWatchedContentQueryParamType.TvShow, 1); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getFileHash(\"file://C:\\Image.png&type=13\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.library.getFileHash("file://C:\Image.png&type=13"); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/library/metadata/{ratingKey}"]["get"] update: x-codeSamples: - lang: typescript label: key - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getMetaDataByRatingKey(9518);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.library.getMetaDataByRatingKey(9518); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/library/metadata/{ratingKey}/banner"]["get"] update: x-codeSamples: - lang: typescript label: image - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.media.getBannerImage({\n ratingKey: 9518,\n width: 396,\n height: 396,\n minSize: 1,\n upscale: 1,\n xPlexToken: \"CV5xoxjTpFKUzBTShsaf\",\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.media.getBannerImage({ + ratingKey: 9518, + width: 396, + height: 396, + minSize: 1, + upscale: 1, + xPlexToken: "CV5xoxjTpFKUzBTShsaf", + }); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getMetadataChildren(1539.14, \"Stream\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.library.getMetadataChildren(1539.15, "Stream"); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/library/metadata/{ratingKey}/thumb"]["get"] update: x-codeSamples: - lang: typescript label: image - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.media.getThumbImage({\n ratingKey: 9518,\n width: 396,\n height: 396,\n minSize: 1,\n upscale: 1,\n xPlexToken: \"CV5xoxjTpFKUzBTShsaf\",\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.media.getThumbImage({ + ratingKey: 9518, + width: 396, + height: 396, + minSize: 1, + upscale: 1, + xPlexToken: "CV5xoxjTpFKUzBTShsaf", + }); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getOnDeck();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.library.getOnDeck(); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getRecentlyAdded(0, 50);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + label: library + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + import { QueryParamIncludeMeta, QueryParamType } from "@lukehagar/plexjs/sdk/models/operations"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.library.getRecentlyAddedLibrary({ + contentDirectoryID: 2, + pinnedContentDirectoryID: [ + 3, + 5, + 7, + 13, + 12, + 1, + 6, + 14, + 2, + 10, + 16, + 17, + ], + sectionID: 2, + type: QueryParamType.TvShow, + includeMeta: QueryParamIncludeMeta.Enable, + xPlexContainerStart: 0, + xPlexContainerSize: 50, + }); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/library/sections"]["get"] update: x-codeSamples: - lang: typescript label: libraries - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getAllLibraries();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.library.getAllLibraries(); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/library/sections/watchlist/{filter}"]["get"] update: x-codeSamples: - lang: typescript label: list - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\nimport { Filter } from \"@lukehagar/plexjs/sdk/models/operations\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.watchlist.getWatchList({\n filter: Filter.Available,\n xPlexContainerStart: 0,\n xPlexContainerSize: 50,\n xPlexToken: \"CV5xoxjTpFKUzBTShsaf\",\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + import { Filter } from "@lukehagar/plexjs/sdk/models/operations"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.watchlist.getWatchList({ + filter: Filter.Available, + xPlexContainerStart: 0, + xPlexContainerSize: 50, + xPlexToken: "CV5xoxjTpFKUzBTShsaf", + }); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/library/sections/{sectionKey}"]["delete"] update: x-codeSamples: - lang: typescript label: deleteLibrary - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.deleteLibrary(9518);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.library.deleteLibrary(9518); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/library/sections/{sectionKey}"]["get"] update: x-codeSamples: - lang: typescript label: details - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getLibraryDetails(9518);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.library.getLibraryDetails(9518); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/library/sections/{sectionKey}/refresh"]["get"] update: x-codeSamples: - lang: typescript label: metadata - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\nimport { Force } from \"@lukehagar/plexjs/sdk/models/operations\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getRefreshLibraryMetadata(9518, Force.One);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + import { Force } from "@lukehagar/plexjs/sdk/models/operations"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.library.getRefreshLibraryMetadata(9518, Force.One); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/library/sections/{sectionKey}/search"]["get"] update: x-codeSamples: - lang: typescript label: library - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\nimport { QueryParamType } from \"@lukehagar/plexjs/sdk/models/operations\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getSearchLibrary(9518, QueryParamType.Two);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + import { GetSearchLibraryQueryParamType } from "@lukehagar/plexjs/sdk/models/operations"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.library.getSearchLibrary(9518, GetSearchLibraryQueryParamType.TvShow); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/library/sections/{sectionKey}/{tag}"]["get"] update: x-codeSamples: - lang: typescript label: items - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\nimport { IncludeGuids, IncludeMeta, Tag, Type } from \"@lukehagar/plexjs/sdk/models/operations\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getLibraryItems({\n sectionKey: 9518,\n tag: Tag.Edition,\n includeGuids: IncludeGuids.One,\n includeMeta: IncludeMeta.One,\n type: Type.Two,\n xPlexContainerStart: 0,\n xPlexContainerSize: 50,\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + import { + GetLibraryItemsQueryParamIncludeMeta, + GetLibraryItemsQueryParamType, + IncludeGuids, + Tag, + } from "@lukehagar/plexjs/sdk/models/operations"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.library.getLibraryItems({ + sectionKey: 9518, + tag: Tag.Edition, + includeGuids: IncludeGuids.Enable, + type: GetLibraryItemsQueryParamType.TvShow, + includeMeta: GetLibraryItemsQueryParamIncludeMeta.Enable, + xPlexContainerStart: 0, + xPlexContainerSize: 50, + }); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/log"]["get"] update: x-codeSamples: - lang: typescript label: logLine - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\nimport { Level } from \"@lukehagar/plexjs/sdk/models/operations\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.log.logLine(Level.Three, \"Test log message\", \"Postman\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + import { Level } from "@lukehagar/plexjs/sdk/models/operations"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.log.logLine(Level.Three, "Test log message", "Postman"); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/log"]["post"] update: x-codeSamples: - lang: typescript label: logMultiLine - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.log.logMultiLine(\"level=4&message=Test%20message%201&source=postman\\n\" +\n \"level=3&message=Test%20message%202&source=postman\\n\" +\n \"level=1&message=Test%20message%203&source=postman\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.log.logMultiLine("level=4&message=Test%20message%201&source=postman\n" + + "level=3&message=Test%20message%202&source=postman\n" + + "level=1&message=Test%20message%203&source=postman"); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.log.enablePaperTrail();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.log.enablePaperTrail(); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/media/providers"]["get"] update: x-codeSamples: - lang: typescript label: providers - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.server.getMediaProviders(\"CV5xoxjTpFKUzBTShsaf\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.server.getMediaProviders("CV5xoxjTpFKUzBTShsaf"); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.server.getMyPlexAccount();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.server.getMyPlexAccount(); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/photo/:/transcode"]["get"] update: x-codeSamples: - lang: typescript label: getResizedPhoto - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\nimport { MinSize, Upscale } from \"@lukehagar/plexjs/sdk/models/operations\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.server.getResizedPhoto({\n width: 110,\n height: 165,\n opacity: 100,\n blur: 20,\n minSize: MinSize.One,\n upscale: Upscale.One,\n url: \"/library/metadata/49564/thumb/1654258204\",\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + import { MinSize, Upscale } from "@lukehagar/plexjs/sdk/models/operations"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.server.getResizedPhoto({ + width: 110, + height: 165, + opacity: 100, + blur: 0, + minSize: MinSize.One, + upscale: Upscale.One, + url: "/library/metadata/49564/thumb/1654258204", + }); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/pins"]["post"] update: x-codeSamples: - lang: typescript label: getPin - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.plex.getPin(\"gcgzw5rz2xovp84b4vha3a40\", \"Plex Web\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.plex.getPin({}); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/pins/{pinID}"]["get"] update: x-codeSamples: - lang: typescript label: getTokenByPinId - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.plex.getTokenByPinId(408895, \"gcgzw5rz2xovp84b4vha3a40\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.plex.getTokenByPinId({ + pinID: 408895, + }); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/playlists"]["get"] update: x-codeSamples: - lang: typescript label: getPlaylists - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.playlists.getPlaylists();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.playlists.getPlaylists(); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/playlists"]["post"] update: x-codeSamples: - lang: typescript label: createPlaylist - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\nimport { CreatePlaylistQueryParamType, Smart } from \"@lukehagar/plexjs/sdk/models/operations\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.playlists.createPlaylist({\n title: \"\",\n type: CreatePlaylistQueryParamType.Photo,\n smart: Smart.One,\n uri: \"https://inborn-brochure.biz\",\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + import { CreatePlaylistQueryParamType, Smart } from "@lukehagar/plexjs/sdk/models/operations"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.playlists.createPlaylist({ + title: "", + type: CreatePlaylistQueryParamType.Photo, + smart: Smart.One, + uri: "https://hoarse-testing.info/", + }); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/playlists/upload"]["post"] update: x-codeSamples: - lang: typescript label: uploadPlaylist - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\nimport { QueryParamForce } from \"@lukehagar/plexjs/sdk/models/operations\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.playlists.uploadPlaylist(\"/home/barkley/playlist.m3u\", QueryParamForce.Zero);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + import { QueryParamForce } from "@lukehagar/plexjs/sdk/models/operations"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.playlists.uploadPlaylist("/home/barkley/playlist.m3u", QueryParamForce.Zero, 1); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.playlists.deletePlaylist(216.22);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.playlists.deletePlaylist(216.22); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.playlists.getPlaylist(4109.48);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.playlists.getPlaylist(4109.48); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.playlists.updatePlaylist(3915);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.playlists.updatePlaylist(3915.00); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.playlists.clearPlaylistContents(1893.18);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.playlists.clearPlaylistContents(1893.18); + + // 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\";\nimport { GetPlaylistContentsQueryParamType } from \"@lukehagar/plexjs/sdk/models/operations\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.playlists.getPlaylistContents(5004.46, GetPlaylistContentsQueryParamType.Two);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + import { GetPlaylistContentsQueryParamType } from "@lukehagar/plexjs/sdk/models/operations"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.playlists.getPlaylistContents(5004.46, GetPlaylistContentsQueryParamType.TvShow); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.playlists.addPlaylistContents(8502.01, \"server://12345/com.plexapp.plugins.library/library/metadata/1\", 123);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.playlists.addPlaylistContents(8502.00, "server://12345/com.plexapp.plugins.library/library/metadata/1", 123); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/resources"]["get"] update: x-codeSamples: - lang: typescript label: resources - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\nimport { IncludeHttps, IncludeIPv6, IncludeRelay } from \"@lukehagar/plexjs/sdk/models/operations\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.plex.getServerResources(\"gcgzw5rz2xovp84b4vha3a40\", IncludeHttps.One, IncludeRelay.One, IncludeIPv6.One);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + import { IncludeHttps, IncludeIPv6, IncludeRelay } from "@lukehagar/plexjs/sdk/models/operations"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.plex.getServerResources(IncludeHttps.Enable, IncludeRelay.Enable, IncludeIPv6.Enable, "gcgzw5rz2xovp84b4vha3a40"); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/search"]["get"] update: x-codeSamples: - lang: typescript label: getSearchResults - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.search.getSearchResults(\"110\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.search.getSearchResults("110"); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.authentication.getSourceConnectionInformation(\"server://client-identifier\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.authentication.getSourceConnectionInformation("provider://provider-identifier"); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/security/token"]["get"] update: x-codeSamples: - lang: typescript label: getTransientToken - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\nimport { GetTransientTokenQueryParamType, Scope } from \"@lukehagar/plexjs/sdk/models/operations\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.authentication.getTransientToken(GetTransientTokenQueryParamType.Delegation, Scope.All);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + import { GetTransientTokenQueryParamType, Scope } from "@lukehagar/plexjs/sdk/models/operations"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.authentication.getTransientToken(GetTransientTokenQueryParamType.Delegation, Scope.All); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/servers"]["get"] update: x-codeSamples: - lang: typescript label: getServerList - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.server.getServerList();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.server.getServerList(); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.statistics.getBandwidthStatistics(4);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.statistics.getBandwidthStatistics(4); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.statistics.getStatistics(4);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.statistics.getStatistics(4); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.statistics.getResourcesStatistics(4);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.statistics.getResourcesStatistics(4); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/status/sessions"]["get"] update: x-codeSamples: - lang: typescript label: getSessions - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.sessions.getSessions();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.sessions.getSessions(); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.sessions.getSessionHistory(\"viewedAt:desc\", 1, {}, 12);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.sessions.getSessionHistory("viewedAt:desc", 1, {}, 12); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.sessions.getTranscodeSessions();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.sessions.getTranscodeSessions(); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.sessions.stopTranscodeSession(\"zz7llzqlx8w9vnrsbnwhbmep\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.sessions.stopTranscodeSession("zz7llzqlx8w9vnrsbnwhbmep"); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/updater/apply"]["put"] update: x-codeSamples: - lang: typescript label: applyUpdates - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\nimport { Skip, Tonight } from \"@lukehagar/plexjs/sdk/models/operations\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.updater.applyUpdates(Tonight.One, Skip.One);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + import { Skip, Tonight } from "@lukehagar/plexjs/sdk/models/operations"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.updater.applyUpdates(Tonight.One, Skip.One); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/updater/check"]["put"] update: x-codeSamples: - lang: typescript label: checkForUpdates - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\nimport { Download } from \"@lukehagar/plexjs/sdk/models/operations\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.updater.checkForUpdates(Download.One);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + import { Download } from "@lukehagar/plexjs/sdk/models/operations"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.updater.checkForUpdates(Download.One); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.updater.getUpdateStatus();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.updater.getUpdateStatus(); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/user"]["get"] update: x-codeSamples: - lang: typescript label: getTokenDetails - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.authentication.getTokenDetails();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.authentication.getTokenDetails(); + + // Handle the result + console.log(result); + } + + run(); - target: $["paths"]["/users/signin"]["post"] update: x-codeSamples: - lang: typescript label: data - source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.authentication.postUsersSignInData(\"gcgzw5rz2xovp84b4vha3a40\", {\n login: \"username@email.com\",\n password: \"password123\",\n verificationCode: \"123456\",\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + async function run() { + const result = await plexAPI.authentication.postUsersSignInData({ + requestBody: { + login: "username@email.com", + password: "password123", + verificationCode: "123456", + }, + }); + + // 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\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.video.startUniversalTranscode({\n hasMDE: 1,\n path: \"/library/metadata/23409\",\n mediaIndex: 0,\n partIndex: 0,\n protocol: \"hls\",\n fastSeek: 0,\n directPlay: 0,\n directStream: 0,\n subtitleSize: 100,\n subtites: \"burn\",\n audioBoost: 100,\n location: \"lan\",\n mediaBufferSize: 102400,\n session: \"zvcage8b7rkioqcm8f4uns4c\",\n addDebugOverlay: 0,\n autoAdjustQuality: 0,\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + source: |- + import { PlexAPI } from "@lukehagar/plexjs"; + + const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", + }); + + 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(); diff --git a/docs/sdk/models/errors/getrecentlyaddedbadrequest.md b/docs/sdk/models/errors/getrecentlyaddedbadrequest.md deleted file mode 100644 index 76e83816..00000000 --- a/docs/sdk/models/errors/getrecentlyaddedbadrequest.md +++ /dev/null @@ -1,18 +0,0 @@ -# GetRecentlyAddedBadRequest - -Bad Request - A parameter was not specified, or was specified incorrectly. - -## Example Usage - -```typescript -import { GetRecentlyAddedBadRequest } from "@lukehagar/plexjs/sdk/models/errors"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -| `errors` | [errors.GetRecentlyAddedErrors](../../../sdk/models/errors/getrecentlyaddederrors.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/sdk/models/errors/getrecentlyaddederrors.md b/docs/sdk/models/errors/getrecentlyaddederrors.md deleted file mode 100644 index 8645c75a..00000000 --- a/docs/sdk/models/errors/getrecentlyaddederrors.md +++ /dev/null @@ -1,21 +0,0 @@ -# GetRecentlyAddedErrors - -## Example Usage - -```typescript -import { GetRecentlyAddedErrors } from "@lukehagar/plexjs/sdk/models/errors"; - -let value: GetRecentlyAddedErrors = { - code: 1000, - message: "X-Plex-Client-Identifier is missing", - status: 400, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `code` | *number* | :heavy_minus_sign: | N/A | 1000 | -| `message` | *string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | -| `status` | *number* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/sdk/models/errors/getrecentlyaddedunauthorized.md b/docs/sdk/models/errors/getrecentlyaddedlibrarybadrequest.md similarity index 89% rename from docs/sdk/models/errors/getrecentlyaddedunauthorized.md rename to docs/sdk/models/errors/getrecentlyaddedlibrarybadrequest.md index 218cb251..0a6c5598 100644 --- a/docs/sdk/models/errors/getrecentlyaddedunauthorized.md +++ b/docs/sdk/models/errors/getrecentlyaddedlibrarybadrequest.md @@ -1,11 +1,11 @@ -# GetRecentlyAddedUnauthorized +# GetRecentlyAddedLibraryBadRequest -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +Bad Request - A parameter was not specified, or was specified incorrectly. ## Example Usage ```typescript -import { GetRecentlyAddedUnauthorized } from "@lukehagar/plexjs/sdk/models/errors"; +import { GetRecentlyAddedLibraryBadRequest } from "@lukehagar/plexjs/sdk/models/errors"; // No examples available for this model ``` diff --git a/docs/sdk/models/errors/getrecentlyaddedlibraryerrors.md b/docs/sdk/models/errors/getrecentlyaddedlibraryerrors.md index 4c02ab1b..1c352baf 100644 --- a/docs/sdk/models/errors/getrecentlyaddedlibraryerrors.md +++ b/docs/sdk/models/errors/getrecentlyaddedlibraryerrors.md @@ -6,16 +6,16 @@ import { GetRecentlyAddedLibraryErrors } from "@lukehagar/plexjs/sdk/models/errors"; let value: GetRecentlyAddedLibraryErrors = { - code: 1001, - message: "User could not be authenticated", - status: 401, + code: 1000, + message: "X-Plex-Client-Identifier is missing", + status: 400, }; ``` ## 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 +| Field | Type | Required | Description | Example | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `code` | *number* | :heavy_minus_sign: | N/A | 1000 | +| `message` | *string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing | +| `status` | *number* | :heavy_minus_sign: | N/A | 400 | \ No newline at end of file diff --git a/docs/sdk/models/errors/getrecentlyaddedlibrarylibraryerrors.md b/docs/sdk/models/errors/getrecentlyaddedlibrarylibraryerrors.md new file mode 100644 index 00000000..648701c2 --- /dev/null +++ b/docs/sdk/models/errors/getrecentlyaddedlibrarylibraryerrors.md @@ -0,0 +1,21 @@ +# GetRecentlyAddedLibraryLibraryErrors + +## Example Usage + +```typescript +import { GetRecentlyAddedLibraryLibraryErrors } from "@lukehagar/plexjs/sdk/models/errors"; + +let value: GetRecentlyAddedLibraryLibraryErrors = { + code: 1001, + message: "User could not be authenticated", + status: 401, +}; +``` + +## 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/sdk/models/errors/getrecentlyaddedlibraryunauthorized.md b/docs/sdk/models/errors/getrecentlyaddedlibraryunauthorized.md new file mode 100644 index 00000000..b1c4d786 --- /dev/null +++ b/docs/sdk/models/errors/getrecentlyaddedlibraryunauthorized.md @@ -0,0 +1,18 @@ +# GetRecentlyAddedLibraryUnauthorized + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + +## Example Usage + +```typescript +import { GetRecentlyAddedLibraryUnauthorized } from "@lukehagar/plexjs/sdk/models/errors"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `errors` | [errors.GetRecentlyAddedLibraryLibraryErrors](../../../sdk/models/errors/getrecentlyaddedlibrarylibraryerrors.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/sdk/models/operations/action.md b/docs/sdk/models/operations/action.md new file mode 100644 index 00000000..eec67680 --- /dev/null +++ b/docs/sdk/models/operations/action.md @@ -0,0 +1,19 @@ +# Action + +## Example Usage + +```typescript +import { Action } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: Action = { + id: "addToContinueWatching", + key: "/actions/addToContinueWatching", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `id` | *string* | :heavy_check_mark: | N/A | addToContinueWatching | +| `key` | *string* | :heavy_check_mark: | N/A | /actions/addToContinueWatching | \ No newline at end of file diff --git a/docs/sdk/models/operations/activedirection.md b/docs/sdk/models/operations/activedirection.md new file mode 100644 index 00000000..a5b29668 --- /dev/null +++ b/docs/sdk/models/operations/activedirection.md @@ -0,0 +1,19 @@ +# ActiveDirection + +The direction of the sort. Can be either `asc` or `desc`. + + +## Example Usage + +```typescript +import { ActiveDirection } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: ActiveDirection = ActiveDirection.Ascending; +``` + +## Values + +| Name | Value | +| ------------ | ------------ | +| `Ascending` | asc | +| `Descending` | desc | \ No newline at end of file diff --git a/docs/sdk/models/operations/addplaylistcontentsrequest.md b/docs/sdk/models/operations/addplaylistcontentsrequest.md index 348f8efa..73822b07 100644 --- a/docs/sdk/models/operations/addplaylistcontentsrequest.md +++ b/docs/sdk/models/operations/addplaylistcontentsrequest.md @@ -6,7 +6,7 @@ import { AddPlaylistContentsRequest } from "@lukehagar/plexjs/sdk/models/operations"; let value: AddPlaylistContentsRequest = { - playlistID: 8209.94, + playlistID: 8966.71, uri: "server://12345/com.plexapp.plugins.library/library/metadata/1", playQueueID: 123, }; diff --git a/docs/sdk/models/operations/addplaylistcontentsresponse.md b/docs/sdk/models/operations/addplaylistcontentsresponse.md index 85a9a8c5..d73bdf2a 100644 --- a/docs/sdk/models/operations/addplaylistcontentsresponse.md +++ b/docs/sdk/models/operations/addplaylistcontentsresponse.md @@ -7,7 +7,7 @@ import { AddPlaylistContentsResponse } from "@lukehagar/plexjs/sdk/models/operat let value: AddPlaylistContentsResponse = { contentType: "", - statusCode: 13571, + statusCode: 502, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/applyupdatesresponse.md b/docs/sdk/models/operations/applyupdatesresponse.md index ea514be0..012d28fa 100644 --- a/docs/sdk/models/operations/applyupdatesresponse.md +++ b/docs/sdk/models/operations/applyupdatesresponse.md @@ -7,7 +7,7 @@ import { ApplyUpdatesResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: ApplyUpdatesResponse = { contentType: "", - statusCode: 667411, + statusCode: 102, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/autoselectsubtitle.md b/docs/sdk/models/operations/autoselectsubtitle.md index 9e5d00a0..a326f475 100644 --- a/docs/sdk/models/operations/autoselectsubtitle.md +++ b/docs/sdk/models/operations/autoselectsubtitle.md @@ -7,12 +7,12 @@ The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign aud ```typescript import { AutoSelectSubtitle } from "@lukehagar/plexjs/sdk/models/operations"; -let value: AutoSelectSubtitle = AutoSelectSubtitle.One; +let value: AutoSelectSubtitle = AutoSelectSubtitle.Enable; ``` ## Values -| Name | Value | -| ------ | ------ | -| `Zero` | 0 | -| `One` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/billing.md b/docs/sdk/models/operations/billing.md index bc13121c..643c6eb4 100644 --- a/docs/sdk/models/operations/billing.md +++ b/docs/sdk/models/operations/billing.md @@ -7,7 +7,7 @@ import { Billing } from "@lukehagar/plexjs/sdk/models/operations"; let value: Billing = { internalPaymentMethod: {}, - paymentMethodId: 414263, + paymentMethodId: 730856, }; ``` diff --git a/docs/sdk/models/operations/cancelserveractivitiesresponse.md b/docs/sdk/models/operations/cancelserveractivitiesresponse.md index 3c3495ee..53f72181 100644 --- a/docs/sdk/models/operations/cancelserveractivitiesresponse.md +++ b/docs/sdk/models/operations/cancelserveractivitiesresponse.md @@ -7,7 +7,7 @@ import { CancelServerActivitiesResponse } from "@lukehagar/plexjs/sdk/models/ope let value: CancelServerActivitiesResponse = { contentType: "", - statusCode: 812169, + statusCode: 417, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/checkforupdatesresponse.md b/docs/sdk/models/operations/checkforupdatesresponse.md index c2fa0fb1..b13692a0 100644 --- a/docs/sdk/models/operations/checkforupdatesresponse.md +++ b/docs/sdk/models/operations/checkforupdatesresponse.md @@ -7,7 +7,7 @@ import { CheckForUpdatesResponse } from "@lukehagar/plexjs/sdk/models/operations let value: CheckForUpdatesResponse = { contentType: "", - statusCode: 9356, + statusCode: 429, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/clearplaylistcontentsrequest.md b/docs/sdk/models/operations/clearplaylistcontentsrequest.md index c30012ad..2ee583a7 100644 --- a/docs/sdk/models/operations/clearplaylistcontentsrequest.md +++ b/docs/sdk/models/operations/clearplaylistcontentsrequest.md @@ -6,7 +6,7 @@ import { ClearPlaylistContentsRequest } from "@lukehagar/plexjs/sdk/models/operations"; let value: ClearPlaylistContentsRequest = { - playlistID: 3687.25, + playlistID: 6793.93, }; ``` diff --git a/docs/sdk/models/operations/clearplaylistcontentsresponse.md b/docs/sdk/models/operations/clearplaylistcontentsresponse.md index 6665fdb9..1b93cf44 100644 --- a/docs/sdk/models/operations/clearplaylistcontentsresponse.md +++ b/docs/sdk/models/operations/clearplaylistcontentsresponse.md @@ -7,7 +7,7 @@ import { ClearPlaylistContentsResponse } from "@lukehagar/plexjs/sdk/models/oper let value: ClearPlaylistContentsResponse = { contentType: "", - statusCode: 662527, + statusCode: 304, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/collection.md b/docs/sdk/models/operations/collection.md new file mode 100644 index 00000000..bd97e909 --- /dev/null +++ b/docs/sdk/models/operations/collection.md @@ -0,0 +1,17 @@ +# Collection + +## Example Usage + +```typescript +import { Collection } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: Collection = { + tag: "Working NL Subs", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `tag` | *string* | :heavy_minus_sign: | N/A | Working NL Subs | \ No newline at end of file diff --git a/docs/sdk/models/operations/connections.md b/docs/sdk/models/operations/connections.md index 2ee822c0..3d715cfb 100644 --- a/docs/sdk/models/operations/connections.md +++ b/docs/sdk/models/operations/connections.md @@ -3,13 +3,13 @@ ## Example Usage ```typescript -import { Connections } from "@lukehagar/plexjs/sdk/models/operations"; +import { Connections, Protocol } from "@lukehagar/plexjs/sdk/models/operations"; let value: Connections = { - protocol: "", - address: "718 Wolff Light", - port: 7991.59, - uri: "https://jumbo-lobotomy.net", + protocol: Protocol.Http, + address: "21611 Schuster Cliffs", + port: 54915, + uri: "https://wobbly-instance.org/", local: false, relay: false, iPv6: false, @@ -18,12 +18,12 @@ let value: Connections = { ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `protocol` | *string* | :heavy_check_mark: | N/A | -| `address` | *string* | :heavy_check_mark: | N/A | -| `port` | *number* | :heavy_check_mark: | N/A | -| `uri` | *string* | :heavy_check_mark: | N/A | -| `local` | *boolean* | :heavy_check_mark: | N/A | -| `relay` | *boolean* | :heavy_check_mark: | N/A | -| `iPv6` | *boolean* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `protocol` | [operations.Protocol](../../../sdk/models/operations/protocol.md) | :heavy_check_mark: | The protocol used for the connection (http, https, etc) | http | +| `address` | *string* | :heavy_check_mark: | The (ip) address or domain name used for the connection | | +| `port` | *number* | :heavy_check_mark: | The port used for the connection | | +| `uri` | *string* | :heavy_check_mark: | The full URI of the connection | | +| `local` | *boolean* | :heavy_check_mark: | If the connection is local address | | +| `relay` | *boolean* | :heavy_check_mark: | If the connection is relayed through plex.direct | | +| `iPv6` | *boolean* | :heavy_check_mark: | If the connection is using IPv6 | | \ No newline at end of file diff --git a/docs/sdk/models/operations/createplaylistrequest.md b/docs/sdk/models/operations/createplaylistrequest.md index bf36a611..43c5ff0e 100644 --- a/docs/sdk/models/operations/createplaylistrequest.md +++ b/docs/sdk/models/operations/createplaylistrequest.md @@ -8,8 +8,8 @@ import { CreatePlaylistQueryParamType, CreatePlaylistRequest, Smart } from "@luk let value: CreatePlaylistRequest = { title: "", type: CreatePlaylistQueryParamType.Video, - smart: Smart.One, - uri: "http://immediate-instructor.info", + smart: Smart.Zero, + uri: "https://pleased-lox.name", }; ``` diff --git a/docs/sdk/models/operations/createplaylistresponse.md b/docs/sdk/models/operations/createplaylistresponse.md index 4edadec4..c4900560 100644 --- a/docs/sdk/models/operations/createplaylistresponse.md +++ b/docs/sdk/models/operations/createplaylistresponse.md @@ -7,7 +7,7 @@ import { CreatePlaylistResponse } from "@lukehagar/plexjs/sdk/models/operations" let value: CreatePlaylistResponse = { contentType: "", - statusCode: 244425, + statusCode: 409, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/defaultdirection.md b/docs/sdk/models/operations/defaultdirection.md new file mode 100644 index 00000000..86bf42e1 --- /dev/null +++ b/docs/sdk/models/operations/defaultdirection.md @@ -0,0 +1,19 @@ +# DefaultDirection + +The direction of the sort. Can be either `asc` or `desc`. + + +## Example Usage + +```typescript +import { DefaultDirection } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: DefaultDirection = DefaultDirection.Ascending; +``` + +## Values + +| Name | Value | +| ------------ | ------------ | +| `Ascending` | asc | +| `Descending` | desc | \ No newline at end of file diff --git a/docs/sdk/models/operations/defaultsubtitleaccessibility.md b/docs/sdk/models/operations/defaultsubtitleaccessibility.md index 3193e76f..21619100 100644 --- a/docs/sdk/models/operations/defaultsubtitleaccessibility.md +++ b/docs/sdk/models/operations/defaultsubtitleaccessibility.md @@ -1,18 +1,18 @@ # DefaultSubtitleAccessibility -The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles) +The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only show non-SDH subtitles) ## Example Usage ```typescript import { DefaultSubtitleAccessibility } from "@lukehagar/plexjs/sdk/models/operations"; -let value: DefaultSubtitleAccessibility = DefaultSubtitleAccessibility.One; +let value: DefaultSubtitleAccessibility = DefaultSubtitleAccessibility.Enable; ``` ## Values -| Name | Value | -| ------ | ------ | -| `Zero` | 0 | -| `One` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/defaultsubtitleforced.md b/docs/sdk/models/operations/defaultsubtitleforced.md index 3921e448..96c21b15 100644 --- a/docs/sdk/models/operations/defaultsubtitleforced.md +++ b/docs/sdk/models/operations/defaultsubtitleforced.md @@ -7,12 +7,12 @@ The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer ```typescript import { DefaultSubtitleForced } from "@lukehagar/plexjs/sdk/models/operations"; -let value: DefaultSubtitleForced = DefaultSubtitleForced.Zero; +let value: DefaultSubtitleForced = DefaultSubtitleForced.Enable; ``` ## Values -| Name | Value | -| ------ | ------ | -| `Zero` | 0 | -| `One` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/deletelibraryresponse.md b/docs/sdk/models/operations/deletelibraryresponse.md index a75179cd..d679c4b4 100644 --- a/docs/sdk/models/operations/deletelibraryresponse.md +++ b/docs/sdk/models/operations/deletelibraryresponse.md @@ -7,7 +7,7 @@ import { DeleteLibraryResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: DeleteLibraryResponse = { contentType: "", - statusCode: 99280, + statusCode: 507, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/deleteplaylistrequest.md b/docs/sdk/models/operations/deleteplaylistrequest.md index aa9a0334..f3c2617c 100644 --- a/docs/sdk/models/operations/deleteplaylistrequest.md +++ b/docs/sdk/models/operations/deleteplaylistrequest.md @@ -6,7 +6,7 @@ import { DeletePlaylistRequest } from "@lukehagar/plexjs/sdk/models/operations"; let value: DeletePlaylistRequest = { - playlistID: 6563.3, + playlistID: 2543.56, }; ``` diff --git a/docs/sdk/models/operations/deleteplaylistresponse.md b/docs/sdk/models/operations/deleteplaylistresponse.md index f2016032..4fd5dda0 100644 --- a/docs/sdk/models/operations/deleteplaylistresponse.md +++ b/docs/sdk/models/operations/deleteplaylistresponse.md @@ -7,7 +7,7 @@ import { DeletePlaylistResponse } from "@lukehagar/plexjs/sdk/models/operations" let value: DeletePlaylistResponse = { contentType: "", - statusCode: 317202, + statusCode: 101, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/director.md b/docs/sdk/models/operations/director.md index ac3d59ce..37d7cf11 100644 --- a/docs/sdk/models/operations/director.md +++ b/docs/sdk/models/operations/director.md @@ -6,7 +6,7 @@ import { Director } from "@lukehagar/plexjs/sdk/models/operations"; let value: Director = { - tag: "Peyton Reed", + tag: "James Cameron", }; ``` @@ -14,4 +14,4 @@ let value: Director = { | Field | Type | Required | Description | Example | | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `tag` | *string* | :heavy_minus_sign: | N/A | Peyton Reed | \ No newline at end of file +| `tag` | *string* | :heavy_minus_sign: | N/A | James Cameron | \ No newline at end of file diff --git a/docs/sdk/models/operations/enablepapertrailresponse.md b/docs/sdk/models/operations/enablepapertrailresponse.md index 7c9500e9..3664cc52 100644 --- a/docs/sdk/models/operations/enablepapertrailresponse.md +++ b/docs/sdk/models/operations/enablepapertrailresponse.md @@ -7,7 +7,7 @@ import { EnablePaperTrailResponse } from "@lukehagar/plexjs/sdk/models/operation let value: EnablePaperTrailResponse = { contentType: "", - statusCode: 635059, + statusCode: 400, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/feature.md b/docs/sdk/models/operations/feature.md index f4f455ee..f9e72a56 100644 --- a/docs/sdk/models/operations/feature.md +++ b/docs/sdk/models/operations/feature.md @@ -5,13 +5,28 @@ ```typescript import { Feature } from "@lukehagar/plexjs/sdk/models/operations"; -let value: Feature = {}; +let value: Feature = { + type: "", + flavor: "global", + scrobbleKey: "/:/scrobble/new", + unscrobbleKey: "/:/unscrobble/new", + action: [ + { + id: "addToContinueWatching", + key: "/actions/addToContinueWatching", + }, + ], +}; ``` ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `key` | *string* | :heavy_minus_sign: | N/A | -| `type` | *string* | :heavy_minus_sign: | N/A | -| `directory` | [operations.GetMediaProvidersDirectory](../../../sdk/models/operations/getmediaprovidersdirectory.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `key` | *string* | :heavy_minus_sign: | N/A | | +| `type` | *string* | :heavy_check_mark: | N/A | | +| `flavor` | *string* | :heavy_minus_sign: | N/A | global | +| `scrobbleKey` | *string* | :heavy_minus_sign: | N/A | /:/scrobble/new | +| `unscrobbleKey` | *string* | :heavy_minus_sign: | N/A | /:/unscrobble/new | +| `directory` | [operations.GetMediaProvidersDirectory](../../../sdk/models/operations/getmediaprovidersdirectory.md)[] | :heavy_minus_sign: | N/A | | +| `action` | [operations.Action](../../../sdk/models/operations/action.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/features.md b/docs/sdk/models/operations/features.md index 340448d9..fdbbe25c 100644 --- a/docs/sdk/models/operations/features.md +++ b/docs/sdk/models/operations/features.md @@ -5,11 +5,13 @@ ```typescript import { Features } from "@lukehagar/plexjs/sdk/models/operations"; -let value: Features = Features.LiveTvSupportIncompleteSegments; +let value: Features = Features.Trailers; ``` ## Values +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + | Name | Value | | --------------------------------------- | --------------------------------------- | | `AndroidDolbyVision` | Android - Dolby Vision | @@ -19,28 +21,43 @@ let value: Features = Features.LiveTvSupportIncompleteSegments; | `TREBLEShowFeatures` | TREBLE-show-features | | `AdCountdownTimer` | ad-countdown-timer | | `AdaptiveBitrate` | adaptive_bitrate | +| `AlbumTypes` | album-types | +| `AllowDvr` | allow_dvr | | `AmazonLoopDebug` | amazon-loop-debug | | `AvodAdAnalysis` | avod-ad-analysis | | `AvodNewMedia` | avod-new-media | | `BlacklistGetSignin` | blacklist_get_signin | +| `BoostVoices` | boost-voices | +| `CameraUpload` | camera_upload | | `ClientRadioStations` | client-radio-stations | | `CloudflareTurnstileRequired` | cloudflare-turnstile-required | +| `Cloudsync` | cloudsync | | `Collections` | collections | | `CommentsAndRepliesPushNotifications` | comments_and_replies_push_notifications | | `CommunityAccessPlexTv` | community_access_plex_tv | | `CompanionsSonos` | companions_sonos | +| `ContentFilter` | content_filter | | `CustomHomeRemoval` | custom-home-removal | | `DisableHomeUserFriendships` | disable_home_user_friendships | | `DisableSharingFriendships` | disable_sharing_friendships | +| `DownloadsGating` | downloads-gating | | `DrmSupport` | drm_support | +| `Dvr` | dvr | +| `DvrBlockUnsupportedCountries` | dvr-block-unsupported-countries | +| `EpgRecentChannels` | epg-recent-channels | | `ExcludeRestrictions` | exclude restrictions | | `FederatedAuth` | federated-auth | | `FriendRequestPushNotifications` | friend_request_push_notifications | +| `GrandfatherSync` | grandfather-sync | | `GuidedUpgrade` | guided-upgrade | +| `HardwareTranscoding` | hardware_transcoding | | `Home` | home | +| `Hwtranscode` | hwtranscode | +| `ImaggaV2` | imagga-v2 | | `IncreasePasswordComplexity` | increase-password-complexity | | `Ios14PrivacyBanner` | ios14-privacy-banner | | `IterableNotificationTokens` | iterable-notification-tokens | +| `ItemClusters` | item_clusters | | `KeepPaymentMethod` | keep-payment-method | | `KevinBacon` | kevin-bacon | | `KoreaConsent` | korea-consent | @@ -49,25 +66,47 @@ let value: Features = Features.LiveTvSupportIncompleteSegments; | `LightningDvrPivot` | lightning-dvr-pivot | | `LiveTvSupportIncompleteSegments` | live-tv-support-incomplete-segments | | `Livetv` | livetv | +| `Lyrics` | lyrics | | `MetadataSearch` | metadata_search | +| `MusicAnalysis` | music-analysis | +| `MusicVideos` | music_videos | | `NewPlexPassPrices` | new_plex_pass_prices | | `NewsProviderSunsetModal` | news-provider-sunset-modal | +| `Nominatim` | nominatim | +| `Pass` | pass | | `PhotosFavorites` | photos-favorites | | `PhotosMetadataEdition` | photos-metadata-edition | +| `PhotosV6Edit` | photosV6-edit | +| `PhotosV6TvAlbums` | photosV6-tv-albums | | `PmsHealth` | pms_health | +| `PremiumDashboard` | premium-dashboard | +| `PremiumMusicMetadata` | premium_music_metadata | | `Radio` | radio | | `RateLimitClientToken` | rate-limit-client-token | | `ScrobblingServicePlexTv` | scrobbling-service-plex-tv | +| `SessionBandwidthRestrictions` | session_bandwidth_restrictions | +| `SessionKick` | session_kick | | `SharedServerNotification` | shared_server_notification | | `SharedSourceNotification` | shared_source_notification | +| `SigninNotification` | signin_notification | | `SigninWithApple` | signin_with_apple | +| `SilenceRemoval` | silence-removal | +| `SleepTimer` | sleep-timer | | `SpringServeAdProvider` | spring_serve_ad_provider | +| `Sync` | sync | +| `SweetFades` | sweet-fades | | `TranscoderCache` | transcoder_cache | +| `Trailers` | trailers | | `TunerSharing` | tuner-sharing | | `TwoFactorAuthentication` | two-factor-authentication | | `Unsupportedtuners` | unsupportedtuners | | `Upgrade3ds2` | upgrade-3ds2 | +| `Visualizers` | visualizers | | `VodSchema` | vod-schema | | `VodCloudflare` | vod_cloudflare | +| `VolumeLeveling` | volume-leveling | | `WatchTogetherInvite` | watch-together-invite | -| `WebServerDashboard` | web_server_dashboard | \ No newline at end of file +| `WatchlistRss` | watchlist-rss | +| `WebServerDashboard` | web_server_dashboard | +| `Webhooks` | webhooks | +| - | `Unrecognized` | \ No newline at end of file diff --git a/docs/sdk/models/operations/field.md b/docs/sdk/models/operations/field.md index a1d81062..9e3b8ea5 100644 --- a/docs/sdk/models/operations/field.md +++ b/docs/sdk/models/operations/field.md @@ -6,10 +6,10 @@ import { Field } from "@lukehagar/plexjs/sdk/models/operations"; let value: Field = { - key: "label", - title: "Label", - type: "tag", - subType: "bitrate", + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", }; ``` @@ -17,7 +17,7 @@ let value: Field = { | Field | Type | Required | Description | Example | | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `key` | *string* | :heavy_minus_sign: | N/A | label | -| `title` | *string* | :heavy_minus_sign: | N/A | Label | -| `type` | *string* | :heavy_minus_sign: | N/A | tag | -| `subType` | *string* | :heavy_minus_sign: | N/A | bitrate | \ No newline at end of file +| `key` | *string* | :heavy_check_mark: | N/A | show.title | +| `title` | *string* | :heavy_check_mark: | N/A | Show Title | +| `type` | *string* | :heavy_check_mark: | N/A | string | +| `subType` | *string* | :heavy_minus_sign: | N/A | rating | \ No newline at end of file diff --git a/docs/sdk/models/operations/fieldtype.md b/docs/sdk/models/operations/fieldtype.md index e683b32f..76f56f63 100644 --- a/docs/sdk/models/operations/fieldtype.md +++ b/docs/sdk/models/operations/fieldtype.md @@ -6,7 +6,7 @@ import { FieldType } from "@lukehagar/plexjs/sdk/models/operations"; let value: FieldType = { - type: "resolution", + type: "tag", operator: [ { key: "=", @@ -20,5 +20,5 @@ let value: FieldType = { | Field | Type | Required | Description | Example | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `type` | *string* | :heavy_minus_sign: | N/A | resolution | -| `operator` | [operations.Operator](../../../sdk/models/operations/operator.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `type` | *string* | :heavy_check_mark: | N/A | tag | +| `operator` | [operations.Operator](../../../sdk/models/operations/operator.md)[] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/filter.md b/docs/sdk/models/operations/filter.md index 85de5e7c..472f5a48 100644 --- a/docs/sdk/models/operations/filter.md +++ b/docs/sdk/models/operations/filter.md @@ -7,7 +7,7 @@ Filter ```typescript import { Filter } from "@lukehagar/plexjs/sdk/models/operations"; -let value: Filter = Filter.All; +let value: Filter = Filter.Released; ``` ## Values diff --git a/docs/sdk/models/operations/flattenseasons.md b/docs/sdk/models/operations/flattenseasons.md new file mode 100644 index 00000000..64e3ec2a --- /dev/null +++ b/docs/sdk/models/operations/flattenseasons.md @@ -0,0 +1,16 @@ +# FlattenSeasons + +## Example Usage + +```typescript +import { FlattenSeasons } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: FlattenSeasons = FlattenSeasons.True; +``` + +## Values + +| Name | Value | +| ------- | ------- | +| `False` | 0 | +| `True` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/force.md b/docs/sdk/models/operations/force.md index 5265772f..272869d9 100644 --- a/docs/sdk/models/operations/force.md +++ b/docs/sdk/models/operations/force.md @@ -7,7 +7,7 @@ Force the refresh even if the library is already being refreshed. ```typescript import { Force } from "@lukehagar/plexjs/sdk/models/operations"; -let value: Force = Force.One; +let value: Force = Force.Zero; ``` ## Values diff --git a/docs/sdk/models/operations/genre.md b/docs/sdk/models/operations/genre.md index 12ee1cf3..eabf9aaa 100644 --- a/docs/sdk/models/operations/genre.md +++ b/docs/sdk/models/operations/genre.md @@ -6,7 +6,7 @@ import { Genre } from "@lukehagar/plexjs/sdk/models/operations"; let value: Genre = { - tag: "Comedy", + tag: "Adventure", }; ``` @@ -14,4 +14,4 @@ let value: Genre = { | Field | Type | Required | Description | Example | | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `tag` | *string* | :heavy_minus_sign: | N/A | Comedy | \ No newline at end of file +| `tag` | *string* | :heavy_minus_sign: | N/A | Adventure | \ No newline at end of file diff --git a/docs/sdk/models/operations/geodata.md b/docs/sdk/models/operations/geodata.md index 74deda8b..82e40604 100644 --- a/docs/sdk/models/operations/geodata.md +++ b/docs/sdk/models/operations/geodata.md @@ -14,7 +14,7 @@ let value: GeoData = { city: "Amsterdam", europeanUnionMember: true, timeZone: "America/St_Thomas", - postalCode: 802, + postalCode: "802", inPrivacyRestrictedCountry: true, inPrivacyRestrictedRegion: true, subdivisions: "Saint Thomas", @@ -32,7 +32,7 @@ let value: GeoData = { | `city` | *string* | :heavy_check_mark: | The name of the city. | Amsterdam | | `europeanUnionMember` | *boolean* | :heavy_minus_sign: | Indicates if the country is a member of the European Union. | true | | `timeZone` | *string* | :heavy_check_mark: | The time zone of the country. | America/St_Thomas | -| `postalCode` | *number* | :heavy_check_mark: | The postal code of the location. | 802 | +| `postalCode` | *string* | :heavy_check_mark: | The postal code of the location. | 802 | | `inPrivacyRestrictedCountry` | *boolean* | :heavy_minus_sign: | Indicates if the country has privacy restrictions. | true | | `inPrivacyRestrictedRegion` | *boolean* | :heavy_minus_sign: | Indicates if the region has privacy restrictions. | true | | `subdivisions` | *string* | :heavy_check_mark: | The name of the primary administrative subdivision. | Saint Thomas | diff --git a/docs/sdk/models/operations/getalllibrariesdirectory.md b/docs/sdk/models/operations/getalllibrariesdirectory.md index 0831616f..44e1f783 100644 --- a/docs/sdk/models/operations/getalllibrariesdirectory.md +++ b/docs/sdk/models/operations/getalllibrariesdirectory.md @@ -24,7 +24,7 @@ let value: GetAllLibrariesDirectory = { scannedAt: 1556281940, content: true, directory: true, - contentChangedAt: 3192854, + contentChangedAt: 1556281940, hidden: 0, location: [ { @@ -39,24 +39,24 @@ let value: GetAllLibrariesDirectory = { | Field | Type | Required | Description | Example | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `allowSync` | *boolean* | :heavy_minus_sign: | N/A | true | -| `art` | *string* | :heavy_minus_sign: | N/A | /:/resources/movie-fanart.jpg | -| `composite` | *string* | :heavy_minus_sign: | N/A | /library/sections/1/composite/1705615584 | -| `filters` | *boolean* | :heavy_minus_sign: | N/A | true | -| `refreshing` | *boolean* | :heavy_minus_sign: | N/A | false | -| `thumb` | *string* | :heavy_minus_sign: | N/A | /:/resources/movie.png | -| `key` | *string* | :heavy_minus_sign: | N/A | 1 | -| `type` | *string* | :heavy_minus_sign: | N/A | movie | -| `title` | *string* | :heavy_minus_sign: | N/A | Movies | -| `agent` | *string* | :heavy_minus_sign: | N/A | tv.plex.agents.movie | -| `scanner` | *string* | :heavy_minus_sign: | N/A | Plex Movie | -| `language` | *string* | :heavy_minus_sign: | N/A | en-US | -| `uuid` | *string* | :heavy_minus_sign: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 | -| `updatedAt` | *number* | :heavy_minus_sign: | Unix epoch datetime | 1556281940 | -| `createdAt` | *number* | :heavy_minus_sign: | Unix epoch datetime | 1556281940 | -| `scannedAt` | *number* | :heavy_minus_sign: | Unix epoch datetime | 1556281940 | -| `content` | *boolean* | :heavy_minus_sign: | N/A | true | -| `directory` | *boolean* | :heavy_minus_sign: | N/A | true | -| `contentChangedAt` | *number* | :heavy_minus_sign: | N/A | 3192854 | -| `hidden` | *number* | :heavy_minus_sign: | N/A | 0 | -| `location` | [operations.Location](../../../sdk/models/operations/location.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `allowSync` | *boolean* | :heavy_check_mark: | N/A | true | +| `art` | *string* | :heavy_check_mark: | N/A | /:/resources/movie-fanart.jpg | +| `composite` | *string* | :heavy_check_mark: | N/A | /library/sections/1/composite/1705615584 | +| `filters` | *boolean* | :heavy_check_mark: | N/A | true | +| `refreshing` | *boolean* | :heavy_check_mark: | N/A | false | +| `thumb` | *string* | :heavy_check_mark: | N/A | /:/resources/movie.png | +| `key` | *string* | :heavy_check_mark: | N/A | 1 | +| `type` | *string* | :heavy_check_mark: | N/A | movie | +| `title` | *string* | :heavy_check_mark: | N/A | Movies | +| `agent` | *string* | :heavy_check_mark: | N/A | tv.plex.agents.movie | +| `scanner` | *string* | :heavy_check_mark: | N/A | Plex Movie | +| `language` | *string* | :heavy_check_mark: | N/A | en-US | +| `uuid` | *string* | :heavy_check_mark: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 | +| `updatedAt` | *number* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | +| `createdAt` | *number* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | +| `scannedAt` | *number* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | +| `content` | *boolean* | :heavy_check_mark: | N/A | true | +| `directory` | *boolean* | :heavy_check_mark: | N/A | true | +| `contentChangedAt` | *number* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | +| `hidden` | *number* | :heavy_check_mark: | N/A | 0 | +| `location` | [operations.Location](../../../sdk/models/operations/location.md)[] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/getalllibrariesmediacontainer.md b/docs/sdk/models/operations/getalllibrariesmediacontainer.md index 9371b436..f6f0775a 100644 --- a/docs/sdk/models/operations/getalllibrariesmediacontainer.md +++ b/docs/sdk/models/operations/getalllibrariesmediacontainer.md @@ -29,7 +29,7 @@ let value: GetAllLibrariesMediaContainer = { scannedAt: 1556281940, content: true, directory: true, - contentChangedAt: 3192854, + contentChangedAt: 1556281940, hidden: 0, location: [ { @@ -49,4 +49,4 @@ let value: GetAllLibrariesMediaContainer = { | `size` | *number* | :heavy_check_mark: | N/A | 5 | | `allowSync` | *boolean* | :heavy_check_mark: | N/A | false | | `title1` | *string* | :heavy_check_mark: | N/A | Plex Library | -| `directory` | [operations.GetAllLibrariesDirectory](../../../sdk/models/operations/getalllibrariesdirectory.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `directory` | [operations.GetAllLibrariesDirectory](../../../sdk/models/operations/getalllibrariesdirectory.md)[] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/getalllibrariesresponse.md b/docs/sdk/models/operations/getalllibrariesresponse.md index 59f7e026..e53fb7ed 100644 --- a/docs/sdk/models/operations/getalllibrariesresponse.md +++ b/docs/sdk/models/operations/getalllibrariesresponse.md @@ -7,7 +7,7 @@ import { GetAllLibrariesResponse } from "@lukehagar/plexjs/sdk/models/operations let value: GetAllLibrariesResponse = { contentType: "", - statusCode: 437032, + statusCode: 308, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), @@ -36,7 +36,7 @@ let value: GetAllLibrariesResponse = { scannedAt: 1556281940, content: true, directory: true, - contentChangedAt: 3192854, + contentChangedAt: 1556281940, hidden: 0, location: [ { diff --git a/docs/sdk/models/operations/getalllibrariesresponsebody.md b/docs/sdk/models/operations/getalllibrariesresponsebody.md index a7ff89dd..d378980a 100644 --- a/docs/sdk/models/operations/getalllibrariesresponsebody.md +++ b/docs/sdk/models/operations/getalllibrariesresponsebody.md @@ -32,7 +32,7 @@ let value: GetAllLibrariesResponseBody = { scannedAt: 1556281940, content: true, directory: true, - contentChangedAt: 3192854, + contentChangedAt: 1556281940, hidden: 0, location: [ { @@ -50,4 +50,4 @@ let value: GetAllLibrariesResponseBody = { | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -| `mediaContainer` | [operations.GetAllLibrariesMediaContainer](../../../sdk/models/operations/getalllibrariesmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `mediaContainer` | [operations.GetAllLibrariesMediaContainer](../../../sdk/models/operations/getalllibrariesmediacontainer.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/getavailableclientsresponse.md b/docs/sdk/models/operations/getavailableclientsresponse.md index 34ecbdda..3364bc12 100644 --- a/docs/sdk/models/operations/getavailableclientsresponse.md +++ b/docs/sdk/models/operations/getavailableclientsresponse.md @@ -7,7 +7,7 @@ import { GetAvailableClientsResponse } from "@lukehagar/plexjs/sdk/models/operat let value: GetAvailableClientsResponse = { contentType: "", - statusCode: 715190, + statusCode: 305, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getbandwidthstatisticsresponse.md b/docs/sdk/models/operations/getbandwidthstatisticsresponse.md index ee95c0bc..a8d40d3e 100644 --- a/docs/sdk/models/operations/getbandwidthstatisticsresponse.md +++ b/docs/sdk/models/operations/getbandwidthstatisticsresponse.md @@ -7,7 +7,7 @@ import { GetBandwidthStatisticsResponse } from "@lukehagar/plexjs/sdk/models/ope let value: GetBandwidthStatisticsResponse = { contentType: "", - statusCode: 921158, + statusCode: 102, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getbutlertasksresponse.md b/docs/sdk/models/operations/getbutlertasksresponse.md index 9e646ad7..ce5697a3 100644 --- a/docs/sdk/models/operations/getbutlertasksresponse.md +++ b/docs/sdk/models/operations/getbutlertasksresponse.md @@ -7,7 +7,7 @@ import { GetButlerTasksResponse } from "@lukehagar/plexjs/sdk/models/operations" let value: GetButlerTasksResponse = { contentType: "", - statusCode: 528895, + statusCode: 431, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getcompanionsdataresponse.md b/docs/sdk/models/operations/getcompanionsdataresponse.md index 88c206df..7259d05a 100644 --- a/docs/sdk/models/operations/getcompanionsdataresponse.md +++ b/docs/sdk/models/operations/getcompanionsdataresponse.md @@ -7,7 +7,7 @@ import { GetCompanionsDataResponse } from "@lukehagar/plexjs/sdk/models/operatio let value: GetCompanionsDataResponse = { contentType: "", - statusCode: 648172, + statusCode: 308, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getdevicesresponse.md b/docs/sdk/models/operations/getdevicesresponse.md index c9de8056..b5a1f5fc 100644 --- a/docs/sdk/models/operations/getdevicesresponse.md +++ b/docs/sdk/models/operations/getdevicesresponse.md @@ -7,7 +7,7 @@ import { GetDevicesResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetDevicesResponse = { contentType: "", - statusCode: 844266, + statusCode: 308, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getfilehashresponse.md b/docs/sdk/models/operations/getfilehashresponse.md index de116395..d8fa7ee2 100644 --- a/docs/sdk/models/operations/getfilehashresponse.md +++ b/docs/sdk/models/operations/getfilehashresponse.md @@ -7,7 +7,7 @@ import { GetFileHashResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetFileHashResponse = { contentType: "", - statusCode: 359508, + statusCode: 305, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getgeodatageodata.md b/docs/sdk/models/operations/getgeodatageodata.md index d0270250..bb6ba4b9 100644 --- a/docs/sdk/models/operations/getgeodatageodata.md +++ b/docs/sdk/models/operations/getgeodatageodata.md @@ -14,7 +14,7 @@ let value: GetGeoDataGeoData = { city: "Amsterdam", europeanUnionMember: true, timeZone: "America/St_Thomas", - postalCode: 802, + postalCode: "802", inPrivacyRestrictedCountry: true, inPrivacyRestrictedRegion: true, subdivisions: "Saint Thomas", @@ -32,7 +32,7 @@ let value: GetGeoDataGeoData = { | `city` | *string* | :heavy_check_mark: | The name of the city. | Amsterdam | | `europeanUnionMember` | *boolean* | :heavy_minus_sign: | Indicates if the country is a member of the European Union. | true | | `timeZone` | *string* | :heavy_check_mark: | The time zone of the country. | America/St_Thomas | -| `postalCode` | *number* | :heavy_check_mark: | The postal code of the location. | 802 | +| `postalCode` | *string* | :heavy_check_mark: | The postal code of the location. | 802 | | `inPrivacyRestrictedCountry` | *boolean* | :heavy_minus_sign: | Indicates if the country has privacy restrictions. | true | | `inPrivacyRestrictedRegion` | *boolean* | :heavy_minus_sign: | Indicates if the region has privacy restrictions. | true | | `subdivisions` | *string* | :heavy_check_mark: | The name of the primary administrative subdivision. | Saint Thomas | diff --git a/docs/sdk/models/operations/getgeodataresponse.md b/docs/sdk/models/operations/getgeodataresponse.md index 7e9731b3..368fd08d 100644 --- a/docs/sdk/models/operations/getgeodataresponse.md +++ b/docs/sdk/models/operations/getgeodataresponse.md @@ -7,7 +7,7 @@ import { GetGeoDataResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetGeoDataResponse = { contentType: "", - statusCode: 368241, + statusCode: 102, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), @@ -18,7 +18,7 @@ let value: GetGeoDataResponse = { city: "Amsterdam", europeanUnionMember: true, timeZone: "America/St_Thomas", - postalCode: 802, + postalCode: "802", inPrivacyRestrictedCountry: true, inPrivacyRestrictedRegion: true, subdivisions: "Saint Thomas", diff --git a/docs/sdk/models/operations/getglobalhubsresponse.md b/docs/sdk/models/operations/getglobalhubsresponse.md index 61045003..3f27a8ca 100644 --- a/docs/sdk/models/operations/getglobalhubsresponse.md +++ b/docs/sdk/models/operations/getglobalhubsresponse.md @@ -7,7 +7,7 @@ import { GetGlobalHubsResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetGlobalHubsResponse = { contentType: "", - statusCode: 149675, + statusCode: 423, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/gethomedataresponse.md b/docs/sdk/models/operations/gethomedataresponse.md index e2769779..96e86a5a 100644 --- a/docs/sdk/models/operations/gethomedataresponse.md +++ b/docs/sdk/models/operations/gethomedataresponse.md @@ -7,7 +7,7 @@ import { GetHomeDataResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetHomeDataResponse = { contentType: "", - statusCode: 832620, + statusCode: 204, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getlibrarydetailsfield.md b/docs/sdk/models/operations/getlibrarydetailsfield.md new file mode 100644 index 00000000..2287d745 --- /dev/null +++ b/docs/sdk/models/operations/getlibrarydetailsfield.md @@ -0,0 +1,23 @@ +# GetLibraryDetailsField + +## Example Usage + +```typescript +import { GetLibraryDetailsField } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryDetailsField = { + key: "label", + title: "Label", + type: "tag", + subType: "bitrate", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `key` | *string* | :heavy_minus_sign: | N/A | label | +| `title` | *string* | :heavy_minus_sign: | N/A | Label | +| `type` | *string* | :heavy_minus_sign: | N/A | tag | +| `subType` | *string* | :heavy_minus_sign: | N/A | bitrate | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibrarydetailsfieldtype.md b/docs/sdk/models/operations/getlibrarydetailsfieldtype.md new file mode 100644 index 00000000..9d4c725f --- /dev/null +++ b/docs/sdk/models/operations/getlibrarydetailsfieldtype.md @@ -0,0 +1,24 @@ +# GetLibraryDetailsFieldType + +## Example Usage + +```typescript +import { GetLibraryDetailsFieldType } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryDetailsFieldType = { + type: "resolution", + operator: [ + { + key: "=", + title: "is", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `type` | *string* | :heavy_minus_sign: | N/A | resolution | +| `operator` | [operations.GetLibraryDetailsOperator](../../../sdk/models/operations/getlibrarydetailsoperator.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibrarydetailsmediacontainer.md b/docs/sdk/models/operations/getlibrarydetailsmediacontainer.md index d1620a90..1f0af0ea 100644 --- a/docs/sdk/models/operations/getlibrarydetailsmediacontainer.md +++ b/docs/sdk/models/operations/getlibrarydetailsmediacontainer.md @@ -94,4 +94,4 @@ let value: GetLibraryDetailsMediaContainer = { | `viewMode` | *number* | :heavy_minus_sign: | N/A | 65592 | | `directory` | [operations.GetLibraryDetailsDirectory](../../../sdk/models/operations/getlibrarydetailsdirectory.md)[] | :heavy_minus_sign: | N/A | | | `type` | [operations.GetLibraryDetailsType](../../../sdk/models/operations/getlibrarydetailstype.md)[] | :heavy_minus_sign: | N/A | | -| `fieldType` | [operations.FieldType](../../../sdk/models/operations/fieldtype.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `fieldType` | [operations.GetLibraryDetailsFieldType](../../../sdk/models/operations/getlibrarydetailsfieldtype.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibrarydetailsoperator.md b/docs/sdk/models/operations/getlibrarydetailsoperator.md new file mode 100644 index 00000000..2767f969 --- /dev/null +++ b/docs/sdk/models/operations/getlibrarydetailsoperator.md @@ -0,0 +1,19 @@ +# GetLibraryDetailsOperator + +## Example Usage + +```typescript +import { GetLibraryDetailsOperator } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryDetailsOperator = { + key: "=", + title: "is", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `key` | *string* | :heavy_minus_sign: | N/A | = | +| `title` | *string* | :heavy_minus_sign: | N/A | is | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibrarydetailsresponse.md b/docs/sdk/models/operations/getlibrarydetailsresponse.md index 6b253a2b..5c09f15f 100644 --- a/docs/sdk/models/operations/getlibrarydetailsresponse.md +++ b/docs/sdk/models/operations/getlibrarydetailsresponse.md @@ -7,7 +7,7 @@ import { GetLibraryDetailsResponse } from "@lukehagar/plexjs/sdk/models/operatio let value: GetLibraryDetailsResponse = { contentType: "", - statusCode: 697631, + statusCode: 308, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getlibrarydetailssort.md b/docs/sdk/models/operations/getlibrarydetailssort.md new file mode 100644 index 00000000..aed7e297 --- /dev/null +++ b/docs/sdk/models/operations/getlibrarydetailssort.md @@ -0,0 +1,27 @@ +# GetLibraryDetailsSort + +## Example Usage + +```typescript +import { GetLibraryDetailsSort } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryDetailsSort = { + default: "asc", + defaultDirection: "desc", + descKey: "random:desc", + firstCharacterKey: "/library/sections/1/firstCharacter", + key: "random", + title: "Randomly", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `default` | *string* | :heavy_minus_sign: | N/A | asc | +| `defaultDirection` | *string* | :heavy_minus_sign: | N/A | desc | +| `descKey` | *string* | :heavy_minus_sign: | N/A | random:desc | +| `firstCharacterKey` | *string* | :heavy_minus_sign: | N/A | /library/sections/1/firstCharacter | +| `key` | *string* | :heavy_minus_sign: | N/A | random | +| `title` | *string* | :heavy_minus_sign: | N/A | Randomly | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibrarydetailstype.md b/docs/sdk/models/operations/getlibrarydetailstype.md index d240b42b..46f7a04a 100644 --- a/docs/sdk/models/operations/getlibrarydetailstype.md +++ b/docs/sdk/models/operations/getlibrarydetailstype.md @@ -49,5 +49,5 @@ let value: GetLibraryDetailsType = { | `title` | *string* | :heavy_minus_sign: | N/A | Movies | | `active` | *boolean* | :heavy_minus_sign: | N/A | false | | `filter` | [operations.GetLibraryDetailsFilter](../../../sdk/models/operations/getlibrarydetailsfilter.md)[] | :heavy_minus_sign: | N/A | | -| `sort` | [operations.Sort](../../../sdk/models/operations/sort.md)[] | :heavy_minus_sign: | N/A | | -| `field` | [operations.Field](../../../sdk/models/operations/field.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `sort` | [operations.GetLibraryDetailsSort](../../../sdk/models/operations/getlibrarydetailssort.md)[] | :heavy_minus_sign: | N/A | | +| `field` | [operations.GetLibraryDetailsField](../../../sdk/models/operations/getlibrarydetailsfield.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryhubsrequest.md b/docs/sdk/models/operations/getlibraryhubsrequest.md index b9bff940..d3dae5b1 100644 --- a/docs/sdk/models/operations/getlibraryhubsrequest.md +++ b/docs/sdk/models/operations/getlibraryhubsrequest.md @@ -6,7 +6,7 @@ import { GetLibraryHubsRequest } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetLibraryHubsRequest = { - sectionId: 2223.21, + sectionId: 6063.93, }; ``` diff --git a/docs/sdk/models/operations/getlibraryhubsresponse.md b/docs/sdk/models/operations/getlibraryhubsresponse.md index d4f5a91a..b5d464b1 100644 --- a/docs/sdk/models/operations/getlibraryhubsresponse.md +++ b/docs/sdk/models/operations/getlibraryhubsresponse.md @@ -8,7 +8,7 @@ import { RFCDate } from "@lukehagar/plexjs/sdk/types"; let value: GetLibraryHubsResponse = { contentType: "", - statusCode: 616934, + statusCode: 101, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getlibraryitemsactivedirection.md b/docs/sdk/models/operations/getlibraryitemsactivedirection.md new file mode 100644 index 00000000..68591818 --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemsactivedirection.md @@ -0,0 +1,20 @@ +# GetLibraryItemsActiveDirection + +The direction of the sort. Can be either `asc` or `desc`. + + +## Example Usage + +```typescript +import { GetLibraryItemsActiveDirection } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsActiveDirection = + GetLibraryItemsActiveDirection.Ascending; +``` + +## Values + +| Name | Value | +| ------------ | ------------ | +| `Ascending` | asc | +| `Descending` | desc | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemscollection.md b/docs/sdk/models/operations/getlibraryitemscollection.md new file mode 100644 index 00000000..cca94489 --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemscollection.md @@ -0,0 +1,17 @@ +# GetLibraryItemsCollection + +## Example Usage + +```typescript +import { GetLibraryItemsCollection } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsCollection = { + tag: "Working NL Subs", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `tag` | *string* | :heavy_minus_sign: | N/A | Working NL Subs | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemsdefaultdirection.md b/docs/sdk/models/operations/getlibraryitemsdefaultdirection.md new file mode 100644 index 00000000..2cba14c3 --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemsdefaultdirection.md @@ -0,0 +1,20 @@ +# GetLibraryItemsDefaultDirection + +The direction of the sort. Can be either `asc` or `desc`. + + +## Example Usage + +```typescript +import { GetLibraryItemsDefaultDirection } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsDefaultDirection = + GetLibraryItemsDefaultDirection.Ascending; +``` + +## Values + +| Name | Value | +| ------------ | ------------ | +| `Ascending` | asc | +| `Descending` | desc | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemsfield.md b/docs/sdk/models/operations/getlibraryitemsfield.md new file mode 100644 index 00000000..157602ef --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemsfield.md @@ -0,0 +1,23 @@ +# GetLibraryItemsField + +## Example Usage + +```typescript +import { GetLibraryItemsField } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsField = { + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `key` | *string* | :heavy_check_mark: | N/A | show.title | +| `title` | *string* | :heavy_check_mark: | N/A | Show Title | +| `type` | *string* | :heavy_check_mark: | N/A | string | +| `subType` | *string* | :heavy_minus_sign: | N/A | rating | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemsfieldtype.md b/docs/sdk/models/operations/getlibraryitemsfieldtype.md new file mode 100644 index 00000000..3f264537 --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemsfieldtype.md @@ -0,0 +1,24 @@ +# GetLibraryItemsFieldType + +## Example Usage + +```typescript +import { GetLibraryItemsFieldType } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsFieldType = { + type: "tag", + operator: [ + { + key: "=", + title: "is", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `type` | *string* | :heavy_check_mark: | N/A | tag | +| `operator` | [operations.GetLibraryItemsOperator](../../../sdk/models/operations/getlibraryitemsoperator.md)[] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemsfilter.md b/docs/sdk/models/operations/getlibraryitemsfilter.md new file mode 100644 index 00000000..87ae32d8 --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemsfilter.md @@ -0,0 +1,25 @@ +# GetLibraryItemsFilter + +## Example Usage + +```typescript +import { GetLibraryItemsFilter } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsFilter = { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `filter` | *string* | :heavy_check_mark: | N/A | genre | +| `filterType` | *string* | :heavy_check_mark: | N/A | string | +| `key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/genre?type=2 | +| `title` | *string* | :heavy_check_mark: | N/A | Genre | +| `type` | *string* | :heavy_check_mark: | N/A | filter | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemsflattenseasons.md b/docs/sdk/models/operations/getlibraryitemsflattenseasons.md new file mode 100644 index 00000000..1d9775bb --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemsflattenseasons.md @@ -0,0 +1,16 @@ +# GetLibraryItemsFlattenSeasons + +## Example Usage + +```typescript +import { GetLibraryItemsFlattenSeasons } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsFlattenSeasons = GetLibraryItemsFlattenSeasons.True; +``` + +## Values + +| Name | Value | +| ------- | ------- | +| `False` | 0 | +| `True` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemshasthumbnail.md b/docs/sdk/models/operations/getlibraryitemshasthumbnail.md new file mode 100644 index 00000000..4d2088c6 --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemshasthumbnail.md @@ -0,0 +1,16 @@ +# GetLibraryItemsHasThumbnail + +## Example Usage + +```typescript +import { GetLibraryItemsHasThumbnail } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsHasThumbnail = GetLibraryItemsHasThumbnail.True; +``` + +## Values + +| Name | Value | +| ------- | ------- | +| `False` | 0 | +| `True` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemsimage.md b/docs/sdk/models/operations/getlibraryitemsimage.md new file mode 100644 index 00000000..6a1abacb --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemsimage.md @@ -0,0 +1,21 @@ +# GetLibraryItemsImage + +## Example Usage + +```typescript +import { GetLibraryItemsImage, GetLibraryItemsLibraryResponse200Type } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsImage = { + alt: "Episode 1", + type: GetLibraryItemsLibraryResponse200Type.Background, + url: "/library/metadata/45521/thumb/1644710589", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `alt` | *string* | :heavy_check_mark: | N/A | Episode 1 | +| `type` | [operations.GetLibraryItemsLibraryResponse200Type](../../../sdk/models/operations/getlibraryitemslibraryresponse200type.md) | :heavy_check_mark: | N/A | background | +| `url` | *string* | :heavy_check_mark: | N/A | /library/metadata/45521/thumb/1644710589 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemslibraryactivedirection.md b/docs/sdk/models/operations/getlibraryitemslibraryactivedirection.md new file mode 100644 index 00000000..ca0a4217 --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemslibraryactivedirection.md @@ -0,0 +1,20 @@ +# GetLibraryItemsLibraryActiveDirection + +The direction of the sort. Can be either `asc` or `desc`. + + +## Example Usage + +```typescript +import { GetLibraryItemsLibraryActiveDirection } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsLibraryActiveDirection = + GetLibraryItemsLibraryActiveDirection.Ascending; +``` + +## Values + +| Name | Value | +| ------------ | ------------ | +| `Ascending` | asc | +| `Descending` | desc | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemslibrarydefaultdirection.md b/docs/sdk/models/operations/getlibraryitemslibrarydefaultdirection.md new file mode 100644 index 00000000..edd76437 --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemslibrarydefaultdirection.md @@ -0,0 +1,20 @@ +# GetLibraryItemsLibraryDefaultDirection + +The direction of the sort. Can be either `asc` or `desc`. + + +## Example Usage + +```typescript +import { GetLibraryItemsLibraryDefaultDirection } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsLibraryDefaultDirection = + GetLibraryItemsLibraryDefaultDirection.Ascending; +``` + +## Values + +| Name | Value | +| ------------ | ------------ | +| `Ascending` | asc | +| `Descending` | desc | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemslibraryfield.md b/docs/sdk/models/operations/getlibraryitemslibraryfield.md new file mode 100644 index 00000000..f26e3b83 --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemslibraryfield.md @@ -0,0 +1,23 @@ +# GetLibraryItemsLibraryField + +## Example Usage + +```typescript +import { GetLibraryItemsLibraryField } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsLibraryField = { + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `key` | *string* | :heavy_check_mark: | N/A | show.title | +| `title` | *string* | :heavy_check_mark: | N/A | Show Title | +| `type` | *string* | :heavy_check_mark: | N/A | string | +| `subType` | *string* | :heavy_minus_sign: | N/A | rating | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemslibraryfieldtype.md b/docs/sdk/models/operations/getlibraryitemslibraryfieldtype.md new file mode 100644 index 00000000..4e17a2dc --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemslibraryfieldtype.md @@ -0,0 +1,24 @@ +# GetLibraryItemsLibraryFieldType + +## Example Usage + +```typescript +import { GetLibraryItemsLibraryFieldType } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsLibraryFieldType = { + type: "tag", + operator: [ + { + key: "=", + title: "is", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `type` | *string* | :heavy_check_mark: | N/A | tag | +| `operator` | [operations.GetLibraryItemsLibraryOperator](../../../sdk/models/operations/getlibraryitemslibraryoperator.md)[] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemslibraryfilter.md b/docs/sdk/models/operations/getlibraryitemslibraryfilter.md new file mode 100644 index 00000000..c07e32d3 --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemslibraryfilter.md @@ -0,0 +1,25 @@ +# GetLibraryItemsLibraryFilter + +## Example Usage + +```typescript +import { GetLibraryItemsLibraryFilter } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsLibraryFilter = { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `filter` | *string* | :heavy_check_mark: | N/A | genre | +| `filterType` | *string* | :heavy_check_mark: | N/A | string | +| `key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/genre?type=2 | +| `title` | *string* | :heavy_check_mark: | N/A | Genre | +| `type` | *string* | :heavy_check_mark: | N/A | filter | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemslibraryoperator.md b/docs/sdk/models/operations/getlibraryitemslibraryoperator.md new file mode 100644 index 00000000..546e8099 --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemslibraryoperator.md @@ -0,0 +1,19 @@ +# GetLibraryItemsLibraryOperator + +## Example Usage + +```typescript +import { GetLibraryItemsLibraryOperator } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsLibraryOperator = { + key: "=", + title: "is", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `key` | *string* | :heavy_check_mark: | N/A | = | +| `title` | *string* | :heavy_check_mark: | N/A | is | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemslibraryresponse200type.md b/docs/sdk/models/operations/getlibraryitemslibraryresponse200type.md new file mode 100644 index 00000000..41409524 --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemslibraryresponse200type.md @@ -0,0 +1,19 @@ +# GetLibraryItemsLibraryResponse200Type + +## Example Usage + +```typescript +import { GetLibraryItemsLibraryResponse200Type } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsLibraryResponse200Type = + GetLibraryItemsLibraryResponse200Type.Background; +``` + +## Values + +| Name | Value | +| ------------- | ------------- | +| `CoverPoster` | coverPoster | +| `Background` | background | +| `Snapshot` | snapshot | +| `ClearLogo` | clearLogo | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemslibraryresponsetype.md b/docs/sdk/models/operations/getlibraryitemslibraryresponsetype.md new file mode 100644 index 00000000..061ecfba --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemslibraryresponsetype.md @@ -0,0 +1,59 @@ +# GetLibraryItemsLibraryResponseType + +## Example Usage + +```typescript +import { + GetLibraryItemsLibraryActiveDirection, + GetLibraryItemsLibraryDefaultDirection, + GetLibraryItemsLibraryResponseType, +} from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsLibraryResponseType = { + key: "/library/sections/2/all?type=2", + type: "show", + title: "TV Shows", + active: false, + filter: [ + { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", + }, + ], + sort: [ + { + default: "asc", + active: false, + activeDirection: GetLibraryItemsLibraryActiveDirection.Ascending, + defaultDirection: GetLibraryItemsLibraryDefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", + }, + ], + field: [ + { + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/all?type=2 | +| `type` | *string* | :heavy_check_mark: | N/A | show | +| `title` | *string* | :heavy_check_mark: | N/A | TV Shows | +| `active` | *boolean* | :heavy_check_mark: | N/A | false | +| `filter` | [operations.GetLibraryItemsLibraryFilter](../../../sdk/models/operations/getlibraryitemslibraryfilter.md)[] | :heavy_minus_sign: | N/A | | +| `sort` | [operations.GetLibraryItemsLibrarySort](../../../sdk/models/operations/getlibraryitemslibrarysort.md)[] | :heavy_minus_sign: | N/A | | +| `field` | [operations.GetLibraryItemsLibraryField](../../../sdk/models/operations/getlibraryitemslibraryfield.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemslibrarysort.md b/docs/sdk/models/operations/getlibraryitemslibrarysort.md new file mode 100644 index 00000000..1679fd75 --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemslibrarysort.md @@ -0,0 +1,35 @@ +# GetLibraryItemsLibrarySort + +## Example Usage + +```typescript +import { + GetLibraryItemsLibraryActiveDirection, + GetLibraryItemsLibraryDefaultDirection, + GetLibraryItemsLibrarySort, +} from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsLibrarySort = { + default: "asc", + active: false, + activeDirection: GetLibraryItemsLibraryActiveDirection.Ascending, + defaultDirection: GetLibraryItemsLibraryDefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `default` | *string* | :heavy_minus_sign: | N/A | asc | +| `active` | *boolean* | :heavy_minus_sign: | N/A | false | +| `activeDirection` | [operations.GetLibraryItemsLibraryActiveDirection](../../../sdk/models/operations/getlibraryitemslibraryactivedirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.
| asc | +| `defaultDirection` | [operations.GetLibraryItemsLibraryDefaultDirection](../../../sdk/models/operations/getlibraryitemslibrarydefaultdirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.
| asc | +| `descKey` | *string* | :heavy_minus_sign: | N/A | titleSort:desc | +| `firstCharacterKey` | *string* | :heavy_minus_sign: | N/A | /library/sections/2/firstCharacter | +| `key` | *string* | :heavy_check_mark: | N/A | titleSort | +| `title` | *string* | :heavy_check_mark: | N/A | Title | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemslibrarytype.md b/docs/sdk/models/operations/getlibraryitemslibrarytype.md new file mode 100644 index 00000000..2fa708c9 --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemslibrarytype.md @@ -0,0 +1,21 @@ +# GetLibraryItemsLibraryType + +The type of media content + + +## Example Usage + +```typescript +import { GetLibraryItemsLibraryType } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsLibraryType = GetLibraryItemsLibraryType.Movie; +``` + +## Values + +| Name | Value | +| --------- | --------- | +| `Movie` | movie | +| `TvShow` | show | +| `Season` | season | +| `Episode` | episode | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemsmedia.md b/docs/sdk/models/operations/getlibraryitemsmedia.md index 490cfa7e..25fcfee9 100644 --- a/docs/sdk/models/operations/getlibraryitemsmedia.md +++ b/docs/sdk/models/operations/getlibraryitemsmedia.md @@ -3,7 +3,11 @@ ## Example Usage ```typescript -import { GetLibraryItemsMedia } from "@lukehagar/plexjs/sdk/models/operations"; +import { + GetLibraryItemsHasThumbnail, + GetLibraryItemsMedia, + GetLibraryItemsOptimizedForStreaming, +} from "@lukehagar/plexjs/sdk/models/operations"; let value: GetLibraryItemsMedia = { id: 119534, @@ -12,6 +16,7 @@ let value: GetLibraryItemsMedia = { width: 3840, height: 2072, aspectRatio: 1.85, + audioProfile: "dts", audioChannels: 6, audioCodec: "eac3", videoCodec: "hevc", @@ -19,6 +24,9 @@ let value: GetLibraryItemsMedia = { container: "mkv", videoFrameRate: "24p", videoProfile: "main 10", + hasVoiceActivity: false, + optimizedForStreaming: GetLibraryItemsOptimizedForStreaming.Enable, + has64bitOffsets: false, part: [ { id: 119542, @@ -28,7 +36,54 @@ let value: GetLibraryItemsMedia = { "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", size: 36158371307, container: "mkv", + audioProfile: "dts", + has64bitOffsets: false, + optimizedForStreaming: false, videoProfile: "main 10", + indexes: "sd", + hasThumbnail: GetLibraryItemsHasThumbnail.True, + stream: [ + { + id: 272796, + streamType: 1, + default: true, + selected: true, + codec: "h264", + index: 0, + bitrate: 6273, + colorPrimaries: "bt709", + colorRange: "tv", + colorSpace: "bt709", + colorTrc: "bt709", + bitDepth: 8, + chromaLocation: "left", + streamIdentifier: "2", + chromaSubsampling: "4:2:0", + codedHeight: 1088, + codedWidth: 1920, + frameRate: 29.97, + hasScalingMatrix: false, + hearingImpaired: false, + closedCaptions: false, + embeddedInVideo: "1", + height: 1080, + level: 40, + profile: "main", + refFrames: 4, + scanType: "progressive", + width: 1920, + displayTitle: "1080p (H.264)", + extendedDisplayTitle: "1080p (H.264)", + channels: 2, + language: "English", + languageTag: "en", + languageCode: "eng", + audioChannelLayout: "stereo", + samplingRate: 48000, + title: "English", + canAutoSync: false, + }, + ], }, ], }; @@ -36,19 +91,23 @@ let value: GetLibraryItemsMedia = { ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `id` | *number* | :heavy_minus_sign: | N/A | 119534 | -| `duration` | *number* | :heavy_minus_sign: | N/A | 11558112 | -| `bitrate` | *number* | :heavy_minus_sign: | N/A | 25025 | -| `width` | *number* | :heavy_minus_sign: | N/A | 3840 | -| `height` | *number* | :heavy_minus_sign: | N/A | 2072 | -| `aspectRatio` | *number* | :heavy_minus_sign: | N/A | 1.85 | -| `audioChannels` | *number* | :heavy_minus_sign: | N/A | 6 | -| `audioCodec` | *string* | :heavy_minus_sign: | N/A | eac3 | -| `videoCodec` | *string* | :heavy_minus_sign: | N/A | hevc | -| `videoResolution` | *string* | :heavy_minus_sign: | N/A | 4k | -| `container` | *string* | :heavy_minus_sign: | N/A | mkv | -| `videoFrameRate` | *string* | :heavy_minus_sign: | N/A | 24p | -| `videoProfile` | *string* | :heavy_minus_sign: | N/A | main 10 | -| `part` | [operations.GetLibraryItemsPart](../../../sdk/models/operations/getlibraryitemspart.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `id` | *number* | :heavy_check_mark: | N/A | 119534 | +| `duration` | *number* | :heavy_check_mark: | N/A | 11558112 | +| `bitrate` | *number* | :heavy_check_mark: | N/A | 25025 | +| `width` | *number* | :heavy_check_mark: | N/A | 3840 | +| `height` | *number* | :heavy_check_mark: | N/A | 2072 | +| `aspectRatio` | *number* | :heavy_check_mark: | N/A | 1.85 | +| `audioProfile` | *string* | :heavy_minus_sign: | N/A | dts | +| `audioChannels` | *number* | :heavy_check_mark: | N/A | 6 | +| `audioCodec` | *string* | :heavy_check_mark: | N/A | eac3 | +| `videoCodec` | *string* | :heavy_check_mark: | N/A | hevc | +| `videoResolution` | *string* | :heavy_check_mark: | N/A | 4k | +| `container` | *string* | :heavy_check_mark: | N/A | mkv | +| `videoFrameRate` | *string* | :heavy_check_mark: | N/A | 24p | +| `videoProfile` | *string* | :heavy_check_mark: | N/A | main 10 | +| `hasVoiceActivity` | *boolean* | :heavy_minus_sign: | N/A | false | +| `optimizedForStreaming` | [operations.GetLibraryItemsOptimizedForStreaming](../../../sdk/models/operations/getlibraryitemsoptimizedforstreaming.md) | :heavy_minus_sign: | N/A | 1 | +| `has64bitOffsets` | *boolean* | :heavy_minus_sign: | N/A | false | +| `part` | [operations.GetLibraryItemsPart](../../../sdk/models/operations/getlibraryitemspart.md)[] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemsmediacontainer.md b/docs/sdk/models/operations/getlibraryitemsmediacontainer.md index af8ea4f5..48310810 100644 --- a/docs/sdk/models/operations/getlibraryitemsmediacontainer.md +++ b/docs/sdk/models/operations/getlibraryitemsmediacontainer.md @@ -1,16 +1,84 @@ # GetLibraryItemsMediaContainer +The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + + ## Example Usage ```typescript -import { GetLibraryItemsMediaContainer } from "@lukehagar/plexjs/sdk/models/operations"; +import { + GetLibraryItemsActiveDirection, + GetLibraryItemsDefaultDirection, + GetLibraryItemsFlattenSeasons, + GetLibraryItemsHasThumbnail, + GetLibraryItemsLibraryActiveDirection, + GetLibraryItemsLibraryDefaultDirection, + GetLibraryItemsLibraryResponse200Type, + GetLibraryItemsLibraryType, + GetLibraryItemsMediaContainer, + GetLibraryItemsOptimizedForStreaming, + GetLibraryItemsShowOrdering, +} from "@lukehagar/plexjs/sdk/models/operations"; import { RFCDate } from "@lukehagar/plexjs/sdk/types"; let value: GetLibraryItemsMediaContainer = { + type: [ + { + key: "/library/sections/2/all?type=2", + type: "show", + title: "TV Shows", + active: false, + filter: [ + { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", + }, + ], + sort: [ + { + default: "asc", + active: false, + activeDirection: GetLibraryItemsActiveDirection.Ascending, + defaultDirection: GetLibraryItemsDefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", + }, + ], + field: [ + { + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", + }, + ], + }, + ], + fieldType: [ + { + type: "tag", + operator: [ + { + key: "=", + title: "is", + }, + ], + }, + ], size: 70, + totalSize: 170, + offset: 0, + content: "secondary", allowSync: true, + nocache: true, art: "/:/resources/movie-fanart.jpg", identifier: "com.plexapp.plugins.library", + librarySectionID: 1, librarySectionTitle: "Movies", librarySectionUUID: "322a231a-b7f7-49f5-920f-14c61199cd30", mediaTagPrefix: "/system/bundle/media/flags/", @@ -27,21 +95,30 @@ let value: GetLibraryItemsMediaContainer = { key: "/library/metadata/58683", guid: "plex://movie/5d7768ba96b655001fdc0408", studio: "20th Century Studios", - type: "movie", + skipChildren: false, + librarySectionID: 1, + librarySectionTitle: "Movies", + librarySectionKey: "/library/sections/1", + type: GetLibraryItemsLibraryType.Movie, title: "Avatar: The Way of Water", + slug: "4-for-texas", contentRating: "PG-13", summary: "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", rating: 7.6, audienceRating: 9.2, year: 2022, + seasonCount: 2022, tagline: "Return to Pandora.", + flattenSeasons: GetLibraryItemsFlattenSeasons.True, + showOrdering: GetLibraryItemsShowOrdering.Dvd, thumb: "/library/metadata/58683/thumb/1703239236", art: "/library/metadata/58683/art/1703239236", + banner: "/library/metadata/58683/banner/1703239236", duration: 11558112, originallyAvailableAt: new RFCDate("2022-12-14T00:00:00Z"), - addedAt: 1680457607, - updatedAt: 1703239236, + addedAt: 1556281940, + updatedAt: 1556281940, audienceRatingImage: "rottentomatoes://image.rating.upright", chapterSource: "media", primaryExtraKey: "/library/metadata/58684", @@ -51,6 +128,8 @@ let value: GetLibraryItemsMediaContainer = { grandparentKey: "/library/metadata/66", grandparentTitle: "Caprica", grandparentThumb: "/library/metadata/66/thumb/1705716261", + parentSlug: "alice-in-borderland-2020", + grandparentSlug: "alice-in-borderland-2020", grandparentArt: "/library/metadata/66/art/1705716261", grandparentTheme: "/library/metadata/66/theme/1705716261", media: [ @@ -61,6 +140,7 @@ let value: GetLibraryItemsMediaContainer = { width: 3840, height: 2072, aspectRatio: 1.85, + audioProfile: "dts", audioChannels: 6, audioCodec: "eac3", videoCodec: "hevc", @@ -68,6 +148,9 @@ let value: GetLibraryItemsMediaContainer = { container: "mkv", videoFrameRate: "24p", videoProfile: "main 10", + hasVoiceActivity: false, + optimizedForStreaming: GetLibraryItemsOptimizedForStreaming.Enable, + has64bitOffsets: false, part: [ { id: 119542, @@ -77,7 +160,54 @@ let value: GetLibraryItemsMediaContainer = { "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", size: 36158371307, container: "mkv", + audioProfile: "dts", + has64bitOffsets: false, + optimizedForStreaming: false, videoProfile: "main 10", + indexes: "sd", + hasThumbnail: GetLibraryItemsHasThumbnail.True, + stream: [ + { + id: 272796, + streamType: 1, + default: true, + selected: true, + codec: "h264", + index: 0, + bitrate: 6273, + colorPrimaries: "bt709", + colorRange: "tv", + colorSpace: "bt709", + colorTrc: "bt709", + bitDepth: 8, + chromaLocation: "left", + streamIdentifier: "2", + chromaSubsampling: "4:2:0", + codedHeight: 1088, + codedWidth: 1920, + frameRate: 29.97, + hasScalingMatrix: false, + hearingImpaired: false, + closedCaptions: false, + embeddedInVideo: "1", + height: 1080, + level: 40, + profile: "main", + refFrames: 4, + scanType: "progressive", + width: 1920, + displayTitle: "1080p (H.264)", + extendedDisplayTitle: "1080p (H.264)", + channels: 2, + language: "English", + languageTag: "en", + languageCode: "eng", + audioChannelLayout: "stereo", + samplingRate: 48000, + title: "English", + canAutoSync: false, + }, + ], }, ], }, @@ -102,9 +232,45 @@ let value: GetLibraryItemsMediaContainer = { tag: "James Cameron", }, ], + collection: [ + { + tag: "Working NL Subs", + }, + ], role: [ { - tag: "Sigourney Weaver", + id: 294129, + filter: "actor=294129", + thumb: + "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", + tag: "Mike Smith", + tagKey: "668e7e7b22bcad9064350c91", + role: "Self", + }, + ], + mediaGuid: [ + { + id: "imdb://tt13015952", + }, + ], + ultraBlurColors: { + topLeft: "11333b", + topRight: "0a232d", + bottomRight: "73958", + bottomLeft: "1f5066", + }, + metaDataRating: [ + { + image: "themoviedb://image.rating", + value: 3, + type: "audience", + }, + ], + image: [ + { + alt: "Episode 1", + type: GetLibraryItemsLibraryResponse200Type.Background, + url: "/library/metadata/45521/thumb/1644710589", }, ], titleSort: "Whale", @@ -131,26 +297,83 @@ let value: GetLibraryItemsMediaContainer = { parentTheme: "/library/metadata/66/theme/1705716261", }, ], + meta: { + type: [ + { + key: "/library/sections/2/all?type=2", + type: "show", + title: "TV Shows", + active: false, + filter: [ + { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", + }, + ], + sort: [ + { + default: "asc", + active: false, + activeDirection: GetLibraryItemsLibraryActiveDirection.Ascending, + defaultDirection: GetLibraryItemsLibraryDefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", + }, + ], + field: [ + { + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", + }, + ], + }, + ], + fieldType: [ + { + type: "tag", + operator: [ + { + key: "=", + title: "is", + }, + ], + }, + ], + }, }; ``` ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `size` | *number* | :heavy_minus_sign: | N/A | 70 | -| `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` | *operations.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/ | -| `mediaTagVersion` | *number* | :heavy_minus_sign: | N/A | 1701731894 | -| `thumb` | *string* | :heavy_minus_sign: | N/A | /:/resources/movie.png | -| `title1` | *string* | :heavy_minus_sign: | N/A | Movies | -| `title2` | *string* | :heavy_minus_sign: | N/A | Recently Released | -| `viewGroup` | *string* | :heavy_minus_sign: | N/A | movie | -| `viewMode` | *number* | :heavy_minus_sign: | N/A | 65592 | -| `mixedParents` | *boolean* | :heavy_minus_sign: | N/A | true | -| `metadata` | [operations.GetLibraryItemsMetadata](../../../sdk/models/operations/getlibraryitemsmetadata.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `type` | [operations.GetLibraryItemsType](../../../sdk/models/operations/getlibraryitemstype.md)[] | :heavy_minus_sign: | N/A | | +| `fieldType` | [operations.GetLibraryItemsFieldType](../../../sdk/models/operations/getlibraryitemsfieldtype.md)[] | :heavy_minus_sign: | N/A | | +| `size` | *number* | :heavy_check_mark: | N/A | 70 | +| `totalSize` | *number* | :heavy_check_mark: | N/A | 170 | +| `offset` | *number* | :heavy_check_mark: | N/A | 0 | +| `content` | *string* | :heavy_check_mark: | N/A | secondary | +| `allowSync` | *boolean* | :heavy_check_mark: | N/A | true | +| `nocache` | *boolean* | :heavy_minus_sign: | N/A | true | +| `art` | *string* | :heavy_check_mark: | N/A | /:/resources/movie-fanart.jpg | +| `identifier` | *string* | :heavy_check_mark: | N/A | com.plexapp.plugins.library | +| `librarySectionID` | *number* | :heavy_check_mark: | N/A | 1 | +| `librarySectionTitle` | *string* | :heavy_check_mark: | N/A | Movies | +| `librarySectionUUID` | *string* | :heavy_check_mark: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 | +| `mediaTagPrefix` | *string* | :heavy_check_mark: | N/A | /system/bundle/media/flags/ | +| `mediaTagVersion` | *number* | :heavy_check_mark: | N/A | 1701731894 | +| `thumb` | *string* | :heavy_check_mark: | N/A | /:/resources/movie.png | +| `title1` | *string* | :heavy_check_mark: | N/A | Movies | +| `title2` | *string* | :heavy_check_mark: | N/A | Recently Released | +| `viewGroup` | *string* | :heavy_check_mark: | N/A | movie | +| `viewMode` | *number* | :heavy_minus_sign: | N/A | 65592 | +| `mixedParents` | *boolean* | :heavy_minus_sign: | N/A | true | +| `metadata` | [operations.GetLibraryItemsMetadata](../../../sdk/models/operations/getlibraryitemsmetadata.md)[] | :heavy_check_mark: | N/A | | +| `meta` | [operations.GetLibraryItemsMeta](../../../sdk/models/operations/getlibraryitemsmeta.md) | :heavy_minus_sign: | The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
| | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemsmediaguid.md b/docs/sdk/models/operations/getlibraryitemsmediaguid.md new file mode 100644 index 00000000..30008e83 --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemsmediaguid.md @@ -0,0 +1,17 @@ +# GetLibraryItemsMediaGuid + +## Example Usage + +```typescript +import { GetLibraryItemsMediaGuid } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsMediaGuid = { + id: "imdb://tt13015952", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Can be one of the following formats:
imdb://tt13015952, tmdb://2434012, tvdb://7945991
| imdb://tt13015952 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemsmeta.md b/docs/sdk/models/operations/getlibraryitemsmeta.md new file mode 100644 index 00000000..5bcfa193 --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemsmeta.md @@ -0,0 +1,72 @@ +# GetLibraryItemsMeta + +The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + + +## Example Usage + +```typescript +import { + GetLibraryItemsLibraryActiveDirection, + GetLibraryItemsLibraryDefaultDirection, + GetLibraryItemsMeta, +} from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsMeta = { + type: [ + { + key: "/library/sections/2/all?type=2", + type: "show", + title: "TV Shows", + active: false, + filter: [ + { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", + }, + ], + sort: [ + { + default: "asc", + active: false, + activeDirection: GetLibraryItemsLibraryActiveDirection.Ascending, + defaultDirection: GetLibraryItemsLibraryDefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", + }, + ], + field: [ + { + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", + }, + ], + }, + ], + fieldType: [ + { + type: "tag", + operator: [ + { + key: "=", + title: "is", + }, + ], + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `type` | [operations.GetLibraryItemsLibraryResponseType](../../../sdk/models/operations/getlibraryitemslibraryresponsetype.md)[] | :heavy_minus_sign: | N/A | +| `fieldType` | [operations.GetLibraryItemsLibraryFieldType](../../../sdk/models/operations/getlibraryitemslibraryfieldtype.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemsmetadata.md b/docs/sdk/models/operations/getlibraryitemsmetadata.md index 5d8e1efa..3a792ae0 100644 --- a/docs/sdk/models/operations/getlibraryitemsmetadata.md +++ b/docs/sdk/models/operations/getlibraryitemsmetadata.md @@ -3,7 +3,15 @@ ## Example Usage ```typescript -import { GetLibraryItemsMetadata } from "@lukehagar/plexjs/sdk/models/operations"; +import { + GetLibraryItemsFlattenSeasons, + GetLibraryItemsHasThumbnail, + GetLibraryItemsLibraryResponse200Type, + GetLibraryItemsLibraryType, + GetLibraryItemsMetadata, + GetLibraryItemsOptimizedForStreaming, + GetLibraryItemsShowOrdering, +} from "@lukehagar/plexjs/sdk/models/operations"; import { RFCDate } from "@lukehagar/plexjs/sdk/types"; let value: GetLibraryItemsMetadata = { @@ -11,21 +19,30 @@ let value: GetLibraryItemsMetadata = { key: "/library/metadata/58683", guid: "plex://movie/5d7768ba96b655001fdc0408", studio: "20th Century Studios", - type: "movie", + skipChildren: false, + librarySectionID: 1, + librarySectionTitle: "Movies", + librarySectionKey: "/library/sections/1", + type: GetLibraryItemsLibraryType.Movie, title: "Avatar: The Way of Water", + slug: "4-for-texas", contentRating: "PG-13", summary: "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", rating: 7.6, audienceRating: 9.2, year: 2022, + seasonCount: 2022, tagline: "Return to Pandora.", + flattenSeasons: GetLibraryItemsFlattenSeasons.True, + showOrdering: GetLibraryItemsShowOrdering.Dvd, thumb: "/library/metadata/58683/thumb/1703239236", art: "/library/metadata/58683/art/1703239236", + banner: "/library/metadata/58683/banner/1703239236", duration: 11558112, originallyAvailableAt: new RFCDate("2022-12-14T00:00:00Z"), - addedAt: 1680457607, - updatedAt: 1703239236, + addedAt: 1556281940, + updatedAt: 1556281940, audienceRatingImage: "rottentomatoes://image.rating.upright", chapterSource: "media", primaryExtraKey: "/library/metadata/58684", @@ -35,6 +52,8 @@ let value: GetLibraryItemsMetadata = { grandparentKey: "/library/metadata/66", grandparentTitle: "Caprica", grandparentThumb: "/library/metadata/66/thumb/1705716261", + parentSlug: "alice-in-borderland-2020", + grandparentSlug: "alice-in-borderland-2020", grandparentArt: "/library/metadata/66/art/1705716261", grandparentTheme: "/library/metadata/66/theme/1705716261", media: [ @@ -45,6 +64,7 @@ let value: GetLibraryItemsMetadata = { width: 3840, height: 2072, aspectRatio: 1.85, + audioProfile: "dts", audioChannels: 6, audioCodec: "eac3", videoCodec: "hevc", @@ -52,6 +72,9 @@ let value: GetLibraryItemsMetadata = { container: "mkv", videoFrameRate: "24p", videoProfile: "main 10", + hasVoiceActivity: false, + optimizedForStreaming: GetLibraryItemsOptimizedForStreaming.Enable, + has64bitOffsets: false, part: [ { id: 119542, @@ -61,7 +84,54 @@ let value: GetLibraryItemsMetadata = { "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", size: 36158371307, container: "mkv", + audioProfile: "dts", + has64bitOffsets: false, + optimizedForStreaming: false, videoProfile: "main 10", + indexes: "sd", + hasThumbnail: GetLibraryItemsHasThumbnail.True, + stream: [ + { + id: 272796, + streamType: 1, + default: true, + selected: true, + codec: "h264", + index: 0, + bitrate: 6273, + colorPrimaries: "bt709", + colorRange: "tv", + colorSpace: "bt709", + colorTrc: "bt709", + bitDepth: 8, + chromaLocation: "left", + streamIdentifier: "2", + chromaSubsampling: "4:2:0", + codedHeight: 1088, + codedWidth: 1920, + frameRate: 29.97, + hasScalingMatrix: false, + hearingImpaired: false, + closedCaptions: false, + embeddedInVideo: "1", + height: 1080, + level: 40, + profile: "main", + refFrames: 4, + scanType: "progressive", + width: 1920, + displayTitle: "1080p (H.264)", + extendedDisplayTitle: "1080p (H.264)", + channels: 2, + language: "English", + languageTag: "en", + languageCode: "eng", + audioChannelLayout: "stereo", + samplingRate: 48000, + title: "English", + canAutoSync: false, + }, + ], }, ], }, @@ -86,9 +156,45 @@ let value: GetLibraryItemsMetadata = { tag: "James Cameron", }, ], + collection: [ + { + tag: "Working NL Subs", + }, + ], role: [ { - tag: "Sigourney Weaver", + id: 294129, + filter: "actor=294129", + thumb: + "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", + tag: "Mike Smith", + tagKey: "668e7e7b22bcad9064350c91", + role: "Self", + }, + ], + mediaGuid: [ + { + id: "imdb://tt13015952", + }, + ], + ultraBlurColors: { + topLeft: "11333b", + topRight: "0a232d", + bottomRight: "73958", + bottomLeft: "1f5066", + }, + metaDataRating: [ + { + image: "themoviedb://image.rating", + value: 3, + type: "audience", + }, + ], + image: [ + { + alt: "Episode 1", + type: GetLibraryItemsLibraryResponse200Type.Background, + url: "/library/metadata/45521/thumb/1644710589", }, ], titleSort: "Whale", @@ -120,24 +226,33 @@ let value: GetLibraryItemsMetadata = { | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ratingKey` | *string* | :heavy_minus_sign: | N/A | 58683 | -| `key` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58683 | -| `guid` | *string* | :heavy_minus_sign: | N/A | plex://movie/5d7768ba96b655001fdc0408 | +| `ratingKey` | *string* | :heavy_check_mark: | The rating key (Media ID) of this media item.
Note: This is always an integer, but is represented as a string in the API.
| 58683 | +| `key` | *string* | :heavy_check_mark: | N/A | /library/metadata/58683 | +| `guid` | *string* | :heavy_check_mark: | N/A | plex://movie/5d7768ba96b655001fdc0408 | | `studio` | *string* | :heavy_minus_sign: | N/A | 20th Century Studios | -| `type` | *string* | :heavy_minus_sign: | N/A | movie | -| `title` | *string* | :heavy_minus_sign: | N/A | Avatar: The Way of Water | +| `skipChildren` | *boolean* | :heavy_minus_sign: | N/A | false | +| `librarySectionID` | *number* | :heavy_minus_sign: | N/A | 1 | +| `librarySectionTitle` | *string* | :heavy_minus_sign: | N/A | Movies | +| `librarySectionKey` | *string* | :heavy_minus_sign: | N/A | /library/sections/1 | +| `type` | [operations.GetLibraryItemsLibraryType](../../../sdk/models/operations/getlibraryitemslibrarytype.md) | :heavy_check_mark: | The type of media content
| movie | +| `title` | *string* | :heavy_check_mark: | N/A | Avatar: The Way of Water | +| `slug` | *string* | :heavy_minus_sign: | N/A | 4-for-texas | | `contentRating` | *string* | :heavy_minus_sign: | N/A | PG-13 | -| `summary` | *string* | :heavy_minus_sign: | N/A | Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home. | +| `summary` | *string* | :heavy_check_mark: | N/A | Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home. | | `rating` | *number* | :heavy_minus_sign: | N/A | 7.6 | | `audienceRating` | *number* | :heavy_minus_sign: | N/A | 9.2 | | `year` | *number* | :heavy_minus_sign: | N/A | 2022 | +| `seasonCount` | *number* | :heavy_minus_sign: | N/A | 2022 | | `tagline` | *string* | :heavy_minus_sign: | N/A | Return to Pandora. | +| `flattenSeasons` | [operations.GetLibraryItemsFlattenSeasons](../../../sdk/models/operations/getlibraryitemsflattenseasons.md) | :heavy_minus_sign: | N/A | 1 | +| `showOrdering` | [operations.GetLibraryItemsShowOrdering](../../../sdk/models/operations/getlibraryitemsshowordering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show
None = Library default,
tmdbAiring = The Movie Database (Aired),
aired = TheTVDB (Aired),
dvd = TheTVDB (DVD),
absolute = TheTVDB (Absolute)).
| dvd | | `thumb` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 | | `art` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 | +| `banner` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58683/banner/1703239236 | | `duration` | *number* | :heavy_minus_sign: | N/A | 11558112 | | `originallyAvailableAt` | [RFCDate](../../../types/rfcdate.md) | :heavy_minus_sign: | N/A | 2022-12-14 00:00:00 +0000 UTC | -| `addedAt` | *number* | :heavy_minus_sign: | N/A | 1680457607 | -| `updatedAt` | *number* | :heavy_minus_sign: | N/A | 1703239236 | +| `addedAt` | *number* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | +| `updatedAt` | *number* | :heavy_minus_sign: | Unix epoch datetime in seconds | 1556281940 | | `audienceRatingImage` | *string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | | `chapterSource` | *string* | :heavy_minus_sign: | N/A | media | | `primaryExtraKey` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58684 | @@ -147,14 +262,21 @@ let value: GetLibraryItemsMetadata = { | `grandparentKey` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66 | | `grandparentTitle` | *string* | :heavy_minus_sign: | N/A | Caprica | | `grandparentThumb` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66/thumb/1705716261 | +| `parentSlug` | *string* | :heavy_minus_sign: | N/A | alice-in-borderland-2020 | +| `grandparentSlug` | *string* | :heavy_minus_sign: | N/A | alice-in-borderland-2020 | | `grandparentArt` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66/art/1705716261 | | `grandparentTheme` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66/theme/1705716261 | -| `media` | [operations.GetLibraryItemsMedia](../../../sdk/models/operations/getlibraryitemsmedia.md)[] | :heavy_minus_sign: | N/A | | +| `media` | [operations.GetLibraryItemsMedia](../../../sdk/models/operations/getlibraryitemsmedia.md)[] | :heavy_minus_sign: | The Media object is only included when type query is `4` or higher.
| | | `genre` | [operations.GetLibraryItemsGenre](../../../sdk/models/operations/getlibraryitemsgenre.md)[] | :heavy_minus_sign: | N/A | | | `country` | [operations.GetLibraryItemsCountry](../../../sdk/models/operations/getlibraryitemscountry.md)[] | :heavy_minus_sign: | N/A | | | `director` | [operations.GetLibraryItemsDirector](../../../sdk/models/operations/getlibraryitemsdirector.md)[] | :heavy_minus_sign: | N/A | | | `writer` | [operations.GetLibraryItemsWriter](../../../sdk/models/operations/getlibraryitemswriter.md)[] | :heavy_minus_sign: | N/A | | +| `collection` | [operations.GetLibraryItemsCollection](../../../sdk/models/operations/getlibraryitemscollection.md)[] | :heavy_minus_sign: | N/A | | | `role` | [operations.GetLibraryItemsRole](../../../sdk/models/operations/getlibraryitemsrole.md)[] | :heavy_minus_sign: | N/A | | +| `mediaGuid` | [operations.GetLibraryItemsMediaGuid](../../../sdk/models/operations/getlibraryitemsmediaguid.md)[] | :heavy_minus_sign: | The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.
| | +| `ultraBlurColors` | [operations.GetLibraryItemsUltraBlurColors](../../../sdk/models/operations/getlibraryitemsultrablurcolors.md) | :heavy_minus_sign: | N/A | | +| `metaDataRating` | [operations.GetLibraryItemsMetaDataRating](../../../sdk/models/operations/getlibraryitemsmetadatarating.md)[] | :heavy_minus_sign: | N/A | | +| `image` | [operations.GetLibraryItemsImage](../../../sdk/models/operations/getlibraryitemsimage.md)[] | :heavy_minus_sign: | N/A | | | `titleSort` | *string* | :heavy_minus_sign: | N/A | Whale | | `viewCount` | *number* | :heavy_minus_sign: | N/A | 1 | | `lastViewedAt` | *number* | :heavy_minus_sign: | N/A | 1682752242 | @@ -168,7 +290,7 @@ let value: GetLibraryItemsMetadata = { | `childCount` | *number* | :heavy_minus_sign: | N/A | 1 | | `hasPremiumExtras` | *string* | :heavy_minus_sign: | N/A | 1 | | `hasPremiumPrimaryExtra` | *string* | :heavy_minus_sign: | N/A | 1 | -| `parentRatingKey` | *string* | :heavy_minus_sign: | N/A | 66 | +| `parentRatingKey` | *string* | :heavy_minus_sign: | The rating key of the parent item.
| 66 | | `parentGuid` | *string* | :heavy_minus_sign: | N/A | plex://show/5d9c081b170e24001f2a7be4 | | `parentStudio` | *string* | :heavy_minus_sign: | N/A | UCP | | `parentKey` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66 | diff --git a/docs/sdk/models/operations/getlibraryitemsmetadatarating.md b/docs/sdk/models/operations/getlibraryitemsmetadatarating.md new file mode 100644 index 00000000..f08b1d9b --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemsmetadatarating.md @@ -0,0 +1,21 @@ +# GetLibraryItemsMetaDataRating + +## Example Usage + +```typescript +import { GetLibraryItemsMetaDataRating } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsMetaDataRating = { + image: "themoviedb://image.rating", + value: 3, + type: "audience", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `image` | *string* | :heavy_check_mark: | A URI or path to the rating image. | themoviedb://image.rating | +| `value` | *number* | :heavy_check_mark: | The value of the rating. | 3 | +| `type` | *string* | :heavy_check_mark: | The type of rating (e.g., audience, critic). | audience | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemsoperator.md b/docs/sdk/models/operations/getlibraryitemsoperator.md new file mode 100644 index 00000000..e8aa4b14 --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemsoperator.md @@ -0,0 +1,19 @@ +# GetLibraryItemsOperator + +## Example Usage + +```typescript +import { GetLibraryItemsOperator } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsOperator = { + key: "=", + title: "is", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `key` | *string* | :heavy_check_mark: | N/A | = | +| `title` | *string* | :heavy_check_mark: | N/A | is | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemsoptimizedforstreaming.md b/docs/sdk/models/operations/getlibraryitemsoptimizedforstreaming.md new file mode 100644 index 00000000..a0a9cba7 --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemsoptimizedforstreaming.md @@ -0,0 +1,17 @@ +# GetLibraryItemsOptimizedForStreaming + +## Example Usage + +```typescript +import { GetLibraryItemsOptimizedForStreaming } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsOptimizedForStreaming = + GetLibraryItemsOptimizedForStreaming.Enable; +``` + +## Values + +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemspart.md b/docs/sdk/models/operations/getlibraryitemspart.md index e28996a1..59f1c77b 100644 --- a/docs/sdk/models/operations/getlibraryitemspart.md +++ b/docs/sdk/models/operations/getlibraryitemspart.md @@ -3,7 +3,7 @@ ## Example Usage ```typescript -import { GetLibraryItemsPart } from "@lukehagar/plexjs/sdk/models/operations"; +import { GetLibraryItemsHasThumbnail, GetLibraryItemsPart } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetLibraryItemsPart = { id: 119542, @@ -13,7 +13,54 @@ let value: GetLibraryItemsPart = { "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", size: 36158371307, container: "mkv", + audioProfile: "dts", + has64bitOffsets: false, + optimizedForStreaming: false, videoProfile: "main 10", + indexes: "sd", + hasThumbnail: GetLibraryItemsHasThumbnail.True, + stream: [ + { + id: 272796, + streamType: 1, + default: true, + selected: true, + codec: "h264", + index: 0, + bitrate: 6273, + colorPrimaries: "bt709", + colorRange: "tv", + colorSpace: "bt709", + colorTrc: "bt709", + bitDepth: 8, + chromaLocation: "left", + streamIdentifier: "2", + chromaSubsampling: "4:2:0", + codedHeight: 1088, + codedWidth: 1920, + frameRate: 29.97, + hasScalingMatrix: false, + hearingImpaired: false, + closedCaptions: false, + embeddedInVideo: "1", + height: 1080, + level: 40, + profile: "main", + refFrames: 4, + scanType: "progressive", + width: 1920, + displayTitle: "1080p (H.264)", + extendedDisplayTitle: "1080p (H.264)", + channels: 2, + language: "English", + languageTag: "en", + languageCode: "eng", + audioChannelLayout: "stereo", + samplingRate: 48000, + title: "English", + canAutoSync: false, + }, + ], }; ``` @@ -21,10 +68,16 @@ let value: GetLibraryItemsPart = { | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `id` | *number* | :heavy_minus_sign: | N/A | 119542 | -| `key` | *string* | :heavy_minus_sign: | N/A | /library/parts/119542/1680457526/file.mkv | -| `duration` | *number* | :heavy_minus_sign: | N/A | 11558112 | -| `file` | *string* | :heavy_minus_sign: | N/A | /movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv | -| `size` | *number* | :heavy_minus_sign: | N/A | 36158371307 | -| `container` | *string* | :heavy_minus_sign: | N/A | mkv | -| `videoProfile` | *string* | :heavy_minus_sign: | N/A | main 10 | \ No newline at end of file +| `id` | *number* | :heavy_check_mark: | N/A | 119542 | +| `key` | *string* | :heavy_check_mark: | N/A | /library/parts/119542/1680457526/file.mkv | +| `duration` | *number* | :heavy_check_mark: | N/A | 11558112 | +| `file` | *string* | :heavy_check_mark: | N/A | /movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv | +| `size` | *number* | :heavy_check_mark: | N/A | 36158371307 | +| `container` | *string* | :heavy_check_mark: | The container format of the media file.
| mkv | +| `audioProfile` | *string* | :heavy_minus_sign: | N/A | dts | +| `has64bitOffsets` | *boolean* | :heavy_minus_sign: | N/A | false | +| `optimizedForStreaming` | *boolean* | :heavy_minus_sign: | N/A | false | +| `videoProfile` | *string* | :heavy_check_mark: | N/A | main 10 | +| `indexes` | *string* | :heavy_minus_sign: | N/A | sd | +| `hasThumbnail` | [operations.GetLibraryItemsHasThumbnail](../../../sdk/models/operations/getlibraryitemshasthumbnail.md) | :heavy_minus_sign: | N/A | 1 | +| `stream` | [operations.GetLibraryItemsStream](../../../sdk/models/operations/getlibraryitemsstream.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemsqueryparamincludemeta.md b/docs/sdk/models/operations/getlibraryitemsqueryparamincludemeta.md new file mode 100644 index 00000000..d642650d --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemsqueryparamincludemeta.md @@ -0,0 +1,20 @@ +# GetLibraryItemsQueryParamIncludeMeta + +Adds the Meta object to the response + + +## Example Usage + +```typescript +import { GetLibraryItemsQueryParamIncludeMeta } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsQueryParamIncludeMeta = + GetLibraryItemsQueryParamIncludeMeta.Enable; +``` + +## Values + +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemsqueryparamtype.md b/docs/sdk/models/operations/getlibraryitemsqueryparamtype.md new file mode 100644 index 00000000..99b8809f --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemsqueryparamtype.md @@ -0,0 +1,26 @@ +# GetLibraryItemsQueryParamType + +The type of media to retrieve. +1 = movie +2 = show +3 = season +4 = episode +E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries + + +## Example Usage + +```typescript +import { GetLibraryItemsQueryParamType } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsQueryParamType = GetLibraryItemsQueryParamType.TvShow; +``` + +## Values + +| Name | Value | +| --------- | --------- | +| `Movie` | 1 | +| `TvShow` | 2 | +| `Season` | 3 | +| `Episode` | 4 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemsrequest.md b/docs/sdk/models/operations/getlibraryitemsrequest.md index cd4c30ea..a5ac4a7f 100644 --- a/docs/sdk/models/operations/getlibraryitemsrequest.md +++ b/docs/sdk/models/operations/getlibraryitemsrequest.md @@ -3,14 +3,20 @@ ## Example Usage ```typescript -import { GetLibraryItemsRequest, IncludeGuids, IncludeMeta, Tag, Type } from "@lukehagar/plexjs/sdk/models/operations"; +import { + GetLibraryItemsQueryParamIncludeMeta, + GetLibraryItemsQueryParamType, + GetLibraryItemsRequest, + IncludeGuids, + Tag, +} from "@lukehagar/plexjs/sdk/models/operations"; let value: GetLibraryItemsRequest = { sectionKey: 9518, - tag: Tag.Folder, - includeGuids: IncludeGuids.One, - includeMeta: IncludeMeta.One, - type: Type.Two, + tag: Tag.FirstCharacter, + includeGuids: IncludeGuids.Enable, + type: GetLibraryItemsQueryParamType.TvShow, + includeMeta: GetLibraryItemsQueryParamIncludeMeta.Enable, xPlexContainerStart: 0, xPlexContainerSize: 50, }; @@ -23,7 +29,7 @@ let value: GetLibraryItemsRequest = { | `sectionKey` | *number* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | | `tag` | [operations.Tag](../../../sdk/models/operations/tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. | | | `includeGuids` | [operations.IncludeGuids](../../../sdk/models/operations/includeguids.md) | :heavy_minus_sign: | Adds the Guids object to the response
| 1 | -| `includeMeta` | [operations.IncludeMeta](../../../sdk/models/operations/includemeta.md) | :heavy_minus_sign: | Adds the Meta object to the response
| 1 | -| `type` | [operations.Type](../../../sdk/models/operations/type.md) | :heavy_check_mark: | The type of media to retrieve.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | +| `type` | [operations.GetLibraryItemsQueryParamType](../../../sdk/models/operations/getlibraryitemsqueryparamtype.md) | :heavy_minus_sign: | The type of media to retrieve.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | +| `includeMeta` | [operations.GetLibraryItemsQueryParamIncludeMeta](../../../sdk/models/operations/getlibraryitemsqueryparamincludemeta.md) | :heavy_minus_sign: | Adds the Meta object to the response
| 1 | | `xPlexContainerStart` | *number* | :heavy_minus_sign: | The index of the first item to return. If not specified, the first item will be returned.
If the number of items exceeds the limit, the response will be paginated.
By default this is 0
| 0 | | `xPlexContainerSize` | *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.
By default this is 50
| 50 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemsresponse.md b/docs/sdk/models/operations/getlibraryitemsresponse.md index d25a64b4..a58c809e 100644 --- a/docs/sdk/models/operations/getlibraryitemsresponse.md +++ b/docs/sdk/models/operations/getlibraryitemsresponse.md @@ -3,21 +3,86 @@ ## Example Usage ```typescript -import { GetLibraryItemsResponse } from "@lukehagar/plexjs/sdk/models/operations"; +import { + GetLibraryItemsActiveDirection, + GetLibraryItemsDefaultDirection, + GetLibraryItemsFlattenSeasons, + GetLibraryItemsHasThumbnail, + GetLibraryItemsLibraryActiveDirection, + GetLibraryItemsLibraryDefaultDirection, + GetLibraryItemsLibraryResponse200Type, + GetLibraryItemsLibraryType, + GetLibraryItemsOptimizedForStreaming, + GetLibraryItemsResponse, + GetLibraryItemsShowOrdering, +} from "@lukehagar/plexjs/sdk/models/operations"; import { RFCDate } from "@lukehagar/plexjs/sdk/types"; let value: GetLibraryItemsResponse = { contentType: "", - statusCode: 653140, + statusCode: 451, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), object: { mediaContainer: { + type: [ + { + key: "/library/sections/2/all?type=2", + type: "show", + title: "TV Shows", + active: false, + filter: [ + { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", + }, + ], + sort: [ + { + default: "asc", + active: false, + activeDirection: GetLibraryItemsActiveDirection.Ascending, + defaultDirection: GetLibraryItemsDefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", + }, + ], + field: [ + { + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", + }, + ], + }, + ], + fieldType: [ + { + type: "tag", + operator: [ + { + key: "=", + title: "is", + }, + ], + }, + ], size: 70, + totalSize: 170, + offset: 0, + content: "secondary", allowSync: true, + nocache: true, art: "/:/resources/movie-fanart.jpg", identifier: "com.plexapp.plugins.library", + librarySectionID: 1, librarySectionTitle: "Movies", librarySectionUUID: "322a231a-b7f7-49f5-920f-14c61199cd30", mediaTagPrefix: "/system/bundle/media/flags/", @@ -34,21 +99,30 @@ let value: GetLibraryItemsResponse = { key: "/library/metadata/58683", guid: "plex://movie/5d7768ba96b655001fdc0408", studio: "20th Century Studios", - type: "movie", + skipChildren: false, + librarySectionID: 1, + librarySectionTitle: "Movies", + librarySectionKey: "/library/sections/1", + type: GetLibraryItemsLibraryType.Movie, title: "Avatar: The Way of Water", + slug: "4-for-texas", contentRating: "PG-13", summary: "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", rating: 7.6, audienceRating: 9.2, year: 2022, + seasonCount: 2022, tagline: "Return to Pandora.", + flattenSeasons: GetLibraryItemsFlattenSeasons.True, + showOrdering: GetLibraryItemsShowOrdering.Dvd, thumb: "/library/metadata/58683/thumb/1703239236", art: "/library/metadata/58683/art/1703239236", + banner: "/library/metadata/58683/banner/1703239236", duration: 11558112, originallyAvailableAt: new RFCDate("2022-12-14T00:00:00Z"), - addedAt: 1680457607, - updatedAt: 1703239236, + addedAt: 1556281940, + updatedAt: 1556281940, audienceRatingImage: "rottentomatoes://image.rating.upright", chapterSource: "media", primaryExtraKey: "/library/metadata/58684", @@ -58,6 +132,8 @@ let value: GetLibraryItemsResponse = { grandparentKey: "/library/metadata/66", grandparentTitle: "Caprica", grandparentThumb: "/library/metadata/66/thumb/1705716261", + parentSlug: "alice-in-borderland-2020", + grandparentSlug: "alice-in-borderland-2020", grandparentArt: "/library/metadata/66/art/1705716261", grandparentTheme: "/library/metadata/66/theme/1705716261", media: [ @@ -68,6 +144,7 @@ let value: GetLibraryItemsResponse = { width: 3840, height: 2072, aspectRatio: 1.85, + audioProfile: "dts", audioChannels: 6, audioCodec: "eac3", videoCodec: "hevc", @@ -75,6 +152,10 @@ let value: GetLibraryItemsResponse = { container: "mkv", videoFrameRate: "24p", videoProfile: "main 10", + hasVoiceActivity: false, + optimizedForStreaming: + GetLibraryItemsOptimizedForStreaming.Enable, + has64bitOffsets: false, part: [ { id: 119542, @@ -84,7 +165,54 @@ let value: GetLibraryItemsResponse = { "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", size: 36158371307, container: "mkv", + audioProfile: "dts", + has64bitOffsets: false, + optimizedForStreaming: false, videoProfile: "main 10", + indexes: "sd", + hasThumbnail: GetLibraryItemsHasThumbnail.True, + stream: [ + { + id: 272796, + streamType: 1, + default: true, + selected: true, + codec: "h264", + index: 0, + bitrate: 6273, + colorPrimaries: "bt709", + colorRange: "tv", + colorSpace: "bt709", + colorTrc: "bt709", + bitDepth: 8, + chromaLocation: "left", + streamIdentifier: "2", + chromaSubsampling: "4:2:0", + codedHeight: 1088, + codedWidth: 1920, + frameRate: 29.97, + hasScalingMatrix: false, + hearingImpaired: false, + closedCaptions: false, + embeddedInVideo: "1", + height: 1080, + level: 40, + profile: "main", + refFrames: 4, + scanType: "progressive", + width: 1920, + displayTitle: "1080p (H.264)", + extendedDisplayTitle: "1080p (H.264)", + channels: 2, + language: "English", + languageTag: "en", + languageCode: "eng", + audioChannelLayout: "stereo", + samplingRate: 48000, + title: "English", + canAutoSync: false, + }, + ], }, ], }, @@ -109,9 +237,45 @@ let value: GetLibraryItemsResponse = { tag: "James Cameron", }, ], + collection: [ + { + tag: "Working NL Subs", + }, + ], role: [ { - tag: "Sigourney Weaver", + id: 294129, + filter: "actor=294129", + thumb: + "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", + tag: "Mike Smith", + tagKey: "668e7e7b22bcad9064350c91", + role: "Self", + }, + ], + mediaGuid: [ + { + id: "imdb://tt13015952", + }, + ], + ultraBlurColors: { + topLeft: "11333b", + topRight: "0a232d", + bottomRight: "73958", + bottomLeft: "1f5066", + }, + metaDataRating: [ + { + image: "themoviedb://image.rating", + value: 3, + type: "audience", + }, + ], + image: [ + { + alt: "Episode 1", + type: GetLibraryItemsLibraryResponse200Type.Background, + url: "/library/metadata/45521/thumb/1644710589", }, ], titleSort: "Whale", @@ -138,6 +302,58 @@ let value: GetLibraryItemsResponse = { parentTheme: "/library/metadata/66/theme/1705716261", }, ], + meta: { + type: [ + { + key: "/library/sections/2/all?type=2", + type: "show", + title: "TV Shows", + active: false, + filter: [ + { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", + }, + ], + sort: [ + { + default: "asc", + active: false, + activeDirection: + GetLibraryItemsLibraryActiveDirection.Ascending, + defaultDirection: + GetLibraryItemsLibraryDefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", + }, + ], + field: [ + { + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", + }, + ], + }, + ], + fieldType: [ + { + type: "tag", + operator: [ + { + key: "=", + title: "is", + }, + ], + }, + ], + }, }, }, }; diff --git a/docs/sdk/models/operations/getlibraryitemsresponsebody.md b/docs/sdk/models/operations/getlibraryitemsresponsebody.md index a4e07e5d..131913e0 100644 --- a/docs/sdk/models/operations/getlibraryitemsresponsebody.md +++ b/docs/sdk/models/operations/getlibraryitemsresponsebody.md @@ -5,15 +5,80 @@ The contents of the library by section and tag ## Example Usage ```typescript -import { GetLibraryItemsResponseBody } from "@lukehagar/plexjs/sdk/models/operations"; +import { + GetLibraryItemsActiveDirection, + GetLibraryItemsDefaultDirection, + GetLibraryItemsFlattenSeasons, + GetLibraryItemsHasThumbnail, + GetLibraryItemsLibraryActiveDirection, + GetLibraryItemsLibraryDefaultDirection, + GetLibraryItemsLibraryResponse200Type, + GetLibraryItemsLibraryType, + GetLibraryItemsOptimizedForStreaming, + GetLibraryItemsResponseBody, + GetLibraryItemsShowOrdering, +} from "@lukehagar/plexjs/sdk/models/operations"; import { RFCDate } from "@lukehagar/plexjs/sdk/types"; let value: GetLibraryItemsResponseBody = { mediaContainer: { + type: [ + { + key: "/library/sections/2/all?type=2", + type: "show", + title: "TV Shows", + active: false, + filter: [ + { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", + }, + ], + sort: [ + { + default: "asc", + active: false, + activeDirection: GetLibraryItemsActiveDirection.Ascending, + defaultDirection: GetLibraryItemsDefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", + }, + ], + field: [ + { + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", + }, + ], + }, + ], + fieldType: [ + { + type: "tag", + operator: [ + { + key: "=", + title: "is", + }, + ], + }, + ], size: 70, + totalSize: 170, + offset: 0, + content: "secondary", allowSync: true, + nocache: true, art: "/:/resources/movie-fanart.jpg", identifier: "com.plexapp.plugins.library", + librarySectionID: 1, librarySectionTitle: "Movies", librarySectionUUID: "322a231a-b7f7-49f5-920f-14c61199cd30", mediaTagPrefix: "/system/bundle/media/flags/", @@ -30,21 +95,30 @@ let value: GetLibraryItemsResponseBody = { key: "/library/metadata/58683", guid: "plex://movie/5d7768ba96b655001fdc0408", studio: "20th Century Studios", - type: "movie", + skipChildren: false, + librarySectionID: 1, + librarySectionTitle: "Movies", + librarySectionKey: "/library/sections/1", + type: GetLibraryItemsLibraryType.Movie, title: "Avatar: The Way of Water", + slug: "4-for-texas", contentRating: "PG-13", summary: "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", rating: 7.6, audienceRating: 9.2, year: 2022, + seasonCount: 2022, tagline: "Return to Pandora.", + flattenSeasons: GetLibraryItemsFlattenSeasons.True, + showOrdering: GetLibraryItemsShowOrdering.Dvd, thumb: "/library/metadata/58683/thumb/1703239236", art: "/library/metadata/58683/art/1703239236", + banner: "/library/metadata/58683/banner/1703239236", duration: 11558112, originallyAvailableAt: new RFCDate("2022-12-14T00:00:00Z"), - addedAt: 1680457607, - updatedAt: 1703239236, + addedAt: 1556281940, + updatedAt: 1556281940, audienceRatingImage: "rottentomatoes://image.rating.upright", chapterSource: "media", primaryExtraKey: "/library/metadata/58684", @@ -54,6 +128,8 @@ let value: GetLibraryItemsResponseBody = { grandparentKey: "/library/metadata/66", grandparentTitle: "Caprica", grandparentThumb: "/library/metadata/66/thumb/1705716261", + parentSlug: "alice-in-borderland-2020", + grandparentSlug: "alice-in-borderland-2020", grandparentArt: "/library/metadata/66/art/1705716261", grandparentTheme: "/library/metadata/66/theme/1705716261", media: [ @@ -64,6 +140,7 @@ let value: GetLibraryItemsResponseBody = { width: 3840, height: 2072, aspectRatio: 1.85, + audioProfile: "dts", audioChannels: 6, audioCodec: "eac3", videoCodec: "hevc", @@ -71,6 +148,9 @@ let value: GetLibraryItemsResponseBody = { container: "mkv", videoFrameRate: "24p", videoProfile: "main 10", + hasVoiceActivity: false, + optimizedForStreaming: GetLibraryItemsOptimizedForStreaming.Enable, + has64bitOffsets: false, part: [ { id: 119542, @@ -80,7 +160,54 @@ let value: GetLibraryItemsResponseBody = { "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", size: 36158371307, container: "mkv", + audioProfile: "dts", + has64bitOffsets: false, + optimizedForStreaming: false, videoProfile: "main 10", + indexes: "sd", + hasThumbnail: GetLibraryItemsHasThumbnail.True, + stream: [ + { + id: 272796, + streamType: 1, + default: true, + selected: true, + codec: "h264", + index: 0, + bitrate: 6273, + colorPrimaries: "bt709", + colorRange: "tv", + colorSpace: "bt709", + colorTrc: "bt709", + bitDepth: 8, + chromaLocation: "left", + streamIdentifier: "2", + chromaSubsampling: "4:2:0", + codedHeight: 1088, + codedWidth: 1920, + frameRate: 29.97, + hasScalingMatrix: false, + hearingImpaired: false, + closedCaptions: false, + embeddedInVideo: "1", + height: 1080, + level: 40, + profile: "main", + refFrames: 4, + scanType: "progressive", + width: 1920, + displayTitle: "1080p (H.264)", + extendedDisplayTitle: "1080p (H.264)", + channels: 2, + language: "English", + languageTag: "en", + languageCode: "eng", + audioChannelLayout: "stereo", + samplingRate: 48000, + title: "English", + canAutoSync: false, + }, + ], }, ], }, @@ -105,9 +232,45 @@ let value: GetLibraryItemsResponseBody = { tag: "James Cameron", }, ], + collection: [ + { + tag: "Working NL Subs", + }, + ], role: [ { - tag: "Sigourney Weaver", + id: 294129, + filter: "actor=294129", + thumb: + "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", + tag: "Mike Smith", + tagKey: "668e7e7b22bcad9064350c91", + role: "Self", + }, + ], + mediaGuid: [ + { + id: "imdb://tt13015952", + }, + ], + ultraBlurColors: { + topLeft: "11333b", + topRight: "0a232d", + bottomRight: "73958", + bottomLeft: "1f5066", + }, + metaDataRating: [ + { + image: "themoviedb://image.rating", + value: 3, + type: "audience", + }, + ], + image: [ + { + alt: "Episode 1", + type: GetLibraryItemsLibraryResponse200Type.Background, + url: "/library/metadata/45521/thumb/1644710589", }, ], titleSort: "Whale", @@ -134,6 +297,57 @@ let value: GetLibraryItemsResponseBody = { parentTheme: "/library/metadata/66/theme/1705716261", }, ], + meta: { + type: [ + { + key: "/library/sections/2/all?type=2", + type: "show", + title: "TV Shows", + active: false, + filter: [ + { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", + }, + ], + sort: [ + { + default: "asc", + active: false, + activeDirection: GetLibraryItemsLibraryActiveDirection.Ascending, + defaultDirection: + GetLibraryItemsLibraryDefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", + }, + ], + field: [ + { + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", + }, + ], + }, + ], + fieldType: [ + { + type: "tag", + operator: [ + { + key: "=", + title: "is", + }, + ], + }, + ], + }, }, }; ``` diff --git a/docs/sdk/models/operations/getlibraryitemsrole.md b/docs/sdk/models/operations/getlibraryitemsrole.md index 899a22a9..86154b28 100644 --- a/docs/sdk/models/operations/getlibraryitemsrole.md +++ b/docs/sdk/models/operations/getlibraryitemsrole.md @@ -6,12 +6,23 @@ import { GetLibraryItemsRole } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetLibraryItemsRole = { - tag: "Sigourney Weaver", + id: 294129, + filter: "actor=294129", + thumb: + "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", + tag: "Mike Smith", + tagKey: "668e7e7b22bcad9064350c91", + role: "Self", }; ``` ## Fields -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `tag` | *string* | :heavy_minus_sign: | N/A | Sigourney Weaver | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `id` | *number* | :heavy_minus_sign: | The ID of the tag or actor. | 294129 | +| `filter` | *string* | :heavy_minus_sign: | The filter used to find the actor or tag. | actor=294129 | +| `thumb` | *string* | :heavy_minus_sign: | The thumbnail of the actor | https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg | +| `tag` | *string* | :heavy_minus_sign: | The name of the tag or actor. | Mike Smith | +| `tagKey` | *string* | :heavy_minus_sign: | Unique identifier for the tag. | 668e7e7b22bcad9064350c91 | +| `role` | *string* | :heavy_minus_sign: | The role of the actor or tag in the media. | Self | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemsshowordering.md b/docs/sdk/models/operations/getlibraryitemsshowordering.md new file mode 100644 index 00000000..cb031063 --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemsshowordering.md @@ -0,0 +1,27 @@ +# GetLibraryItemsShowOrdering + +Setting that indicates the episode ordering for the show +None = Library default, +tmdbAiring = The Movie Database (Aired), +aired = TheTVDB (Aired), +dvd = TheTVDB (DVD), +absolute = TheTVDB (Absolute)). + + +## Example Usage + +```typescript +import { GetLibraryItemsShowOrdering } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsShowOrdering = GetLibraryItemsShowOrdering.Dvd; +``` + +## Values + +| Name | Value | +| ------------ | ------------ | +| `None` | None | +| `TmdbAiring` | tmdbAiring | +| `Aired` | aired | +| `Dvd` | dvd | +| `Absolute` | absolute | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemssort.md b/docs/sdk/models/operations/getlibraryitemssort.md new file mode 100644 index 00000000..c773e3ec --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemssort.md @@ -0,0 +1,35 @@ +# GetLibraryItemsSort + +## Example Usage + +```typescript +import { + GetLibraryItemsActiveDirection, + GetLibraryItemsDefaultDirection, + GetLibraryItemsSort, +} from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsSort = { + default: "asc", + active: false, + activeDirection: GetLibraryItemsActiveDirection.Ascending, + defaultDirection: GetLibraryItemsDefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `default` | *string* | :heavy_minus_sign: | N/A | asc | +| `active` | *boolean* | :heavy_minus_sign: | N/A | false | +| `activeDirection` | [operations.GetLibraryItemsActiveDirection](../../../sdk/models/operations/getlibraryitemsactivedirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.
| asc | +| `defaultDirection` | [operations.GetLibraryItemsDefaultDirection](../../../sdk/models/operations/getlibraryitemsdefaultdirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.
| asc | +| `descKey` | *string* | :heavy_minus_sign: | N/A | titleSort:desc | +| `firstCharacterKey` | *string* | :heavy_minus_sign: | N/A | /library/sections/2/firstCharacter | +| `key` | *string* | :heavy_check_mark: | N/A | titleSort | +| `title` | *string* | :heavy_check_mark: | N/A | Title | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemsstream.md b/docs/sdk/models/operations/getlibraryitemsstream.md new file mode 100644 index 00000000..bb2cdac5 --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemsstream.md @@ -0,0 +1,91 @@ +# GetLibraryItemsStream + +## Example Usage + +```typescript +import { GetLibraryItemsStream } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsStream = { + id: 272796, + streamType: 1, + default: true, + selected: true, + codec: "h264", + index: 0, + bitrate: 6273, + colorPrimaries: "bt709", + colorRange: "tv", + colorSpace: "bt709", + colorTrc: "bt709", + bitDepth: 8, + chromaLocation: "left", + streamIdentifier: "2", + chromaSubsampling: "4:2:0", + codedHeight: 1088, + codedWidth: 1920, + frameRate: 29.97, + hasScalingMatrix: false, + hearingImpaired: false, + closedCaptions: false, + embeddedInVideo: "1", + height: 1080, + level: 40, + profile: "main", + refFrames: 4, + scanType: "progressive", + width: 1920, + displayTitle: "1080p (H.264)", + extendedDisplayTitle: "1080p (H.264)", + channels: 2, + language: "English", + languageTag: "en", + languageCode: "eng", + audioChannelLayout: "stereo", + samplingRate: 48000, + title: "English", + canAutoSync: false, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `id` | *number* | :heavy_check_mark: | N/A | 272796 | +| `streamType` | *number* | :heavy_check_mark: | Type of stream (1 = video, 2 = audio, 3 = subtitle) | 1 | +| `default` | *boolean* | :heavy_minus_sign: | Indicates if this is the default stream | true | +| `selected` | *boolean* | :heavy_minus_sign: | Indicates if the stream is selected | true | +| `codec` | *string* | :heavy_check_mark: | Codec used by the stream | h264 | +| `index` | *number* | :heavy_check_mark: | The index of the stream | 0 | +| `bitrate` | *number* | :heavy_minus_sign: | The bitrate of the stream in kbps | 6273 | +| `colorPrimaries` | *string* | :heavy_minus_sign: | The color primaries of the video stream | bt709 | +| `colorRange` | *string* | :heavy_minus_sign: | The color range of the video stream | tv | +| `colorSpace` | *string* | :heavy_minus_sign: | The color space of the video stream | bt709 | +| `colorTrc` | *string* | :heavy_minus_sign: | The transfer characteristics (TRC) of the video stream | bt709 | +| `bitDepth` | *number* | :heavy_minus_sign: | The bit depth of the video stream | 8 | +| `chromaLocation` | *string* | :heavy_minus_sign: | The chroma location of the video stream | left | +| `streamIdentifier` | *string* | :heavy_minus_sign: | The identifier of the video stream | 2 | +| `chromaSubsampling` | *string* | :heavy_minus_sign: | The chroma subsampling format | 4:2:0 | +| `codedHeight` | *number* | :heavy_minus_sign: | The coded height of the video stream | 1088 | +| `codedWidth` | *number* | :heavy_minus_sign: | The coded width of the video stream | 1920 | +| `frameRate` | *number* | :heavy_minus_sign: | The frame rate of the video stream | 29.97 | +| `hasScalingMatrix` | *boolean* | :heavy_minus_sign: | Indicates if the stream has a scaling matrix | false | +| `hearingImpaired` | *boolean* | :heavy_minus_sign: | N/A | false | +| `closedCaptions` | *boolean* | :heavy_minus_sign: | N/A | false | +| `embeddedInVideo` | *string* | :heavy_minus_sign: | N/A | 1 | +| `height` | *number* | :heavy_minus_sign: | The height of the video stream | 1080 | +| `level` | *number* | :heavy_minus_sign: | The level of the video codec | 40 | +| `profile` | *string* | :heavy_minus_sign: | The profile of the video codec | main | +| `refFrames` | *number* | :heavy_minus_sign: | Number of reference frames | 4 | +| `scanType` | *string* | :heavy_minus_sign: | The scan type (progressive or interlaced) | progressive | +| `width` | *number* | :heavy_minus_sign: | The width of the video stream | 1920 | +| `displayTitle` | *string* | :heavy_minus_sign: | Display title of the stream | 1080p (H.264) | +| `extendedDisplayTitle` | *string* | :heavy_minus_sign: | Extended display title of the stream | 1080p (H.264) | +| `channels` | *number* | :heavy_minus_sign: | Number of audio channels (for audio streams) | 2 | +| `language` | *string* | :heavy_minus_sign: | The language of the stream (for audio/subtitle streams) | English | +| `languageTag` | *string* | :heavy_minus_sign: | Language tag of the stream | en | +| `languageCode` | *string* | :heavy_minus_sign: | Language code of the stream | eng | +| `audioChannelLayout` | *string* | :heavy_minus_sign: | The audio channel layout | stereo | +| `samplingRate` | *number* | :heavy_minus_sign: | Sampling rate of the audio stream in Hz | 48000 | +| `title` | *string* | :heavy_minus_sign: | Title of the subtitle track (for subtitle streams) | English | +| `canAutoSync` | *boolean* | :heavy_minus_sign: | Indicates if the subtitle stream can auto-sync | false | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemstype.md b/docs/sdk/models/operations/getlibraryitemstype.md new file mode 100644 index 00000000..fef3726a --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemstype.md @@ -0,0 +1,59 @@ +# GetLibraryItemsType + +## Example Usage + +```typescript +import { + GetLibraryItemsActiveDirection, + GetLibraryItemsDefaultDirection, + GetLibraryItemsType, +} from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsType = { + key: "/library/sections/2/all?type=2", + type: "show", + title: "TV Shows", + active: false, + filter: [ + { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", + }, + ], + sort: [ + { + default: "asc", + active: false, + activeDirection: GetLibraryItemsActiveDirection.Ascending, + defaultDirection: GetLibraryItemsDefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", + }, + ], + field: [ + { + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/all?type=2 | +| `type` | *string* | :heavy_check_mark: | N/A | show | +| `title` | *string* | :heavy_check_mark: | N/A | TV Shows | +| `active` | *boolean* | :heavy_check_mark: | N/A | false | +| `filter` | [operations.GetLibraryItemsFilter](../../../sdk/models/operations/getlibraryitemsfilter.md)[] | :heavy_minus_sign: | N/A | | +| `sort` | [operations.GetLibraryItemsSort](../../../sdk/models/operations/getlibraryitemssort.md)[] | :heavy_minus_sign: | N/A | | +| `field` | [operations.GetLibraryItemsField](../../../sdk/models/operations/getlibraryitemsfield.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemsultrablurcolors.md b/docs/sdk/models/operations/getlibraryitemsultrablurcolors.md new file mode 100644 index 00000000..04243979 --- /dev/null +++ b/docs/sdk/models/operations/getlibraryitemsultrablurcolors.md @@ -0,0 +1,23 @@ +# GetLibraryItemsUltraBlurColors + +## Example Usage + +```typescript +import { GetLibraryItemsUltraBlurColors } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetLibraryItemsUltraBlurColors = { + topLeft: "11333b", + topRight: "0a232d", + bottomRight: "73958", + bottomLeft: "1f5066", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `topLeft` | *string* | :heavy_check_mark: | N/A | 11333b | +| `topRight` | *string* | :heavy_check_mark: | N/A | 0a232d | +| `bottomRight` | *string* | :heavy_check_mark: | N/A | 73958 | +| `bottomLeft` | *string* | :heavy_check_mark: | N/A | 1f5066 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getmediaprovidersmediacontainer.md b/docs/sdk/models/operations/getmediaprovidersmediacontainer.md index 33f0e8cb..e68db287 100644 --- a/docs/sdk/models/operations/getmediaprovidersmediacontainer.md +++ b/docs/sdk/models/operations/getmediaprovidersmediacontainer.md @@ -5,7 +5,26 @@ ```typescript import { GetMediaProvidersMediaContainer } from "@lukehagar/plexjs/sdk/models/operations"; -let value: GetMediaProvidersMediaContainer = {}; +let value: GetMediaProvidersMediaContainer = { + mediaProvider: [ + { + feature: [ + { + type: "", + flavor: "global", + scrobbleKey: "/:/scrobble/new", + unscrobbleKey: "/:/unscrobble/new", + action: [ + { + id: "addToContinueWatching", + key: "/actions/addToContinueWatching", + }, + ], + }, + ], + }, + ], +}; ``` ## Fields diff --git a/docs/sdk/models/operations/getmediaprovidersresponse.md b/docs/sdk/models/operations/getmediaprovidersresponse.md index 40de279c..f20efde1 100644 --- a/docs/sdk/models/operations/getmediaprovidersresponse.md +++ b/docs/sdk/models/operations/getmediaprovidersresponse.md @@ -7,10 +7,32 @@ import { GetMediaProvidersResponse } from "@lukehagar/plexjs/sdk/models/operatio let value: GetMediaProvidersResponse = { contentType: "", - statusCode: 297534, + statusCode: 511, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), + object: { + mediaContainer: { + mediaProvider: [ + { + feature: [ + { + type: "", + flavor: "global", + scrobbleKey: "/:/scrobble/new", + unscrobbleKey: "/:/unscrobble/new", + action: [ + { + id: "addToContinueWatching", + key: "/actions/addToContinueWatching", + }, + ], + }, + ], + }, + ], + }, + }, }; ``` diff --git a/docs/sdk/models/operations/getmediaprovidersresponsebody.md b/docs/sdk/models/operations/getmediaprovidersresponsebody.md index 8c2da6ab..dc7f44ea 100644 --- a/docs/sdk/models/operations/getmediaprovidersresponsebody.md +++ b/docs/sdk/models/operations/getmediaprovidersresponsebody.md @@ -7,7 +7,28 @@ Media providers and their features ```typescript import { GetMediaProvidersResponseBody } from "@lukehagar/plexjs/sdk/models/operations"; -let value: GetMediaProvidersResponseBody = {}; +let value: GetMediaProvidersResponseBody = { + mediaContainer: { + mediaProvider: [ + { + feature: [ + { + type: "", + flavor: "global", + scrobbleKey: "/:/scrobble/new", + unscrobbleKey: "/:/unscrobble/new", + action: [ + { + id: "addToContinueWatching", + key: "/actions/addToContinueWatching", + }, + ], + }, + ], + }, + ], + }, +}; ``` ## Fields diff --git a/docs/sdk/models/operations/getmetadatabyratingkeypart.md b/docs/sdk/models/operations/getmetadatabyratingkeypart.md index d85705c6..eb9b8f05 100644 --- a/docs/sdk/models/operations/getmetadatabyratingkeypart.md +++ b/docs/sdk/models/operations/getmetadatabyratingkeypart.md @@ -57,16 +57,16 @@ let value: GetMetaDataByRatingKeyPart = { ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | -| `id` | *number* | :heavy_minus_sign: | N/A | 15 | -| `key` | *string* | :heavy_minus_sign: | N/A | /library/parts/15/1705637151/file.mp4 | -| `duration` | *number* | :heavy_minus_sign: | N/A | 141417 | -| `file` | *string* | :heavy_minus_sign: | N/A | /movies/Serenity (2005)/Serenity (2005).mp4 | -| `size` | *number* | :heavy_minus_sign: | N/A | 40271948 | -| `audioProfile` | *string* | :heavy_minus_sign: | N/A | lc | -| `container` | *string* | :heavy_minus_sign: | N/A | mp4 | -| `has64bitOffsets` | *boolean* | :heavy_minus_sign: | N/A | false | -| `optimizedForStreaming` | *boolean* | :heavy_minus_sign: | N/A | false | -| `videoProfile` | *string* | :heavy_minus_sign: | N/A | high | -| `stream` | [operations.Stream](../../../sdk/models/operations/stream.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `id` | *number* | :heavy_minus_sign: | N/A | 15 | +| `key` | *string* | :heavy_minus_sign: | N/A | /library/parts/15/1705637151/file.mp4 | +| `duration` | *number* | :heavy_minus_sign: | N/A | 141417 | +| `file` | *string* | :heavy_minus_sign: | N/A | /movies/Serenity (2005)/Serenity (2005).mp4 | +| `size` | *number* | :heavy_minus_sign: | N/A | 40271948 | +| `audioProfile` | *string* | :heavy_minus_sign: | N/A | lc | +| `container` | *string* | :heavy_minus_sign: | N/A | mp4 | +| `has64bitOffsets` | *boolean* | :heavy_minus_sign: | N/A | false | +| `optimizedForStreaming` | *boolean* | :heavy_minus_sign: | N/A | false | +| `videoProfile` | *string* | :heavy_minus_sign: | N/A | high | +| `stream` | [operations.GetMetaDataByRatingKeyStream](../../../sdk/models/operations/getmetadatabyratingkeystream.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/getmetadatabyratingkeyresponse.md b/docs/sdk/models/operations/getmetadatabyratingkeyresponse.md index 165f8069..21db1556 100644 --- a/docs/sdk/models/operations/getmetadatabyratingkeyresponse.md +++ b/docs/sdk/models/operations/getmetadatabyratingkeyresponse.md @@ -8,7 +8,7 @@ import { RFCDate } from "@lukehagar/plexjs/sdk/types"; let value: GetMetaDataByRatingKeyResponse = { contentType: "", - statusCode: 128926, + statusCode: 506, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getmetadatabyratingkeystream.md b/docs/sdk/models/operations/getmetadatabyratingkeystream.md new file mode 100644 index 00000000..d0193ec8 --- /dev/null +++ b/docs/sdk/models/operations/getmetadatabyratingkeystream.md @@ -0,0 +1,79 @@ +# GetMetaDataByRatingKeyStream + +## Example Usage + +```typescript +import { GetMetaDataByRatingKeyStream } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetMetaDataByRatingKeyStream = { + id: 29, + streamType: 2, + default: true, + codec: "aac", + index: 0, + bitrate: 128, + bitDepth: 8, + chromaLocation: "left", + chromaSubsampling: "14520", + codedHeight: 816, + codedWidth: 1920, + colorPrimaries: "bt709", + colorRange: "tv", + colorSpace: "bt709", + colorTrc: "bt709", + frameRate: 24, + hasScalingMatrix: false, + height: 814, + level: 40, + profile: "lc", + refFrames: 4, + scanType: "progressive", + streamIdentifier: "1", + width: 1920, + displayTitle: "English (AAC Stereo)", + extendedDisplayTitle: "English (AAC Stereo)", + selected: true, + channels: 2, + language: "English", + languageTag: "en", + languageCode: "eng", + samplingRate: 44100, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `id` | *number* | :heavy_minus_sign: | N/A | 29 | +| `streamType` | *number* | :heavy_minus_sign: | N/A | 2 | +| `default` | *boolean* | :heavy_minus_sign: | N/A | true | +| `codec` | *string* | :heavy_minus_sign: | N/A | aac | +| `index` | *number* | :heavy_minus_sign: | N/A | 0 | +| `bitrate` | *number* | :heavy_minus_sign: | N/A | 128 | +| `bitDepth` | *number* | :heavy_minus_sign: | N/A | 8 | +| `chromaLocation` | *string* | :heavy_minus_sign: | N/A | left | +| `chromaSubsampling` | *string* | :heavy_minus_sign: | N/A | 14520 | +| `codedHeight` | *number* | :heavy_minus_sign: | N/A | 816 | +| `codedWidth` | *number* | :heavy_minus_sign: | N/A | 1920 | +| `colorPrimaries` | *string* | :heavy_minus_sign: | N/A | bt709 | +| `colorRange` | *string* | :heavy_minus_sign: | N/A | tv | +| `colorSpace` | *string* | :heavy_minus_sign: | N/A | bt709 | +| `colorTrc` | *string* | :heavy_minus_sign: | N/A | bt709 | +| `frameRate` | *number* | :heavy_minus_sign: | N/A | 24 | +| `hasScalingMatrix` | *boolean* | :heavy_minus_sign: | N/A | false | +| `height` | *number* | :heavy_minus_sign: | N/A | 814 | +| `level` | *number* | :heavy_minus_sign: | N/A | 40 | +| `profile` | *string* | :heavy_minus_sign: | N/A | lc | +| `refFrames` | *number* | :heavy_minus_sign: | N/A | 4 | +| `scanType` | *string* | :heavy_minus_sign: | N/A | progressive | +| `streamIdentifier` | *string* | :heavy_minus_sign: | N/A | 1 | +| `width` | *number* | :heavy_minus_sign: | N/A | 1920 | +| `displayTitle` | *string* | :heavy_minus_sign: | N/A | English (AAC Stereo) | +| `extendedDisplayTitle` | *string* | :heavy_minus_sign: | N/A | English (AAC Stereo) | +| `selected` | *boolean* | :heavy_minus_sign: | N/A | true | +| `channels` | *number* | :heavy_minus_sign: | N/A | 2 | +| `language` | *string* | :heavy_minus_sign: | N/A | English | +| `languageTag` | *string* | :heavy_minus_sign: | N/A | en | +| `languageCode` | *string* | :heavy_minus_sign: | N/A | eng | +| `samplingRate` | *number* | :heavy_minus_sign: | N/A | 44100 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getmetadatachildrenrequest.md b/docs/sdk/models/operations/getmetadatachildrenrequest.md index 22f8a4fa..d714f553 100644 --- a/docs/sdk/models/operations/getmetadatachildrenrequest.md +++ b/docs/sdk/models/operations/getmetadatachildrenrequest.md @@ -6,7 +6,7 @@ import { GetMetadataChildrenRequest } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetMetadataChildrenRequest = { - ratingKey: 7506.86, + ratingKey: 4071.83, }; ``` diff --git a/docs/sdk/models/operations/getmetadatachildrenresponse.md b/docs/sdk/models/operations/getmetadatachildrenresponse.md index c4cacef8..11b1b408 100644 --- a/docs/sdk/models/operations/getmetadatachildrenresponse.md +++ b/docs/sdk/models/operations/getmetadatachildrenresponse.md @@ -7,7 +7,7 @@ import { GetMetadataChildrenResponse } from "@lukehagar/plexjs/sdk/models/operat let value: GetMetadataChildrenResponse = { contentType: "", - statusCode: 315428, + statusCode: 102, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getmyplexaccountresponse.md b/docs/sdk/models/operations/getmyplexaccountresponse.md index dc1de6ce..75b119d3 100644 --- a/docs/sdk/models/operations/getmyplexaccountresponse.md +++ b/docs/sdk/models/operations/getmyplexaccountresponse.md @@ -7,7 +7,7 @@ import { GetMyPlexAccountResponse } from "@lukehagar/plexjs/sdk/models/operation let value: GetMyPlexAccountResponse = { contentType: "", - statusCode: 857946, + statusCode: 415, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getondeckresponse.md b/docs/sdk/models/operations/getondeckresponse.md index ad8c7cc5..e3abad10 100644 --- a/docs/sdk/models/operations/getondeckresponse.md +++ b/docs/sdk/models/operations/getondeckresponse.md @@ -7,7 +7,7 @@ import { GetOnDeckResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetOnDeckResponse = { contentType: "", - statusCode: 363711, + statusCode: 511, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getpinauthpincontainer.md b/docs/sdk/models/operations/getpinauthpincontainer.md index d238a22c..1885c427 100644 --- a/docs/sdk/models/operations/getpinauthpincontainer.md +++ b/docs/sdk/models/operations/getpinauthpincontainer.md @@ -21,7 +21,7 @@ let value: GetPinAuthPinContainer = { city: "Amsterdam", europeanUnionMember: true, timeZone: "America/St_Thomas", - postalCode: 802, + postalCode: "802", inPrivacyRestrictedCountry: true, inPrivacyRestrictedRegion: true, subdivisions: "Saint Thomas", @@ -41,13 +41,13 @@ let value: GetPinAuthPinContainer = { | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | *number* | :heavy_check_mark: | N/A | 308667304 | | `code` | *string* | :heavy_check_mark: | N/A | 7RQZ | -| `product` | *string* | :heavy_check_mark: | N/A | 0 | +| `product` | *string* | :heavy_check_mark: | N/A | Tautulli | | `trusted` | *boolean* | :heavy_minus_sign: | N/A | | | `qr` | *string* | :heavy_check_mark: | N/A | https://plex.tv/api/v2/pins/qr/7RQZ | -| `clientIdentifier` | *string* | :heavy_check_mark: | The X-Client-Identifier used in the request | | +| `clientIdentifier` | *string* | :heavy_check_mark: | The X-Client-Identifier used in the request | Tautulli | | `location` | [operations.GeoData](../../../sdk/models/operations/geodata.md) | :heavy_check_mark: | Geo location data | {
"code": "VI",
"continent_code": "NA",
"country": "United States Virgin Islands",
"city": "Amsterdam",
"european_union_member": true,
"time_zone": "America/St_Thomas",
"postal_code": 802,
"in_privacy_restricted_country": true,
"in_privacy_restricted_region": true,
"subdivisions": "Saint Thomas",
"coordinates": "18.3381, -64.8941"
} | | `expiresIn` | *number* | :heavy_minus_sign: | The number of seconds this pin expires, by default 900 seconds | 876 | | `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | 2024-07-16T17:03:05Z | | `expiresAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | 2024-07-16T17:18:05Z | -| `authToken` | *any* | :heavy_minus_sign: | N/A | | +| `authToken` | *string* | :heavy_minus_sign: | N/A | gcgzw5rz2xovp84b4vha3a40 | | `newRegistration` | *any* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/getpinglobals.md b/docs/sdk/models/operations/getpinglobals.md index 12543995..ac31e071 100644 --- a/docs/sdk/models/operations/getpinglobals.md +++ b/docs/sdk/models/operations/getpinglobals.md @@ -10,6 +10,10 @@ let value: GetPinGlobals = {}; ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `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)
| gcgzw5rz2xovp84b4vha3a40 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `clientID` | *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) | gcgzw5rz2xovp84b4vha3a40 | +| `clientName` | *string* | :heavy_minus_sign: | N/A | Plex Web | +| `deviceName` | *string* | :heavy_minus_sign: | N/A | Linux | +| `clientVersion` | *string* | :heavy_minus_sign: | N/A | 4.133.0 | +| `clientPlatform` | *string* | :heavy_minus_sign: | N/A | Chrome | \ No newline at end of file diff --git a/docs/sdk/models/operations/getpinrequest.md b/docs/sdk/models/operations/getpinrequest.md index e2ebf1cb..122bad48 100644 --- a/docs/sdk/models/operations/getpinrequest.md +++ b/docs/sdk/models/operations/getpinrequest.md @@ -5,15 +5,16 @@ ```typescript import { GetPinRequest } from "@lukehagar/plexjs/sdk/models/operations"; -let value: GetPinRequest = { - xPlexProduct: "Plex Web", -}; +let value: GetPinRequest = {}; ``` ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `strong` | *boolean* | :heavy_minus_sign: | Determines the kind of code returned by the API call
Strong codes are used for Pin authentication flows
Non-Strong codes are used for `Plex.tv/link`
| | -| `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)
| gcgzw5rz2xovp84b4vha3a40 | -| `xPlexProduct` | *string* | :heavy_minus_sign: | N/A | Plex Web | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `strong` | *boolean* | :heavy_minus_sign: | Determines the kind of code returned by the API call
Strong codes are used for Pin authentication flows
Non-Strong codes are used for `Plex.tv/link`
| | +| `clientID` | *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) | gcgzw5rz2xovp84b4vha3a40 | +| `clientName` | *string* | :heavy_minus_sign: | N/A | Plex Web | +| `deviceName` | *string* | :heavy_minus_sign: | N/A | Linux | +| `clientVersion` | *string* | :heavy_minus_sign: | N/A | 4.133.0 | +| `clientPlatform` | *string* | :heavy_minus_sign: | N/A | Chrome | \ No newline at end of file diff --git a/docs/sdk/models/operations/getpinresponse.md b/docs/sdk/models/operations/getpinresponse.md index eaa478eb..5a77f8fe 100644 --- a/docs/sdk/models/operations/getpinresponse.md +++ b/docs/sdk/models/operations/getpinresponse.md @@ -7,7 +7,7 @@ import { GetPinResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetPinResponse = { contentType: "", - statusCode: 135218, + statusCode: 208, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), @@ -25,7 +25,7 @@ let value: GetPinResponse = { city: "Amsterdam", europeanUnionMember: true, timeZone: "America/St_Thomas", - postalCode: 802, + postalCode: "802", inPrivacyRestrictedCountry: true, inPrivacyRestrictedRegion: true, subdivisions: "Saint Thomas", diff --git a/docs/sdk/models/operations/getplaylistcontentsqueryparamtype.md b/docs/sdk/models/operations/getplaylistcontentsqueryparamtype.md index e83e3b77..5f368f91 100644 --- a/docs/sdk/models/operations/getplaylistcontentsqueryparamtype.md +++ b/docs/sdk/models/operations/getplaylistcontentsqueryparamtype.md @@ -14,14 +14,14 @@ E.g. A movie library will not return anything with type 3 as there are no season import { GetPlaylistContentsQueryParamType } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetPlaylistContentsQueryParamType = - GetPlaylistContentsQueryParamType.Two; + GetPlaylistContentsQueryParamType.TvShow; ``` ## Values -| Name | Value | -| ------- | ------- | -| `One` | 1 | -| `Two` | 2 | -| `Three` | 3 | -| `Four` | 4 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Movie` | 1 | +| `TvShow` | 2 | +| `Season` | 3 | +| `Episode` | 4 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getplaylistcontentsrequest.md b/docs/sdk/models/operations/getplaylistcontentsrequest.md index 78a4780a..e52419a9 100644 --- a/docs/sdk/models/operations/getplaylistcontentsrequest.md +++ b/docs/sdk/models/operations/getplaylistcontentsrequest.md @@ -6,8 +6,8 @@ import { GetPlaylistContentsQueryParamType, GetPlaylistContentsRequest } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetPlaylistContentsRequest = { - playlistID: 1965.82, - type: GetPlaylistContentsQueryParamType.Two, + playlistID: 1796.04, + type: GetPlaylistContentsQueryParamType.TvShow, }; ``` diff --git a/docs/sdk/models/operations/getplaylistcontentsresponse.md b/docs/sdk/models/operations/getplaylistcontentsresponse.md index e23895d3..4b056ae4 100644 --- a/docs/sdk/models/operations/getplaylistcontentsresponse.md +++ b/docs/sdk/models/operations/getplaylistcontentsresponse.md @@ -8,7 +8,7 @@ import { RFCDate } from "@lukehagar/plexjs/sdk/types"; let value: GetPlaylistContentsResponse = { contentType: "", - statusCode: 949572, + statusCode: 100, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getplaylistrequest.md b/docs/sdk/models/operations/getplaylistrequest.md index 63b8131a..4b1a1231 100644 --- a/docs/sdk/models/operations/getplaylistrequest.md +++ b/docs/sdk/models/operations/getplaylistrequest.md @@ -6,7 +6,7 @@ import { GetPlaylistRequest } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetPlaylistRequest = { - playlistID: 1103.75, + playlistID: 7395.51, }; ``` diff --git a/docs/sdk/models/operations/getplaylistresponse.md b/docs/sdk/models/operations/getplaylistresponse.md index 1566cb53..b053d838 100644 --- a/docs/sdk/models/operations/getplaylistresponse.md +++ b/docs/sdk/models/operations/getplaylistresponse.md @@ -7,7 +7,7 @@ import { GetPlaylistResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetPlaylistResponse = { contentType: "", - statusCode: 674752, + statusCode: 302, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getplaylistsresponse.md b/docs/sdk/models/operations/getplaylistsresponse.md index 56f4c999..3b90604b 100644 --- a/docs/sdk/models/operations/getplaylistsresponse.md +++ b/docs/sdk/models/operations/getplaylistsresponse.md @@ -7,7 +7,7 @@ import { GetPlaylistsResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetPlaylistsResponse = { contentType: "", - statusCode: 338007, + statusCode: 103, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getrecentlyaddedactivedirection.md b/docs/sdk/models/operations/getrecentlyaddedactivedirection.md new file mode 100644 index 00000000..4f83ffc8 --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedactivedirection.md @@ -0,0 +1,20 @@ +# GetRecentlyAddedActiveDirection + +The direction of the sort. Can be either `asc` or `desc`. + + +## Example Usage + +```typescript +import { GetRecentlyAddedActiveDirection } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedActiveDirection = + GetRecentlyAddedActiveDirection.Ascending; +``` + +## Values + +| Name | Value | +| ------------ | ------------ | +| `Ascending` | asc | +| `Descending` | desc | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddeddefaultdirection.md b/docs/sdk/models/operations/getrecentlyaddeddefaultdirection.md new file mode 100644 index 00000000..69809393 --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddeddefaultdirection.md @@ -0,0 +1,20 @@ +# GetRecentlyAddedDefaultDirection + +The direction of the sort. Can be either `asc` or `desc`. + + +## Example Usage + +```typescript +import { GetRecentlyAddedDefaultDirection } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedDefaultDirection = + GetRecentlyAddedDefaultDirection.Ascending; +``` + +## Values + +| Name | Value | +| ------------ | ------------ | +| `Ascending` | asc | +| `Descending` | desc | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedfield.md b/docs/sdk/models/operations/getrecentlyaddedfield.md new file mode 100644 index 00000000..a115a4b6 --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedfield.md @@ -0,0 +1,23 @@ +# GetRecentlyAddedField + +## Example Usage + +```typescript +import { GetRecentlyAddedField } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedField = { + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `key` | *string* | :heavy_check_mark: | N/A | show.title | +| `title` | *string* | :heavy_check_mark: | N/A | Show Title | +| `type` | *string* | :heavy_check_mark: | N/A | string | +| `subType` | *string* | :heavy_minus_sign: | N/A | rating | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedfieldtype.md b/docs/sdk/models/operations/getrecentlyaddedfieldtype.md new file mode 100644 index 00000000..c98dcee6 --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedfieldtype.md @@ -0,0 +1,24 @@ +# GetRecentlyAddedFieldType + +## Example Usage + +```typescript +import { GetRecentlyAddedFieldType } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedFieldType = { + type: "tag", + operator: [ + { + key: "=", + title: "is", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `type` | *string* | :heavy_check_mark: | N/A | tag | +| `operator` | [operations.GetRecentlyAddedOperator](../../../sdk/models/operations/getrecentlyaddedoperator.md)[] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedfilter.md b/docs/sdk/models/operations/getrecentlyaddedfilter.md new file mode 100644 index 00000000..f257edcc --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedfilter.md @@ -0,0 +1,25 @@ +# GetRecentlyAddedFilter + +## Example Usage + +```typescript +import { GetRecentlyAddedFilter } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedFilter = { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `filter` | *string* | :heavy_check_mark: | N/A | genre | +| `filterType` | *string* | :heavy_check_mark: | N/A | string | +| `key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/genre?type=2 | +| `title` | *string* | :heavy_check_mark: | N/A | Genre | +| `type` | *string* | :heavy_check_mark: | N/A | filter | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedhubsresponsetype.md b/docs/sdk/models/operations/getrecentlyaddedhubsresponsetype.md new file mode 100644 index 00000000..d52d020d --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedhubsresponsetype.md @@ -0,0 +1,19 @@ +# GetRecentlyAddedHubsResponseType + +## Example Usage + +```typescript +import { GetRecentlyAddedHubsResponseType } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedHubsResponseType = + GetRecentlyAddedHubsResponseType.Background; +``` + +## Values + +| Name | Value | +| ------------- | ------------- | +| `CoverPoster` | coverPoster | +| `Background` | background | +| `Snapshot` | snapshot | +| `ClearLogo` | clearLogo | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedhubstype.md b/docs/sdk/models/operations/getrecentlyaddedhubstype.md new file mode 100644 index 00000000..91cbf3b3 --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedhubstype.md @@ -0,0 +1,21 @@ +# GetRecentlyAddedHubsType + +The type of media content + + +## Example Usage + +```typescript +import { GetRecentlyAddedHubsType } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedHubsType = GetRecentlyAddedHubsType.Movie; +``` + +## Values + +| Name | Value | +| --------- | --------- | +| `Movie` | movie | +| `TvShow` | show | +| `Season` | season | +| `Episode` | episode | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedimage.md b/docs/sdk/models/operations/getrecentlyaddedimage.md new file mode 100644 index 00000000..f6c655f9 --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedimage.md @@ -0,0 +1,21 @@ +# GetRecentlyAddedImage + +## Example Usage + +```typescript +import { GetRecentlyAddedHubsResponseType, GetRecentlyAddedImage } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedImage = { + alt: "Episode 1", + type: GetRecentlyAddedHubsResponseType.Background, + url: "/library/metadata/45521/thumb/1644710589", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `alt` | *string* | :heavy_check_mark: | N/A | Episode 1 | +| `type` | [operations.GetRecentlyAddedHubsResponseType](../../../sdk/models/operations/getrecentlyaddedhubsresponsetype.md) | :heavy_check_mark: | N/A | background | +| `url` | *string* | :heavy_check_mark: | N/A | /library/metadata/45521/thumb/1644710589 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedlibrarycountry.md b/docs/sdk/models/operations/getrecentlyaddedlibrarycountry.md new file mode 100644 index 00000000..b324790b --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedlibrarycountry.md @@ -0,0 +1,17 @@ +# GetRecentlyAddedLibraryCountry + +## Example Usage + +```typescript +import { GetRecentlyAddedLibraryCountry } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedLibraryCountry = { + tag: "United States of America", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `tag` | *string* | :heavy_minus_sign: | N/A | United States of America | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedlibrarydirector.md b/docs/sdk/models/operations/getrecentlyaddedlibrarydirector.md new file mode 100644 index 00000000..d1aa15f4 --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedlibrarydirector.md @@ -0,0 +1,17 @@ +# GetRecentlyAddedLibraryDirector + +## Example Usage + +```typescript +import { GetRecentlyAddedLibraryDirector } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedLibraryDirector = { + tag: "Peyton Reed", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `tag` | *string* | :heavy_minus_sign: | N/A | Peyton Reed | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedlibraryfilter.md b/docs/sdk/models/operations/getrecentlyaddedlibraryfilter.md new file mode 100644 index 00000000..b17f95c1 --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedlibraryfilter.md @@ -0,0 +1,25 @@ +# GetRecentlyAddedLibraryFilter + +## Example Usage + +```typescript +import { GetRecentlyAddedLibraryFilter } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedLibraryFilter = { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `filter` | *string* | :heavy_check_mark: | N/A | genre | +| `filterType` | *string* | :heavy_check_mark: | N/A | string | +| `key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/genre?type=2 | +| `title` | *string* | :heavy_check_mark: | N/A | Genre | +| `type` | *string* | :heavy_check_mark: | N/A | filter | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedlibrarygenre.md b/docs/sdk/models/operations/getrecentlyaddedlibrarygenre.md new file mode 100644 index 00000000..b88b0c44 --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedlibrarygenre.md @@ -0,0 +1,17 @@ +# GetRecentlyAddedLibraryGenre + +## Example Usage + +```typescript +import { GetRecentlyAddedLibraryGenre } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedLibraryGenre = { + tag: "Comedy", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `tag` | *string* | :heavy_minus_sign: | N/A | Comedy | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedlibrarymedia.md b/docs/sdk/models/operations/getrecentlyaddedlibrarymedia.md new file mode 100644 index 00000000..bfedc417 --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedlibrarymedia.md @@ -0,0 +1,58 @@ +# GetRecentlyAddedLibraryMedia + +## Example Usage + +```typescript +import { GetRecentlyAddedLibraryMedia } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedLibraryMedia = { + id: 120345, + duration: 7474422, + bitrate: 3623, + width: 1920, + height: 804, + aspectRatio: 2.35, + audioChannels: 6, + audioCodec: "ac3", + videoCodec: "h264", + videoResolution: 1080, + container: "mp4", + videoFrameRate: "24p", + optimizedForStreaming: 0, + videoProfile: "high", + part: [ + { + id: 120353, + key: "/library/parts/120353/1681803203/file.mp4", + duration: 7474422, + file: + "/movies/Ant-Man and the Wasp Quantumania (2023)/Ant-Man.and.the.Wasp.Quantumania.2023.1080p.mp4", + size: 3395307162, + container: "mp4", + hasThumbnail: 1, + videoProfile: "high", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `id` | *number* | :heavy_minus_sign: | N/A | 120345 | +| `duration` | *number* | :heavy_minus_sign: | N/A | 7474422 | +| `bitrate` | *number* | :heavy_minus_sign: | N/A | 3623 | +| `width` | *number* | :heavy_minus_sign: | N/A | 1920 | +| `height` | *number* | :heavy_minus_sign: | N/A | 804 | +| `aspectRatio` | *number* | :heavy_minus_sign: | N/A | 2.35 | +| `audioChannels` | *number* | :heavy_minus_sign: | N/A | 6 | +| `audioCodec` | *string* | :heavy_minus_sign: | N/A | ac3 | +| `videoCodec` | *string* | :heavy_minus_sign: | N/A | h264 | +| `videoResolution` | *number* | :heavy_minus_sign: | N/A | 1080 | +| `container` | *string* | :heavy_minus_sign: | N/A | mp4 | +| `videoFrameRate` | *string* | :heavy_minus_sign: | N/A | 24p | +| `optimizedForStreaming` | *number* | :heavy_minus_sign: | N/A | 0 | +| `has64bitOffsets` | *boolean* | :heavy_minus_sign: | N/A | | +| `videoProfile` | *string* | :heavy_minus_sign: | N/A | high | +| `part` | [operations.GetRecentlyAddedLibraryPart](../../../sdk/models/operations/getrecentlyaddedlibrarypart.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedlibrarymediacontainer.md b/docs/sdk/models/operations/getrecentlyaddedlibrarymediacontainer.md new file mode 100644 index 00000000..3b212d2e --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedlibrarymediacontainer.md @@ -0,0 +1,165 @@ +# GetRecentlyAddedLibraryMediaContainer + +The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + + +## Example Usage + +```typescript +import { ActiveDirection, DefaultDirection, GetRecentlyAddedLibraryMediaContainer } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedLibraryMediaContainer = { + type: [ + { + key: "/library/sections/2/all?type=2", + type: "show", + title: "TV Shows", + active: false, + filter: [ + { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", + }, + ], + sort: [ + { + default: "asc", + active: false, + activeDirection: ActiveDirection.Ascending, + defaultDirection: DefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", + }, + ], + field: [ + { + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", + }, + ], + }, + ], + fieldType: [ + { + type: "tag", + operator: [ + { + key: "=", + title: "is", + }, + ], + }, + ], + size: 50, + identifier: "com.plexapp.plugins.library", + mediaTagPrefix: "/system/bundle/media/flags/", + mediaTagVersion: 1680021154, + metadata: [ + { + librarySectionID: 1, + librarySectionTitle: "Movies", + librarySectionUUID: "322a231a-b7f7-49f5-920f-14c61199cd30", + ratingKey: 59398, + key: "/library/metadata/59398", + guid: "plex://movie/5e161a83bea6ac004126e148", + studio: "Marvel Studios", + type: "movie", + title: "Ant-Man and the Wasp: Quantumania", + contentRating: "PG-13", + summary: + "Scott Lang and Hope Van Dyne along with Hank Pym and Janet Van Dyne explore the Quantum Realm where they interact with strange creatures and embark on an adventure that goes beyond the limits of what they thought was possible.", + rating: 4.7, + audienceRating: 8.3, + year: 2023, + tagline: "Witness the beginning of a new dynasty.", + thumb: "/library/metadata/59398/thumb/1681888010", + art: "/library/metadata/59398/art/1681888010", + duration: 7474422, + originallyAvailableAt: new Date("2023-02-15T00:00:00Z"), + addedAt: 1681803215, + updatedAt: 1681888010, + audienceRatingImage: "rottentomatoes://image.rating.upright", + chapterSource: "media", + primaryExtraKey: "/library/metadata/59399", + ratingImage: "rottentomatoes://image.rating.rotten", + media: [ + { + id: 120345, + duration: 7474422, + bitrate: 3623, + width: 1920, + height: 804, + aspectRatio: 2.35, + audioChannels: 6, + audioCodec: "ac3", + videoCodec: "h264", + videoResolution: 1080, + container: "mp4", + videoFrameRate: "24p", + optimizedForStreaming: 0, + videoProfile: "high", + part: [ + { + id: 120353, + key: "/library/parts/120353/1681803203/file.mp4", + duration: 7474422, + file: + "/movies/Ant-Man and the Wasp Quantumania (2023)/Ant-Man.and.the.Wasp.Quantumania.2023.1080p.mp4", + size: 3395307162, + container: "mp4", + hasThumbnail: 1, + videoProfile: "high", + }, + ], + }, + ], + genre: [ + { + tag: "Comedy", + }, + ], + director: [ + { + tag: "Peyton Reed", + }, + ], + writer: [ + { + tag: "Jeff Loveness", + }, + ], + country: [ + { + tag: "United States of America", + }, + ], + role: [ + { + tag: "Paul Rudd", + }, + ], + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `type` | [operations.GetRecentlyAddedLibraryType](../../../sdk/models/operations/getrecentlyaddedlibrarytype.md)[] | :heavy_minus_sign: | N/A | | +| `fieldType` | [operations.FieldType](../../../sdk/models/operations/fieldtype.md)[] | :heavy_minus_sign: | N/A | | +| `size` | *number* | :heavy_minus_sign: | N/A | 50 | +| `allowSync` | *boolean* | :heavy_minus_sign: | N/A | | +| `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 | 1680021154 | +| `mixedParents` | *boolean* | :heavy_minus_sign: | N/A | | +| `metadata` | [operations.GetRecentlyAddedLibraryMetadata](../../../sdk/models/operations/getrecentlyaddedlibrarymetadata.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedlibrarymetadata.md b/docs/sdk/models/operations/getrecentlyaddedlibrarymetadata.md new file mode 100644 index 00000000..c0fb5b2e --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedlibrarymetadata.md @@ -0,0 +1,129 @@ +# GetRecentlyAddedLibraryMetadata + +## Example Usage + +```typescript +import { GetRecentlyAddedLibraryMetadata } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedLibraryMetadata = { + librarySectionID: 1, + librarySectionTitle: "Movies", + librarySectionUUID: "322a231a-b7f7-49f5-920f-14c61199cd30", + ratingKey: 59398, + key: "/library/metadata/59398", + guid: "plex://movie/5e161a83bea6ac004126e148", + studio: "Marvel Studios", + type: "movie", + title: "Ant-Man and the Wasp: Quantumania", + contentRating: "PG-13", + summary: + "Scott Lang and Hope Van Dyne along with Hank Pym and Janet Van Dyne explore the Quantum Realm where they interact with strange creatures and embark on an adventure that goes beyond the limits of what they thought was possible.", + rating: 4.7, + audienceRating: 8.3, + year: 2023, + tagline: "Witness the beginning of a new dynasty.", + thumb: "/library/metadata/59398/thumb/1681888010", + art: "/library/metadata/59398/art/1681888010", + duration: 7474422, + originallyAvailableAt: new Date("2023-02-15T00:00:00Z"), + addedAt: 1681803215, + updatedAt: 1681888010, + audienceRatingImage: "rottentomatoes://image.rating.upright", + chapterSource: "media", + primaryExtraKey: "/library/metadata/59399", + ratingImage: "rottentomatoes://image.rating.rotten", + media: [ + { + id: 120345, + duration: 7474422, + bitrate: 3623, + width: 1920, + height: 804, + aspectRatio: 2.35, + audioChannels: 6, + audioCodec: "ac3", + videoCodec: "h264", + videoResolution: 1080, + container: "mp4", + videoFrameRate: "24p", + optimizedForStreaming: 0, + videoProfile: "high", + part: [ + { + id: 120353, + key: "/library/parts/120353/1681803203/file.mp4", + duration: 7474422, + file: + "/movies/Ant-Man and the Wasp Quantumania (2023)/Ant-Man.and.the.Wasp.Quantumania.2023.1080p.mp4", + size: 3395307162, + container: "mp4", + hasThumbnail: 1, + videoProfile: "high", + }, + ], + }, + ], + genre: [ + { + tag: "Comedy", + }, + ], + director: [ + { + tag: "Peyton Reed", + }, + ], + writer: [ + { + tag: "Jeff Loveness", + }, + ], + country: [ + { + tag: "United States of America", + }, + ], + role: [ + { + tag: "Paul Rudd", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allowSync` | *boolean* | :heavy_minus_sign: | N/A | | +| `librarySectionID` | *number* | :heavy_minus_sign: | N/A | 1 | +| `librarySectionTitle` | *string* | :heavy_minus_sign: | N/A | Movies | +| `librarySectionUUID` | *string* | :heavy_minus_sign: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 | +| `ratingKey` | *number* | :heavy_minus_sign: | N/A | 59398 | +| `key` | *string* | :heavy_minus_sign: | N/A | /library/metadata/59398 | +| `guid` | *string* | :heavy_minus_sign: | N/A | plex://movie/5e161a83bea6ac004126e148 | +| `studio` | *string* | :heavy_minus_sign: | N/A | Marvel Studios | +| `type` | *string* | :heavy_minus_sign: | N/A | movie | +| `title` | *string* | :heavy_minus_sign: | N/A | Ant-Man and the Wasp: Quantumania | +| `contentRating` | *string* | :heavy_minus_sign: | N/A | PG-13 | +| `summary` | *string* | :heavy_minus_sign: | N/A | Scott Lang and Hope Van Dyne along with Hank Pym and Janet Van Dyne explore the Quantum Realm where they interact with strange creatures and embark on an adventure that goes beyond the limits of what they thought was possible. | +| `rating` | *number* | :heavy_minus_sign: | N/A | 4.7 | +| `audienceRating` | *number* | :heavy_minus_sign: | N/A | 8.3 | +| `year` | *number* | :heavy_minus_sign: | N/A | 2023 | +| `tagline` | *string* | :heavy_minus_sign: | N/A | Witness the beginning of a new dynasty. | +| `thumb` | *string* | :heavy_minus_sign: | N/A | /library/metadata/59398/thumb/1681888010 | +| `art` | *string* | :heavy_minus_sign: | N/A | /library/metadata/59398/art/1681888010 | +| `duration` | *number* | :heavy_minus_sign: | N/A | 7474422 | +| `originallyAvailableAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A | 2023-02-15 00:00:00 +0000 UTC | +| `addedAt` | *number* | :heavy_minus_sign: | N/A | 1681803215 | +| `updatedAt` | *number* | :heavy_minus_sign: | N/A | 1681888010 | +| `audienceRatingImage` | *string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | +| `chapterSource` | *string* | :heavy_minus_sign: | N/A | media | +| `primaryExtraKey` | *string* | :heavy_minus_sign: | N/A | /library/metadata/59399 | +| `ratingImage` | *string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.rotten | +| `media` | [operations.GetRecentlyAddedLibraryMedia](../../../sdk/models/operations/getrecentlyaddedlibrarymedia.md)[] | :heavy_minus_sign: | N/A | | +| `genre` | [operations.GetRecentlyAddedLibraryGenre](../../../sdk/models/operations/getrecentlyaddedlibrarygenre.md)[] | :heavy_minus_sign: | N/A | | +| `director` | [operations.GetRecentlyAddedLibraryDirector](../../../sdk/models/operations/getrecentlyaddedlibrarydirector.md)[] | :heavy_minus_sign: | N/A | | +| `writer` | [operations.GetRecentlyAddedLibraryWriter](../../../sdk/models/operations/getrecentlyaddedlibrarywriter.md)[] | :heavy_minus_sign: | N/A | | +| `country` | [operations.GetRecentlyAddedLibraryCountry](../../../sdk/models/operations/getrecentlyaddedlibrarycountry.md)[] | :heavy_minus_sign: | N/A | | +| `role` | [operations.GetRecentlyAddedLibraryRole](../../../sdk/models/operations/getrecentlyaddedlibraryrole.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedlibrarypart.md b/docs/sdk/models/operations/getrecentlyaddedlibrarypart.md new file mode 100644 index 00000000..8e24c9eb --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedlibrarypart.md @@ -0,0 +1,34 @@ +# GetRecentlyAddedLibraryPart + +## Example Usage + +```typescript +import { GetRecentlyAddedLibraryPart } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedLibraryPart = { + id: 120353, + key: "/library/parts/120353/1681803203/file.mp4", + duration: 7474422, + file: + "/movies/Ant-Man and the Wasp Quantumania (2023)/Ant-Man.and.the.Wasp.Quantumania.2023.1080p.mp4", + size: 3395307162, + container: "mp4", + hasThumbnail: 1, + videoProfile: "high", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `id` | *number* | :heavy_minus_sign: | N/A | 120353 | +| `key` | *string* | :heavy_minus_sign: | N/A | /library/parts/120353/1681803203/file.mp4 | +| `duration` | *number* | :heavy_minus_sign: | N/A | 7474422 | +| `file` | *string* | :heavy_minus_sign: | N/A | /movies/Ant-Man and the Wasp Quantumania (2023)/Ant-Man.and.the.Wasp.Quantumania.2023.1080p.mp4 | +| `size` | *number* | :heavy_minus_sign: | N/A | 3395307162 | +| `container` | *string* | :heavy_minus_sign: | N/A | mp4 | +| `has64bitOffsets` | *boolean* | :heavy_minus_sign: | N/A | | +| `hasThumbnail` | *number* | :heavy_minus_sign: | N/A | 1 | +| `optimizedForStreaming` | *boolean* | :heavy_minus_sign: | N/A | | +| `videoProfile` | *string* | :heavy_minus_sign: | N/A | high | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedlibraryrequest.md b/docs/sdk/models/operations/getrecentlyaddedlibraryrequest.md new file mode 100644 index 00000000..8aaf27e1 --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedlibraryrequest.md @@ -0,0 +1,42 @@ +# GetRecentlyAddedLibraryRequest + +## Example Usage + +```typescript +import { GetRecentlyAddedLibraryRequest, QueryParamIncludeMeta, QueryParamType } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedLibraryRequest = { + contentDirectoryID: 2, + pinnedContentDirectoryID: [ + 3, + 5, + 7, + 13, + 12, + 1, + 6, + 14, + 2, + 10, + 16, + 17, + ], + sectionID: 2, + type: QueryParamType.TvShow, + includeMeta: QueryParamIncludeMeta.Enable, + xPlexContainerStart: 0, + xPlexContainerSize: 50, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `contentDirectoryID` | *number* | :heavy_minus_sign: | N/A | 2 | +| `pinnedContentDirectoryID` | *number*[] | :heavy_minus_sign: | N/A | [
3,
5,
7,
13,
12,
1,
6,
14,
2,
10,
16,
17
] | +| `sectionID` | *number* | :heavy_minus_sign: | The library section ID for filtering content. | 2 | +| `type` | [operations.QueryParamType](../../../sdk/models/operations/queryparamtype.md) | :heavy_check_mark: | The type of media to retrieve.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | +| `includeMeta` | [operations.QueryParamIncludeMeta](../../../sdk/models/operations/queryparamincludemeta.md) | :heavy_minus_sign: | Adds the Meta object to the response
| 1 | +| `xPlexContainerStart` | *number* | :heavy_minus_sign: | The index of the first item to return. If not specified, the first item will be returned.
If the number of items exceeds the limit, the response will be paginated.
By default this is 0
| 0 | +| `xPlexContainerSize` | *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.
By default this is 50
| 50 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedlibraryresponse.md b/docs/sdk/models/operations/getrecentlyaddedlibraryresponse.md new file mode 100644 index 00000000..af13cf27 --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedlibraryresponse.md @@ -0,0 +1,166 @@ +# GetRecentlyAddedLibraryResponse + +## Example Usage + +```typescript +import { ActiveDirection, DefaultDirection, GetRecentlyAddedLibraryResponse } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedLibraryResponse = { + contentType: "", + statusCode: 418, + rawResponse: new Response("{\"message\": \"hello world\"}", { + headers: { "Content-Type": "application/json" }, + }), + object: { + mediaContainer: { + type: [ + { + key: "/library/sections/2/all?type=2", + type: "show", + title: "TV Shows", + active: false, + filter: [ + { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", + }, + ], + sort: [ + { + default: "asc", + active: false, + activeDirection: ActiveDirection.Ascending, + defaultDirection: DefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", + }, + ], + field: [ + { + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", + }, + ], + }, + ], + fieldType: [ + { + type: "tag", + operator: [ + { + key: "=", + title: "is", + }, + ], + }, + ], + size: 50, + identifier: "com.plexapp.plugins.library", + mediaTagPrefix: "/system/bundle/media/flags/", + mediaTagVersion: 1680021154, + metadata: [ + { + librarySectionID: 1, + librarySectionTitle: "Movies", + librarySectionUUID: "322a231a-b7f7-49f5-920f-14c61199cd30", + ratingKey: 59398, + key: "/library/metadata/59398", + guid: "plex://movie/5e161a83bea6ac004126e148", + studio: "Marvel Studios", + type: "movie", + title: "Ant-Man and the Wasp: Quantumania", + contentRating: "PG-13", + summary: + "Scott Lang and Hope Van Dyne along with Hank Pym and Janet Van Dyne explore the Quantum Realm where they interact with strange creatures and embark on an adventure that goes beyond the limits of what they thought was possible.", + rating: 4.7, + audienceRating: 8.3, + year: 2023, + tagline: "Witness the beginning of a new dynasty.", + thumb: "/library/metadata/59398/thumb/1681888010", + art: "/library/metadata/59398/art/1681888010", + duration: 7474422, + originallyAvailableAt: new Date("2023-02-15T00:00:00Z"), + addedAt: 1681803215, + updatedAt: 1681888010, + audienceRatingImage: "rottentomatoes://image.rating.upright", + chapterSource: "media", + primaryExtraKey: "/library/metadata/59399", + ratingImage: "rottentomatoes://image.rating.rotten", + media: [ + { + id: 120345, + duration: 7474422, + bitrate: 3623, + width: 1920, + height: 804, + aspectRatio: 2.35, + audioChannels: 6, + audioCodec: "ac3", + videoCodec: "h264", + videoResolution: 1080, + container: "mp4", + videoFrameRate: "24p", + optimizedForStreaming: 0, + videoProfile: "high", + part: [ + { + id: 120353, + key: "/library/parts/120353/1681803203/file.mp4", + duration: 7474422, + file: + "/movies/Ant-Man and the Wasp Quantumania (2023)/Ant-Man.and.the.Wasp.Quantumania.2023.1080p.mp4", + size: 3395307162, + container: "mp4", + hasThumbnail: 1, + videoProfile: "high", + }, + ], + }, + ], + genre: [ + { + tag: "Comedy", + }, + ], + director: [ + { + tag: "Peyton Reed", + }, + ], + writer: [ + { + tag: "Jeff Loveness", + }, + ], + country: [ + { + tag: "United States of America", + }, + ], + role: [ + { + tag: "Paul Rudd", + }, + ], + }, + ], + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [operations.GetRecentlyAddedLibraryResponseBody](../../../sdk/models/operations/getrecentlyaddedlibraryresponsebody.md) | :heavy_minus_sign: | The recently added content | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedlibraryresponsebody.md b/docs/sdk/models/operations/getrecentlyaddedlibraryresponsebody.md new file mode 100644 index 00000000..881e2163 --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedlibraryresponsebody.md @@ -0,0 +1,158 @@ +# GetRecentlyAddedLibraryResponseBody + +The recently added content + +## Example Usage + +```typescript +import { ActiveDirection, DefaultDirection, GetRecentlyAddedLibraryResponseBody } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedLibraryResponseBody = { + mediaContainer: { + type: [ + { + key: "/library/sections/2/all?type=2", + type: "show", + title: "TV Shows", + active: false, + filter: [ + { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", + }, + ], + sort: [ + { + default: "asc", + active: false, + activeDirection: ActiveDirection.Ascending, + defaultDirection: DefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", + }, + ], + field: [ + { + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", + }, + ], + }, + ], + fieldType: [ + { + type: "tag", + operator: [ + { + key: "=", + title: "is", + }, + ], + }, + ], + size: 50, + identifier: "com.plexapp.plugins.library", + mediaTagPrefix: "/system/bundle/media/flags/", + mediaTagVersion: 1680021154, + metadata: [ + { + librarySectionID: 1, + librarySectionTitle: "Movies", + librarySectionUUID: "322a231a-b7f7-49f5-920f-14c61199cd30", + ratingKey: 59398, + key: "/library/metadata/59398", + guid: "plex://movie/5e161a83bea6ac004126e148", + studio: "Marvel Studios", + type: "movie", + title: "Ant-Man and the Wasp: Quantumania", + contentRating: "PG-13", + summary: + "Scott Lang and Hope Van Dyne along with Hank Pym and Janet Van Dyne explore the Quantum Realm where they interact with strange creatures and embark on an adventure that goes beyond the limits of what they thought was possible.", + rating: 4.7, + audienceRating: 8.3, + year: 2023, + tagline: "Witness the beginning of a new dynasty.", + thumb: "/library/metadata/59398/thumb/1681888010", + art: "/library/metadata/59398/art/1681888010", + duration: 7474422, + originallyAvailableAt: new Date("2023-02-15T00:00:00Z"), + addedAt: 1681803215, + updatedAt: 1681888010, + audienceRatingImage: "rottentomatoes://image.rating.upright", + chapterSource: "media", + primaryExtraKey: "/library/metadata/59399", + ratingImage: "rottentomatoes://image.rating.rotten", + media: [ + { + id: 120345, + duration: 7474422, + bitrate: 3623, + width: 1920, + height: 804, + aspectRatio: 2.35, + audioChannels: 6, + audioCodec: "ac3", + videoCodec: "h264", + videoResolution: 1080, + container: "mp4", + videoFrameRate: "24p", + optimizedForStreaming: 0, + videoProfile: "high", + part: [ + { + id: 120353, + key: "/library/parts/120353/1681803203/file.mp4", + duration: 7474422, + file: + "/movies/Ant-Man and the Wasp Quantumania (2023)/Ant-Man.and.the.Wasp.Quantumania.2023.1080p.mp4", + size: 3395307162, + container: "mp4", + hasThumbnail: 1, + videoProfile: "high", + }, + ], + }, + ], + genre: [ + { + tag: "Comedy", + }, + ], + director: [ + { + tag: "Peyton Reed", + }, + ], + writer: [ + { + tag: "Jeff Loveness", + }, + ], + country: [ + { + tag: "United States of America", + }, + ], + role: [ + { + tag: "Paul Rudd", + }, + ], + }, + ], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `mediaContainer` | [operations.GetRecentlyAddedLibraryMediaContainer](../../../sdk/models/operations/getrecentlyaddedlibrarymediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedlibraryrole.md b/docs/sdk/models/operations/getrecentlyaddedlibraryrole.md new file mode 100644 index 00000000..afb0f0ea --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedlibraryrole.md @@ -0,0 +1,17 @@ +# GetRecentlyAddedLibraryRole + +## Example Usage + +```typescript +import { GetRecentlyAddedLibraryRole } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedLibraryRole = { + tag: "Paul Rudd", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `tag` | *string* | :heavy_minus_sign: | N/A | Paul Rudd | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedlibrarytype.md b/docs/sdk/models/operations/getrecentlyaddedlibrarytype.md new file mode 100644 index 00000000..9bdf89a6 --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedlibrarytype.md @@ -0,0 +1,55 @@ +# GetRecentlyAddedLibraryType + +## Example Usage + +```typescript +import { ActiveDirection, DefaultDirection, GetRecentlyAddedLibraryType } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedLibraryType = { + key: "/library/sections/2/all?type=2", + type: "show", + title: "TV Shows", + active: false, + filter: [ + { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", + }, + ], + sort: [ + { + default: "asc", + active: false, + activeDirection: ActiveDirection.Ascending, + defaultDirection: DefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", + }, + ], + field: [ + { + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/all?type=2 | +| `type` | *string* | :heavy_check_mark: | N/A | show | +| `title` | *string* | :heavy_check_mark: | N/A | TV Shows | +| `active` | *boolean* | :heavy_check_mark: | N/A | false | +| `filter` | [operations.GetRecentlyAddedLibraryFilter](../../../sdk/models/operations/getrecentlyaddedlibraryfilter.md)[] | :heavy_minus_sign: | N/A | | +| `sort` | [operations.Sort](../../../sdk/models/operations/sort.md)[] | :heavy_minus_sign: | N/A | | +| `field` | [operations.Field](../../../sdk/models/operations/field.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedlibrarywriter.md b/docs/sdk/models/operations/getrecentlyaddedlibrarywriter.md new file mode 100644 index 00000000..721890c1 --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedlibrarywriter.md @@ -0,0 +1,17 @@ +# GetRecentlyAddedLibraryWriter + +## Example Usage + +```typescript +import { GetRecentlyAddedLibraryWriter } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedLibraryWriter = { + tag: "Jeff Loveness", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `tag` | *string* | :heavy_minus_sign: | N/A | Jeff Loveness | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedmediacontainer.md b/docs/sdk/models/operations/getrecentlyaddedmediacontainer.md index 923c4e79..87c20caa 100644 --- a/docs/sdk/models/operations/getrecentlyaddedmediacontainer.md +++ b/docs/sdk/models/operations/getrecentlyaddedmediacontainer.md @@ -3,85 +3,198 @@ ## Example Usage ```typescript -import { GetRecentlyAddedMediaContainer } from "@lukehagar/plexjs/sdk/models/operations"; +import { + FlattenSeasons, + GetRecentlyAddedActiveDirection, + GetRecentlyAddedDefaultDirection, + GetRecentlyAddedHubsResponseType, + GetRecentlyAddedHubsType, + GetRecentlyAddedMediaContainer, + HasThumbnail, + OptimizedForStreaming, + ShowOrdering, +} from "@lukehagar/plexjs/sdk/models/operations"; +import { RFCDate } from "@lukehagar/plexjs/sdk/types"; let value: GetRecentlyAddedMediaContainer = { size: 50, identifier: "com.plexapp.plugins.library", - mediaTagPrefix: "/system/bundle/media/flags/", - mediaTagVersion: 1680021154, + meta: { + type: [ + { + key: "/library/sections/2/all?type=2", + type: "show", + title: "TV Shows", + active: false, + filter: [ + { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", + }, + ], + sort: [ + { + default: "asc", + active: false, + activeDirection: GetRecentlyAddedActiveDirection.Ascending, + defaultDirection: GetRecentlyAddedDefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", + }, + ], + field: [ + { + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", + }, + ], + }, + ], + fieldType: [ + { + type: "tag", + operator: [ + { + key: "=", + title: "is", + }, + ], + }, + ], + }, metadata: [ { + ratingKey: "58683", + key: "/library/metadata/58683", + guid: "plex://movie/5d7768ba96b655001fdc0408", + studio: "20th Century Studios", + skipChildren: false, librarySectionID: 1, librarySectionTitle: "Movies", - librarySectionUUID: "322a231a-b7f7-49f5-920f-14c61199cd30", - ratingKey: 59398, - key: "/library/metadata/59398", - guid: "plex://movie/5e161a83bea6ac004126e148", - studio: "Marvel Studios", - type: "movie", - title: "Ant-Man and the Wasp: Quantumania", + librarySectionKey: "/library/sections/1", + type: GetRecentlyAddedHubsType.Movie, + title: "Avatar: The Way of Water", + slug: "4-for-texas", contentRating: "PG-13", summary: - "Scott Lang and Hope Van Dyne along with Hank Pym and Janet Van Dyne explore the Quantum Realm where they interact with strange creatures and embark on an adventure that goes beyond the limits of what they thought was possible.", - rating: 4.7, - audienceRating: 8.3, - year: 2023, - tagline: "Witness the beginning of a new dynasty.", - thumb: "/library/metadata/59398/thumb/1681888010", - art: "/library/metadata/59398/art/1681888010", - duration: 7474422, - originallyAvailableAt: new Date("2023-02-15T00:00:00Z"), - addedAt: 1681803215, - updatedAt: 1681888010, + "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", + rating: 7.6, + audienceRating: 9.2, + year: 2022, + seasonCount: 2022, + tagline: "Return to Pandora.", + flattenSeasons: FlattenSeasons.True, + showOrdering: ShowOrdering.Dvd, + thumb: "/library/metadata/58683/thumb/1703239236", + art: "/library/metadata/58683/art/1703239236", + banner: "/library/metadata/58683/banner/1703239236", + duration: 11558112, + originallyAvailableAt: new RFCDate("2022-12-14T00:00:00Z"), + addedAt: 1556281940, + updatedAt: 1556281940, audienceRatingImage: "rottentomatoes://image.rating.upright", chapterSource: "media", - primaryExtraKey: "/library/metadata/59399", - ratingImage: "rottentomatoes://image.rating.rotten", + primaryExtraKey: "/library/metadata/58684", + ratingImage: "rottentomatoes://image.rating.ripe", + grandparentRatingKey: "66", + grandparentGuid: "plex://show/5d9c081b170e24001f2a7be4", + grandparentKey: "/library/metadata/66", + grandparentTitle: "Caprica", + grandparentThumb: "/library/metadata/66/thumb/1705716261", + parentSlug: "alice-in-borderland-2020", + grandparentSlug: "alice-in-borderland-2020", + grandparentArt: "/library/metadata/66/art/1705716261", + grandparentTheme: "/library/metadata/66/theme/1705716261", media: [ { - id: 120345, - duration: 7474422, - bitrate: 3623, - width: 1920, - height: 804, - aspectRatio: 2.35, + id: 119534, + duration: 11558112, + bitrate: 25025, + width: 3840, + height: 2072, + aspectRatio: 1.85, + audioProfile: "dts", audioChannels: 6, - audioCodec: "ac3", - videoCodec: "h264", - videoResolution: 1080, - container: "mp4", + audioCodec: "eac3", + videoCodec: "hevc", + videoResolution: "4k", + container: "mkv", videoFrameRate: "24p", - optimizedForStreaming: 0, - videoProfile: "high", + videoProfile: "main 10", + hasVoiceActivity: false, + optimizedForStreaming: OptimizedForStreaming.Enable, + has64bitOffsets: false, part: [ { - id: 120353, - key: "/library/parts/120353/1681803203/file.mp4", - duration: 7474422, + id: 119542, + key: "/library/parts/119542/1680457526/file.mkv", + duration: 11558112, file: - "/movies/Ant-Man and the Wasp Quantumania (2023)/Ant-Man.and.the.Wasp.Quantumania.2023.1080p.mp4", - size: 3395307162, - container: "mp4", - hasThumbnail: 1, - videoProfile: "high", + "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", + size: 36158371307, + container: "mkv", + audioProfile: "dts", + has64bitOffsets: false, + optimizedForStreaming: false, + videoProfile: "main 10", + indexes: "sd", + hasThumbnail: HasThumbnail.True, + stream: [ + { + id: 272796, + streamType: 1, + default: true, + selected: true, + codec: "h264", + index: 0, + bitrate: 6273, + colorPrimaries: "bt709", + colorRange: "tv", + colorSpace: "bt709", + colorTrc: "bt709", + bitDepth: 8, + chromaLocation: "left", + streamIdentifier: "2", + chromaSubsampling: "4:2:0", + codedHeight: 1088, + codedWidth: 1920, + frameRate: 29.97, + hasScalingMatrix: false, + hearingImpaired: false, + closedCaptions: false, + embeddedInVideo: "1", + height: 1080, + level: 40, + profile: "main", + refFrames: 4, + scanType: "progressive", + width: 1920, + displayTitle: "1080p (H.264)", + extendedDisplayTitle: "1080p (H.264)", + channels: 2, + language: "English", + languageTag: "en", + languageCode: "eng", + audioChannelLayout: "stereo", + samplingRate: 48000, + title: "English", + canAutoSync: false, + }, + ], }, ], }, ], genre: [ { - tag: "Comedy", - }, - ], - director: [ - { - tag: "Peyton Reed", - }, - ], - writer: [ - { - tag: "Jeff Loveness", + tag: "Adventure", }, ], country: [ @@ -89,11 +202,79 @@ let value: GetRecentlyAddedMediaContainer = { tag: "United States of America", }, ], - role: [ + director: [ { - tag: "Paul Rudd", + tag: "James Cameron", }, ], + writer: [ + { + tag: "James Cameron", + }, + ], + collection: [ + { + tag: "Working NL Subs", + }, + ], + role: [ + { + id: 294129, + filter: "actor=294129", + thumb: + "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", + tag: "Mike Smith", + tagKey: "668e7e7b22bcad9064350c91", + role: "Self", + }, + ], + mediaGuid: [ + { + id: "imdb://tt13015952", + }, + ], + ultraBlurColors: { + topLeft: "11333b", + topRight: "0a232d", + bottomRight: "73958", + bottomLeft: "1f5066", + }, + metaDataRating: [ + { + image: "themoviedb://image.rating", + value: 3, + type: "audience", + }, + ], + image: [ + { + alt: "Episode 1", + type: GetRecentlyAddedHubsResponseType.Background, + url: "/library/metadata/45521/thumb/1644710589", + }, + ], + titleSort: "Whale", + viewCount: 1, + lastViewedAt: 1682752242, + originalTitle: "映画 ブラッククローバー 魔法帝の剣", + viewOffset: 5222500, + skipCount: 1, + index: 1, + theme: "/library/metadata/1/theme/1705636920", + leafCount: 14, + viewedLeafCount: 0, + childCount: 1, + hasPremiumExtras: "1", + hasPremiumPrimaryExtra: "1", + parentRatingKey: "66", + parentGuid: "plex://show/5d9c081b170e24001f2a7be4", + parentStudio: "UCP", + parentKey: "/library/metadata/66", + parentTitle: "Caprica", + parentIndex: 1, + parentYear: 2010, + parentThumb: "/library/metadata/66/thumb/1705716261", + parentTheme: "/library/metadata/66/theme/1705716261", }, ], }; @@ -103,10 +284,10 @@ let value: GetRecentlyAddedMediaContainer = { | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `size` | *number* | :heavy_minus_sign: | N/A | 50 | -| `allowSync` | *boolean* | :heavy_minus_sign: | N/A | | +| `size` | *number* | :heavy_check_mark: | N/A | 50 | +| `offset` | *number* | :heavy_minus_sign: | N/A | | +| `totalSize` | *number* | :heavy_minus_sign: | N/A | | | `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 | 1680021154 | -| `mixedParents` | *boolean* | :heavy_minus_sign: | N/A | | +| `allowSync` | *boolean* | :heavy_minus_sign: | N/A | | +| `meta` | [operations.Meta](../../../sdk/models/operations/meta.md) | :heavy_minus_sign: | The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.
| | | `metadata` | [operations.GetRecentlyAddedMetadata](../../../sdk/models/operations/getrecentlyaddedmetadata.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedmetadata.md b/docs/sdk/models/operations/getrecentlyaddedmetadata.md index 6d09d4c9..73a16d18 100644 --- a/docs/sdk/models/operations/getrecentlyaddedmetadata.md +++ b/docs/sdk/models/operations/getrecentlyaddedmetadata.md @@ -3,79 +3,142 @@ ## Example Usage ```typescript -import { GetRecentlyAddedMetadata } from "@lukehagar/plexjs/sdk/models/operations"; +import { + FlattenSeasons, + GetRecentlyAddedHubsResponseType, + GetRecentlyAddedHubsType, + GetRecentlyAddedMetadata, + HasThumbnail, + OptimizedForStreaming, + ShowOrdering, +} from "@lukehagar/plexjs/sdk/models/operations"; +import { RFCDate } from "@lukehagar/plexjs/sdk/types"; let value: GetRecentlyAddedMetadata = { + ratingKey: "58683", + key: "/library/metadata/58683", + guid: "plex://movie/5d7768ba96b655001fdc0408", + studio: "20th Century Studios", + skipChildren: false, librarySectionID: 1, librarySectionTitle: "Movies", - librarySectionUUID: "322a231a-b7f7-49f5-920f-14c61199cd30", - ratingKey: 59398, - key: "/library/metadata/59398", - guid: "plex://movie/5e161a83bea6ac004126e148", - studio: "Marvel Studios", - type: "movie", - title: "Ant-Man and the Wasp: Quantumania", + librarySectionKey: "/library/sections/1", + type: GetRecentlyAddedHubsType.Movie, + title: "Avatar: The Way of Water", + slug: "4-for-texas", contentRating: "PG-13", summary: - "Scott Lang and Hope Van Dyne along with Hank Pym and Janet Van Dyne explore the Quantum Realm where they interact with strange creatures and embark on an adventure that goes beyond the limits of what they thought was possible.", - rating: 4.7, - audienceRating: 8.3, - year: 2023, - tagline: "Witness the beginning of a new dynasty.", - thumb: "/library/metadata/59398/thumb/1681888010", - art: "/library/metadata/59398/art/1681888010", - duration: 7474422, - originallyAvailableAt: new Date("2023-02-15T00:00:00Z"), - addedAt: 1681803215, - updatedAt: 1681888010, + "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", + rating: 7.6, + audienceRating: 9.2, + year: 2022, + seasonCount: 2022, + tagline: "Return to Pandora.", + flattenSeasons: FlattenSeasons.True, + showOrdering: ShowOrdering.Dvd, + thumb: "/library/metadata/58683/thumb/1703239236", + art: "/library/metadata/58683/art/1703239236", + banner: "/library/metadata/58683/banner/1703239236", + duration: 11558112, + originallyAvailableAt: new RFCDate("2022-12-14T00:00:00Z"), + addedAt: 1556281940, + updatedAt: 1556281940, audienceRatingImage: "rottentomatoes://image.rating.upright", chapterSource: "media", - primaryExtraKey: "/library/metadata/59399", - ratingImage: "rottentomatoes://image.rating.rotten", + primaryExtraKey: "/library/metadata/58684", + ratingImage: "rottentomatoes://image.rating.ripe", + grandparentRatingKey: "66", + grandparentGuid: "plex://show/5d9c081b170e24001f2a7be4", + grandparentKey: "/library/metadata/66", + grandparentTitle: "Caprica", + grandparentThumb: "/library/metadata/66/thumb/1705716261", + parentSlug: "alice-in-borderland-2020", + grandparentSlug: "alice-in-borderland-2020", + grandparentArt: "/library/metadata/66/art/1705716261", + grandparentTheme: "/library/metadata/66/theme/1705716261", media: [ { - id: 120345, - duration: 7474422, - bitrate: 3623, - width: 1920, - height: 804, - aspectRatio: 2.35, + id: 119534, + duration: 11558112, + bitrate: 25025, + width: 3840, + height: 2072, + aspectRatio: 1.85, + audioProfile: "dts", audioChannels: 6, - audioCodec: "ac3", - videoCodec: "h264", - videoResolution: 1080, - container: "mp4", + audioCodec: "eac3", + videoCodec: "hevc", + videoResolution: "4k", + container: "mkv", videoFrameRate: "24p", - optimizedForStreaming: 0, - videoProfile: "high", + videoProfile: "main 10", + hasVoiceActivity: false, + optimizedForStreaming: OptimizedForStreaming.Enable, + has64bitOffsets: false, part: [ { - id: 120353, - key: "/library/parts/120353/1681803203/file.mp4", - duration: 7474422, + id: 119542, + key: "/library/parts/119542/1680457526/file.mkv", + duration: 11558112, file: - "/movies/Ant-Man and the Wasp Quantumania (2023)/Ant-Man.and.the.Wasp.Quantumania.2023.1080p.mp4", - size: 3395307162, - container: "mp4", - hasThumbnail: 1, - videoProfile: "high", + "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", + size: 36158371307, + container: "mkv", + audioProfile: "dts", + has64bitOffsets: false, + optimizedForStreaming: false, + videoProfile: "main 10", + indexes: "sd", + hasThumbnail: HasThumbnail.True, + stream: [ + { + id: 272796, + streamType: 1, + default: true, + selected: true, + codec: "h264", + index: 0, + bitrate: 6273, + colorPrimaries: "bt709", + colorRange: "tv", + colorSpace: "bt709", + colorTrc: "bt709", + bitDepth: 8, + chromaLocation: "left", + streamIdentifier: "2", + chromaSubsampling: "4:2:0", + codedHeight: 1088, + codedWidth: 1920, + frameRate: 29.97, + hasScalingMatrix: false, + hearingImpaired: false, + closedCaptions: false, + embeddedInVideo: "1", + height: 1080, + level: 40, + profile: "main", + refFrames: 4, + scanType: "progressive", + width: 1920, + displayTitle: "1080p (H.264)", + extendedDisplayTitle: "1080p (H.264)", + channels: 2, + language: "English", + languageTag: "en", + languageCode: "eng", + audioChannelLayout: "stereo", + samplingRate: 48000, + title: "English", + canAutoSync: false, + }, + ], }, ], }, ], genre: [ { - tag: "Comedy", - }, - ], - director: [ - { - tag: "Peyton Reed", - }, - ], - writer: [ - { - tag: "Jeff Loveness", + tag: "Adventure", }, ], country: [ @@ -83,47 +146,156 @@ let value: GetRecentlyAddedMetadata = { tag: "United States of America", }, ], - role: [ + director: [ { - tag: "Paul Rudd", + tag: "James Cameron", }, ], + writer: [ + { + tag: "James Cameron", + }, + ], + collection: [ + { + tag: "Working NL Subs", + }, + ], + role: [ + { + id: 294129, + filter: "actor=294129", + thumb: + "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", + tag: "Mike Smith", + tagKey: "668e7e7b22bcad9064350c91", + role: "Self", + }, + ], + mediaGuid: [ + { + id: "imdb://tt13015952", + }, + ], + ultraBlurColors: { + topLeft: "11333b", + topRight: "0a232d", + bottomRight: "73958", + bottomLeft: "1f5066", + }, + metaDataRating: [ + { + image: "themoviedb://image.rating", + value: 3, + type: "audience", + }, + ], + image: [ + { + alt: "Episode 1", + type: GetRecentlyAddedHubsResponseType.Background, + url: "/library/metadata/45521/thumb/1644710589", + }, + ], + titleSort: "Whale", + viewCount: 1, + lastViewedAt: 1682752242, + originalTitle: "映画 ブラッククローバー 魔法帝の剣", + viewOffset: 5222500, + skipCount: 1, + index: 1, + theme: "/library/metadata/1/theme/1705636920", + leafCount: 14, + viewedLeafCount: 0, + childCount: 1, + hasPremiumExtras: "1", + hasPremiumPrimaryExtra: "1", + parentRatingKey: "66", + parentGuid: "plex://show/5d9c081b170e24001f2a7be4", + parentStudio: "UCP", + parentKey: "/library/metadata/66", + parentTitle: "Caprica", + parentIndex: 1, + parentYear: 2010, + parentThumb: "/library/metadata/66/thumb/1705716261", + parentTheme: "/library/metadata/66/theme/1705716261", }; ``` ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `allowSync` | *boolean* | :heavy_minus_sign: | N/A | | -| `librarySectionID` | *number* | :heavy_minus_sign: | N/A | 1 | -| `librarySectionTitle` | *string* | :heavy_minus_sign: | N/A | Movies | -| `librarySectionUUID` | *string* | :heavy_minus_sign: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 | -| `ratingKey` | *number* | :heavy_minus_sign: | N/A | 59398 | -| `key` | *string* | :heavy_minus_sign: | N/A | /library/metadata/59398 | -| `guid` | *string* | :heavy_minus_sign: | N/A | plex://movie/5e161a83bea6ac004126e148 | -| `studio` | *string* | :heavy_minus_sign: | N/A | Marvel Studios | -| `type` | *string* | :heavy_minus_sign: | N/A | movie | -| `title` | *string* | :heavy_minus_sign: | N/A | Ant-Man and the Wasp: Quantumania | -| `contentRating` | *string* | :heavy_minus_sign: | N/A | PG-13 | -| `summary` | *string* | :heavy_minus_sign: | N/A | Scott Lang and Hope Van Dyne along with Hank Pym and Janet Van Dyne explore the Quantum Realm where they interact with strange creatures and embark on an adventure that goes beyond the limits of what they thought was possible. | -| `rating` | *number* | :heavy_minus_sign: | N/A | 4.7 | -| `audienceRating` | *number* | :heavy_minus_sign: | N/A | 8.3 | -| `year` | *number* | :heavy_minus_sign: | N/A | 2023 | -| `tagline` | *string* | :heavy_minus_sign: | N/A | Witness the beginning of a new dynasty. | -| `thumb` | *string* | :heavy_minus_sign: | N/A | /library/metadata/59398/thumb/1681888010 | -| `art` | *string* | :heavy_minus_sign: | N/A | /library/metadata/59398/art/1681888010 | -| `duration` | *number* | :heavy_minus_sign: | N/A | 7474422 | -| `originallyAvailableAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A | 2023-02-15 00:00:00 +0000 UTC | -| `addedAt` | *number* | :heavy_minus_sign: | N/A | 1681803215 | -| `updatedAt` | *number* | :heavy_minus_sign: | N/A | 1681888010 | -| `audienceRatingImage` | *string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | -| `chapterSource` | *string* | :heavy_minus_sign: | N/A | media | -| `primaryExtraKey` | *string* | :heavy_minus_sign: | N/A | /library/metadata/59399 | -| `ratingImage` | *string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.rotten | -| `media` | [operations.Media](../../../sdk/models/operations/media.md)[] | :heavy_minus_sign: | N/A | | -| `genre` | [operations.Genre](../../../sdk/models/operations/genre.md)[] | :heavy_minus_sign: | N/A | | -| `director` | [operations.Director](../../../sdk/models/operations/director.md)[] | :heavy_minus_sign: | N/A | | -| `writer` | [operations.Writer](../../../sdk/models/operations/writer.md)[] | :heavy_minus_sign: | N/A | | -| `country` | [operations.Country](../../../sdk/models/operations/country.md)[] | :heavy_minus_sign: | N/A | | -| `role` | [operations.Role](../../../sdk/models/operations/role.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ratingKey` | *string* | :heavy_check_mark: | The rating key (Media ID) of this media item.
Note: This is always an integer, but is represented as a string in the API.
| 58683 | +| `key` | *string* | :heavy_check_mark: | N/A | /library/metadata/58683 | +| `guid` | *string* | :heavy_check_mark: | N/A | plex://movie/5d7768ba96b655001fdc0408 | +| `studio` | *string* | :heavy_minus_sign: | N/A | 20th Century Studios | +| `skipChildren` | *boolean* | :heavy_minus_sign: | N/A | false | +| `librarySectionID` | *number* | :heavy_minus_sign: | N/A | 1 | +| `librarySectionTitle` | *string* | :heavy_minus_sign: | N/A | Movies | +| `librarySectionKey` | *string* | :heavy_minus_sign: | N/A | /library/sections/1 | +| `type` | [operations.GetRecentlyAddedHubsType](../../../sdk/models/operations/getrecentlyaddedhubstype.md) | :heavy_check_mark: | The type of media content
| movie | +| `title` | *string* | :heavy_check_mark: | N/A | Avatar: The Way of Water | +| `slug` | *string* | :heavy_minus_sign: | N/A | 4-for-texas | +| `contentRating` | *string* | :heavy_minus_sign: | N/A | PG-13 | +| `summary` | *string* | :heavy_check_mark: | N/A | Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home. | +| `rating` | *number* | :heavy_minus_sign: | N/A | 7.6 | +| `audienceRating` | *number* | :heavy_minus_sign: | N/A | 9.2 | +| `year` | *number* | :heavy_minus_sign: | N/A | 2022 | +| `seasonCount` | *number* | :heavy_minus_sign: | N/A | 2022 | +| `tagline` | *string* | :heavy_minus_sign: | N/A | Return to Pandora. | +| `flattenSeasons` | [operations.FlattenSeasons](../../../sdk/models/operations/flattenseasons.md) | :heavy_minus_sign: | N/A | 1 | +| `showOrdering` | [operations.ShowOrdering](../../../sdk/models/operations/showordering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show
None = Library default,
tmdbAiring = The Movie Database (Aired),
aired = TheTVDB (Aired),
dvd = TheTVDB (DVD),
absolute = TheTVDB (Absolute)).
| dvd | +| `thumb` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 | +| `art` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 | +| `banner` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58683/banner/1703239236 | +| `duration` | *number* | :heavy_minus_sign: | N/A | 11558112 | +| `originallyAvailableAt` | [RFCDate](../../../types/rfcdate.md) | :heavy_minus_sign: | N/A | 2022-12-14 00:00:00 +0000 UTC | +| `addedAt` | *number* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | +| `updatedAt` | *number* | :heavy_minus_sign: | Unix epoch datetime in seconds | 1556281940 | +| `audienceRatingImage` | *string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | +| `chapterSource` | *string* | :heavy_minus_sign: | N/A | media | +| `primaryExtraKey` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58684 | +| `ratingImage` | *string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.ripe | +| `grandparentRatingKey` | *string* | :heavy_minus_sign: | N/A | 66 | +| `grandparentGuid` | *string* | :heavy_minus_sign: | N/A | plex://show/5d9c081b170e24001f2a7be4 | +| `grandparentKey` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66 | +| `grandparentTitle` | *string* | :heavy_minus_sign: | N/A | Caprica | +| `grandparentThumb` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66/thumb/1705716261 | +| `parentSlug` | *string* | :heavy_minus_sign: | N/A | alice-in-borderland-2020 | +| `grandparentSlug` | *string* | :heavy_minus_sign: | N/A | alice-in-borderland-2020 | +| `grandparentArt` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66/art/1705716261 | +| `grandparentTheme` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66/theme/1705716261 | +| `media` | [operations.Media](../../../sdk/models/operations/media.md)[] | :heavy_minus_sign: | The Media object is only included when type query is `4` or higher.
| | +| `genre` | [operations.Genre](../../../sdk/models/operations/genre.md)[] | :heavy_minus_sign: | N/A | | +| `country` | [operations.Country](../../../sdk/models/operations/country.md)[] | :heavy_minus_sign: | N/A | | +| `director` | [operations.Director](../../../sdk/models/operations/director.md)[] | :heavy_minus_sign: | N/A | | +| `writer` | [operations.Writer](../../../sdk/models/operations/writer.md)[] | :heavy_minus_sign: | N/A | | +| `collection` | [operations.Collection](../../../sdk/models/operations/collection.md)[] | :heavy_minus_sign: | N/A | | +| `role` | [operations.Role](../../../sdk/models/operations/role.md)[] | :heavy_minus_sign: | N/A | | +| `mediaGuid` | [operations.MediaGuid](../../../sdk/models/operations/mediaguid.md)[] | :heavy_minus_sign: | The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.
| | +| `ultraBlurColors` | [operations.UltraBlurColors](../../../sdk/models/operations/ultrablurcolors.md) | :heavy_minus_sign: | N/A | | +| `metaDataRating` | [operations.MetaDataRating](../../../sdk/models/operations/metadatarating.md)[] | :heavy_minus_sign: | N/A | | +| `image` | [operations.GetRecentlyAddedImage](../../../sdk/models/operations/getrecentlyaddedimage.md)[] | :heavy_minus_sign: | N/A | | +| `titleSort` | *string* | :heavy_minus_sign: | N/A | Whale | +| `viewCount` | *number* | :heavy_minus_sign: | N/A | 1 | +| `lastViewedAt` | *number* | :heavy_minus_sign: | N/A | 1682752242 | +| `originalTitle` | *string* | :heavy_minus_sign: | N/A | 映画 ブラッククローバー 魔法帝の剣 | +| `viewOffset` | *number* | :heavy_minus_sign: | N/A | 5222500 | +| `skipCount` | *number* | :heavy_minus_sign: | N/A | 1 | +| `index` | *number* | :heavy_minus_sign: | N/A | 1 | +| `theme` | *string* | :heavy_minus_sign: | N/A | /library/metadata/1/theme/1705636920 | +| `leafCount` | *number* | :heavy_minus_sign: | N/A | 14 | +| `viewedLeafCount` | *number* | :heavy_minus_sign: | N/A | 0 | +| `childCount` | *number* | :heavy_minus_sign: | N/A | 1 | +| `hasPremiumExtras` | *string* | :heavy_minus_sign: | N/A | 1 | +| `hasPremiumPrimaryExtra` | *string* | :heavy_minus_sign: | N/A | 1 | +| `parentRatingKey` | *string* | :heavy_minus_sign: | The rating key of the parent item.
| 66 | +| `parentGuid` | *string* | :heavy_minus_sign: | N/A | plex://show/5d9c081b170e24001f2a7be4 | +| `parentStudio` | *string* | :heavy_minus_sign: | N/A | UCP | +| `parentKey` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66 | +| `parentTitle` | *string* | :heavy_minus_sign: | N/A | Caprica | +| `parentIndex` | *number* | :heavy_minus_sign: | N/A | 1 | +| `parentYear` | *number* | :heavy_minus_sign: | N/A | 2010 | +| `parentThumb` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66/thumb/1705716261 | +| `parentTheme` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66/theme/1705716261 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedoperator.md b/docs/sdk/models/operations/getrecentlyaddedoperator.md new file mode 100644 index 00000000..414fef26 --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedoperator.md @@ -0,0 +1,19 @@ +# GetRecentlyAddedOperator + +## Example Usage + +```typescript +import { GetRecentlyAddedOperator } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedOperator = { + key: "=", + title: "is", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `key` | *string* | :heavy_check_mark: | N/A | = | +| `title` | *string* | :heavy_check_mark: | N/A | is | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedrequest.md b/docs/sdk/models/operations/getrecentlyaddedrequest.md index 9f358ffa..a03bd72d 100644 --- a/docs/sdk/models/operations/getrecentlyaddedrequest.md +++ b/docs/sdk/models/operations/getrecentlyaddedrequest.md @@ -3,9 +3,13 @@ ## Example Usage ```typescript -import { GetRecentlyAddedRequest } from "@lukehagar/plexjs/sdk/models/operations"; +import { GetRecentlyAddedRequest, IncludeMeta, Type } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetRecentlyAddedRequest = { + contentDirectoryID: 501324, + sectionID: 2, + type: Type.TvShow, + includeMeta: IncludeMeta.Enable, xPlexContainerStart: 0, xPlexContainerSize: 50, }; @@ -15,5 +19,10 @@ let value: GetRecentlyAddedRequest = { | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `contentDirectoryID` | *number* | :heavy_check_mark: | The content directory ID. | | +| `pinnedContentDirectoryID` | *string* | :heavy_minus_sign: | Comma-separated list of pinned content directory IDs. | | +| `sectionID` | *number* | :heavy_minus_sign: | The library section ID for filtering content. | 2 | +| `type` | [operations.Type](../../../sdk/models/operations/type.md) | :heavy_check_mark: | The type of media to retrieve.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | +| `includeMeta` | [operations.IncludeMeta](../../../sdk/models/operations/includemeta.md) | :heavy_minus_sign: | Adds the Meta object to the response
| 1 | | `xPlexContainerStart` | *number* | :heavy_minus_sign: | The index of the first item to return. If not specified, the first item will be returned.
If the number of items exceeds the limit, the response will be paginated.
By default this is 0
| 0 | | `xPlexContainerSize` | *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.
By default this is 50
| 50 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedresponse.md b/docs/sdk/models/operations/getrecentlyaddedresponse.md index 9f75e46e..db0239d7 100644 --- a/docs/sdk/models/operations/getrecentlyaddedresponse.md +++ b/docs/sdk/models/operations/getrecentlyaddedresponse.md @@ -3,11 +3,22 @@ ## Example Usage ```typescript -import { GetRecentlyAddedResponse } from "@lukehagar/plexjs/sdk/models/operations"; +import { + FlattenSeasons, + GetRecentlyAddedActiveDirection, + GetRecentlyAddedDefaultDirection, + GetRecentlyAddedHubsResponseType, + GetRecentlyAddedHubsType, + GetRecentlyAddedResponse, + HasThumbnail, + OptimizedForStreaming, + ShowOrdering, +} from "@lukehagar/plexjs/sdk/models/operations"; +import { RFCDate } from "@lukehagar/plexjs/sdk/types"; let value: GetRecentlyAddedResponse = { contentType: "", - statusCode: 613064, + statusCode: 507, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), @@ -15,80 +26,182 @@ let value: GetRecentlyAddedResponse = { mediaContainer: { size: 50, identifier: "com.plexapp.plugins.library", - mediaTagPrefix: "/system/bundle/media/flags/", - mediaTagVersion: 1680021154, + meta: { + type: [ + { + key: "/library/sections/2/all?type=2", + type: "show", + title: "TV Shows", + active: false, + filter: [ + { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", + }, + ], + sort: [ + { + default: "asc", + active: false, + activeDirection: GetRecentlyAddedActiveDirection.Ascending, + defaultDirection: GetRecentlyAddedDefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", + }, + ], + field: [ + { + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", + }, + ], + }, + ], + fieldType: [ + { + type: "tag", + operator: [ + { + key: "=", + title: "is", + }, + ], + }, + ], + }, metadata: [ { + ratingKey: "58683", + key: "/library/metadata/58683", + guid: "plex://movie/5d7768ba96b655001fdc0408", + studio: "20th Century Studios", + skipChildren: false, librarySectionID: 1, librarySectionTitle: "Movies", - librarySectionUUID: "322a231a-b7f7-49f5-920f-14c61199cd30", - ratingKey: 59398, - key: "/library/metadata/59398", - guid: "plex://movie/5e161a83bea6ac004126e148", - studio: "Marvel Studios", - type: "movie", - title: "Ant-Man and the Wasp: Quantumania", + librarySectionKey: "/library/sections/1", + type: GetRecentlyAddedHubsType.Movie, + title: "Avatar: The Way of Water", + slug: "4-for-texas", contentRating: "PG-13", summary: - "Scott Lang and Hope Van Dyne along with Hank Pym and Janet Van Dyne explore the Quantum Realm where they interact with strange creatures and embark on an adventure that goes beyond the limits of what they thought was possible.", - rating: 4.7, - audienceRating: 8.3, - year: 2023, - tagline: "Witness the beginning of a new dynasty.", - thumb: "/library/metadata/59398/thumb/1681888010", - art: "/library/metadata/59398/art/1681888010", - duration: 7474422, - originallyAvailableAt: new Date("2023-02-15T00:00:00Z"), - addedAt: 1681803215, - updatedAt: 1681888010, + "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", + rating: 7.6, + audienceRating: 9.2, + year: 2022, + seasonCount: 2022, + tagline: "Return to Pandora.", + flattenSeasons: FlattenSeasons.True, + showOrdering: ShowOrdering.Dvd, + thumb: "/library/metadata/58683/thumb/1703239236", + art: "/library/metadata/58683/art/1703239236", + banner: "/library/metadata/58683/banner/1703239236", + duration: 11558112, + originallyAvailableAt: new RFCDate("2022-12-14T00:00:00Z"), + addedAt: 1556281940, + updatedAt: 1556281940, audienceRatingImage: "rottentomatoes://image.rating.upright", chapterSource: "media", - primaryExtraKey: "/library/metadata/59399", - ratingImage: "rottentomatoes://image.rating.rotten", + primaryExtraKey: "/library/metadata/58684", + ratingImage: "rottentomatoes://image.rating.ripe", + grandparentRatingKey: "66", + grandparentGuid: "plex://show/5d9c081b170e24001f2a7be4", + grandparentKey: "/library/metadata/66", + grandparentTitle: "Caprica", + grandparentThumb: "/library/metadata/66/thumb/1705716261", + parentSlug: "alice-in-borderland-2020", + grandparentSlug: "alice-in-borderland-2020", + grandparentArt: "/library/metadata/66/art/1705716261", + grandparentTheme: "/library/metadata/66/theme/1705716261", media: [ { - id: 120345, - duration: 7474422, - bitrate: 3623, - width: 1920, - height: 804, - aspectRatio: 2.35, + id: 119534, + duration: 11558112, + bitrate: 25025, + width: 3840, + height: 2072, + aspectRatio: 1.85, + audioProfile: "dts", audioChannels: 6, - audioCodec: "ac3", - videoCodec: "h264", - videoResolution: 1080, - container: "mp4", + audioCodec: "eac3", + videoCodec: "hevc", + videoResolution: "4k", + container: "mkv", videoFrameRate: "24p", - optimizedForStreaming: 0, - videoProfile: "high", + videoProfile: "main 10", + hasVoiceActivity: false, + optimizedForStreaming: OptimizedForStreaming.Enable, + has64bitOffsets: false, part: [ { - id: 120353, - key: "/library/parts/120353/1681803203/file.mp4", - duration: 7474422, + id: 119542, + key: "/library/parts/119542/1680457526/file.mkv", + duration: 11558112, file: - "/movies/Ant-Man and the Wasp Quantumania (2023)/Ant-Man.and.the.Wasp.Quantumania.2023.1080p.mp4", - size: 3395307162, - container: "mp4", - hasThumbnail: 1, - videoProfile: "high", + "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", + size: 36158371307, + container: "mkv", + audioProfile: "dts", + has64bitOffsets: false, + optimizedForStreaming: false, + videoProfile: "main 10", + indexes: "sd", + hasThumbnail: HasThumbnail.True, + stream: [ + { + id: 272796, + streamType: 1, + default: true, + selected: true, + codec: "h264", + index: 0, + bitrate: 6273, + colorPrimaries: "bt709", + colorRange: "tv", + colorSpace: "bt709", + colorTrc: "bt709", + bitDepth: 8, + chromaLocation: "left", + streamIdentifier: "2", + chromaSubsampling: "4:2:0", + codedHeight: 1088, + codedWidth: 1920, + frameRate: 29.97, + hasScalingMatrix: false, + hearingImpaired: false, + closedCaptions: false, + embeddedInVideo: "1", + height: 1080, + level: 40, + profile: "main", + refFrames: 4, + scanType: "progressive", + width: 1920, + displayTitle: "1080p (H.264)", + extendedDisplayTitle: "1080p (H.264)", + channels: 2, + language: "English", + languageTag: "en", + languageCode: "eng", + audioChannelLayout: "stereo", + samplingRate: 48000, + title: "English", + canAutoSync: false, + }, + ], }, ], }, ], genre: [ { - tag: "Comedy", - }, - ], - director: [ - { - tag: "Peyton Reed", - }, - ], - writer: [ - { - tag: "Jeff Loveness", + tag: "Adventure", }, ], country: [ @@ -96,11 +209,79 @@ let value: GetRecentlyAddedResponse = { tag: "United States of America", }, ], - role: [ + director: [ { - tag: "Paul Rudd", + tag: "James Cameron", }, ], + writer: [ + { + tag: "James Cameron", + }, + ], + collection: [ + { + tag: "Working NL Subs", + }, + ], + role: [ + { + id: 294129, + filter: "actor=294129", + thumb: + "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", + tag: "Mike Smith", + tagKey: "668e7e7b22bcad9064350c91", + role: "Self", + }, + ], + mediaGuid: [ + { + id: "imdb://tt13015952", + }, + ], + ultraBlurColors: { + topLeft: "11333b", + topRight: "0a232d", + bottomRight: "73958", + bottomLeft: "1f5066", + }, + metaDataRating: [ + { + image: "themoviedb://image.rating", + value: 3, + type: "audience", + }, + ], + image: [ + { + alt: "Episode 1", + type: GetRecentlyAddedHubsResponseType.Background, + url: "/library/metadata/45521/thumb/1644710589", + }, + ], + titleSort: "Whale", + viewCount: 1, + lastViewedAt: 1682752242, + originalTitle: "映画 ブラッククローバー 魔法帝の剣", + viewOffset: 5222500, + skipCount: 1, + index: 1, + theme: "/library/metadata/1/theme/1705636920", + leafCount: 14, + viewedLeafCount: 0, + childCount: 1, + hasPremiumExtras: "1", + hasPremiumPrimaryExtra: "1", + parentRatingKey: "66", + parentGuid: "plex://show/5d9c081b170e24001f2a7be4", + parentStudio: "UCP", + parentKey: "/library/metadata/66", + parentTitle: "Caprica", + parentIndex: 1, + parentYear: 2010, + parentThumb: "/library/metadata/66/thumb/1705716261", + parentTheme: "/library/metadata/66/theme/1705716261", }, ], }, @@ -115,4 +296,4 @@ let value: GetRecentlyAddedResponse = { | `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | | `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.GetRecentlyAddedResponseBody](../../../sdk/models/operations/getrecentlyaddedresponsebody.md) | :heavy_minus_sign: | The recently added content | \ No newline at end of file +| `object` | [operations.GetRecentlyAddedResponseBody](../../../sdk/models/operations/getrecentlyaddedresponsebody.md) | :heavy_minus_sign: | A successful response with recently added content. | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedresponsebody.md b/docs/sdk/models/operations/getrecentlyaddedresponsebody.md index 74ea43c5..17042e17 100644 --- a/docs/sdk/models/operations/getrecentlyaddedresponsebody.md +++ b/docs/sdk/models/operations/getrecentlyaddedresponsebody.md @@ -1,90 +1,203 @@ # GetRecentlyAddedResponseBody -The recently added content +A successful response with recently added content. ## Example Usage ```typescript -import { GetRecentlyAddedResponseBody } from "@lukehagar/plexjs/sdk/models/operations"; +import { + FlattenSeasons, + GetRecentlyAddedActiveDirection, + GetRecentlyAddedDefaultDirection, + GetRecentlyAddedHubsResponseType, + GetRecentlyAddedHubsType, + GetRecentlyAddedResponseBody, + HasThumbnail, + OptimizedForStreaming, + ShowOrdering, +} from "@lukehagar/plexjs/sdk/models/operations"; +import { RFCDate } from "@lukehagar/plexjs/sdk/types"; let value: GetRecentlyAddedResponseBody = { mediaContainer: { size: 50, identifier: "com.plexapp.plugins.library", - mediaTagPrefix: "/system/bundle/media/flags/", - mediaTagVersion: 1680021154, + meta: { + type: [ + { + key: "/library/sections/2/all?type=2", + type: "show", + title: "TV Shows", + active: false, + filter: [ + { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", + }, + ], + sort: [ + { + default: "asc", + active: false, + activeDirection: GetRecentlyAddedActiveDirection.Ascending, + defaultDirection: GetRecentlyAddedDefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", + }, + ], + field: [ + { + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", + }, + ], + }, + ], + fieldType: [ + { + type: "tag", + operator: [ + { + key: "=", + title: "is", + }, + ], + }, + ], + }, metadata: [ { + ratingKey: "58683", + key: "/library/metadata/58683", + guid: "plex://movie/5d7768ba96b655001fdc0408", + studio: "20th Century Studios", + skipChildren: false, librarySectionID: 1, librarySectionTitle: "Movies", - librarySectionUUID: "322a231a-b7f7-49f5-920f-14c61199cd30", - ratingKey: 59398, - key: "/library/metadata/59398", - guid: "plex://movie/5e161a83bea6ac004126e148", - studio: "Marvel Studios", - type: "movie", - title: "Ant-Man and the Wasp: Quantumania", + librarySectionKey: "/library/sections/1", + type: GetRecentlyAddedHubsType.Movie, + title: "Avatar: The Way of Water", + slug: "4-for-texas", contentRating: "PG-13", summary: - "Scott Lang and Hope Van Dyne along with Hank Pym and Janet Van Dyne explore the Quantum Realm where they interact with strange creatures and embark on an adventure that goes beyond the limits of what they thought was possible.", - rating: 4.7, - audienceRating: 8.3, - year: 2023, - tagline: "Witness the beginning of a new dynasty.", - thumb: "/library/metadata/59398/thumb/1681888010", - art: "/library/metadata/59398/art/1681888010", - duration: 7474422, - originallyAvailableAt: new Date("2023-02-15T00:00:00Z"), - addedAt: 1681803215, - updatedAt: 1681888010, + "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", + rating: 7.6, + audienceRating: 9.2, + year: 2022, + seasonCount: 2022, + tagline: "Return to Pandora.", + flattenSeasons: FlattenSeasons.True, + showOrdering: ShowOrdering.Dvd, + thumb: "/library/metadata/58683/thumb/1703239236", + art: "/library/metadata/58683/art/1703239236", + banner: "/library/metadata/58683/banner/1703239236", + duration: 11558112, + originallyAvailableAt: new RFCDate("2022-12-14T00:00:00Z"), + addedAt: 1556281940, + updatedAt: 1556281940, audienceRatingImage: "rottentomatoes://image.rating.upright", chapterSource: "media", - primaryExtraKey: "/library/metadata/59399", - ratingImage: "rottentomatoes://image.rating.rotten", + primaryExtraKey: "/library/metadata/58684", + ratingImage: "rottentomatoes://image.rating.ripe", + grandparentRatingKey: "66", + grandparentGuid: "plex://show/5d9c081b170e24001f2a7be4", + grandparentKey: "/library/metadata/66", + grandparentTitle: "Caprica", + grandparentThumb: "/library/metadata/66/thumb/1705716261", + parentSlug: "alice-in-borderland-2020", + grandparentSlug: "alice-in-borderland-2020", + grandparentArt: "/library/metadata/66/art/1705716261", + grandparentTheme: "/library/metadata/66/theme/1705716261", media: [ { - id: 120345, - duration: 7474422, - bitrate: 3623, - width: 1920, - height: 804, - aspectRatio: 2.35, + id: 119534, + duration: 11558112, + bitrate: 25025, + width: 3840, + height: 2072, + aspectRatio: 1.85, + audioProfile: "dts", audioChannels: 6, - audioCodec: "ac3", - videoCodec: "h264", - videoResolution: 1080, - container: "mp4", + audioCodec: "eac3", + videoCodec: "hevc", + videoResolution: "4k", + container: "mkv", videoFrameRate: "24p", - optimizedForStreaming: 0, - videoProfile: "high", + videoProfile: "main 10", + hasVoiceActivity: false, + optimizedForStreaming: OptimizedForStreaming.Enable, + has64bitOffsets: false, part: [ { - id: 120353, - key: "/library/parts/120353/1681803203/file.mp4", - duration: 7474422, + id: 119542, + key: "/library/parts/119542/1680457526/file.mkv", + duration: 11558112, file: - "/movies/Ant-Man and the Wasp Quantumania (2023)/Ant-Man.and.the.Wasp.Quantumania.2023.1080p.mp4", - size: 3395307162, - container: "mp4", - hasThumbnail: 1, - videoProfile: "high", + "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", + size: 36158371307, + container: "mkv", + audioProfile: "dts", + has64bitOffsets: false, + optimizedForStreaming: false, + videoProfile: "main 10", + indexes: "sd", + hasThumbnail: HasThumbnail.True, + stream: [ + { + id: 272796, + streamType: 1, + default: true, + selected: true, + codec: "h264", + index: 0, + bitrate: 6273, + colorPrimaries: "bt709", + colorRange: "tv", + colorSpace: "bt709", + colorTrc: "bt709", + bitDepth: 8, + chromaLocation: "left", + streamIdentifier: "2", + chromaSubsampling: "4:2:0", + codedHeight: 1088, + codedWidth: 1920, + frameRate: 29.97, + hasScalingMatrix: false, + hearingImpaired: false, + closedCaptions: false, + embeddedInVideo: "1", + height: 1080, + level: 40, + profile: "main", + refFrames: 4, + scanType: "progressive", + width: 1920, + displayTitle: "1080p (H.264)", + extendedDisplayTitle: "1080p (H.264)", + channels: 2, + language: "English", + languageTag: "en", + languageCode: "eng", + audioChannelLayout: "stereo", + samplingRate: 48000, + title: "English", + canAutoSync: false, + }, + ], }, ], }, ], genre: [ { - tag: "Comedy", - }, - ], - director: [ - { - tag: "Peyton Reed", - }, - ], - writer: [ - { - tag: "Jeff Loveness", + tag: "Adventure", }, ], country: [ @@ -92,11 +205,79 @@ let value: GetRecentlyAddedResponseBody = { tag: "United States of America", }, ], - role: [ + director: [ { - tag: "Paul Rudd", + tag: "James Cameron", }, ], + writer: [ + { + tag: "James Cameron", + }, + ], + collection: [ + { + tag: "Working NL Subs", + }, + ], + role: [ + { + id: 294129, + filter: "actor=294129", + thumb: + "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", + tag: "Mike Smith", + tagKey: "668e7e7b22bcad9064350c91", + role: "Self", + }, + ], + mediaGuid: [ + { + id: "imdb://tt13015952", + }, + ], + ultraBlurColors: { + topLeft: "11333b", + topRight: "0a232d", + bottomRight: "73958", + bottomLeft: "1f5066", + }, + metaDataRating: [ + { + image: "themoviedb://image.rating", + value: 3, + type: "audience", + }, + ], + image: [ + { + alt: "Episode 1", + type: GetRecentlyAddedHubsResponseType.Background, + url: "/library/metadata/45521/thumb/1644710589", + }, + ], + titleSort: "Whale", + viewCount: 1, + lastViewedAt: 1682752242, + originalTitle: "映画 ブラッククローバー 魔法帝の剣", + viewOffset: 5222500, + skipCount: 1, + index: 1, + theme: "/library/metadata/1/theme/1705636920", + leafCount: 14, + viewedLeafCount: 0, + childCount: 1, + hasPremiumExtras: "1", + hasPremiumPrimaryExtra: "1", + parentRatingKey: "66", + parentGuid: "plex://show/5d9c081b170e24001f2a7be4", + parentStudio: "UCP", + parentKey: "/library/metadata/66", + parentTitle: "Caprica", + parentIndex: 1, + parentYear: 2010, + parentThumb: "/library/metadata/66/thumb/1705716261", + parentTheme: "/library/metadata/66/theme/1705716261", }, ], }, diff --git a/docs/sdk/models/operations/getrecentlyaddedsort.md b/docs/sdk/models/operations/getrecentlyaddedsort.md new file mode 100644 index 00000000..aa40c1a1 --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedsort.md @@ -0,0 +1,35 @@ +# GetRecentlyAddedSort + +## Example Usage + +```typescript +import { + GetRecentlyAddedActiveDirection, + GetRecentlyAddedDefaultDirection, + GetRecentlyAddedSort, +} from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedSort = { + default: "asc", + active: false, + activeDirection: GetRecentlyAddedActiveDirection.Ascending, + defaultDirection: GetRecentlyAddedDefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `default` | *string* | :heavy_minus_sign: | N/A | asc | +| `active` | *boolean* | :heavy_minus_sign: | N/A | false | +| `activeDirection` | [operations.GetRecentlyAddedActiveDirection](../../../sdk/models/operations/getrecentlyaddedactivedirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.
| asc | +| `defaultDirection` | [operations.GetRecentlyAddedDefaultDirection](../../../sdk/models/operations/getrecentlyaddeddefaultdirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.
| asc | +| `descKey` | *string* | :heavy_minus_sign: | N/A | titleSort:desc | +| `firstCharacterKey` | *string* | :heavy_minus_sign: | N/A | /library/sections/2/firstCharacter | +| `key` | *string* | :heavy_check_mark: | N/A | titleSort | +| `title` | *string* | :heavy_check_mark: | N/A | Title | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedtype.md b/docs/sdk/models/operations/getrecentlyaddedtype.md new file mode 100644 index 00000000..2aa9d352 --- /dev/null +++ b/docs/sdk/models/operations/getrecentlyaddedtype.md @@ -0,0 +1,59 @@ +# GetRecentlyAddedType + +## Example Usage + +```typescript +import { + GetRecentlyAddedActiveDirection, + GetRecentlyAddedDefaultDirection, + GetRecentlyAddedType, +} from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetRecentlyAddedType = { + key: "/library/sections/2/all?type=2", + type: "show", + title: "TV Shows", + active: false, + filter: [ + { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", + }, + ], + sort: [ + { + default: "asc", + active: false, + activeDirection: GetRecentlyAddedActiveDirection.Ascending, + defaultDirection: GetRecentlyAddedDefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", + }, + ], + field: [ + { + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/all?type=2 | +| `type` | *string* | :heavy_check_mark: | N/A | show | +| `title` | *string* | :heavy_check_mark: | N/A | TV Shows | +| `active` | *boolean* | :heavy_check_mark: | N/A | false | +| `filter` | [operations.GetRecentlyAddedFilter](../../../sdk/models/operations/getrecentlyaddedfilter.md)[] | :heavy_minus_sign: | N/A | | +| `sort` | [operations.GetRecentlyAddedSort](../../../sdk/models/operations/getrecentlyaddedsort.md)[] | :heavy_minus_sign: | N/A | | +| `field` | [operations.GetRecentlyAddedField](../../../sdk/models/operations/getrecentlyaddedfield.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrefreshlibrarymetadatarequest.md b/docs/sdk/models/operations/getrefreshlibrarymetadatarequest.md index 09adf626..d41ca89f 100644 --- a/docs/sdk/models/operations/getrefreshlibrarymetadatarequest.md +++ b/docs/sdk/models/operations/getrefreshlibrarymetadatarequest.md @@ -7,7 +7,7 @@ import { Force, GetRefreshLibraryMetadataRequest } from "@lukehagar/plexjs/sdk/m let value: GetRefreshLibraryMetadataRequest = { sectionKey: 9518, - force: Force.Zero, + force: Force.One, }; ``` diff --git a/docs/sdk/models/operations/getrefreshlibrarymetadataresponse.md b/docs/sdk/models/operations/getrefreshlibrarymetadataresponse.md index 6645a83d..5640bd89 100644 --- a/docs/sdk/models/operations/getrefreshlibrarymetadataresponse.md +++ b/docs/sdk/models/operations/getrefreshlibrarymetadataresponse.md @@ -7,7 +7,7 @@ import { GetRefreshLibraryMetadataResponse } from "@lukehagar/plexjs/sdk/models/ let value: GetRefreshLibraryMetadataResponse = { contentType: "", - statusCode: 210382, + statusCode: 102, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getresizedphotorequest.md b/docs/sdk/models/operations/getresizedphotorequest.md index 7bacfeee..216b5a04 100644 --- a/docs/sdk/models/operations/getresizedphotorequest.md +++ b/docs/sdk/models/operations/getresizedphotorequest.md @@ -9,8 +9,8 @@ let value: GetResizedPhotoRequest = { width: 110, height: 165, opacity: 100, - blur: 20, - minSize: MinSize.One, + blur: 0, + minSize: MinSize.Zero, upscale: Upscale.Zero, url: "/library/metadata/49564/thumb/1654258204", }; diff --git a/docs/sdk/models/operations/getresizedphotoresponse.md b/docs/sdk/models/operations/getresizedphotoresponse.md index e592d632..c7c78d9a 100644 --- a/docs/sdk/models/operations/getresizedphotoresponse.md +++ b/docs/sdk/models/operations/getresizedphotoresponse.md @@ -7,7 +7,7 @@ import { GetResizedPhotoResponse } from "@lukehagar/plexjs/sdk/models/operations let value: GetResizedPhotoResponse = { contentType: "", - statusCode: 437587, + statusCode: 508, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getresourcesstatisticsresponse.md b/docs/sdk/models/operations/getresourcesstatisticsresponse.md index 69d048a3..ca603c9c 100644 --- a/docs/sdk/models/operations/getresourcesstatisticsresponse.md +++ b/docs/sdk/models/operations/getresourcesstatisticsresponse.md @@ -7,7 +7,7 @@ import { GetResourcesStatisticsResponse } from "@lukehagar/plexjs/sdk/models/ope let value: GetResourcesStatisticsResponse = { contentType: "", - statusCode: 93940, + statusCode: 307, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getsearchlibraryqueryparamtype.md b/docs/sdk/models/operations/getsearchlibraryqueryparamtype.md new file mode 100644 index 00000000..95bbe654 --- /dev/null +++ b/docs/sdk/models/operations/getsearchlibraryqueryparamtype.md @@ -0,0 +1,27 @@ +# GetSearchLibraryQueryParamType + +The type of media to retrieve. +1 = movie +2 = show +3 = season +4 = episode +E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries + + +## Example Usage + +```typescript +import { GetSearchLibraryQueryParamType } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: GetSearchLibraryQueryParamType = + GetSearchLibraryQueryParamType.TvShow; +``` + +## Values + +| Name | Value | +| --------- | --------- | +| `Movie` | 1 | +| `TvShow` | 2 | +| `Season` | 3 | +| `Episode` | 4 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getsearchlibraryrequest.md b/docs/sdk/models/operations/getsearchlibraryrequest.md index 2f611679..c8d76b7c 100644 --- a/docs/sdk/models/operations/getsearchlibraryrequest.md +++ b/docs/sdk/models/operations/getsearchlibraryrequest.md @@ -3,11 +3,11 @@ ## Example Usage ```typescript -import { GetSearchLibraryRequest, QueryParamType } from "@lukehagar/plexjs/sdk/models/operations"; +import { GetSearchLibraryQueryParamType, GetSearchLibraryRequest } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetSearchLibraryRequest = { sectionKey: 9518, - type: QueryParamType.Two, + type: GetSearchLibraryQueryParamType.TvShow, }; ``` @@ -16,4 +16,4 @@ let value: GetSearchLibraryRequest = { | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sectionKey` | *number* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | -| `type` | [operations.QueryParamType](../../../sdk/models/operations/queryparamtype.md) | :heavy_check_mark: | The type of media to retrieve.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | \ No newline at end of file +| `type` | [operations.GetSearchLibraryQueryParamType](../../../sdk/models/operations/getsearchlibraryqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getsearchlibraryresponse.md b/docs/sdk/models/operations/getsearchlibraryresponse.md index 324a00ff..cf0cfb7e 100644 --- a/docs/sdk/models/operations/getsearchlibraryresponse.md +++ b/docs/sdk/models/operations/getsearchlibraryresponse.md @@ -7,7 +7,7 @@ import { GetSearchLibraryResponse } from "@lukehagar/plexjs/sdk/models/operation let value: GetSearchLibraryResponse = { contentType: "", - statusCode: 358152, + statusCode: 103, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getsearchresultsresponse.md b/docs/sdk/models/operations/getsearchresultsresponse.md index 391ab760..303227ea 100644 --- a/docs/sdk/models/operations/getsearchresultsresponse.md +++ b/docs/sdk/models/operations/getsearchresultsresponse.md @@ -7,7 +7,7 @@ import { GetSearchResultsResponse } from "@lukehagar/plexjs/sdk/models/operation let value: GetSearchResultsResponse = { contentType: "", - statusCode: 449950, + statusCode: 205, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getserveractivitiesresponse.md b/docs/sdk/models/operations/getserveractivitiesresponse.md index e71485ce..77b4e97c 100644 --- a/docs/sdk/models/operations/getserveractivitiesresponse.md +++ b/docs/sdk/models/operations/getserveractivitiesresponse.md @@ -7,7 +7,7 @@ import { GetServerActivitiesResponse } from "@lukehagar/plexjs/sdk/models/operat let value: GetServerActivitiesResponse = { contentType: "", - statusCode: 791725, + statusCode: 300, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getservercapabilitiesresponse.md b/docs/sdk/models/operations/getservercapabilitiesresponse.md index 3ee1a882..e8672eeb 100644 --- a/docs/sdk/models/operations/getservercapabilitiesresponse.md +++ b/docs/sdk/models/operations/getservercapabilitiesresponse.md @@ -7,7 +7,7 @@ import { GetServerCapabilitiesResponse } from "@lukehagar/plexjs/sdk/models/oper let value: GetServerCapabilitiesResponse = { contentType: "", - statusCode: 548814, + statusCode: 306, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getserveridentityresponse.md b/docs/sdk/models/operations/getserveridentityresponse.md index e2a6dd0e..47040895 100644 --- a/docs/sdk/models/operations/getserveridentityresponse.md +++ b/docs/sdk/models/operations/getserveridentityresponse.md @@ -7,7 +7,7 @@ import { GetServerIdentityResponse } from "@lukehagar/plexjs/sdk/models/operatio let value: GetServerIdentityResponse = { contentType: "", - statusCode: 602763, + statusCode: 504, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getserverlistresponse.md b/docs/sdk/models/operations/getserverlistresponse.md index 411e1915..1732ddcd 100644 --- a/docs/sdk/models/operations/getserverlistresponse.md +++ b/docs/sdk/models/operations/getserverlistresponse.md @@ -7,7 +7,7 @@ import { GetServerListResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetServerListResponse = { contentType: "", - statusCode: 891773, + statusCode: 413, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getserverpreferencesresponse.md b/docs/sdk/models/operations/getserverpreferencesresponse.md index 3425b619..c735306e 100644 --- a/docs/sdk/models/operations/getserverpreferencesresponse.md +++ b/docs/sdk/models/operations/getserverpreferencesresponse.md @@ -7,7 +7,7 @@ import { GetServerPreferencesResponse } from "@lukehagar/plexjs/sdk/models/opera let value: GetServerPreferencesResponse = { contentType: "", - statusCode: 592845, + statusCode: 415, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getserverresourcesglobals.md b/docs/sdk/models/operations/getserverresourcesglobals.md index e634d779..595b9e3a 100644 --- a/docs/sdk/models/operations/getserverresourcesglobals.md +++ b/docs/sdk/models/operations/getserverresourcesglobals.md @@ -10,6 +10,6 @@ let value: GetServerResourcesGlobals = {}; ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `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)
| gcgzw5rz2xovp84b4vha3a40 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `clientID` | *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) | gcgzw5rz2xovp84b4vha3a40 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getserverresourcesrequest.md b/docs/sdk/models/operations/getserverresourcesrequest.md index 34421482..8870de86 100644 --- a/docs/sdk/models/operations/getserverresourcesrequest.md +++ b/docs/sdk/models/operations/getserverresourcesrequest.md @@ -6,17 +6,17 @@ import { GetServerResourcesRequest, IncludeHttps, IncludeIPv6, IncludeRelay } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetServerResourcesRequest = { - includeHttps: IncludeHttps.One, - includeRelay: IncludeRelay.One, - includeIPv6: IncludeIPv6.One, + includeHttps: IncludeHttps.Enable, + includeRelay: IncludeRelay.Enable, + includeIPv6: IncludeIPv6.Enable, }; ``` ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `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)
| gcgzw5rz2xovp84b4vha3a40 | -| `includeHttps` | [operations.IncludeHttps](../../../sdk/models/operations/includehttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 | -| `includeRelay` | [operations.IncludeRelay](../../../sdk/models/operations/includerelay.md) | :heavy_minus_sign: | Include Relay addresses in the results
E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400
| 1 | -| `includeIPv6` | [operations.IncludeIPv6](../../../sdk/models/operations/includeipv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `includeHttps` | [operations.IncludeHttps](../../../sdk/models/operations/includehttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 | +| `includeRelay` | [operations.IncludeRelay](../../../sdk/models/operations/includerelay.md) | :heavy_minus_sign: | Include Relay addresses in the results
E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400
| 1 | +| `includeIPv6` | [operations.IncludeIPv6](../../../sdk/models/operations/includeipv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 | +| `clientID` | *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) | gcgzw5rz2xovp84b4vha3a40 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getserverresourcesresponse.md b/docs/sdk/models/operations/getserverresourcesresponse.md index 96b31e7e..3377cae5 100644 --- a/docs/sdk/models/operations/getserverresourcesresponse.md +++ b/docs/sdk/models/operations/getserverresourcesresponse.md @@ -3,14 +3,52 @@ ## Example Usage ```typescript -import { GetServerResourcesResponse } from "@lukehagar/plexjs/sdk/models/operations"; +import { GetServerResourcesResponse, Protocol } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetServerResourcesResponse = { contentType: "", - statusCode: 568434, + statusCode: 102, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), + plexDevices: [ + { + name: "", + product: "Generic Cotton Pants", + productVersion: "", + platform: "", + platformVersion: "", + device: "Desktop", + clientIdentifier: "", + createdAt: new Date("2019-06-24T11:38:02Z"), + lastSeenAt: new Date("2019-06-24T11:38:02Z"), + provides: "", + ownerId: 828940, + sourceTitle: "", + publicAddress: "", + accessToken: "", + owned: false, + home: false, + synced: false, + relay: false, + presence: false, + httpsRequired: false, + publicAddressMatches: false, + dnsRebindingProtection: false, + natLoopbackSupported: false, + connections: [ + { + protocol: Protocol.Http, + address: "72792 Medhurst Mountains", + port: 14619, + uri: "https://kaleidoscopic-status.net", + local: false, + relay: false, + iPv6: false, + }, + ], + }, + ], }; ``` diff --git a/docs/sdk/models/operations/getsessionhistoryresponse.md b/docs/sdk/models/operations/getsessionhistoryresponse.md index ea2d243b..a675b001 100644 --- a/docs/sdk/models/operations/getsessionhistoryresponse.md +++ b/docs/sdk/models/operations/getsessionhistoryresponse.md @@ -8,7 +8,7 @@ import { RFCDate } from "@lukehagar/plexjs/sdk/types"; let value: GetSessionHistoryResponse = { contentType: "", - statusCode: 83112, + statusCode: 205, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getsessionsresponse.md b/docs/sdk/models/operations/getsessionsresponse.md index ed1b9c43..661290ea 100644 --- a/docs/sdk/models/operations/getsessionsresponse.md +++ b/docs/sdk/models/operations/getsessionsresponse.md @@ -7,7 +7,7 @@ import { GetSessionsResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetSessionsResponse = { contentType: "", - statusCode: 575947, + statusCode: 102, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getsourceconnectioninformationresponse.md b/docs/sdk/models/operations/getsourceconnectioninformationresponse.md index 3675e593..3b0f2773 100644 --- a/docs/sdk/models/operations/getsourceconnectioninformationresponse.md +++ b/docs/sdk/models/operations/getsourceconnectioninformationresponse.md @@ -7,7 +7,7 @@ import { GetSourceConnectionInformationResponse } from "@lukehagar/plexjs/sdk/mo let value: GetSourceConnectionInformationResponse = { contentType: "", - statusCode: 976460, + statusCode: 506, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getstatisticsresponse.md b/docs/sdk/models/operations/getstatisticsresponse.md index c269269a..6b61b3ad 100644 --- a/docs/sdk/models/operations/getstatisticsresponse.md +++ b/docs/sdk/models/operations/getstatisticsresponse.md @@ -7,7 +7,7 @@ import { GetStatisticsResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetStatisticsResponse = { contentType: "", - statusCode: 916723, + statusCode: 302, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/gettimelineresponse.md b/docs/sdk/models/operations/gettimelineresponse.md index 0a158149..180a960c 100644 --- a/docs/sdk/models/operations/gettimelineresponse.md +++ b/docs/sdk/models/operations/gettimelineresponse.md @@ -7,7 +7,7 @@ import { GetTimelineResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetTimelineResponse = { contentType: "", - statusCode: 383441, + statusCode: 302, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/gettokenbypinidauthpincontainer.md b/docs/sdk/models/operations/gettokenbypinidauthpincontainer.md index 4df7c9bb..6fb1277b 100644 --- a/docs/sdk/models/operations/gettokenbypinidauthpincontainer.md +++ b/docs/sdk/models/operations/gettokenbypinidauthpincontainer.md @@ -21,7 +21,7 @@ let value: GetTokenByPinIdAuthPinContainer = { city: "Amsterdam", europeanUnionMember: true, timeZone: "America/St_Thomas", - postalCode: 802, + postalCode: "802", inPrivacyRestrictedCountry: true, inPrivacyRestrictedRegion: true, subdivisions: "Saint Thomas", @@ -41,13 +41,13 @@ let value: GetTokenByPinIdAuthPinContainer = { | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | *number* | :heavy_check_mark: | N/A | 308667304 | | `code` | *string* | :heavy_check_mark: | N/A | 7RQZ | -| `product` | *string* | :heavy_check_mark: | N/A | 0 | +| `product` | *string* | :heavy_check_mark: | N/A | Tautulli | | `trusted` | *boolean* | :heavy_minus_sign: | N/A | | | `qr` | *string* | :heavy_check_mark: | N/A | https://plex.tv/api/v2/pins/qr/7RQZ | -| `clientIdentifier` | *string* | :heavy_check_mark: | The X-Client-Identifier used in the request | | +| `clientIdentifier` | *string* | :heavy_check_mark: | The X-Client-Identifier used in the request | Tautulli | | `location` | [operations.GetTokenByPinIdGeoData](../../../sdk/models/operations/gettokenbypinidgeodata.md) | :heavy_check_mark: | Geo location data | {
"code": "VI",
"continent_code": "NA",
"country": "United States Virgin Islands",
"city": "Amsterdam",
"european_union_member": true,
"time_zone": "America/St_Thomas",
"postal_code": 802,
"in_privacy_restricted_country": true,
"in_privacy_restricted_region": true,
"subdivisions": "Saint Thomas",
"coordinates": "18.3381, -64.8941"
} | | `expiresIn` | *number* | :heavy_minus_sign: | The number of seconds this pin expires, by default 900 seconds | 876 | | `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | 2024-07-16T17:03:05Z | | `expiresAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | 2024-07-16T17:18:05Z | -| `authToken` | *any* | :heavy_minus_sign: | N/A | | +| `authToken` | *string* | :heavy_minus_sign: | N/A | gcgzw5rz2xovp84b4vha3a40 | | `newRegistration` | *any* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/gettokenbypinidgeodata.md b/docs/sdk/models/operations/gettokenbypinidgeodata.md index 1d3f649c..69f899b2 100644 --- a/docs/sdk/models/operations/gettokenbypinidgeodata.md +++ b/docs/sdk/models/operations/gettokenbypinidgeodata.md @@ -14,7 +14,7 @@ let value: GetTokenByPinIdGeoData = { city: "Amsterdam", europeanUnionMember: true, timeZone: "America/St_Thomas", - postalCode: 802, + postalCode: "802", inPrivacyRestrictedCountry: true, inPrivacyRestrictedRegion: true, subdivisions: "Saint Thomas", @@ -32,7 +32,7 @@ let value: GetTokenByPinIdGeoData = { | `city` | *string* | :heavy_check_mark: | The name of the city. | Amsterdam | | `europeanUnionMember` | *boolean* | :heavy_minus_sign: | Indicates if the country is a member of the European Union. | true | | `timeZone` | *string* | :heavy_check_mark: | The time zone of the country. | America/St_Thomas | -| `postalCode` | *number* | :heavy_check_mark: | The postal code of the location. | 802 | +| `postalCode` | *string* | :heavy_check_mark: | The postal code of the location. | 802 | | `inPrivacyRestrictedCountry` | *boolean* | :heavy_minus_sign: | Indicates if the country has privacy restrictions. | true | | `inPrivacyRestrictedRegion` | *boolean* | :heavy_minus_sign: | Indicates if the region has privacy restrictions. | true | | `subdivisions` | *string* | :heavy_check_mark: | The name of the primary administrative subdivision. | Saint Thomas | diff --git a/docs/sdk/models/operations/gettokenbypinidglobals.md b/docs/sdk/models/operations/gettokenbypinidglobals.md index 08c5bf2d..db29de19 100644 --- a/docs/sdk/models/operations/gettokenbypinidglobals.md +++ b/docs/sdk/models/operations/gettokenbypinidglobals.md @@ -10,6 +10,10 @@ let value: GetTokenByPinIdGlobals = {}; ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `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)
| gcgzw5rz2xovp84b4vha3a40 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `clientID` | *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) | gcgzw5rz2xovp84b4vha3a40 | +| `clientName` | *string* | :heavy_minus_sign: | N/A | Plex Web | +| `deviceName` | *string* | :heavy_minus_sign: | N/A | Linux | +| `clientVersion` | *string* | :heavy_minus_sign: | N/A | 4.133.0 | +| `clientPlatform` | *string* | :heavy_minus_sign: | N/A | Chrome | \ No newline at end of file diff --git a/docs/sdk/models/operations/gettokenbypinidrequest.md b/docs/sdk/models/operations/gettokenbypinidrequest.md index 396e7a2d..32d76725 100644 --- a/docs/sdk/models/operations/gettokenbypinidrequest.md +++ b/docs/sdk/models/operations/gettokenbypinidrequest.md @@ -6,13 +6,17 @@ import { GetTokenByPinIdRequest } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetTokenByPinIdRequest = { - pinID: 18789, + pinID: 396506, }; ``` ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `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)
| gcgzw5rz2xovp84b4vha3a40 | -| `pinID` | *number* | :heavy_check_mark: | The PinID to retrieve an access token for | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `pinID` | *number* | :heavy_check_mark: | The PinID to retrieve an access token for | | +| `clientID` | *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) | gcgzw5rz2xovp84b4vha3a40 | +| `clientName` | *string* | :heavy_minus_sign: | N/A | Plex Web | +| `deviceName` | *string* | :heavy_minus_sign: | N/A | Linux | +| `clientVersion` | *string* | :heavy_minus_sign: | N/A | 4.133.0 | +| `clientPlatform` | *string* | :heavy_minus_sign: | N/A | Chrome | \ No newline at end of file diff --git a/docs/sdk/models/operations/gettokenbypinidresponse.md b/docs/sdk/models/operations/gettokenbypinidresponse.md index 28e12e56..447d7a9c 100644 --- a/docs/sdk/models/operations/gettokenbypinidresponse.md +++ b/docs/sdk/models/operations/gettokenbypinidresponse.md @@ -7,7 +7,7 @@ import { GetTokenByPinIdResponse } from "@lukehagar/plexjs/sdk/models/operations let value: GetTokenByPinIdResponse = { contentType: "", - statusCode: 324141, + statusCode: 506, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), @@ -25,7 +25,7 @@ let value: GetTokenByPinIdResponse = { city: "Amsterdam", europeanUnionMember: true, timeZone: "America/St_Thomas", - postalCode: 802, + postalCode: "802", inPrivacyRestrictedCountry: true, inPrivacyRestrictedRegion: true, subdivisions: "Saint Thomas", diff --git a/docs/sdk/models/operations/gettokendetailsfeatures.md b/docs/sdk/models/operations/gettokendetailsfeatures.md index ef415209..a3cda7c0 100644 --- a/docs/sdk/models/operations/gettokendetailsfeatures.md +++ b/docs/sdk/models/operations/gettokendetailsfeatures.md @@ -6,11 +6,13 @@ import { GetTokenDetailsFeatures } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetTokenDetailsFeatures = - GetTokenDetailsFeatures.IncreasePasswordComplexity; + GetTokenDetailsFeatures.DisableSharingFriendships; ``` ## Values +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + | Name | Value | | --------------------------------------- | --------------------------------------- | | `AndroidDolbyVision` | Android - Dolby Vision | @@ -20,28 +22,43 @@ let value: GetTokenDetailsFeatures = | `TREBLEShowFeatures` | TREBLE-show-features | | `AdCountdownTimer` | ad-countdown-timer | | `AdaptiveBitrate` | adaptive_bitrate | +| `AlbumTypes` | album-types | +| `AllowDvr` | allow_dvr | | `AmazonLoopDebug` | amazon-loop-debug | | `AvodAdAnalysis` | avod-ad-analysis | | `AvodNewMedia` | avod-new-media | | `BlacklistGetSignin` | blacklist_get_signin | +| `BoostVoices` | boost-voices | +| `CameraUpload` | camera_upload | | `ClientRadioStations` | client-radio-stations | | `CloudflareTurnstileRequired` | cloudflare-turnstile-required | +| `Cloudsync` | cloudsync | | `Collections` | collections | | `CommentsAndRepliesPushNotifications` | comments_and_replies_push_notifications | | `CommunityAccessPlexTv` | community_access_plex_tv | | `CompanionsSonos` | companions_sonos | +| `ContentFilter` | content_filter | | `CustomHomeRemoval` | custom-home-removal | | `DisableHomeUserFriendships` | disable_home_user_friendships | | `DisableSharingFriendships` | disable_sharing_friendships | +| `DownloadsGating` | downloads-gating | | `DrmSupport` | drm_support | +| `Dvr` | dvr | +| `DvrBlockUnsupportedCountries` | dvr-block-unsupported-countries | +| `EpgRecentChannels` | epg-recent-channels | | `ExcludeRestrictions` | exclude restrictions | | `FederatedAuth` | federated-auth | | `FriendRequestPushNotifications` | friend_request_push_notifications | +| `GrandfatherSync` | grandfather-sync | | `GuidedUpgrade` | guided-upgrade | +| `HardwareTranscoding` | hardware_transcoding | | `Home` | home | +| `Hwtranscode` | hwtranscode | +| `ImaggaV2` | imagga-v2 | | `IncreasePasswordComplexity` | increase-password-complexity | | `Ios14PrivacyBanner` | ios14-privacy-banner | | `IterableNotificationTokens` | iterable-notification-tokens | +| `ItemClusters` | item_clusters | | `KeepPaymentMethod` | keep-payment-method | | `KevinBacon` | kevin-bacon | | `KoreaConsent` | korea-consent | @@ -50,25 +67,47 @@ let value: GetTokenDetailsFeatures = | `LightningDvrPivot` | lightning-dvr-pivot | | `LiveTvSupportIncompleteSegments` | live-tv-support-incomplete-segments | | `Livetv` | livetv | +| `Lyrics` | lyrics | | `MetadataSearch` | metadata_search | +| `MusicAnalysis` | music-analysis | +| `MusicVideos` | music_videos | | `NewPlexPassPrices` | new_plex_pass_prices | | `NewsProviderSunsetModal` | news-provider-sunset-modal | +| `Nominatim` | nominatim | +| `Pass` | pass | | `PhotosFavorites` | photos-favorites | | `PhotosMetadataEdition` | photos-metadata-edition | +| `PhotosV6Edit` | photosV6-edit | +| `PhotosV6TvAlbums` | photosV6-tv-albums | | `PmsHealth` | pms_health | +| `PremiumDashboard` | premium-dashboard | +| `PremiumMusicMetadata` | premium_music_metadata | | `Radio` | radio | | `RateLimitClientToken` | rate-limit-client-token | | `ScrobblingServicePlexTv` | scrobbling-service-plex-tv | +| `SessionBandwidthRestrictions` | session_bandwidth_restrictions | +| `SessionKick` | session_kick | | `SharedServerNotification` | shared_server_notification | | `SharedSourceNotification` | shared_source_notification | +| `SigninNotification` | signin_notification | | `SigninWithApple` | signin_with_apple | +| `SilenceRemoval` | silence-removal | +| `SleepTimer` | sleep-timer | | `SpringServeAdProvider` | spring_serve_ad_provider | +| `Sync` | sync | +| `SweetFades` | sweet-fades | | `TranscoderCache` | transcoder_cache | +| `Trailers` | trailers | | `TunerSharing` | tuner-sharing | | `TwoFactorAuthentication` | two-factor-authentication | | `Unsupportedtuners` | unsupportedtuners | | `Upgrade3ds2` | upgrade-3ds2 | +| `Visualizers` | visualizers | | `VodSchema` | vod-schema | | `VodCloudflare` | vod_cloudflare | +| `VolumeLeveling` | volume-leveling | | `WatchTogetherInvite` | watch-together-invite | -| `WebServerDashboard` | web_server_dashboard | \ No newline at end of file +| `WatchlistRss` | watchlist-rss | +| `WebServerDashboard` | web_server_dashboard | +| `Webhooks` | webhooks | +| - | `Unrecognized` | \ No newline at end of file diff --git a/docs/sdk/models/operations/gettokendetailsresponse.md b/docs/sdk/models/operations/gettokendetailsresponse.md index 6a76b4a5..d2d1a965 100644 --- a/docs/sdk/models/operations/gettokendetailsresponse.md +++ b/docs/sdk/models/operations/gettokendetailsresponse.md @@ -20,7 +20,7 @@ import { let value: GetTokenDetailsResponse = { contentType: "", - statusCode: 441711, + statusCode: 103, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), @@ -49,18 +49,18 @@ let value: GetTokenDetailsResponse = { joinedAt: 1721154902, locale: null, mailingListActive: false, - mailingListStatus: MailingListStatus.Active, + mailingListStatus: MailingListStatus.Unsubscribed, maxHomeSize: 15, pin: "string", profile: { autoSelectAudio: true, defaultAudioLanguage: "ja", defaultSubtitleLanguage: "en", - autoSelectSubtitle: AutoSelectSubtitle.One, - defaultSubtitleAccessibility: DefaultSubtitleAccessibility.One, - defaultSubtitleForced: DefaultSubtitleForced.One, - watchedIndicator: WatchedIndicator.One, - mediaReviewsVisibility: MediaReviewsVisibility.Zero, + autoSelectSubtitle: AutoSelectSubtitle.Enable, + defaultSubtitleAccessibility: DefaultSubtitleAccessibility.Enable, + defaultSubtitleForced: DefaultSubtitleForced.Enable, + watchedIndicator: WatchedIndicator.Enable, + mediaReviewsVisibility: MediaReviewsVisibility.Enable, }, protected: false, rememberExpiresAt: 1722364046, @@ -106,6 +106,7 @@ let value: GetTokenDetailsResponse = { twoFactorEnabled: false, username: "Username", uuid: "dae343c1f45beb4f", + attributionPartner: null, }, }; ``` diff --git a/docs/sdk/models/operations/gettokendetailsuserplexaccount.md b/docs/sdk/models/operations/gettokendetailsuserplexaccount.md index 875e6af9..8da50601 100644 --- a/docs/sdk/models/operations/gettokendetailsuserplexaccount.md +++ b/docs/sdk/models/operations/gettokendetailsuserplexaccount.md @@ -52,11 +52,11 @@ let value: GetTokenDetailsUserPlexAccount = { autoSelectAudio: true, defaultAudioLanguage: "ja", defaultSubtitleLanguage: "en", - autoSelectSubtitle: AutoSelectSubtitle.One, - defaultSubtitleAccessibility: DefaultSubtitleAccessibility.One, - defaultSubtitleForced: DefaultSubtitleForced.Zero, - watchedIndicator: WatchedIndicator.One, - mediaReviewsVisibility: MediaReviewsVisibility.Zero, + autoSelectSubtitle: AutoSelectSubtitle.Enable, + defaultSubtitleAccessibility: DefaultSubtitleAccessibility.Enable, + defaultSubtitleForced: DefaultSubtitleForced.Enable, + watchedIndicator: WatchedIndicator.Enable, + mediaReviewsVisibility: MediaReviewsVisibility.Enable, }, protected: false, rememberExpiresAt: 1722364046, @@ -102,6 +102,7 @@ let value: GetTokenDetailsUserPlexAccount = { twoFactorEnabled: false, username: "Username", uuid: "dae343c1f45beb4f", + attributionPartner: null, }; ``` @@ -128,15 +129,15 @@ let value: GetTokenDetailsUserPlexAccount = { | `homeAdmin` | *boolean* | :heavy_minus_sign: | If the account is the Plex Home admin | | | `homeSize` | *number* | :heavy_check_mark: | The number of accounts in the Plex Home | 1 | | `id` | *number* | :heavy_check_mark: | The Plex account ID | 13692262 | -| `joinedAt` | *number* | :heavy_check_mark: | Unix epoch datetime | 1556281940 | +| `joinedAt` | *number* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | | `locale` | *string* | :heavy_check_mark: | The account locale | | | `mailingListActive` | *boolean* | :heavy_minus_sign: | If you are subscribed to the Plex newsletter | | -| `mailingListStatus` | [operations.MailingListStatus](../../../sdk/models/operations/mailingliststatus.md) | :heavy_check_mark: | Your current mailing list status | | +| `mailingListStatus` | [operations.MailingListStatus](../../../sdk/models/operations/mailingliststatus.md) | :heavy_check_mark: | Your current mailing list status (active or unsubscribed) | active | | `maxHomeSize` | *number* | :heavy_check_mark: | The maximum number of accounts allowed in the Plex Home | 15 | | ~~`pin`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

[Might be removed] The hashed Plex Home PIN | | | `profile` | [operations.UserProfile](../../../sdk/models/operations/userprofile.md) | :heavy_check_mark: | N/A | | | `protected` | *boolean* | :heavy_minus_sign: | If the account has a Plex Home PIN enabled | | -| `rememberExpiresAt` | *number* | :heavy_check_mark: | Unix epoch datetime | 1556281940 | +| `rememberExpiresAt` | *number* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | | `restricted` | *boolean* | :heavy_minus_sign: | If the account is a Plex Home managed user | | | `roles` | *string*[] | :heavy_minus_sign: | [Might be removed] List of account roles. Plexpass membership listed here | | | `scrobbleTypes` | *string* | :heavy_check_mark: | Unknown | | @@ -148,4 +149,5 @@ let value: GetTokenDetailsUserPlexAccount = { | `title` | *string* | :heavy_check_mark: | The title of the account (username or friendly name) | UsernameTitle | | `twoFactorEnabled` | *boolean* | :heavy_minus_sign: | If two-factor authentication is enabled | | | `username` | *string* | :heavy_check_mark: | The account username | Username | -| `uuid` | *string* | :heavy_check_mark: | The account UUID | dae343c1f45beb4f | \ No newline at end of file +| `uuid` | *string* | :heavy_check_mark: | The account UUID | dae343c1f45beb4f | +| `attributionPartner` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/gettopwatchedcontentqueryparamtype.md b/docs/sdk/models/operations/gettopwatchedcontentqueryparamtype.md index e700eaf9..3e284fb1 100644 --- a/docs/sdk/models/operations/gettopwatchedcontentqueryparamtype.md +++ b/docs/sdk/models/operations/gettopwatchedcontentqueryparamtype.md @@ -14,14 +14,14 @@ E.g. A movie library will not return anything with type 3 as there are no season import { GetTopWatchedContentQueryParamType } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetTopWatchedContentQueryParamType = - GetTopWatchedContentQueryParamType.Two; + GetTopWatchedContentQueryParamType.TvShow; ``` ## Values -| Name | Value | -| ------- | ------- | -| `One` | 1 | -| `Two` | 2 | -| `Three` | 3 | -| `Four` | 4 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Movie` | 1 | +| `TvShow` | 2 | +| `Season` | 3 | +| `Episode` | 4 | \ No newline at end of file diff --git a/docs/sdk/models/operations/gettopwatchedcontentrequest.md b/docs/sdk/models/operations/gettopwatchedcontentrequest.md index 404af2d6..690dfd80 100644 --- a/docs/sdk/models/operations/gettopwatchedcontentrequest.md +++ b/docs/sdk/models/operations/gettopwatchedcontentrequest.md @@ -6,7 +6,7 @@ import { GetTopWatchedContentQueryParamType, GetTopWatchedContentRequest } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetTopWatchedContentRequest = { - type: GetTopWatchedContentQueryParamType.Two, + type: GetTopWatchedContentQueryParamType.TvShow, includeGuids: 1, }; ``` diff --git a/docs/sdk/models/operations/gettopwatchedcontentresponse.md b/docs/sdk/models/operations/gettopwatchedcontentresponse.md index 57a32588..72d76b8e 100644 --- a/docs/sdk/models/operations/gettopwatchedcontentresponse.md +++ b/docs/sdk/models/operations/gettopwatchedcontentresponse.md @@ -8,7 +8,7 @@ import { RFCDate } from "@lukehagar/plexjs/sdk/types"; let value: GetTopWatchedContentResponse = { contentType: "", - statusCode: 607831, + statusCode: 306, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/gettranscodesessionsresponse.md b/docs/sdk/models/operations/gettranscodesessionsresponse.md index ab32ff16..43c14377 100644 --- a/docs/sdk/models/operations/gettranscodesessionsresponse.md +++ b/docs/sdk/models/operations/gettranscodesessionsresponse.md @@ -7,7 +7,7 @@ import { GetTranscodeSessionsResponse } from "@lukehagar/plexjs/sdk/models/opera let value: GetTranscodeSessionsResponse = { contentType: "", - statusCode: 929297, + statusCode: 100, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/gettransienttokenresponse.md b/docs/sdk/models/operations/gettransienttokenresponse.md index cfd463cd..2518f7b7 100644 --- a/docs/sdk/models/operations/gettransienttokenresponse.md +++ b/docs/sdk/models/operations/gettransienttokenresponse.md @@ -7,7 +7,7 @@ import { GetTransientTokenResponse } from "@lukehagar/plexjs/sdk/models/operatio let value: GetTransientTokenResponse = { contentType: "", - statusCode: 673660, + statusCode: 203, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getupdatestatusresponse.md b/docs/sdk/models/operations/getupdatestatusresponse.md index 78fde426..1451f267 100644 --- a/docs/sdk/models/operations/getupdatestatusresponse.md +++ b/docs/sdk/models/operations/getupdatestatusresponse.md @@ -7,7 +7,7 @@ import { GetUpdateStatusResponse } from "@lukehagar/plexjs/sdk/models/operations let value: GetUpdateStatusResponse = { contentType: "", - statusCode: 318569, + statusCode: 508, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getuserfriendsresponse.md b/docs/sdk/models/operations/getuserfriendsresponse.md index 8c7f322b..b4a10cda 100644 --- a/docs/sdk/models/operations/getuserfriendsresponse.md +++ b/docs/sdk/models/operations/getuserfriendsresponse.md @@ -7,7 +7,7 @@ import { GetUserFriendsResponse, Status } from "@lukehagar/plexjs/sdk/models/ope let value: GetUserFriendsResponse = { contentType: "", - statusCode: 20218, + statusCode: 100, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/getwatchlistrequest.md b/docs/sdk/models/operations/getwatchlistrequest.md index 3c9b4178..6c4ea96a 100644 --- a/docs/sdk/models/operations/getwatchlistrequest.md +++ b/docs/sdk/models/operations/getwatchlistrequest.md @@ -6,7 +6,7 @@ import { Filter, GetWatchListRequest } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetWatchListRequest = { - filter: Filter.Available, + filter: Filter.All, xPlexContainerStart: 0, xPlexContainerSize: 50, xPlexToken: "CV5xoxjTpFKUzBTShsaf", diff --git a/docs/sdk/models/operations/getwatchlistresponse.md b/docs/sdk/models/operations/getwatchlistresponse.md index 2d386bf0..54f99804 100644 --- a/docs/sdk/models/operations/getwatchlistresponse.md +++ b/docs/sdk/models/operations/getwatchlistresponse.md @@ -7,7 +7,7 @@ import { GetWatchListResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetWatchListResponse = { contentType: "", - statusCode: 988374, + statusCode: 300, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/hasthumbnail.md b/docs/sdk/models/operations/hasthumbnail.md new file mode 100644 index 00000000..9f368e56 --- /dev/null +++ b/docs/sdk/models/operations/hasthumbnail.md @@ -0,0 +1,16 @@ +# HasThumbnail + +## Example Usage + +```typescript +import { HasThumbnail } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: HasThumbnail = HasThumbnail.True; +``` + +## Values + +| Name | Value | +| ------- | ------- | +| `False` | 0 | +| `True` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/includedetails.md b/docs/sdk/models/operations/includedetails.md index b9055091..2074e151 100644 --- a/docs/sdk/models/operations/includedetails.md +++ b/docs/sdk/models/operations/includedetails.md @@ -9,7 +9,7 @@ Only exists for backwards compatibility, media providers other than the server l ```typescript import { IncludeDetails } from "@lukehagar/plexjs/sdk/models/operations"; -let value: IncludeDetails = IncludeDetails.One; +let value: IncludeDetails = IncludeDetails.Zero; ``` ## Values diff --git a/docs/sdk/models/operations/includeexternalmedia.md b/docs/sdk/models/operations/includeexternalmedia.md index 309bac8f..e720260e 100644 --- a/docs/sdk/models/operations/includeexternalmedia.md +++ b/docs/sdk/models/operations/includeexternalmedia.md @@ -8,7 +8,7 @@ include external media in the results ```typescript import { IncludeExternalMedia } from "@lukehagar/plexjs/sdk/models/operations"; -let value: IncludeExternalMedia = IncludeExternalMedia.One; +let value: IncludeExternalMedia = IncludeExternalMedia.Zero; ``` ## Values diff --git a/docs/sdk/models/operations/includeguids.md b/docs/sdk/models/operations/includeguids.md index 6acd187c..fb7ac0bb 100644 --- a/docs/sdk/models/operations/includeguids.md +++ b/docs/sdk/models/operations/includeguids.md @@ -8,12 +8,12 @@ Adds the Guids object to the response ```typescript import { IncludeGuids } from "@lukehagar/plexjs/sdk/models/operations"; -let value: IncludeGuids = IncludeGuids.One; +let value: IncludeGuids = IncludeGuids.Enable; ``` ## Values -| Name | Value | -| ------ | ------ | -| `Zero` | 0 | -| `One` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/includehttps.md b/docs/sdk/models/operations/includehttps.md index bd1d3e9f..5d7bbe80 100644 --- a/docs/sdk/models/operations/includehttps.md +++ b/docs/sdk/models/operations/includehttps.md @@ -7,12 +7,12 @@ Include Https entries in the results ```typescript import { IncludeHttps } from "@lukehagar/plexjs/sdk/models/operations"; -let value: IncludeHttps = IncludeHttps.One; +let value: IncludeHttps = IncludeHttps.Enable; ``` ## Values -| Name | Value | -| ------ | ------ | -| `Zero` | 0 | -| `One` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/includeipv6.md b/docs/sdk/models/operations/includeipv6.md index 8af68c43..48402b21 100644 --- a/docs/sdk/models/operations/includeipv6.md +++ b/docs/sdk/models/operations/includeipv6.md @@ -7,12 +7,12 @@ Include IPv6 entries in the results ```typescript import { IncludeIPv6 } from "@lukehagar/plexjs/sdk/models/operations"; -let value: IncludeIPv6 = IncludeIPv6.One; +let value: IncludeIPv6 = IncludeIPv6.Enable; ``` ## Values -| Name | Value | -| ------ | ------ | -| `Zero` | 0 | -| `One` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/includemeta.md b/docs/sdk/models/operations/includemeta.md index e05ef21d..ce04cd62 100644 --- a/docs/sdk/models/operations/includemeta.md +++ b/docs/sdk/models/operations/includemeta.md @@ -8,12 +8,12 @@ Adds the Meta object to the response ```typescript import { IncludeMeta } from "@lukehagar/plexjs/sdk/models/operations"; -let value: IncludeMeta = IncludeMeta.One; +let value: IncludeMeta = IncludeMeta.Enable; ``` ## Values -| Name | Value | -| ------ | ------ | -| `Zero` | 0 | -| `One` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/includerelay.md b/docs/sdk/models/operations/includerelay.md index c69be327..d6b8314b 100644 --- a/docs/sdk/models/operations/includerelay.md +++ b/docs/sdk/models/operations/includerelay.md @@ -9,12 +9,12 @@ E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400 ```typescript import { IncludeRelay } from "@lukehagar/plexjs/sdk/models/operations"; -let value: IncludeRelay = IncludeRelay.One; +let value: IncludeRelay = IncludeRelay.Enable; ``` ## Values -| Name | Value | -| ------ | ------ | -| `Zero` | 0 | -| `One` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/level.md b/docs/sdk/models/operations/level.md index 52a894ce..84e7388e 100644 --- a/docs/sdk/models/operations/level.md +++ b/docs/sdk/models/operations/level.md @@ -13,7 +13,7 @@ An integer log level to write to the PMS log with. ```typescript import { Level } from "@lukehagar/plexjs/sdk/models/operations"; -let value: Level = Level.Four; +let value: Level = Level.Zero; ``` ## Values diff --git a/docs/sdk/models/operations/librarysectionid.md b/docs/sdk/models/operations/librarysectionid.md deleted file mode 100644 index 8d1c1a3a..00000000 --- a/docs/sdk/models/operations/librarysectionid.md +++ /dev/null @@ -1,24 +0,0 @@ -# LibrarySectionID - -## Example Usage - -```typescript -import { LibrarySectionID } from "@lukehagar/plexjs/sdk/models/operations"; - -let value: LibrarySectionID = ""; -``` - -## Supported Types - -### `number` - -```typescript -const value: number = /* values here */ -``` - -### `string` - -```typescript -const value: string = /* values here */ -``` - diff --git a/docs/sdk/models/operations/libtype.md b/docs/sdk/models/operations/libtype.md index 00bd8379..ff8aa206 100644 --- a/docs/sdk/models/operations/libtype.md +++ b/docs/sdk/models/operations/libtype.md @@ -8,7 +8,7 @@ The type of library to filter. Can be "movie" or "show", or all if not present. ```typescript import { Libtype } from "@lukehagar/plexjs/sdk/models/operations"; -let value: Libtype = Libtype.Show; +let value: Libtype = Libtype.Movie; ``` ## Values diff --git a/docs/sdk/models/operations/location.md b/docs/sdk/models/operations/location.md index 1db1d55e..a2ec4016 100644 --- a/docs/sdk/models/operations/location.md +++ b/docs/sdk/models/operations/location.md @@ -15,5 +15,5 @@ let value: Location = { | Field | Type | Required | Description | Example | | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `id` | *number* | :heavy_minus_sign: | N/A | 1 | -| `path` | *string* | :heavy_minus_sign: | N/A | /movies | \ No newline at end of file +| `id` | *number* | :heavy_check_mark: | N/A | 1 | +| `path` | *string* | :heavy_check_mark: | N/A | /movies | \ No newline at end of file diff --git a/docs/sdk/models/operations/loglineresponse.md b/docs/sdk/models/operations/loglineresponse.md index c556b402..260a924b 100644 --- a/docs/sdk/models/operations/loglineresponse.md +++ b/docs/sdk/models/operations/loglineresponse.md @@ -7,7 +7,7 @@ import { LogLineResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: LogLineResponse = { contentType: "", - statusCode: 652790, + statusCode: 406, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/logmultilineresponse.md b/docs/sdk/models/operations/logmultilineresponse.md index 4daa4a63..03d58738 100644 --- a/docs/sdk/models/operations/logmultilineresponse.md +++ b/docs/sdk/models/operations/logmultilineresponse.md @@ -7,7 +7,7 @@ import { LogMultiLineResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: LogMultiLineResponse = { contentType: "", - statusCode: 208876, + statusCode: 226, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/mailingliststatus.md b/docs/sdk/models/operations/mailingliststatus.md index e3329096..bb7258fb 100644 --- a/docs/sdk/models/operations/mailingliststatus.md +++ b/docs/sdk/models/operations/mailingliststatus.md @@ -1,13 +1,13 @@ # MailingListStatus -Your current mailing list status +Your current mailing list status (active or unsubscribed) ## Example Usage ```typescript import { MailingListStatus } from "@lukehagar/plexjs/sdk/models/operations"; -let value: MailingListStatus = MailingListStatus.Unsubscribed; +let value: MailingListStatus = MailingListStatus.Active; ``` ## Values diff --git a/docs/sdk/models/operations/markplayedresponse.md b/docs/sdk/models/operations/markplayedresponse.md index 1ed35f01..4830e0a1 100644 --- a/docs/sdk/models/operations/markplayedresponse.md +++ b/docs/sdk/models/operations/markplayedresponse.md @@ -7,7 +7,7 @@ import { MarkPlayedResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: MarkPlayedResponse = { contentType: "", - statusCode: 56713, + statusCode: 403, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/markunplayedresponse.md b/docs/sdk/models/operations/markunplayedresponse.md index b6380d34..46447d94 100644 --- a/docs/sdk/models/operations/markunplayedresponse.md +++ b/docs/sdk/models/operations/markunplayedresponse.md @@ -7,7 +7,7 @@ import { MarkUnplayedResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: MarkUnplayedResponse = { contentType: "", - statusCode: 963663, + statusCode: 404, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/media.md b/docs/sdk/models/operations/media.md index aadccb21..b5070b53 100644 --- a/docs/sdk/models/operations/media.md +++ b/docs/sdk/models/operations/media.md @@ -3,34 +3,83 @@ ## Example Usage ```typescript -import { Media } from "@lukehagar/plexjs/sdk/models/operations"; +import { HasThumbnail, Media, OptimizedForStreaming } from "@lukehagar/plexjs/sdk/models/operations"; let value: Media = { - id: 120345, - duration: 7474422, - bitrate: 3623, - width: 1920, - height: 804, - aspectRatio: 2.35, + id: 119534, + duration: 11558112, + bitrate: 25025, + width: 3840, + height: 2072, + aspectRatio: 1.85, + audioProfile: "dts", audioChannels: 6, - audioCodec: "ac3", - videoCodec: "h264", - videoResolution: 1080, - container: "mp4", + audioCodec: "eac3", + videoCodec: "hevc", + videoResolution: "4k", + container: "mkv", videoFrameRate: "24p", - optimizedForStreaming: 0, - videoProfile: "high", + videoProfile: "main 10", + hasVoiceActivity: false, + optimizedForStreaming: OptimizedForStreaming.Enable, + has64bitOffsets: false, part: [ { - id: 120353, - key: "/library/parts/120353/1681803203/file.mp4", - duration: 7474422, + id: 119542, + key: "/library/parts/119542/1680457526/file.mkv", + duration: 11558112, file: - "/movies/Ant-Man and the Wasp Quantumania (2023)/Ant-Man.and.the.Wasp.Quantumania.2023.1080p.mp4", - size: 3395307162, - container: "mp4", - hasThumbnail: 1, - videoProfile: "high", + "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", + size: 36158371307, + container: "mkv", + audioProfile: "dts", + has64bitOffsets: false, + optimizedForStreaming: false, + videoProfile: "main 10", + indexes: "sd", + hasThumbnail: HasThumbnail.True, + stream: [ + { + id: 272796, + streamType: 1, + default: true, + selected: true, + codec: "h264", + index: 0, + bitrate: 6273, + colorPrimaries: "bt709", + colorRange: "tv", + colorSpace: "bt709", + colorTrc: "bt709", + bitDepth: 8, + chromaLocation: "left", + streamIdentifier: "2", + chromaSubsampling: "4:2:0", + codedHeight: 1088, + codedWidth: 1920, + frameRate: 29.97, + hasScalingMatrix: false, + hearingImpaired: false, + closedCaptions: false, + embeddedInVideo: "1", + height: 1080, + level: 40, + profile: "main", + refFrames: 4, + scanType: "progressive", + width: 1920, + displayTitle: "1080p (H.264)", + extendedDisplayTitle: "1080p (H.264)", + channels: 2, + language: "English", + languageTag: "en", + languageCode: "eng", + audioChannelLayout: "stereo", + samplingRate: 48000, + title: "English", + canAutoSync: false, + }, + ], }, ], }; @@ -38,21 +87,23 @@ let value: Media = { ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | -| `id` | *number* | :heavy_minus_sign: | N/A | 120345 | -| `duration` | *number* | :heavy_minus_sign: | N/A | 7474422 | -| `bitrate` | *number* | :heavy_minus_sign: | N/A | 3623 | -| `width` | *number* | :heavy_minus_sign: | N/A | 1920 | -| `height` | *number* | :heavy_minus_sign: | N/A | 804 | -| `aspectRatio` | *number* | :heavy_minus_sign: | N/A | 2.35 | -| `audioChannels` | *number* | :heavy_minus_sign: | N/A | 6 | -| `audioCodec` | *string* | :heavy_minus_sign: | N/A | ac3 | -| `videoCodec` | *string* | :heavy_minus_sign: | N/A | h264 | -| `videoResolution` | *number* | :heavy_minus_sign: | N/A | 1080 | -| `container` | *string* | :heavy_minus_sign: | N/A | mp4 | -| `videoFrameRate` | *string* | :heavy_minus_sign: | N/A | 24p | -| `optimizedForStreaming` | *number* | :heavy_minus_sign: | N/A | 0 | -| `has64bitOffsets` | *boolean* | :heavy_minus_sign: | N/A | | -| `videoProfile` | *string* | :heavy_minus_sign: | N/A | high | -| `part` | [operations.Part](../../../sdk/models/operations/part.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `id` | *number* | :heavy_check_mark: | N/A | 119534 | +| `duration` | *number* | :heavy_check_mark: | N/A | 11558112 | +| `bitrate` | *number* | :heavy_check_mark: | N/A | 25025 | +| `width` | *number* | :heavy_check_mark: | N/A | 3840 | +| `height` | *number* | :heavy_check_mark: | N/A | 2072 | +| `aspectRatio` | *number* | :heavy_check_mark: | N/A | 1.85 | +| `audioProfile` | *string* | :heavy_minus_sign: | N/A | dts | +| `audioChannels` | *number* | :heavy_check_mark: | N/A | 6 | +| `audioCodec` | *string* | :heavy_check_mark: | N/A | eac3 | +| `videoCodec` | *string* | :heavy_check_mark: | N/A | hevc | +| `videoResolution` | *string* | :heavy_check_mark: | N/A | 4k | +| `container` | *string* | :heavy_check_mark: | N/A | mkv | +| `videoFrameRate` | *string* | :heavy_check_mark: | N/A | 24p | +| `videoProfile` | *string* | :heavy_check_mark: | N/A | main 10 | +| `hasVoiceActivity` | *boolean* | :heavy_minus_sign: | N/A | false | +| `optimizedForStreaming` | [operations.OptimizedForStreaming](../../../sdk/models/operations/optimizedforstreaming.md) | :heavy_minus_sign: | N/A | 1 | +| `has64bitOffsets` | *boolean* | :heavy_minus_sign: | N/A | false | +| `part` | [operations.Part](../../../sdk/models/operations/part.md)[] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/mediaguid.md b/docs/sdk/models/operations/mediaguid.md new file mode 100644 index 00000000..eb94124d --- /dev/null +++ b/docs/sdk/models/operations/mediaguid.md @@ -0,0 +1,17 @@ +# MediaGuid + +## Example Usage + +```typescript +import { MediaGuid } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: MediaGuid = { + id: "imdb://tt13015952", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Can be one of the following formats:
imdb://tt13015952, tmdb://2434012, tvdb://7945991
| imdb://tt13015952 | \ No newline at end of file diff --git a/docs/sdk/models/operations/mediaprovider.md b/docs/sdk/models/operations/mediaprovider.md index f3b95776..55301096 100644 --- a/docs/sdk/models/operations/mediaprovider.md +++ b/docs/sdk/models/operations/mediaprovider.md @@ -5,7 +5,22 @@ ```typescript import { MediaProvider } from "@lukehagar/plexjs/sdk/models/operations"; -let value: MediaProvider = {}; +let value: MediaProvider = { + feature: [ + { + type: "", + flavor: "global", + scrobbleKey: "/:/scrobble/new", + unscrobbleKey: "/:/unscrobble/new", + action: [ + { + id: "addToContinueWatching", + key: "/actions/addToContinueWatching", + }, + ], + }, + ], +}; ``` ## Fields diff --git a/docs/sdk/models/operations/mediareviewsvisibility.md b/docs/sdk/models/operations/mediareviewsvisibility.md index 17050ffd..03144ea7 100644 --- a/docs/sdk/models/operations/mediareviewsvisibility.md +++ b/docs/sdk/models/operations/mediareviewsvisibility.md @@ -1,16 +1,18 @@ # MediaReviewsVisibility +Whether or not the account has media reviews visibility enabled + ## Example Usage ```typescript import { MediaReviewsVisibility } from "@lukehagar/plexjs/sdk/models/operations"; -let value: MediaReviewsVisibility = MediaReviewsVisibility.One; +let value: MediaReviewsVisibility = MediaReviewsVisibility.Enable; ``` ## Values -| Name | Value | -| ------ | ------ | -| `Zero` | 0 | -| `One` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/meta.md b/docs/sdk/models/operations/meta.md new file mode 100644 index 00000000..ee677427 --- /dev/null +++ b/docs/sdk/models/operations/meta.md @@ -0,0 +1,68 @@ +# Meta + +The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + + +## Example Usage + +```typescript +import { GetRecentlyAddedActiveDirection, GetRecentlyAddedDefaultDirection, Meta } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: Meta = { + type: [ + { + key: "/library/sections/2/all?type=2", + type: "show", + title: "TV Shows", + active: false, + filter: [ + { + filter: "genre", + filterType: "string", + key: "/library/sections/2/genre?type=2", + title: "Genre", + type: "filter", + }, + ], + sort: [ + { + default: "asc", + active: false, + activeDirection: GetRecentlyAddedActiveDirection.Ascending, + defaultDirection: GetRecentlyAddedDefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", + }, + ], + field: [ + { + key: "show.title", + title: "Show Title", + type: "string", + subType: "rating", + }, + ], + }, + ], + fieldType: [ + { + type: "tag", + operator: [ + { + key: "=", + title: "is", + }, + ], + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `type` | [operations.GetRecentlyAddedType](../../../sdk/models/operations/getrecentlyaddedtype.md)[] | :heavy_minus_sign: | N/A | +| `fieldType` | [operations.GetRecentlyAddedFieldType](../../../sdk/models/operations/getrecentlyaddedfieldtype.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/metadatarating.md b/docs/sdk/models/operations/metadatarating.md new file mode 100644 index 00000000..cca82d42 --- /dev/null +++ b/docs/sdk/models/operations/metadatarating.md @@ -0,0 +1,21 @@ +# MetaDataRating + +## Example Usage + +```typescript +import { MetaDataRating } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: MetaDataRating = { + image: "themoviedb://image.rating", + value: 3, + type: "audience", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `image` | *string* | :heavy_check_mark: | A URI or path to the rating image. | themoviedb://image.rating | +| `value` | *number* | :heavy_check_mark: | The value of the rating. | 3 | +| `type` | *string* | :heavy_check_mark: | The type of rating (e.g., audience, critic). | audience | \ No newline at end of file diff --git a/docs/sdk/models/operations/operator.md b/docs/sdk/models/operations/operator.md index fbac8246..a354bc7c 100644 --- a/docs/sdk/models/operations/operator.md +++ b/docs/sdk/models/operations/operator.md @@ -15,5 +15,5 @@ let value: Operator = { | Field | Type | Required | Description | Example | | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `key` | *string* | :heavy_minus_sign: | N/A | = | -| `title` | *string* | :heavy_minus_sign: | N/A | is | \ No newline at end of file +| `key` | *string* | :heavy_check_mark: | N/A | = | +| `title` | *string* | :heavy_check_mark: | N/A | is | \ No newline at end of file diff --git a/docs/sdk/models/operations/optimizedforstreaming.md b/docs/sdk/models/operations/optimizedforstreaming.md new file mode 100644 index 00000000..4d233e37 --- /dev/null +++ b/docs/sdk/models/operations/optimizedforstreaming.md @@ -0,0 +1,16 @@ +# OptimizedForStreaming + +## Example Usage + +```typescript +import { OptimizedForStreaming } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: OptimizedForStreaming = OptimizedForStreaming.Enable; +``` + +## Values + +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/part.md b/docs/sdk/models/operations/part.md index cfd14e4b..260ef19b 100644 --- a/docs/sdk/models/operations/part.md +++ b/docs/sdk/models/operations/part.md @@ -3,32 +3,81 @@ ## Example Usage ```typescript -import { Part } from "@lukehagar/plexjs/sdk/models/operations"; +import { HasThumbnail, Part } from "@lukehagar/plexjs/sdk/models/operations"; let value: Part = { - id: 120353, - key: "/library/parts/120353/1681803203/file.mp4", - duration: 7474422, + id: 119542, + key: "/library/parts/119542/1680457526/file.mkv", + duration: 11558112, file: - "/movies/Ant-Man and the Wasp Quantumania (2023)/Ant-Man.and.the.Wasp.Quantumania.2023.1080p.mp4", - size: 3395307162, - container: "mp4", - hasThumbnail: 1, - videoProfile: "high", + "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", + size: 36158371307, + container: "mkv", + audioProfile: "dts", + has64bitOffsets: false, + optimizedForStreaming: false, + videoProfile: "main 10", + indexes: "sd", + hasThumbnail: HasThumbnail.True, + stream: [ + { + id: 272796, + streamType: 1, + default: true, + selected: true, + codec: "h264", + index: 0, + bitrate: 6273, + colorPrimaries: "bt709", + colorRange: "tv", + colorSpace: "bt709", + colorTrc: "bt709", + bitDepth: 8, + chromaLocation: "left", + streamIdentifier: "2", + chromaSubsampling: "4:2:0", + codedHeight: 1088, + codedWidth: 1920, + frameRate: 29.97, + hasScalingMatrix: false, + hearingImpaired: false, + closedCaptions: false, + embeddedInVideo: "1", + height: 1080, + level: 40, + profile: "main", + refFrames: 4, + scanType: "progressive", + width: 1920, + displayTitle: "1080p (H.264)", + extendedDisplayTitle: "1080p (H.264)", + channels: 2, + language: "English", + languageTag: "en", + languageCode: "eng", + audioChannelLayout: "stereo", + samplingRate: 48000, + title: "English", + canAutoSync: false, + }, + ], }; ``` ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `id` | *number* | :heavy_minus_sign: | N/A | 120353 | -| `key` | *string* | :heavy_minus_sign: | N/A | /library/parts/120353/1681803203/file.mp4 | -| `duration` | *number* | :heavy_minus_sign: | N/A | 7474422 | -| `file` | *string* | :heavy_minus_sign: | N/A | /movies/Ant-Man and the Wasp Quantumania (2023)/Ant-Man.and.the.Wasp.Quantumania.2023.1080p.mp4 | -| `size` | *number* | :heavy_minus_sign: | N/A | 3395307162 | -| `container` | *string* | :heavy_minus_sign: | N/A | mp4 | -| `has64bitOffsets` | *boolean* | :heavy_minus_sign: | N/A | | -| `hasThumbnail` | *number* | :heavy_minus_sign: | N/A | 1 | -| `optimizedForStreaming` | *boolean* | :heavy_minus_sign: | N/A | | -| `videoProfile` | *string* | :heavy_minus_sign: | N/A | high | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `id` | *number* | :heavy_check_mark: | N/A | 119542 | +| `key` | *string* | :heavy_check_mark: | N/A | /library/parts/119542/1680457526/file.mkv | +| `duration` | *number* | :heavy_check_mark: | N/A | 11558112 | +| `file` | *string* | :heavy_check_mark: | N/A | /movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv | +| `size` | *number* | :heavy_check_mark: | N/A | 36158371307 | +| `container` | *string* | :heavy_check_mark: | The container format of the media file.
| mkv | +| `audioProfile` | *string* | :heavy_minus_sign: | N/A | dts | +| `has64bitOffsets` | *boolean* | :heavy_minus_sign: | N/A | false | +| `optimizedForStreaming` | *boolean* | :heavy_minus_sign: | N/A | false | +| `videoProfile` | *string* | :heavy_check_mark: | N/A | main 10 | +| `indexes` | *string* | :heavy_minus_sign: | N/A | sd | +| `hasThumbnail` | [operations.HasThumbnail](../../../sdk/models/operations/hasthumbnail.md) | :heavy_minus_sign: | N/A | 1 | +| `stream` | [operations.Stream](../../../sdk/models/operations/stream.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/pastsubscription.md b/docs/sdk/models/operations/pastsubscription.md index bc406c92..584a29fd 100644 --- a/docs/sdk/models/operations/pastsubscription.md +++ b/docs/sdk/models/operations/pastsubscription.md @@ -22,7 +22,7 @@ let value: PastSubscription = { state: PostUsersSignInDataState.Ended, billing: { internalPaymentMethod: {}, - paymentMethodId: 918236, + paymentMethodId: 253941, }, }; ``` diff --git a/docs/sdk/models/operations/pathparamtaskname.md b/docs/sdk/models/operations/pathparamtaskname.md index 14f0bccd..d69df2b2 100644 --- a/docs/sdk/models/operations/pathparamtaskname.md +++ b/docs/sdk/models/operations/pathparamtaskname.md @@ -7,7 +7,7 @@ The name of the task to be started. ```typescript import { PathParamTaskName } from "@lukehagar/plexjs/sdk/models/operations"; -let value: PathParamTaskName = PathParamTaskName.BackupDatabase; +let value: PathParamTaskName = PathParamTaskName.BuildGracenoteCollections; ``` ## Values diff --git a/docs/sdk/models/operations/performsearchresponse.md b/docs/sdk/models/operations/performsearchresponse.md index 3c62599a..093fa92d 100644 --- a/docs/sdk/models/operations/performsearchresponse.md +++ b/docs/sdk/models/operations/performsearchresponse.md @@ -7,7 +7,7 @@ import { PerformSearchResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: PerformSearchResponse = { contentType: "", - statusCode: 902599, + statusCode: 206, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/performvoicesearchresponse.md b/docs/sdk/models/operations/performvoicesearchresponse.md index 2435efbe..ea1ccdbf 100644 --- a/docs/sdk/models/operations/performvoicesearchresponse.md +++ b/docs/sdk/models/operations/performvoicesearchresponse.md @@ -7,7 +7,7 @@ import { PerformVoiceSearchResponse } from "@lukehagar/plexjs/sdk/models/operati let value: PerformVoiceSearchResponse = { contentType: "", - statusCode: 681820, + statusCode: 301, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/plexdevice.md b/docs/sdk/models/operations/plexdevice.md index a867d3db..700a272b 100644 --- a/docs/sdk/models/operations/plexdevice.md +++ b/docs/sdk/models/operations/plexdevice.md @@ -3,20 +3,20 @@ ## Example Usage ```typescript -import { PlexDevice } from "@lukehagar/plexjs/sdk/models/operations"; +import { PlexDevice, Protocol } from "@lukehagar/plexjs/sdk/models/operations"; let value: PlexDevice = { name: "", - product: "Handcrafted Bronze Fish", + product: "Modern Rubber Bacon", productVersion: "", platform: "", platformVersion: "", - device: "", + device: "Desktop", clientIdentifier: "", - createdAt: new Date("2023-12-03T08:28:56.752Z"), - lastSeenAt: new Date("2023-09-30T21:26:54.920Z"), + createdAt: new Date("2019-06-24T11:38:02Z"), + lastSeenAt: new Date("2019-06-24T11:38:02Z"), provides: "", - ownerId: 143353, + ownerId: 120196, sourceTitle: "", publicAddress: "", accessToken: "", @@ -31,10 +31,10 @@ let value: PlexDevice = { natLoopbackSupported: false, connections: [ { - protocol: "", - address: "9751 Jaren Ford", - port: 1863.32, - uri: "https://several-increase.biz", + protocol: Protocol.Http, + address: "23406 Gleason Meadow", + port: 6156, + uri: "https://vengeful-farmer.net", local: false, relay: false, iPv6: false, @@ -45,29 +45,29 @@ let value: PlexDevice = { ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `name` | *string* | :heavy_check_mark: | N/A | -| `product` | *string* | :heavy_check_mark: | N/A | -| `productVersion` | *string* | :heavy_check_mark: | N/A | -| `platform` | *string* | :heavy_check_mark: | N/A | -| `platformVersion` | *string* | :heavy_check_mark: | N/A | -| `device` | *string* | :heavy_check_mark: | N/A | -| `clientIdentifier` | *string* | :heavy_check_mark: | N/A | -| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | -| `lastSeenAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | -| `provides` | *string* | :heavy_check_mark: | N/A | -| `ownerId` | *number* | :heavy_check_mark: | ownerId is null when the device is owned by the token used to send the request | -| `sourceTitle` | *string* | :heavy_check_mark: | N/A | -| `publicAddress` | *string* | :heavy_check_mark: | N/A | -| `accessToken` | *string* | :heavy_check_mark: | N/A | -| `owned` | *boolean* | :heavy_check_mark: | N/A | -| `home` | *boolean* | :heavy_check_mark: | N/A | -| `synced` | *boolean* | :heavy_check_mark: | N/A | -| `relay` | *boolean* | :heavy_check_mark: | N/A | -| `presence` | *boolean* | :heavy_check_mark: | N/A | -| `httpsRequired` | *boolean* | :heavy_check_mark: | N/A | -| `publicAddressMatches` | *boolean* | :heavy_check_mark: | N/A | -| `dnsRebindingProtection` | *boolean* | :heavy_check_mark: | N/A | -| `natLoopbackSupported` | *boolean* | :heavy_check_mark: | N/A | -| `connections` | [operations.Connections](../../../sdk/models/operations/connections.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_check_mark: | N/A | | +| `product` | *string* | :heavy_check_mark: | N/A | | +| `productVersion` | *string* | :heavy_check_mark: | N/A | | +| `platform` | *string* | :heavy_check_mark: | N/A | | +| `platformVersion` | *string* | :heavy_check_mark: | N/A | | +| `device` | *string* | :heavy_check_mark: | N/A | | +| `clientIdentifier` | *string* | :heavy_check_mark: | N/A | | +| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | 2019-06-24T11:38:02Z | +| `lastSeenAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | 2019-06-24T11:38:02Z | +| `provides` | *string* | :heavy_check_mark: | N/A | | +| `ownerId` | *number* | :heavy_check_mark: | ownerId is null when the device is owned by the token used to send the request | | +| `sourceTitle` | *string* | :heavy_check_mark: | N/A | | +| `publicAddress` | *string* | :heavy_check_mark: | N/A | | +| `accessToken` | *string* | :heavy_check_mark: | N/A | | +| `owned` | *boolean* | :heavy_check_mark: | N/A | | +| `home` | *boolean* | :heavy_check_mark: | N/A | | +| `synced` | *boolean* | :heavy_check_mark: | N/A | | +| `relay` | *boolean* | :heavy_check_mark: | N/A | | +| `presence` | *boolean* | :heavy_check_mark: | N/A | | +| `httpsRequired` | *boolean* | :heavy_check_mark: | N/A | | +| `publicAddressMatches` | *boolean* | :heavy_check_mark: | N/A | | +| `dnsRebindingProtection` | *boolean* | :heavy_check_mark: | N/A | | +| `natLoopbackSupported` | *boolean* | :heavy_check_mark: | N/A | | +| `connections` | [operations.Connections](../../../sdk/models/operations/connections.md)[] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/postuserssignindataauthenticationfeatures.md b/docs/sdk/models/operations/postuserssignindataauthenticationfeatures.md index e9afccb8..12fe5629 100644 --- a/docs/sdk/models/operations/postuserssignindataauthenticationfeatures.md +++ b/docs/sdk/models/operations/postuserssignindataauthenticationfeatures.md @@ -6,11 +6,13 @@ import { PostUsersSignInDataAuthenticationFeatures } from "@lukehagar/plexjs/sdk/models/operations"; let value: PostUsersSignInDataAuthenticationFeatures = - PostUsersSignInDataAuthenticationFeatures.TunerSharing; + PostUsersSignInDataAuthenticationFeatures.VolumeLeveling; ``` ## Values +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + | Name | Value | | --------------------------------------- | --------------------------------------- | | `AndroidDolbyVision` | Android - Dolby Vision | @@ -20,28 +22,43 @@ let value: PostUsersSignInDataAuthenticationFeatures = | `TREBLEShowFeatures` | TREBLE-show-features | | `AdCountdownTimer` | ad-countdown-timer | | `AdaptiveBitrate` | adaptive_bitrate | +| `AlbumTypes` | album-types | +| `AllowDvr` | allow_dvr | | `AmazonLoopDebug` | amazon-loop-debug | | `AvodAdAnalysis` | avod-ad-analysis | | `AvodNewMedia` | avod-new-media | | `BlacklistGetSignin` | blacklist_get_signin | +| `BoostVoices` | boost-voices | +| `CameraUpload` | camera_upload | | `ClientRadioStations` | client-radio-stations | | `CloudflareTurnstileRequired` | cloudflare-turnstile-required | +| `Cloudsync` | cloudsync | | `Collections` | collections | | `CommentsAndRepliesPushNotifications` | comments_and_replies_push_notifications | | `CommunityAccessPlexTv` | community_access_plex_tv | | `CompanionsSonos` | companions_sonos | +| `ContentFilter` | content_filter | | `CustomHomeRemoval` | custom-home-removal | | `DisableHomeUserFriendships` | disable_home_user_friendships | | `DisableSharingFriendships` | disable_sharing_friendships | +| `DownloadsGating` | downloads-gating | | `DrmSupport` | drm_support | +| `Dvr` | dvr | +| `DvrBlockUnsupportedCountries` | dvr-block-unsupported-countries | +| `EpgRecentChannels` | epg-recent-channels | | `ExcludeRestrictions` | exclude restrictions | | `FederatedAuth` | federated-auth | | `FriendRequestPushNotifications` | friend_request_push_notifications | +| `GrandfatherSync` | grandfather-sync | | `GuidedUpgrade` | guided-upgrade | +| `HardwareTranscoding` | hardware_transcoding | | `Home` | home | +| `Hwtranscode` | hwtranscode | +| `ImaggaV2` | imagga-v2 | | `IncreasePasswordComplexity` | increase-password-complexity | | `Ios14PrivacyBanner` | ios14-privacy-banner | | `IterableNotificationTokens` | iterable-notification-tokens | +| `ItemClusters` | item_clusters | | `KeepPaymentMethod` | keep-payment-method | | `KevinBacon` | kevin-bacon | | `KoreaConsent` | korea-consent | @@ -50,25 +67,47 @@ let value: PostUsersSignInDataAuthenticationFeatures = | `LightningDvrPivot` | lightning-dvr-pivot | | `LiveTvSupportIncompleteSegments` | live-tv-support-incomplete-segments | | `Livetv` | livetv | +| `Lyrics` | lyrics | | `MetadataSearch` | metadata_search | +| `MusicAnalysis` | music-analysis | +| `MusicVideos` | music_videos | | `NewPlexPassPrices` | new_plex_pass_prices | | `NewsProviderSunsetModal` | news-provider-sunset-modal | +| `Nominatim` | nominatim | +| `Pass` | pass | | `PhotosFavorites` | photos-favorites | | `PhotosMetadataEdition` | photos-metadata-edition | +| `PhotosV6Edit` | photosV6-edit | +| `PhotosV6TvAlbums` | photosV6-tv-albums | | `PmsHealth` | pms_health | +| `PremiumDashboard` | premium-dashboard | +| `PremiumMusicMetadata` | premium_music_metadata | | `Radio` | radio | | `RateLimitClientToken` | rate-limit-client-token | | `ScrobblingServicePlexTv` | scrobbling-service-plex-tv | +| `SessionBandwidthRestrictions` | session_bandwidth_restrictions | +| `SessionKick` | session_kick | | `SharedServerNotification` | shared_server_notification | | `SharedSourceNotification` | shared_source_notification | +| `SigninNotification` | signin_notification | | `SigninWithApple` | signin_with_apple | +| `SilenceRemoval` | silence-removal | +| `SleepTimer` | sleep-timer | | `SpringServeAdProvider` | spring_serve_ad_provider | +| `Sync` | sync | +| `SweetFades` | sweet-fades | | `TranscoderCache` | transcoder_cache | +| `Trailers` | trailers | | `TunerSharing` | tuner-sharing | | `TwoFactorAuthentication` | two-factor-authentication | | `Unsupportedtuners` | unsupportedtuners | | `Upgrade3ds2` | upgrade-3ds2 | +| `Visualizers` | visualizers | | `VodSchema` | vod-schema | | `VodCloudflare` | vod_cloudflare | +| `VolumeLeveling` | volume-leveling | | `WatchTogetherInvite` | watch-together-invite | -| `WebServerDashboard` | web_server_dashboard | \ No newline at end of file +| `WatchlistRss` | watchlist-rss | +| `WebServerDashboard` | web_server_dashboard | +| `Webhooks` | webhooks | +| - | `Unrecognized` | \ No newline at end of file diff --git a/docs/sdk/models/operations/postuserssignindataautoselectsubtitle.md b/docs/sdk/models/operations/postuserssignindataautoselectsubtitle.md index d07f5d74..d694d0cc 100644 --- a/docs/sdk/models/operations/postuserssignindataautoselectsubtitle.md +++ b/docs/sdk/models/operations/postuserssignindataautoselectsubtitle.md @@ -8,12 +8,12 @@ The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign aud import { PostUsersSignInDataAutoSelectSubtitle } from "@lukehagar/plexjs/sdk/models/operations"; let value: PostUsersSignInDataAutoSelectSubtitle = - PostUsersSignInDataAutoSelectSubtitle.One; + PostUsersSignInDataAutoSelectSubtitle.Enable; ``` ## Values -| Name | Value | -| ------ | ------ | -| `Zero` | 0 | -| `One` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/postuserssignindatadefaultsubtitleaccessibility.md b/docs/sdk/models/operations/postuserssignindatadefaultsubtitleaccessibility.md index 393dda67..4fea1fbe 100644 --- a/docs/sdk/models/operations/postuserssignindatadefaultsubtitleaccessibility.md +++ b/docs/sdk/models/operations/postuserssignindatadefaultsubtitleaccessibility.md @@ -1,6 +1,6 @@ # PostUsersSignInDataDefaultSubtitleAccessibility -The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles) +The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only show non-SDH subtitles) ## Example Usage @@ -8,12 +8,12 @@ The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer no import { PostUsersSignInDataDefaultSubtitleAccessibility } from "@lukehagar/plexjs/sdk/models/operations"; let value: PostUsersSignInDataDefaultSubtitleAccessibility = - PostUsersSignInDataDefaultSubtitleAccessibility.One; + PostUsersSignInDataDefaultSubtitleAccessibility.Enable; ``` ## Values -| Name | Value | -| ------ | ------ | -| `Zero` | 0 | -| `One` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/postuserssignindatadefaultsubtitleforced.md b/docs/sdk/models/operations/postuserssignindatadefaultsubtitleforced.md index 6fbdf5d9..790d4a95 100644 --- a/docs/sdk/models/operations/postuserssignindatadefaultsubtitleforced.md +++ b/docs/sdk/models/operations/postuserssignindatadefaultsubtitleforced.md @@ -8,12 +8,12 @@ The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer import { PostUsersSignInDataDefaultSubtitleForced } from "@lukehagar/plexjs/sdk/models/operations"; let value: PostUsersSignInDataDefaultSubtitleForced = - PostUsersSignInDataDefaultSubtitleForced.Zero; + PostUsersSignInDataDefaultSubtitleForced.Enable; ``` ## Values -| Name | Value | -| ------ | ------ | -| `Zero` | 0 | -| `One` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/postuserssignindatafeatures.md b/docs/sdk/models/operations/postuserssignindatafeatures.md index 118ed52e..ed39468e 100644 --- a/docs/sdk/models/operations/postuserssignindatafeatures.md +++ b/docs/sdk/models/operations/postuserssignindatafeatures.md @@ -6,11 +6,13 @@ import { PostUsersSignInDataFeatures } from "@lukehagar/plexjs/sdk/models/operations"; let value: PostUsersSignInDataFeatures = - PostUsersSignInDataFeatures.DisableHomeUserFriendships; + PostUsersSignInDataFeatures.CommunityAccessPlexTv; ``` ## Values +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + | Name | Value | | --------------------------------------- | --------------------------------------- | | `AndroidDolbyVision` | Android - Dolby Vision | @@ -20,28 +22,43 @@ let value: PostUsersSignInDataFeatures = | `TREBLEShowFeatures` | TREBLE-show-features | | `AdCountdownTimer` | ad-countdown-timer | | `AdaptiveBitrate` | adaptive_bitrate | +| `AlbumTypes` | album-types | +| `AllowDvr` | allow_dvr | | `AmazonLoopDebug` | amazon-loop-debug | | `AvodAdAnalysis` | avod-ad-analysis | | `AvodNewMedia` | avod-new-media | | `BlacklistGetSignin` | blacklist_get_signin | +| `BoostVoices` | boost-voices | +| `CameraUpload` | camera_upload | | `ClientRadioStations` | client-radio-stations | | `CloudflareTurnstileRequired` | cloudflare-turnstile-required | +| `Cloudsync` | cloudsync | | `Collections` | collections | | `CommentsAndRepliesPushNotifications` | comments_and_replies_push_notifications | | `CommunityAccessPlexTv` | community_access_plex_tv | | `CompanionsSonos` | companions_sonos | +| `ContentFilter` | content_filter | | `CustomHomeRemoval` | custom-home-removal | | `DisableHomeUserFriendships` | disable_home_user_friendships | | `DisableSharingFriendships` | disable_sharing_friendships | +| `DownloadsGating` | downloads-gating | | `DrmSupport` | drm_support | +| `Dvr` | dvr | +| `DvrBlockUnsupportedCountries` | dvr-block-unsupported-countries | +| `EpgRecentChannels` | epg-recent-channels | | `ExcludeRestrictions` | exclude restrictions | | `FederatedAuth` | federated-auth | | `FriendRequestPushNotifications` | friend_request_push_notifications | +| `GrandfatherSync` | grandfather-sync | | `GuidedUpgrade` | guided-upgrade | +| `HardwareTranscoding` | hardware_transcoding | | `Home` | home | +| `Hwtranscode` | hwtranscode | +| `ImaggaV2` | imagga-v2 | | `IncreasePasswordComplexity` | increase-password-complexity | | `Ios14PrivacyBanner` | ios14-privacy-banner | | `IterableNotificationTokens` | iterable-notification-tokens | +| `ItemClusters` | item_clusters | | `KeepPaymentMethod` | keep-payment-method | | `KevinBacon` | kevin-bacon | | `KoreaConsent` | korea-consent | @@ -50,25 +67,47 @@ let value: PostUsersSignInDataFeatures = | `LightningDvrPivot` | lightning-dvr-pivot | | `LiveTvSupportIncompleteSegments` | live-tv-support-incomplete-segments | | `Livetv` | livetv | +| `Lyrics` | lyrics | | `MetadataSearch` | metadata_search | +| `MusicAnalysis` | music-analysis | +| `MusicVideos` | music_videos | | `NewPlexPassPrices` | new_plex_pass_prices | | `NewsProviderSunsetModal` | news-provider-sunset-modal | +| `Nominatim` | nominatim | +| `Pass` | pass | | `PhotosFavorites` | photos-favorites | | `PhotosMetadataEdition` | photos-metadata-edition | +| `PhotosV6Edit` | photosV6-edit | +| `PhotosV6TvAlbums` | photosV6-tv-albums | | `PmsHealth` | pms_health | +| `PremiumDashboard` | premium-dashboard | +| `PremiumMusicMetadata` | premium_music_metadata | | `Radio` | radio | | `RateLimitClientToken` | rate-limit-client-token | | `ScrobblingServicePlexTv` | scrobbling-service-plex-tv | +| `SessionBandwidthRestrictions` | session_bandwidth_restrictions | +| `SessionKick` | session_kick | | `SharedServerNotification` | shared_server_notification | | `SharedSourceNotification` | shared_source_notification | +| `SigninNotification` | signin_notification | | `SigninWithApple` | signin_with_apple | +| `SilenceRemoval` | silence-removal | +| `SleepTimer` | sleep-timer | | `SpringServeAdProvider` | spring_serve_ad_provider | +| `Sync` | sync | +| `SweetFades` | sweet-fades | | `TranscoderCache` | transcoder_cache | +| `Trailers` | trailers | | `TunerSharing` | tuner-sharing | | `TwoFactorAuthentication` | two-factor-authentication | | `Unsupportedtuners` | unsupportedtuners | | `Upgrade3ds2` | upgrade-3ds2 | +| `Visualizers` | visualizers | | `VodSchema` | vod-schema | | `VodCloudflare` | vod_cloudflare | +| `VolumeLeveling` | volume-leveling | | `WatchTogetherInvite` | watch-together-invite | -| `WebServerDashboard` | web_server_dashboard | \ No newline at end of file +| `WatchlistRss` | watchlist-rss | +| `WebServerDashboard` | web_server_dashboard | +| `Webhooks` | webhooks | +| - | `Unrecognized` | \ No newline at end of file diff --git a/docs/sdk/models/operations/postuserssignindataglobals.md b/docs/sdk/models/operations/postuserssignindataglobals.md index f60c8c1f..cfe5cc0d 100644 --- a/docs/sdk/models/operations/postuserssignindataglobals.md +++ b/docs/sdk/models/operations/postuserssignindataglobals.md @@ -10,6 +10,10 @@ let value: PostUsersSignInDataGlobals = {}; ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `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)
| gcgzw5rz2xovp84b4vha3a40 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `clientID` | *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) | gcgzw5rz2xovp84b4vha3a40 | +| `clientName` | *string* | :heavy_minus_sign: | N/A | Plex Web | +| `deviceName` | *string* | :heavy_minus_sign: | N/A | Linux | +| `clientVersion` | *string* | :heavy_minus_sign: | N/A | 4.133.0 | +| `clientPlatform` | *string* | :heavy_minus_sign: | N/A | Chrome | \ No newline at end of file diff --git a/docs/sdk/models/operations/postuserssignindatamailingliststatus.md b/docs/sdk/models/operations/postuserssignindatamailingliststatus.md index feffaa19..93aecfc7 100644 --- a/docs/sdk/models/operations/postuserssignindatamailingliststatus.md +++ b/docs/sdk/models/operations/postuserssignindatamailingliststatus.md @@ -1,6 +1,6 @@ # PostUsersSignInDataMailingListStatus -Your current mailing list status +Your current mailing list status (active or unsubscribed) ## Example Usage diff --git a/docs/sdk/models/operations/postuserssignindatamediareviewsvisibility.md b/docs/sdk/models/operations/postuserssignindatamediareviewsvisibility.md index 0922c8d2..6a222670 100644 --- a/docs/sdk/models/operations/postuserssignindatamediareviewsvisibility.md +++ b/docs/sdk/models/operations/postuserssignindatamediareviewsvisibility.md @@ -1,17 +1,19 @@ # PostUsersSignInDataMediaReviewsVisibility +Whether or not the account has media reviews visibility enabled + ## Example Usage ```typescript import { PostUsersSignInDataMediaReviewsVisibility } from "@lukehagar/plexjs/sdk/models/operations"; let value: PostUsersSignInDataMediaReviewsVisibility = - PostUsersSignInDataMediaReviewsVisibility.Zero; + PostUsersSignInDataMediaReviewsVisibility.Enable; ``` ## Values -| Name | Value | -| ------ | ------ | -| `Zero` | 0 | -| `One` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/postuserssignindatarequest.md b/docs/sdk/models/operations/postuserssignindatarequest.md index b67d34ae..6922e29f 100644 --- a/docs/sdk/models/operations/postuserssignindatarequest.md +++ b/docs/sdk/models/operations/postuserssignindatarequest.md @@ -16,7 +16,11 @@ let value: PostUsersSignInDataRequest = { ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `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)
| gcgzw5rz2xovp84b4vha3a40 | -| `requestBody` | [operations.PostUsersSignInDataRequestBody](../../../sdk/models/operations/postuserssignindatarequestbody.md) | :heavy_minus_sign: | Login credentials | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `clientID` | *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) | gcgzw5rz2xovp84b4vha3a40 | +| `clientName` | *string* | :heavy_minus_sign: | N/A | Plex Web | +| `deviceName` | *string* | :heavy_minus_sign: | N/A | Linux | +| `clientVersion` | *string* | :heavy_minus_sign: | N/A | 4.133.0 | +| `clientPlatform` | *string* | :heavy_minus_sign: | N/A | Chrome | +| `requestBody` | [operations.PostUsersSignInDataRequestBody](../../../sdk/models/operations/postuserssignindatarequestbody.md) | :heavy_minus_sign: | Login credentials | | \ No newline at end of file diff --git a/docs/sdk/models/operations/postuserssignindataresponse.md b/docs/sdk/models/operations/postuserssignindataresponse.md index e5c7d36d..a20d7e0b 100644 --- a/docs/sdk/models/operations/postuserssignindataresponse.md +++ b/docs/sdk/models/operations/postuserssignindataresponse.md @@ -21,7 +21,7 @@ import { let value: PostUsersSignInDataResponse = { contentType: "", - statusCode: 566602, + statusCode: 100, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), @@ -50,19 +50,19 @@ let value: PostUsersSignInDataResponse = { joinedAt: 1721154902, locale: null, mailingListActive: false, - mailingListStatus: PostUsersSignInDataMailingListStatus.Unsubscribed, + mailingListStatus: PostUsersSignInDataMailingListStatus.Active, maxHomeSize: 15, pin: "string", profile: { autoSelectAudio: true, defaultAudioLanguage: "ja", defaultSubtitleLanguage: "en", - autoSelectSubtitle: PostUsersSignInDataAutoSelectSubtitle.One, + autoSelectSubtitle: PostUsersSignInDataAutoSelectSubtitle.Enable, defaultSubtitleAccessibility: - PostUsersSignInDataDefaultSubtitleAccessibility.One, - defaultSubtitleForced: PostUsersSignInDataDefaultSubtitleForced.Zero, - watchedIndicator: PostUsersSignInDataWatchedIndicator.One, - mediaReviewsVisibility: PostUsersSignInDataMediaReviewsVisibility.One, + PostUsersSignInDataDefaultSubtitleAccessibility.Enable, + defaultSubtitleForced: PostUsersSignInDataDefaultSubtitleForced.Enable, + watchedIndicator: PostUsersSignInDataWatchedIndicator.Enable, + mediaReviewsVisibility: PostUsersSignInDataMediaReviewsVisibility.Enable, }, protected: false, rememberExpiresAt: 1722364046, @@ -108,6 +108,7 @@ let value: PostUsersSignInDataResponse = { twoFactorEnabled: false, username: "Username", uuid: "dae343c1f45beb4f", + attributionPartner: null, pastSubscriptions: [ { id: "string", @@ -126,7 +127,7 @@ let value: PostUsersSignInDataResponse = { state: PostUsersSignInDataState.Ended, billing: { internalPaymentMethod: {}, - paymentMethodId: 523248, + paymentMethodId: 374170, }, }, ], diff --git a/docs/sdk/models/operations/postuserssignindatauserplexaccount.md b/docs/sdk/models/operations/postuserssignindatauserplexaccount.md index d2da938e..d76a880a 100644 --- a/docs/sdk/models/operations/postuserssignindatauserplexaccount.md +++ b/docs/sdk/models/operations/postuserssignindatauserplexaccount.md @@ -53,12 +53,12 @@ let value: PostUsersSignInDataUserPlexAccount = { autoSelectAudio: true, defaultAudioLanguage: "ja", defaultSubtitleLanguage: "en", - autoSelectSubtitle: PostUsersSignInDataAutoSelectSubtitle.One, + autoSelectSubtitle: PostUsersSignInDataAutoSelectSubtitle.Enable, defaultSubtitleAccessibility: - PostUsersSignInDataDefaultSubtitleAccessibility.One, - defaultSubtitleForced: PostUsersSignInDataDefaultSubtitleForced.Zero, - watchedIndicator: PostUsersSignInDataWatchedIndicator.One, - mediaReviewsVisibility: PostUsersSignInDataMediaReviewsVisibility.One, + PostUsersSignInDataDefaultSubtitleAccessibility.Enable, + defaultSubtitleForced: PostUsersSignInDataDefaultSubtitleForced.Enable, + watchedIndicator: PostUsersSignInDataWatchedIndicator.Enable, + mediaReviewsVisibility: PostUsersSignInDataMediaReviewsVisibility.Enable, }, protected: false, rememberExpiresAt: 1722364046, @@ -104,6 +104,7 @@ let value: PostUsersSignInDataUserPlexAccount = { twoFactorEnabled: false, username: "Username", uuid: "dae343c1f45beb4f", + attributionPartner: null, pastSubscriptions: [ { id: "string", @@ -122,7 +123,7 @@ let value: PostUsersSignInDataUserPlexAccount = { state: PostUsersSignInDataState.Ended, billing: { internalPaymentMethod: {}, - paymentMethodId: 565189, + paymentMethodId: 518201, }, }, ], @@ -155,15 +156,15 @@ let value: PostUsersSignInDataUserPlexAccount = { | `homeAdmin` | *boolean* | :heavy_minus_sign: | If the account is the Plex Home admin | | | `homeSize` | *number* | :heavy_check_mark: | The number of accounts in the Plex Home | 1 | | `id` | *number* | :heavy_check_mark: | The Plex account ID | 13692262 | -| `joinedAt` | *number* | :heavy_check_mark: | Unix epoch datetime | 1556281940 | +| `joinedAt` | *number* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | | `locale` | *string* | :heavy_check_mark: | The account locale | | | `mailingListActive` | *boolean* | :heavy_minus_sign: | If you are subscribed to the Plex newsletter | | -| `mailingListStatus` | [operations.PostUsersSignInDataMailingListStatus](../../../sdk/models/operations/postuserssignindatamailingliststatus.md) | :heavy_check_mark: | Your current mailing list status | | +| `mailingListStatus` | [operations.PostUsersSignInDataMailingListStatus](../../../sdk/models/operations/postuserssignindatamailingliststatus.md) | :heavy_check_mark: | Your current mailing list status (active or unsubscribed) | active | | `maxHomeSize` | *number* | :heavy_check_mark: | The maximum number of accounts allowed in the Plex Home | 15 | | ~~`pin`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

[Might be removed] The hashed Plex Home PIN | | | `profile` | [operations.PostUsersSignInDataUserProfile](../../../sdk/models/operations/postuserssignindatauserprofile.md) | :heavy_check_mark: | N/A | | | `protected` | *boolean* | :heavy_minus_sign: | If the account has a Plex Home PIN enabled | | -| `rememberExpiresAt` | *number* | :heavy_check_mark: | Unix epoch datetime | 1556281940 | +| `rememberExpiresAt` | *number* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 | | `restricted` | *boolean* | :heavy_minus_sign: | If the account is a Plex Home managed user | | | `roles` | *string*[] | :heavy_minus_sign: | [Might be removed] List of account roles. Plexpass membership listed here | | | `scrobbleTypes` | *string* | :heavy_check_mark: | Unknown | | @@ -176,5 +177,6 @@ let value: PostUsersSignInDataUserPlexAccount = { | `twoFactorEnabled` | *boolean* | :heavy_minus_sign: | If two-factor authentication is enabled | | | `username` | *string* | :heavy_check_mark: | The account username | Username | | `uuid` | *string* | :heavy_check_mark: | The account UUID | dae343c1f45beb4f | +| `attributionPartner` | *string* | :heavy_check_mark: | N/A | | | `pastSubscriptions` | [operations.PastSubscription](../../../sdk/models/operations/pastsubscription.md)[] | :heavy_check_mark: | N/A | | | `trials` | [operations.Trials](../../../sdk/models/operations/trials.md)[] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/postuserssignindatauserprofile.md b/docs/sdk/models/operations/postuserssignindatauserprofile.md index 0c5ccb7f..87c88fc1 100644 --- a/docs/sdk/models/operations/postuserssignindatauserprofile.md +++ b/docs/sdk/models/operations/postuserssignindatauserprofile.md @@ -16,24 +16,24 @@ let value: PostUsersSignInDataUserProfile = { autoSelectAudio: true, defaultAudioLanguage: "ja", defaultSubtitleLanguage: "en", - autoSelectSubtitle: PostUsersSignInDataAutoSelectSubtitle.One, + autoSelectSubtitle: PostUsersSignInDataAutoSelectSubtitle.Enable, defaultSubtitleAccessibility: - PostUsersSignInDataDefaultSubtitleAccessibility.One, - defaultSubtitleForced: PostUsersSignInDataDefaultSubtitleForced.Zero, - watchedIndicator: PostUsersSignInDataWatchedIndicator.One, - mediaReviewsVisibility: PostUsersSignInDataMediaReviewsVisibility.One, + PostUsersSignInDataDefaultSubtitleAccessibility.Enable, + defaultSubtitleForced: PostUsersSignInDataDefaultSubtitleForced.Enable, + watchedIndicator: PostUsersSignInDataWatchedIndicator.Enable, + mediaReviewsVisibility: PostUsersSignInDataMediaReviewsVisibility.Enable, }; ``` ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `autoSelectAudio` | *boolean* | :heavy_minus_sign: | If the account has automatically select audio and subtitle tracks enabled | true | -| `defaultAudioLanguage` | *string* | :heavy_check_mark: | The preferred audio language for the account | ja | -| `defaultSubtitleLanguage` | *string* | :heavy_check_mark: | The preferred subtitle language for the account | en | -| `autoSelectSubtitle` | [operations.PostUsersSignInDataAutoSelectSubtitle](../../../sdk/models/operations/postuserssignindataautoselectsubtitle.md) | :heavy_minus_sign: | The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) | 1 | -| `defaultSubtitleAccessibility` | [operations.PostUsersSignInDataDefaultSubtitleAccessibility](../../../sdk/models/operations/postuserssignindatadefaultsubtitleaccessibility.md) | :heavy_minus_sign: | The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles) | 1 | -| `defaultSubtitleForced` | [operations.PostUsersSignInDataDefaultSubtitleForced](../../../sdk/models/operations/postuserssignindatadefaultsubtitleforced.md) | :heavy_minus_sign: | The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles) | 0 | -| `watchedIndicator` | [operations.PostUsersSignInDataWatchedIndicator](../../../sdk/models/operations/postuserssignindatawatchedindicator.md) | :heavy_minus_sign: | N/A | 1 | -| `mediaReviewsVisibility` | [operations.PostUsersSignInDataMediaReviewsVisibility](../../../sdk/models/operations/postuserssignindatamediareviewsvisibility.md) | :heavy_minus_sign: | N/A | 0 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| `autoSelectAudio` | *boolean* | :heavy_minus_sign: | If the account has automatically select audio and subtitle tracks enabled | true | +| `defaultAudioLanguage` | *string* | :heavy_check_mark: | The preferred audio language for the account | ja | +| `defaultSubtitleLanguage` | *string* | :heavy_check_mark: | The preferred subtitle language for the account | en | +| `autoSelectSubtitle` | [operations.PostUsersSignInDataAutoSelectSubtitle](../../../sdk/models/operations/postuserssignindataautoselectsubtitle.md) | :heavy_minus_sign: | N/A | 1 | +| `defaultSubtitleAccessibility` | [operations.PostUsersSignInDataDefaultSubtitleAccessibility](../../../sdk/models/operations/postuserssignindatadefaultsubtitleaccessibility.md) | :heavy_minus_sign: | N/A | 1 | +| `defaultSubtitleForced` | [operations.PostUsersSignInDataDefaultSubtitleForced](../../../sdk/models/operations/postuserssignindatadefaultsubtitleforced.md) | :heavy_minus_sign: | N/A | 1 | +| `watchedIndicator` | [operations.PostUsersSignInDataWatchedIndicator](../../../sdk/models/operations/postuserssignindatawatchedindicator.md) | :heavy_minus_sign: | N/A | 1 | +| `mediaReviewsVisibility` | [operations.PostUsersSignInDataMediaReviewsVisibility](../../../sdk/models/operations/postuserssignindatamediareviewsvisibility.md) | :heavy_minus_sign: | N/A | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/postuserssignindatawatchedindicator.md b/docs/sdk/models/operations/postuserssignindatawatchedindicator.md index 54d74e9f..fbaf4d1b 100644 --- a/docs/sdk/models/operations/postuserssignindatawatchedindicator.md +++ b/docs/sdk/models/operations/postuserssignindatawatchedindicator.md @@ -1,17 +1,19 @@ # PostUsersSignInDataWatchedIndicator +Whether or not media watched indicators are enabled (little orange dot on media) + ## Example Usage ```typescript import { PostUsersSignInDataWatchedIndicator } from "@lukehagar/plexjs/sdk/models/operations"; let value: PostUsersSignInDataWatchedIndicator = - PostUsersSignInDataWatchedIndicator.One; + PostUsersSignInDataWatchedIndicator.Enable; ``` ## Values -| Name | Value | -| ------ | ------ | -| `Zero` | 0 | -| `One` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/protocol.md b/docs/sdk/models/operations/protocol.md new file mode 100644 index 00000000..02a9c95c --- /dev/null +++ b/docs/sdk/models/operations/protocol.md @@ -0,0 +1,18 @@ +# Protocol + +The protocol used for the connection (http, https, etc) + +## Example Usage + +```typescript +import { Protocol } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: Protocol = Protocol.Http; +``` + +## Values + +| Name | Value | +| ------- | ------- | +| `Http` | http | +| `Https` | https | \ No newline at end of file diff --git a/docs/sdk/models/operations/queryparamforce.md b/docs/sdk/models/operations/queryparamforce.md index a105e3bd..2fbceaab 100644 --- a/docs/sdk/models/operations/queryparamforce.md +++ b/docs/sdk/models/operations/queryparamforce.md @@ -11,7 +11,7 @@ If the `force` argument is set to 0, a new playlist will be created suffixed wit ```typescript import { QueryParamForce } from "@lukehagar/plexjs/sdk/models/operations"; -let value: QueryParamForce = QueryParamForce.Zero; +let value: QueryParamForce = QueryParamForce.One; ``` ## Values diff --git a/docs/sdk/models/operations/queryparamincludemeta.md b/docs/sdk/models/operations/queryparamincludemeta.md new file mode 100644 index 00000000..3e59c78a --- /dev/null +++ b/docs/sdk/models/operations/queryparamincludemeta.md @@ -0,0 +1,19 @@ +# QueryParamIncludeMeta + +Adds the Meta object to the response + + +## Example Usage + +```typescript +import { QueryParamIncludeMeta } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: QueryParamIncludeMeta = QueryParamIncludeMeta.Enable; +``` + +## Values + +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/queryparamonlytransient.md b/docs/sdk/models/operations/queryparamonlytransient.md index 7741ec6b..fb6039e8 100644 --- a/docs/sdk/models/operations/queryparamonlytransient.md +++ b/docs/sdk/models/operations/queryparamonlytransient.md @@ -7,7 +7,7 @@ Only return hubs which are "transient", meaning those which are prone to changin ```typescript import { QueryParamOnlyTransient } from "@lukehagar/plexjs/sdk/models/operations"; -let value: QueryParamOnlyTransient = QueryParamOnlyTransient.One; +let value: QueryParamOnlyTransient = QueryParamOnlyTransient.Zero; ``` ## Values diff --git a/docs/sdk/models/operations/queryparamtype.md b/docs/sdk/models/operations/queryparamtype.md index 1d7e46c2..57d6d98b 100644 --- a/docs/sdk/models/operations/queryparamtype.md +++ b/docs/sdk/models/operations/queryparamtype.md @@ -13,14 +13,14 @@ E.g. A movie library will not return anything with type 3 as there are no season ```typescript import { QueryParamType } from "@lukehagar/plexjs/sdk/models/operations"; -let value: QueryParamType = QueryParamType.Two; +let value: QueryParamType = QueryParamType.TvShow; ``` ## Values -| Name | Value | -| ------- | ------- | -| `One` | 1 | -| `Two` | 2 | -| `Three` | 3 | -| `Four` | 4 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Movie` | 1 | +| `TvShow` | 2 | +| `Season` | 3 | +| `Episode` | 4 | \ No newline at end of file diff --git a/docs/sdk/models/operations/role.md b/docs/sdk/models/operations/role.md index 9eadc353..05624010 100644 --- a/docs/sdk/models/operations/role.md +++ b/docs/sdk/models/operations/role.md @@ -6,12 +6,23 @@ import { Role } from "@lukehagar/plexjs/sdk/models/operations"; let value: Role = { - tag: "Paul Rudd", + id: 294129, + filter: "actor=294129", + thumb: + "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", + tag: "Mike Smith", + tagKey: "668e7e7b22bcad9064350c91", + role: "Self", }; ``` ## Fields -| Field | Type | Required | Description | Example | -| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `tag` | *string* | :heavy_minus_sign: | N/A | Paul Rudd | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `id` | *number* | :heavy_minus_sign: | The ID of the tag or actor. | 294129 | +| `filter` | *string* | :heavy_minus_sign: | The filter used to find the actor or tag. | actor=294129 | +| `thumb` | *string* | :heavy_minus_sign: | The thumbnail of the actor | https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg | +| `tag` | *string* | :heavy_minus_sign: | The name of the tag or actor. | Mike Smith | +| `tagKey` | *string* | :heavy_minus_sign: | Unique identifier for the tag. | 668e7e7b22bcad9064350c91 | +| `role` | *string* | :heavy_minus_sign: | The role of the actor or tag in the media. | Self | \ No newline at end of file diff --git a/docs/sdk/models/operations/showordering.md b/docs/sdk/models/operations/showordering.md new file mode 100644 index 00000000..3c1d23e7 --- /dev/null +++ b/docs/sdk/models/operations/showordering.md @@ -0,0 +1,27 @@ +# ShowOrdering + +Setting that indicates the episode ordering for the show +None = Library default, +tmdbAiring = The Movie Database (Aired), +aired = TheTVDB (Aired), +dvd = TheTVDB (DVD), +absolute = TheTVDB (Absolute)). + + +## Example Usage + +```typescript +import { ShowOrdering } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: ShowOrdering = ShowOrdering.Dvd; +``` + +## Values + +| Name | Value | +| ------------ | ------------ | +| `None` | None | +| `TmdbAiring` | tmdbAiring | +| `Aired` | aired | +| `Dvd` | dvd | +| `Absolute` | absolute | \ No newline at end of file diff --git a/docs/sdk/models/operations/sort.md b/docs/sdk/models/operations/sort.md index 09666a4b..e1d59fd1 100644 --- a/docs/sdk/models/operations/sort.md +++ b/docs/sdk/models/operations/sort.md @@ -3,25 +3,29 @@ ## Example Usage ```typescript -import { Sort } from "@lukehagar/plexjs/sdk/models/operations"; +import { ActiveDirection, DefaultDirection, Sort } from "@lukehagar/plexjs/sdk/models/operations"; let value: Sort = { default: "asc", - defaultDirection: "desc", - descKey: "random:desc", - firstCharacterKey: "/library/sections/1/firstCharacter", - key: "random", - title: "Randomly", + active: false, + activeDirection: ActiveDirection.Ascending, + defaultDirection: DefaultDirection.Ascending, + descKey: "titleSort:desc", + firstCharacterKey: "/library/sections/2/firstCharacter", + key: "titleSort", + title: "Title", }; ``` ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | -| `default` | *string* | :heavy_minus_sign: | N/A | asc | -| `defaultDirection` | *string* | :heavy_minus_sign: | N/A | desc | -| `descKey` | *string* | :heavy_minus_sign: | N/A | random:desc | -| `firstCharacterKey` | *string* | :heavy_minus_sign: | N/A | /library/sections/1/firstCharacter | -| `key` | *string* | :heavy_minus_sign: | N/A | random | -| `title` | *string* | :heavy_minus_sign: | N/A | Randomly | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `default` | *string* | :heavy_minus_sign: | N/A | asc | +| `active` | *boolean* | :heavy_minus_sign: | N/A | false | +| `activeDirection` | [operations.ActiveDirection](../../../sdk/models/operations/activedirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.
| asc | +| `defaultDirection` | [operations.DefaultDirection](../../../sdk/models/operations/defaultdirection.md) | :heavy_minus_sign: | The direction of the sort. Can be either `asc` or `desc`.
| asc | +| `descKey` | *string* | :heavy_minus_sign: | N/A | titleSort:desc | +| `firstCharacterKey` | *string* | :heavy_minus_sign: | N/A | /library/sections/2/firstCharacter | +| `key` | *string* | :heavy_check_mark: | N/A | titleSort | +| `title` | *string* | :heavy_check_mark: | N/A | Title | \ No newline at end of file diff --git a/docs/sdk/models/operations/startalltasksresponse.md b/docs/sdk/models/operations/startalltasksresponse.md index e4c95504..683e9599 100644 --- a/docs/sdk/models/operations/startalltasksresponse.md +++ b/docs/sdk/models/operations/startalltasksresponse.md @@ -7,7 +7,7 @@ import { StartAllTasksResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: StartAllTasksResponse = { contentType: "", - statusCode: 479977, + statusCode: 410, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/starttaskrequest.md b/docs/sdk/models/operations/starttaskrequest.md index 8ecf870d..b299f1fe 100644 --- a/docs/sdk/models/operations/starttaskrequest.md +++ b/docs/sdk/models/operations/starttaskrequest.md @@ -6,7 +6,7 @@ import { StartTaskRequest, TaskName } from "@lukehagar/plexjs/sdk/models/operations"; let value: StartTaskRequest = { - taskName: TaskName.RefreshPeriodicMetadata, + taskName: TaskName.OptimizeDatabase, }; ``` diff --git a/docs/sdk/models/operations/starttaskresponse.md b/docs/sdk/models/operations/starttaskresponse.md index 70e61062..a40ec5e9 100644 --- a/docs/sdk/models/operations/starttaskresponse.md +++ b/docs/sdk/models/operations/starttaskresponse.md @@ -7,7 +7,7 @@ import { StartTaskResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: StartTaskResponse = { contentType: "", - statusCode: 836079, + statusCode: 406, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/startuniversaltranscoderesponse.md b/docs/sdk/models/operations/startuniversaltranscoderesponse.md index 40b91bfc..acaf0914 100644 --- a/docs/sdk/models/operations/startuniversaltranscoderesponse.md +++ b/docs/sdk/models/operations/startuniversaltranscoderesponse.md @@ -7,7 +7,7 @@ import { StartUniversalTranscodeResponse } from "@lukehagar/plexjs/sdk/models/op let value: StartUniversalTranscodeResponse = { contentType: "", - statusCode: 477665, + statusCode: 413, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/stopalltasksresponse.md b/docs/sdk/models/operations/stopalltasksresponse.md index cf4a954c..0583b68f 100644 --- a/docs/sdk/models/operations/stopalltasksresponse.md +++ b/docs/sdk/models/operations/stopalltasksresponse.md @@ -7,7 +7,7 @@ import { StopAllTasksResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: StopAllTasksResponse = { contentType: "", - statusCode: 568045, + statusCode: 306, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/stoptaskresponse.md b/docs/sdk/models/operations/stoptaskresponse.md index e13d00d7..21151add 100644 --- a/docs/sdk/models/operations/stoptaskresponse.md +++ b/docs/sdk/models/operations/stoptaskresponse.md @@ -7,7 +7,7 @@ import { StopTaskResponse } from "@lukehagar/plexjs/sdk/models/operations"; let value: StopTaskResponse = { contentType: "", - statusCode: 87129, + statusCode: 205, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/stoptranscodesessionresponse.md b/docs/sdk/models/operations/stoptranscodesessionresponse.md index 84ebee88..cc636e68 100644 --- a/docs/sdk/models/operations/stoptranscodesessionresponse.md +++ b/docs/sdk/models/operations/stoptranscodesessionresponse.md @@ -7,7 +7,7 @@ import { StopTranscodeSessionResponse } from "@lukehagar/plexjs/sdk/models/opera let value: StopTranscodeSessionResponse = { contentType: "", - statusCode: 277718, + statusCode: 303, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/stream.md b/docs/sdk/models/operations/stream.md index 2fc68607..679240d1 100644 --- a/docs/sdk/models/operations/stream.md +++ b/docs/sdk/models/operations/stream.md @@ -6,74 +6,86 @@ import { Stream } from "@lukehagar/plexjs/sdk/models/operations"; let value: Stream = { - id: 29, - streamType: 2, + id: 272796, + streamType: 1, default: true, - codec: "aac", + selected: true, + codec: "h264", index: 0, - bitrate: 128, - bitDepth: 8, - chromaLocation: "left", - chromaSubsampling: "14520", - codedHeight: 816, - codedWidth: 1920, + bitrate: 6273, colorPrimaries: "bt709", colorRange: "tv", colorSpace: "bt709", colorTrc: "bt709", - frameRate: 24, + bitDepth: 8, + chromaLocation: "left", + streamIdentifier: "2", + chromaSubsampling: "4:2:0", + codedHeight: 1088, + codedWidth: 1920, + frameRate: 29.97, hasScalingMatrix: false, - height: 814, + hearingImpaired: false, + closedCaptions: false, + embeddedInVideo: "1", + height: 1080, level: 40, - profile: "lc", + profile: "main", refFrames: 4, scanType: "progressive", - streamIdentifier: "1", width: 1920, - displayTitle: "English (AAC Stereo)", - extendedDisplayTitle: "English (AAC Stereo)", - selected: true, + displayTitle: "1080p (H.264)", + extendedDisplayTitle: "1080p (H.264)", channels: 2, language: "English", languageTag: "en", languageCode: "eng", - samplingRate: 44100, + audioChannelLayout: "stereo", + samplingRate: 48000, + title: "English", + canAutoSync: false, }; ``` ## Fields -| Field | Type | Required | Description | Example | -| ---------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- | -| `id` | *number* | :heavy_minus_sign: | N/A | 29 | -| `streamType` | *number* | :heavy_minus_sign: | N/A | 2 | -| `default` | *boolean* | :heavy_minus_sign: | N/A | true | -| `codec` | *string* | :heavy_minus_sign: | N/A | aac | -| `index` | *number* | :heavy_minus_sign: | N/A | 0 | -| `bitrate` | *number* | :heavy_minus_sign: | N/A | 128 | -| `bitDepth` | *number* | :heavy_minus_sign: | N/A | 8 | -| `chromaLocation` | *string* | :heavy_minus_sign: | N/A | left | -| `chromaSubsampling` | *string* | :heavy_minus_sign: | N/A | 14520 | -| `codedHeight` | *number* | :heavy_minus_sign: | N/A | 816 | -| `codedWidth` | *number* | :heavy_minus_sign: | N/A | 1920 | -| `colorPrimaries` | *string* | :heavy_minus_sign: | N/A | bt709 | -| `colorRange` | *string* | :heavy_minus_sign: | N/A | tv | -| `colorSpace` | *string* | :heavy_minus_sign: | N/A | bt709 | -| `colorTrc` | *string* | :heavy_minus_sign: | N/A | bt709 | -| `frameRate` | *number* | :heavy_minus_sign: | N/A | 24 | -| `hasScalingMatrix` | *boolean* | :heavy_minus_sign: | N/A | false | -| `height` | *number* | :heavy_minus_sign: | N/A | 814 | -| `level` | *number* | :heavy_minus_sign: | N/A | 40 | -| `profile` | *string* | :heavy_minus_sign: | N/A | lc | -| `refFrames` | *number* | :heavy_minus_sign: | N/A | 4 | -| `scanType` | *string* | :heavy_minus_sign: | N/A | progressive | -| `streamIdentifier` | *string* | :heavy_minus_sign: | N/A | 1 | -| `width` | *number* | :heavy_minus_sign: | N/A | 1920 | -| `displayTitle` | *string* | :heavy_minus_sign: | N/A | English (AAC Stereo) | -| `extendedDisplayTitle` | *string* | :heavy_minus_sign: | N/A | English (AAC Stereo) | -| `selected` | *boolean* | :heavy_minus_sign: | N/A | true | -| `channels` | *number* | :heavy_minus_sign: | N/A | 2 | -| `language` | *string* | :heavy_minus_sign: | N/A | English | -| `languageTag` | *string* | :heavy_minus_sign: | N/A | en | -| `languageCode` | *string* | :heavy_minus_sign: | N/A | eng | -| `samplingRate` | *number* | :heavy_minus_sign: | N/A | 44100 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `id` | *number* | :heavy_check_mark: | N/A | 272796 | +| `streamType` | *number* | :heavy_check_mark: | Type of stream (1 = video, 2 = audio, 3 = subtitle) | 1 | +| `default` | *boolean* | :heavy_minus_sign: | Indicates if this is the default stream | true | +| `selected` | *boolean* | :heavy_minus_sign: | Indicates if the stream is selected | true | +| `codec` | *string* | :heavy_check_mark: | Codec used by the stream | h264 | +| `index` | *number* | :heavy_check_mark: | The index of the stream | 0 | +| `bitrate` | *number* | :heavy_minus_sign: | The bitrate of the stream in kbps | 6273 | +| `colorPrimaries` | *string* | :heavy_minus_sign: | The color primaries of the video stream | bt709 | +| `colorRange` | *string* | :heavy_minus_sign: | The color range of the video stream | tv | +| `colorSpace` | *string* | :heavy_minus_sign: | The color space of the video stream | bt709 | +| `colorTrc` | *string* | :heavy_minus_sign: | The transfer characteristics (TRC) of the video stream | bt709 | +| `bitDepth` | *number* | :heavy_minus_sign: | The bit depth of the video stream | 8 | +| `chromaLocation` | *string* | :heavy_minus_sign: | The chroma location of the video stream | left | +| `streamIdentifier` | *string* | :heavy_minus_sign: | The identifier of the video stream | 2 | +| `chromaSubsampling` | *string* | :heavy_minus_sign: | The chroma subsampling format | 4:2:0 | +| `codedHeight` | *number* | :heavy_minus_sign: | The coded height of the video stream | 1088 | +| `codedWidth` | *number* | :heavy_minus_sign: | The coded width of the video stream | 1920 | +| `frameRate` | *number* | :heavy_minus_sign: | The frame rate of the video stream | 29.97 | +| `hasScalingMatrix` | *boolean* | :heavy_minus_sign: | Indicates if the stream has a scaling matrix | false | +| `hearingImpaired` | *boolean* | :heavy_minus_sign: | N/A | false | +| `closedCaptions` | *boolean* | :heavy_minus_sign: | N/A | false | +| `embeddedInVideo` | *string* | :heavy_minus_sign: | N/A | 1 | +| `height` | *number* | :heavy_minus_sign: | The height of the video stream | 1080 | +| `level` | *number* | :heavy_minus_sign: | The level of the video codec | 40 | +| `profile` | *string* | :heavy_minus_sign: | The profile of the video codec | main | +| `refFrames` | *number* | :heavy_minus_sign: | Number of reference frames | 4 | +| `scanType` | *string* | :heavy_minus_sign: | The scan type (progressive or interlaced) | progressive | +| `width` | *number* | :heavy_minus_sign: | The width of the video stream | 1920 | +| `displayTitle` | *string* | :heavy_minus_sign: | Display title of the stream | 1080p (H.264) | +| `extendedDisplayTitle` | *string* | :heavy_minus_sign: | Extended display title of the stream | 1080p (H.264) | +| `channels` | *number* | :heavy_minus_sign: | Number of audio channels (for audio streams) | 2 | +| `language` | *string* | :heavy_minus_sign: | The language of the stream (for audio/subtitle streams) | English | +| `languageTag` | *string* | :heavy_minus_sign: | Language tag of the stream | en | +| `languageCode` | *string* | :heavy_minus_sign: | Language code of the stream | eng | +| `audioChannelLayout` | *string* | :heavy_minus_sign: | The audio channel layout | stereo | +| `samplingRate` | *number* | :heavy_minus_sign: | Sampling rate of the audio stream in Hz | 48000 | +| `title` | *string* | :heavy_minus_sign: | Title of the subtitle track (for subtitle streams) | English | +| `canAutoSync` | *boolean* | :heavy_minus_sign: | Indicates if the subtitle stream can auto-sync | false | \ No newline at end of file diff --git a/docs/sdk/models/operations/taskname.md b/docs/sdk/models/operations/taskname.md index aa75e60a..783649b2 100644 --- a/docs/sdk/models/operations/taskname.md +++ b/docs/sdk/models/operations/taskname.md @@ -7,7 +7,7 @@ the name of the task to be started. ```typescript import { TaskName } from "@lukehagar/plexjs/sdk/models/operations"; -let value: TaskName = TaskName.DeepMediaAnalysis; +let value: TaskName = TaskName.BackupDatabase; ``` ## Values diff --git a/docs/sdk/models/operations/type.md b/docs/sdk/models/operations/type.md index 5ea081d0..7a8165a4 100644 --- a/docs/sdk/models/operations/type.md +++ b/docs/sdk/models/operations/type.md @@ -13,14 +13,14 @@ E.g. A movie library will not return anything with type 3 as there are no season ```typescript import { Type } from "@lukehagar/plexjs/sdk/models/operations"; -let value: Type = Type.Two; +let value: Type = Type.TvShow; ``` ## Values -| Name | Value | -| ------- | ------- | -| `One` | 1 | -| `Two` | 2 | -| `Three` | 3 | -| `Four` | 4 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Movie` | 1 | +| `TvShow` | 2 | +| `Season` | 3 | +| `Episode` | 4 | \ No newline at end of file diff --git a/docs/sdk/models/operations/ultrablurcolors.md b/docs/sdk/models/operations/ultrablurcolors.md new file mode 100644 index 00000000..c63973a4 --- /dev/null +++ b/docs/sdk/models/operations/ultrablurcolors.md @@ -0,0 +1,23 @@ +# UltraBlurColors + +## Example Usage + +```typescript +import { UltraBlurColors } from "@lukehagar/plexjs/sdk/models/operations"; + +let value: UltraBlurColors = { + topLeft: "11333b", + topRight: "0a232d", + bottomRight: "73958", + bottomLeft: "1f5066", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `topLeft` | *string* | :heavy_check_mark: | N/A | 11333b | +| `topRight` | *string* | :heavy_check_mark: | N/A | 0a232d | +| `bottomRight` | *string* | :heavy_check_mark: | N/A | 73958 | +| `bottomLeft` | *string* | :heavy_check_mark: | N/A | 1f5066 | \ No newline at end of file diff --git a/docs/sdk/models/operations/updateplaylistrequest.md b/docs/sdk/models/operations/updateplaylistrequest.md index 5c352a40..d89ca2e1 100644 --- a/docs/sdk/models/operations/updateplaylistrequest.md +++ b/docs/sdk/models/operations/updateplaylistrequest.md @@ -6,7 +6,7 @@ import { UpdatePlaylistRequest } from "@lukehagar/plexjs/sdk/models/operations"; let value: UpdatePlaylistRequest = { - playlistID: 1381.83, + playlistID: 3117.96, }; ``` diff --git a/docs/sdk/models/operations/updateplaylistresponse.md b/docs/sdk/models/operations/updateplaylistresponse.md index d96abd23..1481ef9d 100644 --- a/docs/sdk/models/operations/updateplaylistresponse.md +++ b/docs/sdk/models/operations/updateplaylistresponse.md @@ -7,7 +7,7 @@ import { UpdatePlaylistResponse } from "@lukehagar/plexjs/sdk/models/operations" let value: UpdatePlaylistResponse = { contentType: "", - statusCode: 778346, + statusCode: 410, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/updateplayprogressresponse.md b/docs/sdk/models/operations/updateplayprogressresponse.md index 015111d8..1a8c70e7 100644 --- a/docs/sdk/models/operations/updateplayprogressresponse.md +++ b/docs/sdk/models/operations/updateplayprogressresponse.md @@ -7,7 +7,7 @@ import { UpdatePlayProgressResponse } from "@lukehagar/plexjs/sdk/models/operati let value: UpdatePlayProgressResponse = { contentType: "", - statusCode: 272656, + statusCode: 505, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/uploadplaylistrequest.md b/docs/sdk/models/operations/uploadplaylistrequest.md index dfa54d04..1efbb2c1 100644 --- a/docs/sdk/models/operations/uploadplaylistrequest.md +++ b/docs/sdk/models/operations/uploadplaylistrequest.md @@ -7,7 +7,8 @@ import { QueryParamForce, UploadPlaylistRequest } from "@lukehagar/plexjs/sdk/mo let value: UploadPlaylistRequest = { path: "/home/barkley/playlist.m3u", - force: QueryParamForce.One, + force: QueryParamForce.Zero, + sectionID: 1, }; ``` @@ -16,4 +17,5 @@ let value: UploadPlaylistRequest = { | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `path` | *string* | :heavy_check_mark: | absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.
If the `path` argument is a directory, that path will be scanned for playlist files to be processed.
Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.
The GUID of each playlist is based on the filename.
If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it.
The GUID of each playlist is based on the filename.
| /home/barkley/playlist.m3u | -| `force` | [operations.QueryParamForce](../../../sdk/models/operations/queryparamforce.md) | :heavy_check_mark: | Force overwriting of duplicate playlists.
By default, a playlist file uploaded with the same path will overwrite the existing playlist.
The `force` argument is used to disable overwriting.
If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.
| | \ No newline at end of file +| `force` | [operations.QueryParamForce](../../../sdk/models/operations/queryparamforce.md) | :heavy_check_mark: | Force overwriting of duplicate playlists.
By default, a playlist file uploaded with the same path will overwrite the existing playlist.
The `force` argument is used to disable overwriting.
If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.
| | +| `sectionID` | *number* | :heavy_check_mark: | Possibly the section ID to upload the playlist to, we are not certain. | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/uploadplaylistresponse.md b/docs/sdk/models/operations/uploadplaylistresponse.md index 00699527..89f15dfe 100644 --- a/docs/sdk/models/operations/uploadplaylistresponse.md +++ b/docs/sdk/models/operations/uploadplaylistresponse.md @@ -7,7 +7,7 @@ import { UploadPlaylistResponse } from "@lukehagar/plexjs/sdk/models/operations" let value: UploadPlaylistResponse = { contentType: "", - statusCode: 837945, + statusCode: 103, rawResponse: new Response("{\"message\": \"hello world\"}", { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/sdk/models/operations/userprofile.md b/docs/sdk/models/operations/userprofile.md index cbe78df8..b06b1512 100644 --- a/docs/sdk/models/operations/userprofile.md +++ b/docs/sdk/models/operations/userprofile.md @@ -16,23 +16,23 @@ let value: UserProfile = { autoSelectAudio: true, defaultAudioLanguage: "ja", defaultSubtitleLanguage: "en", - autoSelectSubtitle: AutoSelectSubtitle.One, - defaultSubtitleAccessibility: DefaultSubtitleAccessibility.One, - defaultSubtitleForced: DefaultSubtitleForced.One, - watchedIndicator: WatchedIndicator.One, - mediaReviewsVisibility: MediaReviewsVisibility.Zero, + autoSelectSubtitle: AutoSelectSubtitle.Enable, + defaultSubtitleAccessibility: DefaultSubtitleAccessibility.Enable, + defaultSubtitleForced: DefaultSubtitleForced.Enable, + watchedIndicator: WatchedIndicator.Enable, + mediaReviewsVisibility: MediaReviewsVisibility.Enable, }; ``` ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `autoSelectAudio` | *boolean* | :heavy_minus_sign: | If the account has automatically select audio and subtitle tracks enabled | true | -| `defaultAudioLanguage` | *string* | :heavy_check_mark: | The preferred audio language for the account | ja | -| `defaultSubtitleLanguage` | *string* | :heavy_check_mark: | The preferred subtitle language for the account | en | -| `autoSelectSubtitle` | [operations.AutoSelectSubtitle](../../../sdk/models/operations/autoselectsubtitle.md) | :heavy_minus_sign: | The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) | 1 | -| `defaultSubtitleAccessibility` | [operations.DefaultSubtitleAccessibility](../../../sdk/models/operations/defaultsubtitleaccessibility.md) | :heavy_minus_sign: | The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles) | 1 | -| `defaultSubtitleForced` | [operations.DefaultSubtitleForced](../../../sdk/models/operations/defaultsubtitleforced.md) | :heavy_minus_sign: | The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles) | 0 | -| `watchedIndicator` | [operations.WatchedIndicator](../../../sdk/models/operations/watchedindicator.md) | :heavy_minus_sign: | N/A | 1 | -| `mediaReviewsVisibility` | [operations.MediaReviewsVisibility](../../../sdk/models/operations/mediareviewsvisibility.md) | :heavy_minus_sign: | N/A | 0 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `autoSelectAudio` | *boolean* | :heavy_minus_sign: | If the account has automatically select audio and subtitle tracks enabled | true | +| `defaultAudioLanguage` | *string* | :heavy_check_mark: | The preferred audio language for the account | ja | +| `defaultSubtitleLanguage` | *string* | :heavy_check_mark: | The preferred subtitle language for the account | en | +| `autoSelectSubtitle` | [operations.AutoSelectSubtitle](../../../sdk/models/operations/autoselectsubtitle.md) | :heavy_minus_sign: | N/A | 1 | +| `defaultSubtitleAccessibility` | [operations.DefaultSubtitleAccessibility](../../../sdk/models/operations/defaultsubtitleaccessibility.md) | :heavy_minus_sign: | N/A | 1 | +| `defaultSubtitleForced` | [operations.DefaultSubtitleForced](../../../sdk/models/operations/defaultsubtitleforced.md) | :heavy_minus_sign: | N/A | 1 | +| `watchedIndicator` | [operations.WatchedIndicator](../../../sdk/models/operations/watchedindicator.md) | :heavy_minus_sign: | N/A | 1 | +| `mediaReviewsVisibility` | [operations.MediaReviewsVisibility](../../../sdk/models/operations/mediareviewsvisibility.md) | :heavy_minus_sign: | N/A | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/watchedindicator.md b/docs/sdk/models/operations/watchedindicator.md index a4ee7ed3..6801abea 100644 --- a/docs/sdk/models/operations/watchedindicator.md +++ b/docs/sdk/models/operations/watchedindicator.md @@ -1,16 +1,18 @@ # WatchedIndicator +Whether or not media watched indicators are enabled (little orange dot on media) + ## Example Usage ```typescript import { WatchedIndicator } from "@lukehagar/plexjs/sdk/models/operations"; -let value: WatchedIndicator = WatchedIndicator.One; +let value: WatchedIndicator = WatchedIndicator.Enable; ``` ## Values -| Name | Value | -| ------ | ------ | -| `Zero` | 0 | -| `One` | 1 | \ No newline at end of file +| Name | Value | +| --------- | --------- | +| `Disable` | 0 | +| `Enable` | 1 | \ No newline at end of file diff --git a/docs/sdk/models/operations/writer.md b/docs/sdk/models/operations/writer.md index eb344674..26349e64 100644 --- a/docs/sdk/models/operations/writer.md +++ b/docs/sdk/models/operations/writer.md @@ -6,7 +6,7 @@ import { Writer } from "@lukehagar/plexjs/sdk/models/operations"; let value: Writer = { - tag: "Jeff Loveness", + tag: "James Cameron", }; ``` @@ -14,4 +14,4 @@ let value: Writer = { | Field | Type | Required | Description | Example | | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | -| `tag` | *string* | :heavy_minus_sign: | N/A | Jeff Loveness | \ No newline at end of file +| `tag` | *string* | :heavy_minus_sign: | N/A | James Cameron | \ No newline at end of file diff --git a/docs/sdks/activities/README.md b/docs/sdks/activities/README.md index e1795e46..986e49b6 100644 --- a/docs/sdks/activities/README.md +++ b/docs/sdks/activities/README.md @@ -28,14 +28,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.activities.getServerActivities(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -53,7 +57,11 @@ import { activitiesGetServerActivities } from "@lukehagar/plexjs/funcs/activitie // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -66,7 +74,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -86,12 +94,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | -------------------------------------- | -------------------------------------- | -------------------------------------- | | errors.GetServerActivitiesBadRequest | 400 | application/json | | errors.GetServerActivitiesUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## cancelServerActivities @@ -104,14 +111,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.activities.cancelServerActivities("25b71ed5-0f9d-461c-baa7-d404e9e10d3e"); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -129,7 +140,11 @@ import { activitiesCancelServerActivities } from "@lukehagar/plexjs/funcs/activi // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -142,7 +157,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -163,8 +178,8 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | | errors.CancelServerActivitiesBadRequest | 400 | application/json | | errors.CancelServerActivitiesUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/authentication/README.md b/docs/sdks/authentication/README.md index ca719457..002e01bf 100644 --- a/docs/sdks/authentication/README.md +++ b/docs/sdks/authentication/README.md @@ -26,14 +26,18 @@ import { GetTransientTokenQueryParamType, Scope } from "@lukehagar/plexjs/sdk/mo const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.authentication.getTransientToken(GetTransientTokenQueryParamType.Delegation, Scope.All); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -52,7 +56,11 @@ import { GetTransientTokenQueryParamType, Scope } from "@lukehagar/plexjs/sdk/mo // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -65,7 +73,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -87,12 +95,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------------------------ | ------------------------------------ | ------------------------------------ | | errors.GetTransientTokenBadRequest | 400 | application/json | | errors.GetTransientTokenUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getSourceConnectionInformation @@ -107,14 +114,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { - const result = await plexAPI.authentication.getSourceConnectionInformation("server://client-identifier"); - + const result = await plexAPI.authentication.getSourceConnectionInformation("provider://provider-identifier"); + // Handle the result - console.log(result) + console.log(result); } run(); @@ -132,11 +143,15 @@ import { authenticationGetSourceConnectionInformation } from "@lukehagar/plexjs/ // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { - const res = await authenticationGetSourceConnectionInformation(plexAPI, "server://client-identifier"); + const res = await authenticationGetSourceConnectionInformation(plexAPI, "provider://provider-identifier"); if (!res.ok) { throw res.error; @@ -145,7 +160,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -166,12 +181,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | | errors.GetSourceConnectionInformationBadRequest | 400 | application/json | | errors.GetSourceConnectionInformationUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getTokenDetails @@ -184,14 +198,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.authentication.getTokenDetails(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -209,7 +227,11 @@ import { authenticationGetTokenDetails } from "@lukehagar/plexjs/funcs/authentic // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -222,7 +244,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -243,12 +265,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ---------------------------------- | ---------------------------------- | ---------------------------------- | | errors.GetTokenDetailsBadRequest | 400 | application/json | | errors.GetTokenDetailsUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## postUsersSignInData @@ -260,18 +281,24 @@ Sign in user with username and password and return user data with Plex authentic import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { - const result = await plexAPI.authentication.postUsersSignInData("gcgzw5rz2xovp84b4vha3a40", { - login: "username@email.com", - password: "password123", - verificationCode: "123456", + const result = await plexAPI.authentication.postUsersSignInData({ + requestBody: { + login: "username@email.com", + password: "password123", + verificationCode: "123456", + }, }); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -288,14 +315,20 @@ import { authenticationPostUsersSignInData } from "@lukehagar/plexjs/funcs/authe // Use `PlexAPICore` for best tree-shaking performance. // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { - const res = await authenticationPostUsersSignInData(plexAPI, "gcgzw5rz2xovp84b4vha3a40", { - login: "username@email.com", - password: "password123", - verificationCode: "123456", + const res = await authenticationPostUsersSignInData(plexAPI, { + requestBody: { + login: "username@email.com", + password: "password123", + verificationCode: "123456", + }, }); if (!res.ok) { @@ -305,7 +338,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -313,14 +346,13 @@ run(); ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `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)
| [object Object] | -| `requestBody` | [operations.PostUsersSignInDataRequestBody](../../sdk/models/operations/postuserssignindatarequestbody.md) | :heavy_minus_sign: | Login credentials | | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | | -| `options.serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.PostUsersSignInDataRequest](../../sdk/models/operations/postuserssignindatarequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| `options.serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -328,8 +360,8 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | -------------------------------------- | -------------------------------------- | -------------------------------------- | | errors.PostUsersSignInDataBadRequest | 400 | application/json | | errors.PostUsersSignInDataUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/butler/README.md b/docs/sdks/butler/README.md index da8ca7d9..b35ac789 100644 --- a/docs/sdks/butler/README.md +++ b/docs/sdks/butler/README.md @@ -25,14 +25,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.butler.getButlerTasks(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -50,7 +54,11 @@ import { butlerGetButlerTasks } from "@lukehagar/plexjs/funcs/butlerGetButlerTas // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -63,7 +71,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -83,12 +91,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------------------- | --------------------------------- | --------------------------------- | | errors.GetButlerTasksBadRequest | 400 | application/json | | errors.GetButlerTasksUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## startAllTasks @@ -106,14 +113,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.butler.startAllTasks(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -131,7 +142,11 @@ import { butlerStartAllTasks } from "@lukehagar/plexjs/funcs/butlerStartAllTasks // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -144,7 +159,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -164,12 +179,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | -------------------------------- | -------------------------------- | -------------------------------- | | errors.StartAllTasksBadRequest | 400 | application/json | | errors.StartAllTasksUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## stopAllTasks @@ -183,14 +197,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.butler.stopAllTasks(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -208,7 +226,11 @@ import { butlerStopAllTasks } from "@lukehagar/plexjs/funcs/butlerStopAllTasks.j // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -221,7 +243,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -241,12 +263,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.StopAllTasksBadRequest | 400 | application/json | | errors.StopAllTasksUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## startTask @@ -265,14 +286,18 @@ import { TaskName } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.butler.startTask(TaskName.CleanOldBundles); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -291,7 +316,11 @@ import { TaskName } from "@lukehagar/plexjs/sdk/models/operations"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -304,7 +333,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -325,12 +354,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ---------------------------- | ---------------------------- | ---------------------------- | | errors.StartTaskBadRequest | 400 | application/json | | errors.StartTaskUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## stopTask @@ -345,14 +373,18 @@ import { PathParamTaskName } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.butler.stopTask(PathParamTaskName.BackupDatabase); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -371,7 +403,11 @@ import { PathParamTaskName } from "@lukehagar/plexjs/sdk/models/operations"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -384,7 +420,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -405,8 +441,8 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | errors.StopTaskBadRequest | 400 | application/json | | errors.StopTaskUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/hubs/README.md b/docs/sdks/hubs/README.md index 6f2b8d28..4774284b 100644 --- a/docs/sdks/hubs/README.md +++ b/docs/sdks/hubs/README.md @@ -9,6 +9,7 @@ Hubs are a structured two-dimensional container for media, generally represented ### Available Operations * [getGlobalHubs](#getglobalhubs) - Get Global Hubs +* [getRecentlyAdded](#getrecentlyadded) - Get Recently Added * [getLibraryHubs](#getlibraryhubs) - Get library specific hubs ## getGlobalHubs @@ -22,14 +23,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.hubs.getGlobalHubs(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -47,7 +52,11 @@ import { hubsGetGlobalHubs } from "@lukehagar/plexjs/funcs/hubsGetGlobalHubs.js" // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -60,7 +69,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -82,12 +91,110 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | -------------------------------- | -------------------------------- | -------------------------------- | | errors.GetGlobalHubsBadRequest | 400 | application/json | | errors.GetGlobalHubsUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | +## getRecentlyAdded + +This endpoint will return the recently added content. + + +### Example Usage + +```typescript +import { PlexAPI } from "@lukehagar/plexjs"; +import { IncludeMeta, Type } from "@lukehagar/plexjs/sdk/models/operations"; + +const plexAPI = new PlexAPI({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", +}); + +async function run() { + const result = await plexAPI.hubs.getRecentlyAdded({ + contentDirectoryID: 470161, + sectionID: 2, + type: Type.TvShow, + includeMeta: IncludeMeta.Enable, + xPlexContainerStart: 0, + xPlexContainerSize: 50, + }); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { PlexAPICore } from "@lukehagar/plexjs/core.js"; +import { hubsGetRecentlyAdded } from "@lukehagar/plexjs/funcs/hubsGetRecentlyAdded.js"; +import { IncludeMeta, Type } from "@lukehagar/plexjs/sdk/models/operations"; + +// Use `PlexAPICore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const plexAPI = new PlexAPICore({ + accessToken: "", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", +}); + +async function run() { + const res = await hubsGetRecentlyAdded(plexAPI, { + contentDirectoryID: 470161, + sectionID: 2, + type: Type.TvShow, + includeMeta: IncludeMeta.Enable, + xPlexContainerStart: 0, + xPlexContainerSize: 50, + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetRecentlyAddedRequest](../../sdk/models/operations/getrecentlyaddedrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GetRecentlyAddedResponse](../../sdk/models/operations/getrecentlyaddedresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | ## getLibraryHubs @@ -101,14 +208,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.hubs.getLibraryHubs(6728.76); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -126,7 +237,11 @@ import { hubsGetLibraryHubs } from "@lukehagar/plexjs/funcs/hubsGetLibraryHubs.j // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -139,7 +254,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -162,8 +277,8 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------------------- | --------------------------------- | --------------------------------- | | errors.GetLibraryHubsBadRequest | 400 | application/json | | errors.GetLibraryHubsUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/library/README.md b/docs/sdks/library/README.md index 4ed2ecfd..767acc81 100644 --- a/docs/sdks/library/README.md +++ b/docs/sdks/library/README.md @@ -9,7 +9,7 @@ API Calls interacting with Plex Media Server Libraries ### Available Operations * [getFileHash](#getfilehash) - Get Hash Value -* [getRecentlyAdded](#getrecentlyadded) - Get Recently Added +* [getRecentlyAddedLibrary](#getrecentlyaddedlibrary) - Get Recently Added * [getAllLibraries](#getalllibraries) - Get All Libraries * [getLibraryDetails](#getlibrarydetails) - Get Library Details * [deleteLibrary](#deletelibrary) - Delete Library Section @@ -32,14 +32,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.library.getFileHash("file://C:\Image.png&type=13"); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -57,7 +61,11 @@ import { libraryGetFileHash } from "@lukehagar/plexjs/funcs/libraryGetFileHash.j // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -70,7 +78,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -92,14 +100,13 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------------------ | ------------------------------ | ------------------------------ | | errors.GetFileHashBadRequest | 400 | application/json | | errors.GetFileHashUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | - -## getRecentlyAdded +## getRecentlyAddedLibrary This endpoint will return the recently added content. @@ -108,17 +115,43 @@ This endpoint will return the recently added content. ```typescript import { PlexAPI } from "@lukehagar/plexjs"; +import { QueryParamIncludeMeta, QueryParamType } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { - const result = await plexAPI.library.getRecentlyAdded(0, 50); - + const result = await plexAPI.library.getRecentlyAddedLibrary({ + contentDirectoryID: 2, + pinnedContentDirectoryID: [ + 3, + 5, + 7, + 13, + 12, + 1, + 6, + 14, + 2, + 10, + 16, + 17, + ], + sectionID: 2, + type: QueryParamType.TvShow, + includeMeta: QueryParamIncludeMeta.Enable, + xPlexContainerStart: 0, + xPlexContainerSize: 50, + }); + // Handle the result - console.log(result) + console.log(result); } run(); @@ -130,17 +163,43 @@ The standalone function version of this method: ```typescript import { PlexAPICore } from "@lukehagar/plexjs/core.js"; -import { libraryGetRecentlyAdded } from "@lukehagar/plexjs/funcs/libraryGetRecentlyAdded.js"; +import { libraryGetRecentlyAddedLibrary } from "@lukehagar/plexjs/funcs/libraryGetRecentlyAddedLibrary.js"; +import { QueryParamIncludeMeta, QueryParamType } from "@lukehagar/plexjs/sdk/models/operations"; // Use `PlexAPICore` for best tree-shaking performance. // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { - const res = await libraryGetRecentlyAdded(plexAPI, 0, 50); + const res = await libraryGetRecentlyAddedLibrary(plexAPI, { + contentDirectoryID: 2, + pinnedContentDirectoryID: [ + 3, + 5, + 7, + 13, + 12, + 1, + 6, + 14, + 2, + 10, + 16, + 17, + ], + sectionID: 2, + type: QueryParamType.TvShow, + includeMeta: QueryParamIncludeMeta.Enable, + xPlexContainerStart: 0, + xPlexContainerSize: 50, + }); if (!res.ok) { throw res.error; @@ -149,7 +208,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -157,26 +216,24 @@ run(); ### Parameters -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `xPlexContainerStart` | *number* | :heavy_minus_sign: | The index of the first item to return. If not specified, the first item will be returned.
If the number of items exceeds the limit, the response will be paginated.
By default this is 0
| [object Object] | -| `xPlexContainerSize` | *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.
By default this is 50
| [object Object] | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetRecentlyAddedLibraryRequest](../../sdk/models/operations/getrecentlyaddedlibraryrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise\<[operations.GetRecentlyAddedResponse](../../sdk/models/operations/getrecentlyaddedresponse.md)\>** +**Promise\<[operations.GetRecentlyAddedLibraryResponse](../../sdk/models/operations/getrecentlyaddedlibraryresponse.md)\>** ### Errors -| Error Object | Status Code | Content Type | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | -| errors.GetRecentlyAddedBadRequest | 400 | application/json | -| errors.GetRecentlyAddedUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| Error Type | Status Code | Content Type | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| errors.GetRecentlyAddedLibraryBadRequest | 400 | application/json | +| errors.GetRecentlyAddedLibraryUnauthorized | 401 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## getAllLibraries @@ -195,14 +252,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.library.getAllLibraries(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -220,7 +281,11 @@ import { libraryGetAllLibraries } from "@lukehagar/plexjs/funcs/libraryGetAllLib // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -233,7 +298,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -253,12 +318,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ---------------------------------- | ---------------------------------- | ---------------------------------- | | errors.GetAllLibrariesBadRequest | 400 | application/json | | errors.GetAllLibrariesUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getLibraryDetails @@ -310,14 +374,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.library.getLibraryDetails(9518); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -335,7 +403,11 @@ import { libraryGetLibraryDetails } from "@lukehagar/plexjs/funcs/libraryGetLibr // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -348,7 +420,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -370,12 +442,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------------------------ | ------------------------------------ | ------------------------------------ | | errors.GetLibraryDetailsBadRequest | 400 | application/json | | errors.GetLibraryDetailsUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## deleteLibrary @@ -388,14 +459,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.library.deleteLibrary(9518); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -413,7 +488,11 @@ import { libraryDeleteLibrary } from "@lukehagar/plexjs/funcs/libraryDeleteLibra // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -426,7 +505,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -447,12 +526,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | -------------------------------- | -------------------------------- | -------------------------------- | | errors.DeleteLibraryBadRequest | 400 | application/json | | errors.DeleteLibraryUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getLibraryItems @@ -482,26 +560,35 @@ Fetches details from a specific section of the library identified by a section k ```typescript import { PlexAPI } from "@lukehagar/plexjs"; -import { IncludeGuids, IncludeMeta, Tag, Type } from "@lukehagar/plexjs/sdk/models/operations"; +import { + GetLibraryItemsQueryParamIncludeMeta, + GetLibraryItemsQueryParamType, + IncludeGuids, + Tag, +} from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.library.getLibraryItems({ sectionKey: 9518, tag: Tag.Edition, - includeGuids: IncludeGuids.One, - includeMeta: IncludeMeta.One, - type: Type.Two, + includeGuids: IncludeGuids.Enable, + type: GetLibraryItemsQueryParamType.TvShow, + includeMeta: GetLibraryItemsQueryParamIncludeMeta.Enable, xPlexContainerStart: 0, xPlexContainerSize: 50, }); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -514,22 +601,31 @@ The standalone function version of this method: ```typescript import { PlexAPICore } from "@lukehagar/plexjs/core.js"; import { libraryGetLibraryItems } from "@lukehagar/plexjs/funcs/libraryGetLibraryItems.js"; -import { IncludeGuids, IncludeMeta, Tag, Type } from "@lukehagar/plexjs/sdk/models/operations"; +import { + GetLibraryItemsQueryParamIncludeMeta, + GetLibraryItemsQueryParamType, + IncludeGuids, + Tag, +} from "@lukehagar/plexjs/sdk/models/operations"; // Use `PlexAPICore` for best tree-shaking performance. // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const res = await libraryGetLibraryItems(plexAPI, { sectionKey: 9518, tag: Tag.Edition, - includeGuids: IncludeGuids.One, - includeMeta: IncludeMeta.One, - type: Type.Two, + includeGuids: IncludeGuids.Enable, + type: GetLibraryItemsQueryParamType.TvShow, + includeMeta: GetLibraryItemsQueryParamIncludeMeta.Enable, xPlexContainerStart: 0, xPlexContainerSize: 50, }); @@ -541,7 +637,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -562,12 +658,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ---------------------------------- | ---------------------------------- | ---------------------------------- | | errors.GetLibraryItemsBadRequest | 400 | application/json | | errors.GetLibraryItemsUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getRefreshLibraryMetadata @@ -582,14 +677,18 @@ import { Force } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.library.getRefreshLibraryMetadata(9518, Force.One); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -608,11 +707,15 @@ import { Force } from "@lukehagar/plexjs/sdk/models/operations"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { - const res = await libraryGetRefreshLibraryMetadata(plexAPI, 9518, Force.One); + const res = await libraryGetRefreshLibraryMetadata(plexAPI, 9518, Force.Zero); if (!res.ok) { throw res.error; @@ -621,7 +724,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -643,12 +746,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | | errors.GetRefreshLibraryMetadataBadRequest | 400 | application/json | | errors.GetRefreshLibraryMetadataUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getSearchLibrary @@ -676,18 +778,22 @@ Each type in the library comes with a set of filters and sorts, aiding in buildi ```typescript import { PlexAPI } from "@lukehagar/plexjs"; -import { QueryParamType } from "@lukehagar/plexjs/sdk/models/operations"; +import { GetSearchLibraryQueryParamType } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { - const result = await plexAPI.library.getSearchLibrary(9518, QueryParamType.Two); - + const result = await plexAPI.library.getSearchLibrary(9518, GetSearchLibraryQueryParamType.TvShow); + // Handle the result - console.log(result) + console.log(result); } run(); @@ -700,17 +806,21 @@ The standalone function version of this method: ```typescript import { PlexAPICore } from "@lukehagar/plexjs/core.js"; import { libraryGetSearchLibrary } from "@lukehagar/plexjs/funcs/libraryGetSearchLibrary.js"; -import { QueryParamType } from "@lukehagar/plexjs/sdk/models/operations"; +import { GetSearchLibraryQueryParamType } from "@lukehagar/plexjs/sdk/models/operations"; // Use `PlexAPICore` for best tree-shaking performance. // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { - const res = await libraryGetSearchLibrary(plexAPI, 9518, QueryParamType.Two); + const res = await libraryGetSearchLibrary(plexAPI, 9518, GetSearchLibraryQueryParamType.TvShow); if (!res.ok) { throw res.error; @@ -719,7 +829,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -730,7 +840,7 @@ run(); | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sectionKey` | *number* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| [object Object] | -| `type` | [operations.QueryParamType](../../sdk/models/operations/queryparamtype.md) | :heavy_check_mark: | The type of media to retrieve.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| [object Object] | +| `type` | [operations.GetSearchLibraryQueryParamType](../../sdk/models/operations/getsearchlibraryqueryparamtype.md) | :heavy_check_mark: | The type of media to retrieve.
1 = movie
2 = show
3 = season
4 = episode
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| [object Object] | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | | @@ -741,12 +851,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | errors.GetSearchLibraryBadRequest | 400 | application/json | | errors.GetSearchLibraryUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getMetaDataByRatingKey @@ -760,14 +869,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.library.getMetaDataByRatingKey(9518); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -785,7 +898,11 @@ import { libraryGetMetaDataByRatingKey } from "@lukehagar/plexjs/funcs/libraryGe // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -798,7 +915,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -819,12 +936,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | | errors.GetMetaDataByRatingKeyBadRequest | 400 | application/json | | errors.GetMetaDataByRatingKeyUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getMetadataChildren @@ -838,14 +954,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.library.getMetadataChildren(1539.14, "Stream"); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -863,7 +983,11 @@ import { libraryGetMetadataChildren } from "@lukehagar/plexjs/funcs/libraryGetMe // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -876,7 +1000,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -898,12 +1022,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | -------------------------------------- | -------------------------------------- | -------------------------------------- | | errors.GetMetadataChildrenBadRequest | 400 | application/json | | errors.GetMetadataChildrenUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getTopWatchedContent @@ -918,14 +1041,18 @@ import { GetTopWatchedContentQueryParamType } from "@lukehagar/plexjs/sdk/models const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { - const result = await plexAPI.library.getTopWatchedContent(GetTopWatchedContentQueryParamType.Two, 1); - + const result = await plexAPI.library.getTopWatchedContent(GetTopWatchedContentQueryParamType.TvShow, 1); + // Handle the result - console.log(result) + console.log(result); } run(); @@ -944,11 +1071,15 @@ import { GetTopWatchedContentQueryParamType } from "@lukehagar/plexjs/sdk/models // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { - const res = await libraryGetTopWatchedContent(plexAPI, GetTopWatchedContentQueryParamType.Two, 1); + const res = await libraryGetTopWatchedContent(plexAPI, GetTopWatchedContentQueryParamType.TvShow, 1); if (!res.ok) { throw res.error; @@ -957,7 +1088,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -979,12 +1110,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------------------------- | --------------------------------------- | --------------------------------------- | | errors.GetTopWatchedContentBadRequest | 400 | application/json | | errors.GetTopWatchedContentUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getOnDeck @@ -998,14 +1128,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.library.getOnDeck(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -1023,7 +1157,11 @@ import { libraryGetOnDeck } from "@lukehagar/plexjs/funcs/libraryGetOnDeck.js"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -1036,7 +1174,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -1056,8 +1194,8 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ---------------------------- | ---------------------------- | ---------------------------- | | errors.GetOnDeckBadRequest | 400 | application/json | | errors.GetOnDeckUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/log/README.md b/docs/sdks/log/README.md index 766716a7..bd195797 100644 --- a/docs/sdks/log/README.md +++ b/docs/sdks/log/README.md @@ -25,14 +25,18 @@ import { Level } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.log.logLine(Level.Three, "Test log message", "Postman"); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -51,7 +55,11 @@ import { Level } from "@lukehagar/plexjs/sdk/models/operations"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -64,7 +72,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -87,12 +95,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.LogLineBadRequest | 400 | application/json | | errors.LogLineUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## logMultiLine @@ -126,16 +133,20 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.log.logMultiLine("level=4&message=Test%20message%201&source=postman\n" + "level=3&message=Test%20message%202&source=postman\n" + "level=1&message=Test%20message%203&source=postman"); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -153,7 +164,11 @@ import { logLogMultiLine } from "@lukehagar/plexjs/funcs/logLogMultiLine.js"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -168,7 +183,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -189,12 +204,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.LogMultiLineBadRequest | 400 | application/json | | errors.LogMultiLineUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## enablePaperTrail @@ -208,14 +222,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.log.enablePaperTrail(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -233,7 +251,11 @@ import { logEnablePaperTrail } from "@lukehagar/plexjs/funcs/logEnablePaperTrail // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -246,7 +268,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -266,8 +288,8 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | errors.EnablePaperTrailBadRequest | 400 | application/json | | errors.EnablePaperTrailUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/media/README.md b/docs/sdks/media/README.md index 9ba2cc6f..0896986d 100644 --- a/docs/sdks/media/README.md +++ b/docs/sdks/media/README.md @@ -25,14 +25,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.media.markPlayed(59398); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -50,7 +54,11 @@ import { mediaMarkPlayed } from "@lukehagar/plexjs/funcs/mediaMarkPlayed.js"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -63,7 +71,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -84,12 +92,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ----------------------------- | ----------------------------- | ----------------------------- | | errors.MarkPlayedBadRequest | 400 | application/json | | errors.MarkPlayedUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## markUnplayed @@ -102,14 +109,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.media.markUnplayed(59398); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -127,7 +138,11 @@ import { mediaMarkUnplayed } from "@lukehagar/plexjs/funcs/mediaMarkUnplayed.js" // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -140,7 +155,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -161,12 +176,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.MarkUnplayedBadRequest | 400 | application/json | | errors.MarkUnplayedUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## updatePlayProgress @@ -180,14 +194,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.media.updatePlayProgress("", 90000, "played"); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -205,7 +223,11 @@ import { mediaUpdatePlayProgress } from "@lukehagar/plexjs/funcs/mediaUpdatePlay // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -218,7 +240,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -241,12 +263,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------------------------- | ------------------------------------- | ------------------------------------- | | errors.UpdatePlayProgressBadRequest | 400 | application/json | | errors.UpdatePlayProgressUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getBannerImage @@ -259,7 +280,11 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -271,9 +296,9 @@ async function run() { upscale: 1, xPlexToken: "CV5xoxjTpFKUzBTShsaf", }); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -291,7 +316,11 @@ import { mediaGetBannerImage } from "@lukehagar/plexjs/funcs/mediaGetBannerImage // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -311,7 +340,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -332,12 +361,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------------------- | --------------------------------- | --------------------------------- | | errors.GetBannerImageBadRequest | 400 | application/json | | errors.GetBannerImageUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getThumbImage @@ -350,7 +378,11 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -362,9 +394,9 @@ async function run() { upscale: 1, xPlexToken: "CV5xoxjTpFKUzBTShsaf", }); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -382,7 +414,11 @@ import { mediaGetThumbImage } from "@lukehagar/plexjs/funcs/mediaGetThumbImage.j // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -402,7 +438,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -423,8 +459,8 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | -------------------------------- | -------------------------------- | -------------------------------- | | errors.GetThumbImageBadRequest | 400 | application/json | | errors.GetThumbImageUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/playlists/README.md b/docs/sdks/playlists/README.md index cfc8fa3a..ae0eb911 100644 --- a/docs/sdks/playlists/README.md +++ b/docs/sdks/playlists/README.md @@ -36,7 +36,11 @@ import { CreatePlaylistQueryParamType, Smart } from "@lukehagar/plexjs/sdk/model const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -46,9 +50,9 @@ async function run() { smart: Smart.One, uri: "https://inborn-brochure.biz", }); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -67,7 +71,11 @@ import { CreatePlaylistQueryParamType, Smart } from "@lukehagar/plexjs/sdk/model // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -85,7 +93,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -106,12 +114,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------------------- | --------------------------------- | --------------------------------- | | errors.CreatePlaylistBadRequest | 400 | application/json | | errors.CreatePlaylistUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getPlaylists @@ -124,14 +131,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.playlists.getPlaylists(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -149,7 +160,11 @@ import { playlistsGetPlaylists } from "@lukehagar/plexjs/funcs/playlistsGetPlayl // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -162,7 +177,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -184,12 +199,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.GetPlaylistsBadRequest | 400 | application/json | | errors.GetPlaylistsUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getPlaylist @@ -204,14 +218,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.playlists.getPlaylist(4109.48); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -229,7 +247,11 @@ import { playlistsGetPlaylist } from "@lukehagar/plexjs/funcs/playlistsGetPlayli // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -242,7 +264,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -263,12 +285,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------------------ | ------------------------------ | ------------------------------ | | errors.GetPlaylistBadRequest | 400 | application/json | | errors.GetPlaylistUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## deletePlaylist @@ -282,14 +303,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.playlists.deletePlaylist(216.22); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -307,7 +332,11 @@ import { playlistsDeletePlaylist } from "@lukehagar/plexjs/funcs/playlistsDelete // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -320,7 +349,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -341,12 +370,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------------------- | --------------------------------- | --------------------------------- | | errors.DeletePlaylistBadRequest | 400 | application/json | | errors.DeletePlaylistUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## updatePlaylist @@ -360,14 +388,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.playlists.updatePlaylist(3915); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -385,7 +417,11 @@ import { playlistsUpdatePlaylist } from "@lukehagar/plexjs/funcs/playlistsUpdate // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -398,7 +434,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -421,12 +457,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------------------- | --------------------------------- | --------------------------------- | | errors.UpdatePlaylistBadRequest | 400 | application/json | | errors.UpdatePlaylistUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getPlaylistContents @@ -444,14 +479,18 @@ import { GetPlaylistContentsQueryParamType } from "@lukehagar/plexjs/sdk/models/ const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { - const result = await plexAPI.playlists.getPlaylistContents(5004.46, GetPlaylistContentsQueryParamType.Two); - + const result = await plexAPI.playlists.getPlaylistContents(5004.46, GetPlaylistContentsQueryParamType.TvShow); + // Handle the result - console.log(result) + console.log(result); } run(); @@ -470,11 +509,15 @@ import { GetPlaylistContentsQueryParamType } from "@lukehagar/plexjs/sdk/models/ // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { - const res = await playlistsGetPlaylistContents(plexAPI, 5004.46, GetPlaylistContentsQueryParamType.Two); + const res = await playlistsGetPlaylistContents(plexAPI, 5004.46, GetPlaylistContentsQueryParamType.TvShow); if (!res.ok) { throw res.error; @@ -483,7 +526,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -505,12 +548,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | -------------------------------------- | -------------------------------------- | -------------------------------------- | | errors.GetPlaylistContentsBadRequest | 400 | application/json | | errors.GetPlaylistContentsUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## clearPlaylistContents @@ -524,14 +566,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.playlists.clearPlaylistContents(1893.18); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -549,7 +595,11 @@ import { playlistsClearPlaylistContents } from "@lukehagar/plexjs/funcs/playlist // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -562,7 +612,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -583,12 +633,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | | errors.ClearPlaylistContentsBadRequest | 400 | application/json | | errors.ClearPlaylistContentsUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## addPlaylistContents @@ -603,14 +652,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); 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) + console.log(result); } run(); @@ -628,7 +681,11 @@ import { playlistsAddPlaylistContents } from "@lukehagar/plexjs/funcs/playlistsA // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -641,7 +698,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -664,12 +721,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | -------------------------------------- | -------------------------------------- | -------------------------------------- | | errors.AddPlaylistContentsBadRequest | 400 | application/json | | errors.AddPlaylistContentsUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## uploadPlaylist @@ -684,14 +740,18 @@ import { QueryParamForce } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { - const result = await plexAPI.playlists.uploadPlaylist("/home/barkley/playlist.m3u", QueryParamForce.Zero); - + const result = await plexAPI.playlists.uploadPlaylist("/home/barkley/playlist.m3u", QueryParamForce.Zero, 1); + // Handle the result - console.log(result) + console.log(result); } run(); @@ -710,11 +770,15 @@ import { QueryParamForce } from "@lukehagar/plexjs/sdk/models/operations"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { - const res = await playlistsUploadPlaylist(plexAPI, "/home/barkley/playlist.m3u", QueryParamForce.Zero); + const res = await playlistsUploadPlaylist(plexAPI, "/home/barkley/playlist.m3u", QueryParamForce.One, 1); if (!res.ok) { throw res.error; @@ -723,7 +787,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -735,6 +799,7 @@ run(); | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `path` | *string* | :heavy_check_mark: | absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.
If the `path` argument is a directory, that path will be scanned for playlist files to be processed.
Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.
The GUID of each playlist is based on the filename.
If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it.
The GUID of each playlist is based on the filename.
| [object Object] | | `force` | [operations.QueryParamForce](../../sdk/models/operations/queryparamforce.md) | :heavy_check_mark: | Force overwriting of duplicate playlists.
By default, a playlist file uploaded with the same path will overwrite the existing playlist.
The `force` argument is used to disable overwriting.
If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.
| | +| `sectionID` | *number* | :heavy_check_mark: | Possibly the section ID to upload the playlist to, we are not certain. | [object Object] | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | | @@ -745,8 +810,8 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------------------- | --------------------------------- | --------------------------------- | | errors.UploadPlaylistBadRequest | 400 | application/json | | errors.UploadPlaylistUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/plex/README.md b/docs/sdks/plex/README.md index 36ad0235..2c953db3 100644 --- a/docs/sdks/plex/README.md +++ b/docs/sdks/plex/README.md @@ -27,14 +27,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.plex.getCompanionsData(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -52,7 +56,11 @@ import { plexGetCompanionsData } from "@lukehagar/plexjs/funcs/plexGetCompanions // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -65,7 +73,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -86,12 +94,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------------------------ | ------------------------------------ | ------------------------------------ | | errors.GetCompanionsDataBadRequest | 400 | application/json | | errors.GetCompanionsDataUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getUserFriends @@ -104,14 +111,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.plex.getUserFriends(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -129,7 +140,11 @@ import { plexGetUserFriends } from "@lukehagar/plexjs/funcs/plexGetUserFriends.j // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -142,7 +157,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -163,12 +178,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------------------- | --------------------------------- | --------------------------------- | | errors.GetUserFriendsBadRequest | 400 | application/json | | errors.GetUserFriendsUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getGeoData @@ -180,14 +194,18 @@ Returns the geolocation and locale data of the caller import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.plex.getGeoData(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -204,7 +222,11 @@ import { plexGetGeoData } from "@lukehagar/plexjs/funcs/plexGetGeoData.js"; // Use `PlexAPICore` for best tree-shaking performance. // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -217,7 +239,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -238,12 +260,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ----------------------------- | ----------------------------- | ----------------------------- | | errors.GetGeoDataBadRequest | 400 | application/json | | errors.GetGeoDataUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getHomeData @@ -256,14 +277,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.plex.getHomeData(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -281,7 +306,11 @@ import { plexGetHomeData } from "@lukehagar/plexjs/funcs/plexGetHomeData.js"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -294,7 +323,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -314,12 +343,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------------------ | ------------------------------ | ------------------------------ | | errors.GetHomeDataBadRequest | 400 | application/json | | errors.GetHomeDataUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getServerResources @@ -333,14 +361,18 @@ import { IncludeHttps, IncludeIPv6, IncludeRelay } from "@lukehagar/plexjs/sdk/m const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { - const result = await plexAPI.plex.getServerResources("gcgzw5rz2xovp84b4vha3a40", IncludeHttps.One, IncludeRelay.One, IncludeIPv6.One); - + const result = await plexAPI.plex.getServerResources(IncludeHttps.Enable, IncludeRelay.Enable, IncludeIPv6.Enable, "gcgzw5rz2xovp84b4vha3a40"); + // Handle the result - console.log(result) + console.log(result); } run(); @@ -359,11 +391,15 @@ import { IncludeHttps, IncludeIPv6, IncludeRelay } from "@lukehagar/plexjs/sdk/m // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { - const res = await plexGetServerResources(plexAPI, "gcgzw5rz2xovp84b4vha3a40", IncludeHttps.One, IncludeRelay.One, IncludeIPv6.One); + const res = await plexGetServerResources(plexAPI, IncludeHttps.Enable, IncludeRelay.Enable, IncludeIPv6.Enable, "gcgzw5rz2xovp84b4vha3a40"); if (!res.ok) { throw res.error; @@ -372,7 +408,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -382,10 +418,10 @@ run(); | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `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)
| [object Object] | | `includeHttps` | [operations.IncludeHttps](../../sdk/models/operations/includehttps.md) | :heavy_minus_sign: | Include Https entries in the results | [object Object] | | `includeRelay` | [operations.IncludeRelay](../../sdk/models/operations/includerelay.md) | :heavy_minus_sign: | Include Relay addresses in the results
E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400
| [object Object] | | `includeIPv6` | [operations.IncludeIPv6](../../sdk/models/operations/includeipv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | [object Object] | +| `clientID` | *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) | [object Object] | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | | @@ -397,16 +433,15 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------------------------- | ------------------------------------- | ------------------------------------- | | errors.GetServerResourcesBadRequest | 400 | application/json | | errors.GetServerResourcesUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getPin -Retrieve a Pin from Plex.tv for authentication flows +Retrieve a Pin ID from Plex.tv to use for authentication flows ### Example Usage @@ -414,14 +449,18 @@ Retrieve a Pin from Plex.tv for authentication flows import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { - const result = await plexAPI.plex.getPin("gcgzw5rz2xovp84b4vha3a40", "Plex Web"); - + const result = await plexAPI.plex.getPin({}); + // Handle the result - console.log(result) + console.log(result); } run(); @@ -438,11 +477,15 @@ import { plexGetPin } from "@lukehagar/plexjs/funcs/plexGetPin.js"; // Use `PlexAPICore` for best tree-shaking performance. // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { - const res = await plexGetPin(plexAPI, "gcgzw5rz2xovp84b4vha3a40", "Plex Web"); + const res = await plexGetPin(plexAPI, {}); if (!res.ok) { throw res.error; @@ -451,7 +494,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -459,15 +502,13 @@ run(); ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `strong` | *boolean* | :heavy_minus_sign: | Determines the kind of code returned by the API call
Strong codes are used for Pin authentication flows
Non-Strong codes are used for `Plex.tv/link`
| | -| `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)
| [object Object] | -| `xPlexProduct` | *string* | :heavy_minus_sign: | N/A | [object Object] | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | | -| `options.serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetPinRequest](../../sdk/models/operations/getpinrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| `options.serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -475,11 +516,10 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ----------------------- | ----------------------- | ----------------------- | | errors.GetPinBadRequest | 400 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getTokenByPinId @@ -491,14 +531,20 @@ Retrieve an Access Token from Plex.tv after the Pin has been authenticated import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { - const result = await plexAPI.plex.getTokenByPinId(408895, "gcgzw5rz2xovp84b4vha3a40"); - + const result = await plexAPI.plex.getTokenByPinId({ + pinID: 408895, + }); + // Handle the result - console.log(result) + console.log(result); } run(); @@ -515,11 +561,17 @@ import { plexGetTokenByPinId } from "@lukehagar/plexjs/funcs/plexGetTokenByPinId // Use `PlexAPICore` for best tree-shaking performance. // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { - const res = await plexGetTokenByPinId(plexAPI, 408895, "gcgzw5rz2xovp84b4vha3a40"); + const res = await plexGetTokenByPinId(plexAPI, { + pinID: 408895, + }); if (!res.ok) { throw res.error; @@ -528,7 +580,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -536,14 +588,13 @@ run(); ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `pinID` | *number* | :heavy_check_mark: | The PinID to retrieve an access token for | | -| `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)
| [object Object] | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | | -| `options.serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetTokenByPinIdRequest](../../sdk/models/operations/gettokenbypinidrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| `options.serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -551,8 +602,8 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ---------------------------------- | ---------------------------------- | ---------------------------------- | | errors.GetTokenByPinIdBadRequest | 400 | application/json | | errors.GetTokenByPinIdResponseBody | 404 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/plexapi/README.md b/docs/sdks/plexapi/README.md index 2fd26ab8..1baeb06d 100644 --- a/docs/sdks/plexapi/README.md +++ b/docs/sdks/plexapi/README.md @@ -2,4 +2,27 @@ ## Overview -Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server \ No newline at end of file +# Plex Media Server OpenAPI Specification + +An Open Source OpenAPI Specification for Plex Media Server + +Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/) + +## Documentation + +[API Documentation](https://plexapi.dev) + +## SDKs + +The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the [main specification Repository](https://github.com/LukeHagar/plex-api-spec). + +| Language | Repository | Releases | Other | +| --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- | +| Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - | +| JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - | +| Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) | +| Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - | +| Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - | +| PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - | +| Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - | +| C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | - diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md index c0a7e6bb..5d4a1ab5 100644 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -35,14 +35,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.search.performSearch("dylan", 5); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -60,7 +64,11 @@ import { searchPerformSearch } from "@lukehagar/plexjs/funcs/searchPerformSearch // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -73,7 +81,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -96,12 +104,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | -------------------------------- | -------------------------------- | -------------------------------- | | errors.PerformSearchBadRequest | 400 | application/json | | errors.PerformSearchUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## performVoiceSearch @@ -118,14 +125,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.search.performVoiceSearch("dead+poop", 5); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -143,7 +154,11 @@ import { searchPerformVoiceSearch } from "@lukehagar/plexjs/funcs/searchPerformV // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -156,7 +171,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -179,12 +194,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------------------------- | ------------------------------------- | ------------------------------------- | | errors.PerformVoiceSearchBadRequest | 400 | application/json | | errors.PerformVoiceSearchUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getSearchResults @@ -197,14 +211,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.search.getSearchResults("110"); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -222,7 +240,11 @@ import { searchGetSearchResults } from "@lukehagar/plexjs/funcs/searchGetSearchR // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -235,7 +257,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -256,8 +278,8 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | errors.GetSearchResultsBadRequest | 400 | application/json | | errors.GetSearchResultsUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/server/README.md b/docs/sdks/server/README.md index 6a1bbfea..bfd7b162 100644 --- a/docs/sdks/server/README.md +++ b/docs/sdks/server/README.md @@ -29,14 +29,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.server.getServerCapabilities(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -54,7 +58,11 @@ import { serverGetServerCapabilities } from "@lukehagar/plexjs/funcs/serverGetSe // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -67,7 +75,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -87,12 +95,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | | errors.GetServerCapabilitiesBadRequest | 400 | application/json | | errors.GetServerCapabilitiesUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getServerPreferences @@ -105,14 +112,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.server.getServerPreferences(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -130,7 +141,11 @@ import { serverGetServerPreferences } from "@lukehagar/plexjs/funcs/serverGetSer // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -143,7 +158,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -163,12 +178,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------------------------- | --------------------------------------- | --------------------------------------- | | errors.GetServerPreferencesBadRequest | 400 | application/json | | errors.GetServerPreferencesUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getAvailableClients @@ -181,14 +195,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.server.getAvailableClients(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -206,7 +224,11 @@ import { serverGetAvailableClients } from "@lukehagar/plexjs/funcs/serverGetAvai // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -219,7 +241,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -239,12 +261,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | -------------------------------------- | -------------------------------------- | -------------------------------------- | | errors.GetAvailableClientsBadRequest | 400 | application/json | | errors.GetAvailableClientsUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getDevices @@ -257,14 +278,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.server.getDevices(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -282,7 +307,11 @@ import { serverGetDevices } from "@lukehagar/plexjs/funcs/serverGetDevices.js"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -295,7 +324,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -315,12 +344,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ----------------------------- | ----------------------------- | ----------------------------- | | errors.GetDevicesBadRequest | 400 | application/json | | errors.GetDevicesUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getServerIdentity @@ -332,14 +360,18 @@ This request is useful to determine if the server is online or offline import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.server.getServerIdentity(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -356,7 +388,11 @@ import { serverGetServerIdentity } from "@lukehagar/plexjs/funcs/serverGetServer // Use `PlexAPICore` for best tree-shaking performance. // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -369,7 +405,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -389,11 +425,10 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | -------------------------------------- | -------------------------------------- | -------------------------------------- | | errors.GetServerIdentityRequestTimeout | 408 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getMyPlexAccount @@ -406,14 +441,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.server.getMyPlexAccount(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -431,7 +470,11 @@ import { serverGetMyPlexAccount } from "@lukehagar/plexjs/funcs/serverGetMyPlexA // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -444,7 +487,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -464,12 +507,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | errors.GetMyPlexAccountBadRequest | 400 | application/json | | errors.GetMyPlexAccountUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getResizedPhoto @@ -484,7 +526,11 @@ import { MinSize, Upscale } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -492,14 +538,14 @@ async function run() { width: 110, height: 165, opacity: 100, - blur: 20, + blur: 0, minSize: MinSize.One, upscale: Upscale.One, url: "/library/metadata/49564/thumb/1654258204", }); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -518,7 +564,11 @@ import { MinSize, Upscale } from "@lukehagar/plexjs/sdk/models/operations"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -526,9 +576,9 @@ async function run() { width: 110, height: 165, opacity: 100, - blur: 20, + blur: 0, minSize: MinSize.One, - upscale: Upscale.Zero, + upscale: Upscale.One, url: "/library/metadata/49564/thumb/1654258204", }); @@ -539,7 +589,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -560,12 +610,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ---------------------------------- | ---------------------------------- | ---------------------------------- | | errors.GetResizedPhotoBadRequest | 400 | application/json | | errors.GetResizedPhotoUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getMediaProviders @@ -578,14 +627,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.server.getMediaProviders("CV5xoxjTpFKUzBTShsaf"); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -603,7 +656,11 @@ import { serverGetMediaProviders } from "@lukehagar/plexjs/funcs/serverGetMediaP // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -616,7 +673,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -637,12 +694,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------------------------ | ------------------------------------ | ------------------------------------ | | errors.GetMediaProvidersBadRequest | 400 | application/json | | errors.GetMediaProvidersUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getServerList @@ -655,14 +711,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.server.getServerList(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -680,7 +740,11 @@ import { serverGetServerList } from "@lukehagar/plexjs/funcs/serverGetServerList // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -693,7 +757,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -713,8 +777,8 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | -------------------------------- | -------------------------------- | -------------------------------- | | errors.GetServerListBadRequest | 400 | application/json | | errors.GetServerListUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/sessions/README.md b/docs/sdks/sessions/README.md index 0b60b42a..975297b9 100644 --- a/docs/sdks/sessions/README.md +++ b/docs/sdks/sessions/README.md @@ -24,14 +24,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.sessions.getSessions(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -49,7 +53,11 @@ import { sessionsGetSessions } from "@lukehagar/plexjs/funcs/sessionsGetSessions // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -62,7 +70,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -82,12 +90,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------------------ | ------------------------------ | ------------------------------ | | errors.GetSessionsBadRequest | 400 | application/json | | errors.GetSessionsUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getSessionHistory @@ -100,14 +107,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.sessions.getSessionHistory("viewedAt:desc", 1, {}, 12); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -125,7 +136,11 @@ import { sessionsGetSessionHistory } from "@lukehagar/plexjs/funcs/sessionsGetSe // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -138,7 +153,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -162,12 +177,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------------------------ | ------------------------------------ | ------------------------------------ | | errors.GetSessionHistoryBadRequest | 400 | application/json | | errors.GetSessionHistoryUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getTranscodeSessions @@ -180,14 +194,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.sessions.getTranscodeSessions(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -205,7 +223,11 @@ import { sessionsGetTranscodeSessions } from "@lukehagar/plexjs/funcs/sessionsGe // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -218,7 +240,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -238,12 +260,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------------------------- | --------------------------------------- | --------------------------------------- | | errors.GetTranscodeSessionsBadRequest | 400 | application/json | | errors.GetTranscodeSessionsUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## stopTranscodeSession @@ -256,14 +277,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.sessions.stopTranscodeSession("zz7llzqlx8w9vnrsbnwhbmep"); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -281,7 +306,11 @@ import { sessionsStopTranscodeSession } from "@lukehagar/plexjs/funcs/sessionsSt // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -294,7 +323,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -315,8 +344,8 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------------------------- | --------------------------------------- | --------------------------------------- | | errors.StopTranscodeSessionBadRequest | 400 | application/json | | errors.StopTranscodeSessionUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/statistics/README.md b/docs/sdks/statistics/README.md index e11559e6..51ef8dbf 100644 --- a/docs/sdks/statistics/README.md +++ b/docs/sdks/statistics/README.md @@ -23,14 +23,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.statistics.getStatistics(4); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -48,7 +52,11 @@ import { statisticsGetStatistics } from "@lukehagar/plexjs/funcs/statisticsGetSt // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -61,7 +69,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -82,12 +90,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | -------------------------------- | -------------------------------- | -------------------------------- | | errors.GetStatisticsBadRequest | 400 | application/json | | errors.GetStatisticsUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getResourcesStatistics @@ -100,14 +107,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.statistics.getResourcesStatistics(4); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -125,7 +136,11 @@ import { statisticsGetResourcesStatistics } from "@lukehagar/plexjs/funcs/statis // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -138,7 +153,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -159,12 +174,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | | errors.GetResourcesStatisticsBadRequest | 400 | application/json | | errors.GetResourcesStatisticsUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## getBandwidthStatistics @@ -177,14 +191,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.statistics.getBandwidthStatistics(4); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -202,7 +220,11 @@ import { statisticsGetBandwidthStatistics } from "@lukehagar/plexjs/funcs/statis // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -215,7 +237,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -236,8 +258,8 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | | errors.GetBandwidthStatisticsBadRequest | 400 | application/json | | errors.GetBandwidthStatisticsUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/updater/README.md b/docs/sdks/updater/README.md index e4563416..f79169ec 100644 --- a/docs/sdks/updater/README.md +++ b/docs/sdks/updater/README.md @@ -24,14 +24,18 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.updater.getUpdateStatus(); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -49,7 +53,11 @@ import { updaterGetUpdateStatus } from "@lukehagar/plexjs/funcs/updaterGetUpdate // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -62,7 +70,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -82,12 +90,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ---------------------------------- | ---------------------------------- | ---------------------------------- | | errors.GetUpdateStatusBadRequest | 400 | application/json | | errors.GetUpdateStatusUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## checkForUpdates @@ -101,14 +108,18 @@ import { Download } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.updater.checkForUpdates(Download.One); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -127,7 +138,11 @@ import { Download } from "@lukehagar/plexjs/sdk/models/operations"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -140,7 +155,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -161,12 +176,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ---------------------------------- | ---------------------------------- | ---------------------------------- | | errors.CheckForUpdatesBadRequest | 400 | application/json | | errors.CheckForUpdatesUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## applyUpdates @@ -181,14 +195,18 @@ import { Skip, Tonight } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { const result = await plexAPI.updater.applyUpdates(Tonight.One, Skip.One); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -207,7 +225,11 @@ import { Skip, Tonight } from "@lukehagar/plexjs/sdk/models/operations"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -220,7 +242,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -242,8 +264,8 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.ApplyUpdatesBadRequest | 400 | application/json | | errors.ApplyUpdatesUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/video/README.md b/docs/sdks/video/README.md index 40f00498..bad216ea 100644 --- a/docs/sdks/video/README.md +++ b/docs/sdks/video/README.md @@ -23,7 +23,11 @@ import { State } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -39,9 +43,9 @@ async function run() { playBackTime: 2000, row: 1, }); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -60,7 +64,11 @@ import { State } from "@lukehagar/plexjs/sdk/models/operations"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -84,7 +92,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -105,12 +113,11 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------------------ | ------------------------------ | ------------------------------ | | errors.GetTimelineBadRequest | 400 | application/json | | errors.GetTimelineUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## startUniversalTranscode @@ -123,7 +130,11 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -145,9 +156,9 @@ async function run() { addDebugOverlay: 0, autoAdjustQuality: 0, }); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -165,7 +176,11 @@ import { videoStartUniversalTranscode } from "@lukehagar/plexjs/funcs/videoStart // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -195,7 +210,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -216,8 +231,8 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | | errors.StartUniversalTranscodeBadRequest | 400 | application/json | | errors.StartUniversalTranscodeUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/watchlist/README.md b/docs/sdks/watchlist/README.md index 2cc58db8..6af7c56f 100644 --- a/docs/sdks/watchlist/README.md +++ b/docs/sdks/watchlist/README.md @@ -22,7 +22,11 @@ import { Filter } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -32,9 +36,9 @@ async function run() { xPlexContainerSize: 50, xPlexToken: "CV5xoxjTpFKUzBTShsaf", }); - + // Handle the result - console.log(result) + console.log(result); } run(); @@ -53,7 +57,11 @@ import { Filter } from "@lukehagar/plexjs/sdk/models/operations"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", + clientID: "gcgzw5rz2xovp84b4vha3a40", + clientName: "Plex Web", + clientVersion: "4.133.0", + clientPlatform: "Chrome", + deviceName: "Linux", }); async function run() { @@ -71,7 +79,7 @@ async function run() { const { value: result } = res; // Handle the result - console.log(result) + console.log(result); } run(); @@ -93,8 +101,8 @@ run(); ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------------------- | ------------------------------- | ------------------------------- | | errors.GetWatchListBadRequest | 400 | application/json | | errors.GetWatchListUnauthorized | 401 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/jsr.json b/jsr.json index 03948a01..7ff24ec5 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@lukehagar/plexjs", - "version": "0.23.5", + "version": "0.24.0", "exports": { ".": "./src/index.ts", "./sdk/models/errors": "./src/sdk/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index fd421bad..7a228fec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@lukehagar/plexjs", - "version": "0.23.5", + "version": "0.24.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@lukehagar/plexjs", - "version": "0.23.5", + "version": "0.24.0", "devDependencies": { "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", diff --git a/package.json b/package.json index 50d58025..ffa6d6e9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lukehagar/plexjs", - "version": "0.23.5", + "version": "0.24.0", "author": "LukeHagar", "main": "./index.js", "sideEffects": false, diff --git a/src/funcs/activitiesCancelServerActivities.ts b/src/funcs/activitiesCancelServerActivities.ts index 00ab5c0c..567ebc43 100644 --- a/src/funcs/activitiesCancelServerActivities.ts +++ b/src/funcs/activitiesCancelServerActivities.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * Cancel Server Activities */ export async function activitiesCancelServerActivities( - client$: PlexAPICore, + client: PlexAPICore, activityUUID: string, options?: RequestOptions, ): Promise< @@ -46,62 +46,62 @@ export async function activitiesCancelServerActivities( | ConnectionError > > { - const input$: operations.CancelServerActivitiesRequest = { + const input: operations.CancelServerActivitiesRequest = { activityUUID: activityUUID, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => - operations.CancelServerActivitiesRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => + operations.CancelServerActivitiesRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const pathParams$ = { - activityUUID: encodeSimple$("activityUUID", payload$.activityUUID, { + const pathParams = { + activityUUID: encodeSimple("activityUUID", payload.activityUUID, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/activities/{activityUUID}")(pathParams$); + const path = pathToFunc("/activities/{activityUUID}")(pathParams); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "cancelServerActivities", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "DELETE", - path: path$, - headers: headers$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -109,7 +109,7 @@ export async function activitiesCancelServerActivities( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -117,7 +117,7 @@ export async function activitiesCancelServerActivities( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.CancelServerActivitiesResponse, | errors.CancelServerActivitiesBadRequest | errors.CancelServerActivitiesUnauthorized @@ -129,14 +129,14 @@ export async function activitiesCancelServerActivities( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.CancelServerActivitiesResponse$inboundSchema), - m$.jsonErr(400, errors.CancelServerActivitiesBadRequest$inboundSchema), - m$.jsonErr(401, errors.CancelServerActivitiesUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.CancelServerActivitiesResponse$inboundSchema), + M.jsonErr(400, errors.CancelServerActivitiesBadRequest$inboundSchema), + M.jsonErr(401, errors.CancelServerActivitiesUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/activitiesGetServerActivities.ts b/src/funcs/activitiesGetServerActivities.ts index 747cf54a..ac12893c 100644 --- a/src/funcs/activitiesGetServerActivities.ts +++ b/src/funcs/activitiesGetServerActivities.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -27,7 +27,7 @@ import { Result } from "../sdk/types/fp.js"; * Get Server Activities */ export async function activitiesGetServerActivities( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions, ): Promise< Result< @@ -43,38 +43,38 @@ export async function activitiesGetServerActivities( | ConnectionError > > { - const path$ = pathToFunc("/activities")(); + const path = pathToFunc("/activities")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getServerActivities", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -82,7 +82,7 @@ export async function activitiesGetServerActivities( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -90,7 +90,7 @@ export async function activitiesGetServerActivities( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetServerActivitiesResponse, | errors.GetServerActivitiesBadRequest | errors.GetServerActivitiesUnauthorized @@ -102,16 +102,16 @@ export async function activitiesGetServerActivities( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetServerActivitiesResponse$inboundSchema, { + M.json(200, operations.GetServerActivitiesResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetServerActivitiesBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetServerActivitiesUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetServerActivitiesBadRequest$inboundSchema), + M.jsonErr(401, errors.GetServerActivitiesUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/authenticationGetSourceConnectionInformation.ts b/src/funcs/authenticationGetSourceConnectionInformation.ts index 5a858395..5ae86236 100644 --- a/src/funcs/authenticationGetSourceConnectionInformation.ts +++ b/src/funcs/authenticationGetSourceConnectionInformation.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -30,7 +30,7 @@ import { Result } from "../sdk/types/fp.js"; * Note: requires Plex Media Server >= 1.15.4. */ export async function authenticationGetSourceConnectionInformation( - client$: PlexAPICore, + client: PlexAPICore, source: string, options?: RequestOptions, ): Promise< @@ -47,62 +47,62 @@ export async function authenticationGetSourceConnectionInformation( | ConnectionError > > { - const input$: operations.GetSourceConnectionInformationRequest = { + const input: operations.GetSourceConnectionInformationRequest = { source: source, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => + const parsed = safeParse( + input, + (value) => operations.GetSourceConnectionInformationRequest$outboundSchema.parse( - value$, + value, ), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/security/resources")(); + const path = pathToFunc("/security/resources")(); - const query$ = encodeFormQuery$({ - "source": payload$.source, + const query = encodeFormQuery({ + "source": payload.source, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getSourceConnectionInformation", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -110,7 +110,7 @@ export async function authenticationGetSourceConnectionInformation( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -118,7 +118,7 @@ export async function authenticationGetSourceConnectionInformation( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetSourceConnectionInformationResponse, | errors.GetSourceConnectionInformationBadRequest | errors.GetSourceConnectionInformationUnauthorized @@ -130,23 +130,20 @@ export async function authenticationGetSourceConnectionInformation( | RequestTimeoutError | ConnectionError >( - m$.nil( - 200, - operations.GetSourceConnectionInformationResponse$inboundSchema, - ), - m$.jsonErr( + M.nil(200, operations.GetSourceConnectionInformationResponse$inboundSchema), + M.jsonErr( 400, errors.GetSourceConnectionInformationBadRequest$inboundSchema, ), - m$.jsonErr( + M.jsonErr( 401, errors.GetSourceConnectionInformationUnauthorized$inboundSchema, ), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/authenticationGetTokenDetails.ts b/src/funcs/authenticationGetTokenDetails.ts index e4957001..03e562cc 100644 --- a/src/funcs/authenticationGetTokenDetails.ts +++ b/src/funcs/authenticationGetTokenDetails.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -28,7 +28,7 @@ import { Result } from "../sdk/types/fp.js"; * Get the User data from the provided X-Plex-Token */ export async function authenticationGetTokenDetails( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions & { serverURL?: string }, ): Promise< Result< @@ -44,42 +44,42 @@ export async function authenticationGetTokenDetails( | ConnectionError > > { - const baseURL$ = options?.serverURL + const baseURL = options?.serverURL || pathToFunc(GetTokenDetailsServerList[0], { charEncoding: "percent" })(); - const path$ = pathToFunc("/user")(); + const path = pathToFunc("/user")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getTokenDetails", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - baseURL: baseURL$, - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + baseURL: baseURL, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -87,7 +87,7 @@ export async function authenticationGetTokenDetails( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -95,7 +95,7 @@ export async function authenticationGetTokenDetails( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetTokenDetailsResponse, | errors.GetTokenDetailsBadRequest | errors.GetTokenDetailsUnauthorized @@ -107,16 +107,16 @@ export async function authenticationGetTokenDetails( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetTokenDetailsResponse$inboundSchema, { + M.json(200, operations.GetTokenDetailsResponse$inboundSchema, { key: "UserPlexAccount", }), - m$.jsonErr(400, errors.GetTokenDetailsBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetTokenDetailsUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetTokenDetailsBadRequest$inboundSchema), + M.jsonErr(401, errors.GetTokenDetailsUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/authenticationGetTransientToken.ts b/src/funcs/authenticationGetTransientToken.ts index b91efb8f..bd04e110 100644 --- a/src/funcs/authenticationGetTransientToken.ts +++ b/src/funcs/authenticationGetTransientToken.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted. */ export async function authenticationGetTransientToken( - client$: PlexAPICore, + client: PlexAPICore, type: operations.GetTransientTokenQueryParamType, scope: operations.Scope, options?: RequestOptions, @@ -47,62 +47,61 @@ export async function authenticationGetTransientToken( | ConnectionError > > { - const input$: operations.GetTransientTokenRequest = { + const input: operations.GetTransientTokenRequest = { type: type, scope: scope, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => - operations.GetTransientTokenRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.GetTransientTokenRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/security/token")(); + const path = pathToFunc("/security/token")(); - const query$ = encodeFormQuery$({ - "scope": payload$.scope, - "type": payload$.type, + const query = encodeFormQuery({ + "scope": payload.scope, + "type": payload.type, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getTransientToken", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -110,7 +109,7 @@ export async function authenticationGetTransientToken( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -118,7 +117,7 @@ export async function authenticationGetTransientToken( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetTransientTokenResponse, | errors.GetTransientTokenBadRequest | errors.GetTransientTokenUnauthorized @@ -130,14 +129,14 @@ export async function authenticationGetTransientToken( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.GetTransientTokenResponse$inboundSchema), - m$.jsonErr(400, errors.GetTransientTokenBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetTransientTokenUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.GetTransientTokenResponse$inboundSchema), + M.jsonErr(400, errors.GetTransientTokenBadRequest$inboundSchema), + M.jsonErr(401, errors.GetTransientTokenUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/authenticationPostUsersSignInData.ts b/src/funcs/authenticationPostUsersSignInData.ts index fcaa08ec..fc9c8733 100644 --- a/src/funcs/authenticationPostUsersSignInData.ts +++ b/src/funcs/authenticationPostUsersSignInData.ts @@ -3,12 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { - encodeBodyForm as encodeBodyForm$, - encodeFormQuery as encodeFormQuery$, -} from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeBodyForm, encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { pathToFunc } from "../lib/url.js"; import { @@ -32,9 +29,8 @@ import { Result } from "../sdk/types/fp.js"; * Sign in user with username and password and return user data with Plex authentication token */ export async function authenticationPostUsersSignInData( - client$: PlexAPICore, - xPlexClientIdentifier?: string | undefined, - requestBody?: operations.PostUsersSignInDataRequestBody | undefined, + client: PlexAPICore, + request: operations.PostUsersSignInDataRequest, options?: RequestOptions & { serverURL?: string }, ): Promise< Result< @@ -50,39 +46,44 @@ export async function authenticationPostUsersSignInData( | ConnectionError > > { - const input$: operations.PostUsersSignInDataRequest = { - xPlexClientIdentifier: xPlexClientIdentifier, - requestBody: requestBody, - }; + const input = request; - const parsed$ = schemas$.safeParse( - input$, - (value$) => - operations.PostUsersSignInDataRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => + operations.PostUsersSignInDataRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; + const payload = parsed.value; - const body$ = Object.entries(payload$.RequestBody || {}).map(([k, v]) => { - return encodeBodyForm$(k, v, { charEncoding: "percent" }); + const body = Object.entries(payload.RequestBody || {}).map(([k, v]) => { + return encodeBodyForm(k, v, { charEncoding: "percent" }); }).join("&"); - const baseURL$ = options?.serverURL + const baseURL = options?.serverURL || pathToFunc(PostUsersSignInDataServerList[0], { charEncoding: "percent", })(); - const path$ = pathToFunc("/users/signin")(); + const path = pathToFunc("/users/signin")(); - const query$ = encodeFormQuery$({ - "X-Plex-Client-Identifier": payload$["X-Plex-Client-Identifier"] - ?? client$.options$.xPlexClientIdentifier, + const query = encodeFormQuery({ + "X-Plex-Client-Identifier": payload.ClientID, + "X-Plex-Client-Identifier": client._options.clientID, + "X-Plex-Device": payload.DeviceName, + "X-Plex-Device": client._options.deviceName, + "X-Plex-Platform": payload.ClientPlatform, + "X-Plex-Platform": client._options.clientPlatform, + "X-Plex-Product": client._options.clientName, + "X-Plex-Product": payload.ClientName, + "X-Plex-Version": client._options.clientVersion, + "X-Plex-Version": payload.ClientVersion, }); - const headers$ = new Headers({ + const headers = new Headers({ "Content-Type": "application/x-www-form-urlencoded", Accept: "application/json", }); @@ -93,25 +94,25 @@ export async function authenticationPostUsersSignInData( securitySource: null, }; - const requestRes = client$.createRequest$(context, { + const requestRes = client._createRequest(context, { method: "POST", - baseURL: baseURL$, - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + baseURL: baseURL, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -119,7 +120,7 @@ export async function authenticationPostUsersSignInData( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -127,7 +128,7 @@ export async function authenticationPostUsersSignInData( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.PostUsersSignInDataResponse, | errors.PostUsersSignInDataBadRequest | errors.PostUsersSignInDataUnauthorized @@ -139,16 +140,16 @@ export async function authenticationPostUsersSignInData( | RequestTimeoutError | ConnectionError >( - m$.json(201, operations.PostUsersSignInDataResponse$inboundSchema, { + M.json(201, operations.PostUsersSignInDataResponse$inboundSchema, { key: "UserPlexAccount", }), - m$.jsonErr(400, errors.PostUsersSignInDataBadRequest$inboundSchema), - m$.jsonErr(401, errors.PostUsersSignInDataUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.PostUsersSignInDataBadRequest$inboundSchema), + M.jsonErr(401, errors.PostUsersSignInDataUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/butlerGetButlerTasks.ts b/src/funcs/butlerGetButlerTasks.ts index 2c0819e9..d73604a5 100644 --- a/src/funcs/butlerGetButlerTasks.ts +++ b/src/funcs/butlerGetButlerTasks.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -27,7 +27,7 @@ import { Result } from "../sdk/types/fp.js"; * Returns a list of butler tasks */ export async function butlerGetButlerTasks( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions, ): Promise< Result< @@ -43,38 +43,38 @@ export async function butlerGetButlerTasks( | ConnectionError > > { - const path$ = pathToFunc("/butler")(); + const path = pathToFunc("/butler")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getButlerTasks", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -82,7 +82,7 @@ export async function butlerGetButlerTasks( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -90,7 +90,7 @@ export async function butlerGetButlerTasks( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetButlerTasksResponse, | errors.GetButlerTasksBadRequest | errors.GetButlerTasksUnauthorized @@ -102,16 +102,16 @@ export async function butlerGetButlerTasks( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetButlerTasksResponse$inboundSchema, { + M.json(200, operations.GetButlerTasksResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetButlerTasksBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetButlerTasksUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetButlerTasksBadRequest$inboundSchema), + M.jsonErr(401, errors.GetButlerTasksUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/butlerStartAllTasks.ts b/src/funcs/butlerStartAllTasks.ts index 08b1f85f..aaff2818 100644 --- a/src/funcs/butlerStartAllTasks.ts +++ b/src/funcs/butlerStartAllTasks.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -31,7 +31,7 @@ import { Result } from "../sdk/types/fp.js"; * 4. If we are outside the configured window, the task will start immediately. */ export async function butlerStartAllTasks( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions, ): Promise< Result< @@ -47,38 +47,38 @@ export async function butlerStartAllTasks( | ConnectionError > > { - const path$ = pathToFunc("/butler")(); + const path = pathToFunc("/butler")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "startAllTasks", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "POST", - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -86,7 +86,7 @@ export async function butlerStartAllTasks( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -94,7 +94,7 @@ export async function butlerStartAllTasks( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.StartAllTasksResponse, | errors.StartAllTasksBadRequest | errors.StartAllTasksUnauthorized @@ -106,14 +106,14 @@ export async function butlerStartAllTasks( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.StartAllTasksResponse$inboundSchema), - m$.jsonErr(400, errors.StartAllTasksBadRequest$inboundSchema), - m$.jsonErr(401, errors.StartAllTasksUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.StartAllTasksResponse$inboundSchema), + M.jsonErr(400, errors.StartAllTasksBadRequest$inboundSchema), + M.jsonErr(401, errors.StartAllTasksUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/butlerStartTask.ts b/src/funcs/butlerStartTask.ts index f07c3cf5..2c4bea72 100644 --- a/src/funcs/butlerStartTask.ts +++ b/src/funcs/butlerStartTask.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -33,7 +33,7 @@ import { Result } from "../sdk/types/fp.js"; * 4. If we are outside the configured window, the task will start immediately. */ export async function butlerStartTask( - client$: PlexAPICore, + client: PlexAPICore, taskName: operations.TaskName, options?: RequestOptions, ): Promise< @@ -50,61 +50,61 @@ export async function butlerStartTask( | ConnectionError > > { - const input$: operations.StartTaskRequest = { + const input: operations.StartTaskRequest = { taskName: taskName, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.StartTaskRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.StartTaskRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const pathParams$ = { - taskName: encodeSimple$("taskName", payload$.taskName, { + const pathParams = { + taskName: encodeSimple("taskName", payload.taskName, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/butler/{taskName}")(pathParams$); + const path = pathToFunc("/butler/{taskName}")(pathParams); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "startTask", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "POST", - path: path$, - headers: headers$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -112,7 +112,7 @@ export async function butlerStartTask( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -120,7 +120,7 @@ export async function butlerStartTask( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.StartTaskResponse, | errors.StartTaskBadRequest | errors.StartTaskUnauthorized @@ -132,14 +132,14 @@ export async function butlerStartTask( | RequestTimeoutError | ConnectionError >( - m$.nil([200, 202], operations.StartTaskResponse$inboundSchema), - m$.jsonErr(400, errors.StartTaskBadRequest$inboundSchema), - m$.jsonErr(401, errors.StartTaskUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil([200, 202], operations.StartTaskResponse$inboundSchema), + M.jsonErr(400, errors.StartTaskBadRequest$inboundSchema), + M.jsonErr(401, errors.StartTaskUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/butlerStopAllTasks.ts b/src/funcs/butlerStopAllTasks.ts index b59c86f3..d0395835 100644 --- a/src/funcs/butlerStopAllTasks.ts +++ b/src/funcs/butlerStopAllTasks.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -27,7 +27,7 @@ import { Result } from "../sdk/types/fp.js"; * This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue. */ export async function butlerStopAllTasks( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions, ): Promise< Result< @@ -43,38 +43,38 @@ export async function butlerStopAllTasks( | ConnectionError > > { - const path$ = pathToFunc("/butler")(); + const path = pathToFunc("/butler")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "stopAllTasks", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "DELETE", - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -82,7 +82,7 @@ export async function butlerStopAllTasks( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -90,7 +90,7 @@ export async function butlerStopAllTasks( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.StopAllTasksResponse, | errors.StopAllTasksBadRequest | errors.StopAllTasksUnauthorized @@ -102,14 +102,14 @@ export async function butlerStopAllTasks( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.StopAllTasksResponse$inboundSchema), - m$.jsonErr(400, errors.StopAllTasksBadRequest$inboundSchema), - m$.jsonErr(401, errors.StopAllTasksUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.StopAllTasksResponse$inboundSchema), + M.jsonErr(400, errors.StopAllTasksBadRequest$inboundSchema), + M.jsonErr(401, errors.StopAllTasksUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/butlerStopTask.ts b/src/funcs/butlerStopTask.ts index 25199e3a..2613c496 100644 --- a/src/funcs/butlerStopTask.ts +++ b/src/funcs/butlerStopTask.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists. See the section above for a list of task names for this endpoint. */ export async function butlerStopTask( - client$: PlexAPICore, + client: PlexAPICore, taskName: operations.PathParamTaskName, options?: RequestOptions, ): Promise< @@ -46,61 +46,61 @@ export async function butlerStopTask( | ConnectionError > > { - const input$: operations.StopTaskRequest = { + const input: operations.StopTaskRequest = { taskName: taskName, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.StopTaskRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.StopTaskRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const pathParams$ = { - taskName: encodeSimple$("taskName", payload$.taskName, { + const pathParams = { + taskName: encodeSimple("taskName", payload.taskName, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/butler/{taskName}")(pathParams$); + const path = pathToFunc("/butler/{taskName}")(pathParams); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "stopTask", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "DELETE", - path: path$, - headers: headers$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "404", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -108,7 +108,7 @@ export async function butlerStopTask( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -116,7 +116,7 @@ export async function butlerStopTask( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.StopTaskResponse, | errors.StopTaskBadRequest | errors.StopTaskUnauthorized @@ -128,14 +128,14 @@ export async function butlerStopTask( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.StopTaskResponse$inboundSchema), - m$.jsonErr(400, errors.StopTaskBadRequest$inboundSchema), - m$.jsonErr(401, errors.StopTaskUnauthorized$inboundSchema), - m$.fail([404, "4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.StopTaskResponse$inboundSchema), + M.jsonErr(400, errors.StopTaskBadRequest$inboundSchema), + M.jsonErr(401, errors.StopTaskUnauthorized$inboundSchema), + M.fail([404, "4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/hubsGetGlobalHubs.ts b/src/funcs/hubsGetGlobalHubs.ts index 5970b387..e5ed6ad8 100644 --- a/src/funcs/hubsGetGlobalHubs.ts +++ b/src/funcs/hubsGetGlobalHubs.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * Get Global Hubs filtered by the parameters provided. */ export async function hubsGetGlobalHubs( - client$: PlexAPICore, + client: PlexAPICore, count?: number | undefined, onlyTransient?: operations.OnlyTransient | undefined, options?: RequestOptions, @@ -47,61 +47,61 @@ export async function hubsGetGlobalHubs( | ConnectionError > > { - const input$: operations.GetGlobalHubsRequest = { + const input: operations.GetGlobalHubsRequest = { count: count, onlyTransient: onlyTransient, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.GetGlobalHubsRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.GetGlobalHubsRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/hubs")(); + const path = pathToFunc("/hubs")(); - const query$ = encodeFormQuery$({ - "count": payload$.count, - "onlyTransient": payload$.onlyTransient, + const query = encodeFormQuery({ + "count": payload.count, + "onlyTransient": payload.onlyTransient, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getGlobalHubs", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -109,7 +109,7 @@ export async function hubsGetGlobalHubs( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -117,7 +117,7 @@ export async function hubsGetGlobalHubs( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetGlobalHubsResponse, | errors.GetGlobalHubsBadRequest | errors.GetGlobalHubsUnauthorized @@ -129,16 +129,16 @@ export async function hubsGetGlobalHubs( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetGlobalHubsResponse$inboundSchema, { + M.json(200, operations.GetGlobalHubsResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetGlobalHubsBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetGlobalHubsUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetGlobalHubsBadRequest$inboundSchema), + M.jsonErr(401, errors.GetGlobalHubsUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/hubsGetLibraryHubs.ts b/src/funcs/hubsGetLibraryHubs.ts index 0a4b59c1..678b717e 100644 --- a/src/funcs/hubsGetLibraryHubs.ts +++ b/src/funcs/hubsGetLibraryHubs.ts @@ -3,12 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -32,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * This endpoint will return a list of library specific hubs */ export async function hubsGetLibraryHubs( - client$: PlexAPICore, + client: PlexAPICore, sectionId: number, count?: number | undefined, onlyTransient?: operations.QueryParamOnlyTransient | undefined, @@ -51,69 +48,69 @@ export async function hubsGetLibraryHubs( | ConnectionError > > { - const input$: operations.GetLibraryHubsRequest = { + const input: operations.GetLibraryHubsRequest = { sectionId: sectionId, count: count, onlyTransient: onlyTransient, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.GetLibraryHubsRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.GetLibraryHubsRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const pathParams$ = { - sectionId: encodeSimple$("sectionId", payload$.sectionId, { + const pathParams = { + sectionId: encodeSimple("sectionId", payload.sectionId, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/hubs/sections/{sectionId}")(pathParams$); + const path = pathToFunc("/hubs/sections/{sectionId}")(pathParams); - const query$ = encodeFormQuery$({ - "count": payload$.count, - "onlyTransient": payload$.onlyTransient, + const query = encodeFormQuery({ + "count": payload.count, + "onlyTransient": payload.onlyTransient, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getLibraryHubs", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -121,7 +118,7 @@ export async function hubsGetLibraryHubs( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -129,7 +126,7 @@ export async function hubsGetLibraryHubs( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetLibraryHubsResponse, | errors.GetLibraryHubsBadRequest | errors.GetLibraryHubsUnauthorized @@ -141,16 +138,16 @@ export async function hubsGetLibraryHubs( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetLibraryHubsResponse$inboundSchema, { + M.json(200, operations.GetLibraryHubsResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetLibraryHubsBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetLibraryHubsUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetLibraryHubsBadRequest$inboundSchema), + M.jsonErr(401, errors.GetLibraryHubsUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/hubsGetRecentlyAdded.ts b/src/funcs/hubsGetRecentlyAdded.ts new file mode 100644 index 00000000..1ef78e7b --- /dev/null +++ b/src/funcs/hubsGetRecentlyAdded.ts @@ -0,0 +1,138 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { PlexAPICore } from "../core.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get Recently Added + * + * @remarks + * This endpoint will return the recently added content. + */ +export async function hubsGetRecentlyAdded( + client: PlexAPICore, + request: operations.GetRecentlyAddedRequest, + options?: RequestOptions, +): Promise< + Result< + operations.GetRecentlyAddedResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input = request; + + const parsed = safeParse( + input, + (value) => operations.GetRecentlyAddedRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return parsed; + } + const payload = parsed.value; + const body = null; + + const path = pathToFunc("/hubs/home/recentlyAdded")(); + + const query = encodeFormQuery({ + "contentDirectoryID": payload.contentDirectoryID, + "includeMeta": payload.includeMeta, + "pinnedContentDirectoryID": payload.pinnedContentDirectoryID, + "sectionID": payload.sectionID, + "type": payload.type, + "X-Plex-Container-Size": payload["X-Plex-Container-Size"], + "X-Plex-Container-Start": payload["X-Plex-Container-Start"], + }); + + const headers = new Headers({ + Accept: "application/json", + }); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const context = { + operationID: "get-recently-added", + oAuth2Scopes: [], + securitySource: client._options.accessToken, + }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return requestRes; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "5XX"], + retryConfig: options?.retries + || client._options.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields = { + ContentType: response.headers.get("content-type") + ?? "application/octet-stream", + StatusCode: response.status, + RawResponse: response, + Headers: {}, + }; + + const [result] = await M.match< + operations.GetRecentlyAddedResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + M.json(200, operations.GetRecentlyAddedResponse$inboundSchema, { + key: "object", + }), + M.fail([400, 401, "4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; + } + + return result; +} diff --git a/src/funcs/libraryDeleteLibrary.ts b/src/funcs/libraryDeleteLibrary.ts index 463a3889..2306e1d7 100644 --- a/src/funcs/libraryDeleteLibrary.ts +++ b/src/funcs/libraryDeleteLibrary.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * Delete a library using a specific section id */ export async function libraryDeleteLibrary( - client$: PlexAPICore, + client: PlexAPICore, sectionKey: number, options?: RequestOptions, ): Promise< @@ -46,61 +46,61 @@ export async function libraryDeleteLibrary( | ConnectionError > > { - const input$: operations.DeleteLibraryRequest = { + const input: operations.DeleteLibraryRequest = { sectionKey: sectionKey, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.DeleteLibraryRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.DeleteLibraryRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const pathParams$ = { - sectionKey: encodeSimple$("sectionKey", payload$.sectionKey, { + const pathParams = { + sectionKey: encodeSimple("sectionKey", payload.sectionKey, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/library/sections/{sectionKey}")(pathParams$); + const path = pathToFunc("/library/sections/{sectionKey}")(pathParams); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "deleteLibrary", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "DELETE", - path: path$, - headers: headers$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -108,7 +108,7 @@ export async function libraryDeleteLibrary( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -116,7 +116,7 @@ export async function libraryDeleteLibrary( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.DeleteLibraryResponse, | errors.DeleteLibraryBadRequest | errors.DeleteLibraryUnauthorized @@ -128,14 +128,14 @@ export async function libraryDeleteLibrary( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.DeleteLibraryResponse$inboundSchema), - m$.jsonErr(400, errors.DeleteLibraryBadRequest$inboundSchema), - m$.jsonErr(401, errors.DeleteLibraryUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.DeleteLibraryResponse$inboundSchema), + M.jsonErr(400, errors.DeleteLibraryBadRequest$inboundSchema), + M.jsonErr(401, errors.DeleteLibraryUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/libraryGetAllLibraries.ts b/src/funcs/libraryGetAllLibraries.ts index 62135a30..c5b327fe 100644 --- a/src/funcs/libraryGetAllLibraries.ts +++ b/src/funcs/libraryGetAllLibraries.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -32,7 +32,7 @@ import { Result } from "../sdk/types/fp.js"; * This allows a client to provide a rich interface around the media (e.g. allow sorting movies by release year). */ export async function libraryGetAllLibraries( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions, ): Promise< Result< @@ -48,38 +48,38 @@ export async function libraryGetAllLibraries( | ConnectionError > > { - const path$ = pathToFunc("/library/sections")(); + const path = pathToFunc("/library/sections")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "get-all-libraries", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -87,7 +87,7 @@ export async function libraryGetAllLibraries( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -95,7 +95,7 @@ export async function libraryGetAllLibraries( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetAllLibrariesResponse, | errors.GetAllLibrariesBadRequest | errors.GetAllLibrariesUnauthorized @@ -107,16 +107,16 @@ export async function libraryGetAllLibraries( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetAllLibrariesResponse$inboundSchema, { + M.json(200, operations.GetAllLibrariesResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetAllLibrariesBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetAllLibrariesUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetAllLibrariesBadRequest$inboundSchema), + M.jsonErr(401, errors.GetAllLibrariesUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/libraryGetFileHash.ts b/src/funcs/libraryGetFileHash.ts index 1d37b765..de8e59f7 100644 --- a/src/funcs/libraryGetFileHash.ts +++ b/src/funcs/libraryGetFileHash.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * This resource returns hash values for local files */ export async function libraryGetFileHash( - client$: PlexAPICore, + client: PlexAPICore, url: string, type?: number | undefined, options?: RequestOptions, @@ -47,61 +47,61 @@ export async function libraryGetFileHash( | ConnectionError > > { - const input$: operations.GetFileHashRequest = { + const input: operations.GetFileHashRequest = { url: url, type: type, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.GetFileHashRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.GetFileHashRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/library/hashes")(); + const path = pathToFunc("/library/hashes")(); - const query$ = encodeFormQuery$({ - "type": payload$.type, - "url": payload$.url, + const query = encodeFormQuery({ + "type": payload.type, + "url": payload.url, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getFileHash", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -109,7 +109,7 @@ export async function libraryGetFileHash( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -117,7 +117,7 @@ export async function libraryGetFileHash( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetFileHashResponse, | errors.GetFileHashBadRequest | errors.GetFileHashUnauthorized @@ -129,14 +129,14 @@ export async function libraryGetFileHash( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.GetFileHashResponse$inboundSchema), - m$.jsonErr(400, errors.GetFileHashBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetFileHashUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.GetFileHashResponse$inboundSchema), + M.jsonErr(400, errors.GetFileHashBadRequest$inboundSchema), + M.jsonErr(401, errors.GetFileHashUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/libraryGetLibraryDetails.ts b/src/funcs/libraryGetLibraryDetails.ts index dd8c0c37..1ba68b4c 100644 --- a/src/funcs/libraryGetLibraryDetails.ts +++ b/src/funcs/libraryGetLibraryDetails.ts @@ -3,12 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -70,7 +67,7 @@ import { Result } from "../sdk/types/fp.js"; * > **Note**: Filters and sorts are optional; without them, no filtering controls are rendered. */ export async function libraryGetLibraryDetails( - client$: PlexAPICore, + client: PlexAPICore, sectionKey: number, includeDetails?: operations.IncludeDetails | undefined, options?: RequestOptions, @@ -88,68 +85,67 @@ export async function libraryGetLibraryDetails( | ConnectionError > > { - const input$: operations.GetLibraryDetailsRequest = { + const input: operations.GetLibraryDetailsRequest = { sectionKey: sectionKey, includeDetails: includeDetails, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => - operations.GetLibraryDetailsRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.GetLibraryDetailsRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const pathParams$ = { - sectionKey: encodeSimple$("sectionKey", payload$.sectionKey, { + const pathParams = { + sectionKey: encodeSimple("sectionKey", payload.sectionKey, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/library/sections/{sectionKey}")(pathParams$); + const path = pathToFunc("/library/sections/{sectionKey}")(pathParams); - const query$ = encodeFormQuery$({ - "includeDetails": payload$.includeDetails, + const query = encodeFormQuery({ + "includeDetails": payload.includeDetails, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "get-library-details", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -157,7 +153,7 @@ export async function libraryGetLibraryDetails( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -165,7 +161,7 @@ export async function libraryGetLibraryDetails( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetLibraryDetailsResponse, | errors.GetLibraryDetailsBadRequest | errors.GetLibraryDetailsUnauthorized @@ -177,16 +173,16 @@ export async function libraryGetLibraryDetails( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetLibraryDetailsResponse$inboundSchema, { + M.json(200, operations.GetLibraryDetailsResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetLibraryDetailsBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetLibraryDetailsUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetLibraryDetailsBadRequest$inboundSchema), + M.jsonErr(401, errors.GetLibraryDetailsUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/libraryGetLibraryItems.ts b/src/funcs/libraryGetLibraryItems.ts index acaa10dc..4952a0ed 100644 --- a/src/funcs/libraryGetLibraryItems.ts +++ b/src/funcs/libraryGetLibraryItems.ts @@ -3,12 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -51,7 +48,7 @@ import { Result } from "../sdk/types/fp.js"; * - `folder`: Items categorized by folder. */ export async function libraryGetLibraryItems( - client$: PlexAPICore, + client: PlexAPICore, request: operations.GetLibraryItemsRequest, options?: RequestOptions, ): Promise< @@ -68,72 +65,72 @@ export async function libraryGetLibraryItems( | ConnectionError > > { - const input$ = request; + const input = request; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.GetLibraryItemsRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.GetLibraryItemsRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const pathParams$ = { - sectionKey: encodeSimple$("sectionKey", payload$.sectionKey, { + const pathParams = { + sectionKey: encodeSimple("sectionKey", payload.sectionKey, { explode: false, charEncoding: "percent", }), - tag: encodeSimple$("tag", payload$.tag, { + tag: encodeSimple("tag", payload.tag, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/library/sections/{sectionKey}/{tag}")(pathParams$); + const path = pathToFunc("/library/sections/{sectionKey}/{tag}")(pathParams); - const query$ = encodeFormQuery$({ - "includeGuids": payload$.includeGuids, - "includeMeta": payload$.includeMeta, - "type": payload$.type, - "X-Plex-Container-Size": payload$["X-Plex-Container-Size"], - "X-Plex-Container-Start": payload$["X-Plex-Container-Start"], + const query = encodeFormQuery({ + "includeGuids": payload.includeGuids, + "includeMeta": payload.includeMeta, + "type": payload.type, + "X-Plex-Container-Size": payload["X-Plex-Container-Size"], + "X-Plex-Container-Start": payload["X-Plex-Container-Start"], }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "get-library-items", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -141,7 +138,7 @@ export async function libraryGetLibraryItems( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -149,7 +146,7 @@ export async function libraryGetLibraryItems( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetLibraryItemsResponse, | errors.GetLibraryItemsBadRequest | errors.GetLibraryItemsUnauthorized @@ -161,16 +158,16 @@ export async function libraryGetLibraryItems( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetLibraryItemsResponse$inboundSchema, { + M.json(200, operations.GetLibraryItemsResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetLibraryItemsBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetLibraryItemsUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetLibraryItemsBadRequest$inboundSchema), + M.jsonErr(401, errors.GetLibraryItemsUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/libraryGetMetaDataByRatingKey.ts b/src/funcs/libraryGetMetaDataByRatingKey.ts index ac1e2003..7917963e 100644 --- a/src/funcs/libraryGetMetaDataByRatingKey.ts +++ b/src/funcs/libraryGetMetaDataByRatingKey.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * This endpoint will return the metadata of a library item specified with the ratingKey. */ export async function libraryGetMetaDataByRatingKey( - client$: PlexAPICore, + client: PlexAPICore, ratingKey: number, options?: RequestOptions, ): Promise< @@ -46,62 +46,62 @@ export async function libraryGetMetaDataByRatingKey( | ConnectionError > > { - const input$: operations.GetMetaDataByRatingKeyRequest = { + const input: operations.GetMetaDataByRatingKeyRequest = { ratingKey: ratingKey, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => - operations.GetMetaDataByRatingKeyRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => + operations.GetMetaDataByRatingKeyRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const pathParams$ = { - ratingKey: encodeSimple$("ratingKey", payload$.ratingKey, { + const pathParams = { + ratingKey: encodeSimple("ratingKey", payload.ratingKey, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/library/metadata/{ratingKey}")(pathParams$); + const path = pathToFunc("/library/metadata/{ratingKey}")(pathParams); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "get-meta-data-by-rating-key", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -109,7 +109,7 @@ export async function libraryGetMetaDataByRatingKey( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -117,7 +117,7 @@ export async function libraryGetMetaDataByRatingKey( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetMetaDataByRatingKeyResponse, | errors.GetMetaDataByRatingKeyBadRequest | errors.GetMetaDataByRatingKeyUnauthorized @@ -129,16 +129,16 @@ export async function libraryGetMetaDataByRatingKey( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetMetaDataByRatingKeyResponse$inboundSchema, { + M.json(200, operations.GetMetaDataByRatingKeyResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetMetaDataByRatingKeyBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetMetaDataByRatingKeyUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetMetaDataByRatingKeyBadRequest$inboundSchema), + M.jsonErr(401, errors.GetMetaDataByRatingKeyUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/libraryGetMetadataChildren.ts b/src/funcs/libraryGetMetadataChildren.ts index 86ddc4ec..11d14bbb 100644 --- a/src/funcs/libraryGetMetadataChildren.ts +++ b/src/funcs/libraryGetMetadataChildren.ts @@ -3,12 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -32,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * This endpoint will return the children of of a library item specified with the ratingKey. */ export async function libraryGetMetadataChildren( - client$: PlexAPICore, + client: PlexAPICore, ratingKey: number, includeElements?: string | undefined, options?: RequestOptions, @@ -50,70 +47,68 @@ export async function libraryGetMetadataChildren( | ConnectionError > > { - const input$: operations.GetMetadataChildrenRequest = { + const input: operations.GetMetadataChildrenRequest = { ratingKey: ratingKey, includeElements: includeElements, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => - operations.GetMetadataChildrenRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => + operations.GetMetadataChildrenRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const pathParams$ = { - ratingKey: encodeSimple$("ratingKey", payload$.ratingKey, { + const pathParams = { + ratingKey: encodeSimple("ratingKey", payload.ratingKey, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/library/metadata/{ratingKey}/children")( - pathParams$, - ); + const path = pathToFunc("/library/metadata/{ratingKey}/children")(pathParams); - const query$ = encodeFormQuery$({ - "includeElements": payload$.includeElements, + const query = encodeFormQuery({ + "includeElements": payload.includeElements, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getMetadataChildren", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -121,7 +116,7 @@ export async function libraryGetMetadataChildren( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -129,7 +124,7 @@ export async function libraryGetMetadataChildren( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetMetadataChildrenResponse, | errors.GetMetadataChildrenBadRequest | errors.GetMetadataChildrenUnauthorized @@ -141,16 +136,16 @@ export async function libraryGetMetadataChildren( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetMetadataChildrenResponse$inboundSchema, { + M.json(200, operations.GetMetadataChildrenResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetMetadataChildrenBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetMetadataChildrenUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetMetadataChildrenBadRequest$inboundSchema), + M.jsonErr(401, errors.GetMetadataChildrenUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/libraryGetOnDeck.ts b/src/funcs/libraryGetOnDeck.ts index 23043dad..9b6b9665 100644 --- a/src/funcs/libraryGetOnDeck.ts +++ b/src/funcs/libraryGetOnDeck.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -27,7 +27,7 @@ import { Result } from "../sdk/types/fp.js"; * This endpoint will return the on deck content. */ export async function libraryGetOnDeck( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions, ): Promise< Result< @@ -43,38 +43,38 @@ export async function libraryGetOnDeck( | ConnectionError > > { - const path$ = pathToFunc("/library/onDeck")(); + const path = pathToFunc("/library/onDeck")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getOnDeck", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -82,7 +82,7 @@ export async function libraryGetOnDeck( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -90,7 +90,7 @@ export async function libraryGetOnDeck( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetOnDeckResponse, | errors.GetOnDeckBadRequest | errors.GetOnDeckUnauthorized @@ -102,14 +102,14 @@ export async function libraryGetOnDeck( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetOnDeckResponse$inboundSchema, { key: "object" }), - m$.jsonErr(400, errors.GetOnDeckBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetOnDeckUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.json(200, operations.GetOnDeckResponse$inboundSchema, { key: "object" }), + M.jsonErr(400, errors.GetOnDeckBadRequest$inboundSchema), + M.jsonErr(401, errors.GetOnDeckUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/libraryGetRecentlyAdded.ts b/src/funcs/libraryGetRecentlyAdded.ts deleted file mode 100644 index 136e1055..00000000 --- a/src/funcs/libraryGetRecentlyAdded.ts +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { Result } from "../sdk/types/fp.js"; - -/** - * Get Recently Added - * - * @remarks - * This endpoint will return the recently added content. - */ -export async function libraryGetRecentlyAdded( - client$: PlexAPICore, - xPlexContainerStart?: number | undefined, - xPlexContainerSize?: number | undefined, - options?: RequestOptions, -): Promise< - Result< - operations.GetRecentlyAddedResponse, - | errors.GetRecentlyAddedBadRequest - | errors.GetRecentlyAddedUnauthorized - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - > -> { - const input$: operations.GetRecentlyAddedRequest = { - xPlexContainerStart: xPlexContainerStart, - xPlexContainerSize: xPlexContainerSize, - }; - - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.GetRecentlyAddedRequest$outboundSchema.parse(value$), - "Input validation failed", - ); - if (!parsed$.ok) { - return parsed$; - } - const payload$ = parsed$.value; - const body$ = null; - - const path$ = pathToFunc("/library/recentlyAdded")(); - - const query$ = encodeFormQuery$({ - "X-Plex-Container-Size": payload$["X-Plex-Container-Size"], - "X-Plex-Container-Start": payload$["X-Plex-Container-Start"], - }); - - const headers$ = new Headers({ - Accept: "application/json", - }); - - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; - const context = { - operationID: "getRecentlyAdded", - oAuth2Scopes: [], - securitySource: client$.options$.accessToken, - }; - const securitySettings$ = resolveGlobalSecurity(security$); - - const requestRes = client$.createRequest$(context, { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return requestRes; - } - const request$ = requestRes.value; - - const doResult = await client$.do$(request$, { - context, - errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client$.options$.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }); - if (!doResult.ok) { - return doResult; - } - const response = doResult.value; - - const responseFields$ = { - ContentType: response.headers.get("content-type") - ?? "application/octet-stream", - StatusCode: response.status, - RawResponse: response, - Headers: {}, - }; - - const [result$] = await m$.match< - operations.GetRecentlyAddedResponse, - | errors.GetRecentlyAddedBadRequest - | errors.GetRecentlyAddedUnauthorized - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - >( - m$.json(200, operations.GetRecentlyAddedResponse$inboundSchema, { - key: "object", - }), - m$.jsonErr(400, errors.GetRecentlyAddedBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetRecentlyAddedUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; - } - - return result$; -} diff --git a/src/funcs/libraryGetRecentlyAddedLibrary.ts b/src/funcs/libraryGetRecentlyAddedLibrary.ts new file mode 100644 index 00000000..75b036d0 --- /dev/null +++ b/src/funcs/libraryGetRecentlyAddedLibrary.ts @@ -0,0 +1,146 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { PlexAPICore } from "../core.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import * as errors from "../sdk/models/errors/index.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get Recently Added + * + * @remarks + * This endpoint will return the recently added content. + */ +export async function libraryGetRecentlyAddedLibrary( + client: PlexAPICore, + request: operations.GetRecentlyAddedLibraryRequest, + options?: RequestOptions, +): Promise< + Result< + operations.GetRecentlyAddedLibraryResponse, + | errors.GetRecentlyAddedLibraryBadRequest + | errors.GetRecentlyAddedLibraryUnauthorized + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input = request; + + const parsed = safeParse( + input, + (value) => + operations.GetRecentlyAddedLibraryRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return parsed; + } + const payload = parsed.value; + const body = null; + + const path = pathToFunc("/library/recentlyAdded")(); + + const query = encodeFormQuery({ + "contentDirectoryID": payload.contentDirectoryID, + "includeMeta": payload.includeMeta, + "pinnedContentDirectoryID": payload.pinnedContentDirectoryID, + "sectionID": payload.sectionID, + "type": payload.type, + "X-Plex-Container-Size": payload["X-Plex-Container-Size"], + "X-Plex-Container-Start": payload["X-Plex-Container-Start"], + }); + + const headers = new Headers({ + Accept: "application/json", + }); + + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const context = { + operationID: "get-recently-added-library", + oAuth2Scopes: [], + securitySource: client._options.accessToken, + }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return requestRes; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "4XX", "5XX"], + retryConfig: options?.retries + || client._options.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const responseFields = { + ContentType: response.headers.get("content-type") + ?? "application/octet-stream", + StatusCode: response.status, + RawResponse: response, + Headers: {}, + }; + + const [result] = await M.match< + operations.GetRecentlyAddedLibraryResponse, + | errors.GetRecentlyAddedLibraryBadRequest + | errors.GetRecentlyAddedLibraryUnauthorized + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + M.json(200, operations.GetRecentlyAddedLibraryResponse$inboundSchema, { + key: "object", + }), + M.jsonErr(400, errors.GetRecentlyAddedLibraryBadRequest$inboundSchema), + M.jsonErr(401, errors.GetRecentlyAddedLibraryUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; + } + + return result; +} diff --git a/src/funcs/libraryGetRefreshLibraryMetadata.ts b/src/funcs/libraryGetRefreshLibraryMetadata.ts index 48e5a2a7..32e1cabe 100644 --- a/src/funcs/libraryGetRefreshLibraryMetadata.ts +++ b/src/funcs/libraryGetRefreshLibraryMetadata.ts @@ -3,12 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -32,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * This endpoint Refreshes all the Metadata of the library. */ export async function libraryGetRefreshLibraryMetadata( - client$: PlexAPICore, + client: PlexAPICore, sectionKey: number, force?: operations.Force | undefined, options?: RequestOptions, @@ -50,70 +47,68 @@ export async function libraryGetRefreshLibraryMetadata( | ConnectionError > > { - const input$: operations.GetRefreshLibraryMetadataRequest = { + const input: operations.GetRefreshLibraryMetadataRequest = { sectionKey: sectionKey, force: force, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => - operations.GetRefreshLibraryMetadataRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => + operations.GetRefreshLibraryMetadataRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const pathParams$ = { - sectionKey: encodeSimple$("sectionKey", payload$.sectionKey, { + const pathParams = { + sectionKey: encodeSimple("sectionKey", payload.sectionKey, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/library/sections/{sectionKey}/refresh")( - pathParams$, - ); + const path = pathToFunc("/library/sections/{sectionKey}/refresh")(pathParams); - const query$ = encodeFormQuery$({ - "force": payload$.force, + const query = encodeFormQuery({ + "force": payload.force, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "get-refresh-library-metadata", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -121,7 +116,7 @@ export async function libraryGetRefreshLibraryMetadata( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -129,7 +124,7 @@ export async function libraryGetRefreshLibraryMetadata( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetRefreshLibraryMetadataResponse, | errors.GetRefreshLibraryMetadataBadRequest | errors.GetRefreshLibraryMetadataUnauthorized @@ -141,14 +136,14 @@ export async function libraryGetRefreshLibraryMetadata( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.GetRefreshLibraryMetadataResponse$inboundSchema), - m$.jsonErr(400, errors.GetRefreshLibraryMetadataBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetRefreshLibraryMetadataUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.GetRefreshLibraryMetadataResponse$inboundSchema), + M.jsonErr(400, errors.GetRefreshLibraryMetadataBadRequest$inboundSchema), + M.jsonErr(401, errors.GetRefreshLibraryMetadataUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/libraryGetSearchLibrary.ts b/src/funcs/libraryGetSearchLibrary.ts index 9645fb40..e2168cf0 100644 --- a/src/funcs/libraryGetSearchLibrary.ts +++ b/src/funcs/libraryGetSearchLibrary.ts @@ -3,12 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -49,9 +46,9 @@ import { Result } from "../sdk/types/fp.js"; * > **Note**: Filters and sorts are optional; without them, no filtering controls are rendered. */ export async function libraryGetSearchLibrary( - client$: PlexAPICore, + client: PlexAPICore, sectionKey: number, - type: operations.QueryParamType, + type: operations.GetSearchLibraryQueryParamType, options?: RequestOptions, ): Promise< Result< @@ -67,69 +64,67 @@ export async function libraryGetSearchLibrary( | ConnectionError > > { - const input$: operations.GetSearchLibraryRequest = { + const input: operations.GetSearchLibraryRequest = { sectionKey: sectionKey, type: type, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.GetSearchLibraryRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.GetSearchLibraryRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const pathParams$ = { - sectionKey: encodeSimple$("sectionKey", payload$.sectionKey, { + const pathParams = { + sectionKey: encodeSimple("sectionKey", payload.sectionKey, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/library/sections/{sectionKey}/search")( - pathParams$, - ); + const path = pathToFunc("/library/sections/{sectionKey}/search")(pathParams); - const query$ = encodeFormQuery$({ - "type": payload$.type, + const query = encodeFormQuery({ + "type": payload.type, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "get-search-library", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -137,7 +132,7 @@ export async function libraryGetSearchLibrary( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -145,7 +140,7 @@ export async function libraryGetSearchLibrary( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetSearchLibraryResponse, | errors.GetSearchLibraryBadRequest | errors.GetSearchLibraryUnauthorized @@ -157,16 +152,16 @@ export async function libraryGetSearchLibrary( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetSearchLibraryResponse$inboundSchema, { + M.json(200, operations.GetSearchLibraryResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetSearchLibraryBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetSearchLibraryUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetSearchLibraryBadRequest$inboundSchema), + M.jsonErr(401, errors.GetSearchLibraryUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/libraryGetTopWatchedContent.ts b/src/funcs/libraryGetTopWatchedContent.ts index 2226ca90..f21cd5d5 100644 --- a/src/funcs/libraryGetTopWatchedContent.ts +++ b/src/funcs/libraryGetTopWatchedContent.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * This endpoint will return the top watched content from libraries of a certain type */ export async function libraryGetTopWatchedContent( - client$: PlexAPICore, + client: PlexAPICore, type: operations.GetTopWatchedContentQueryParamType, includeGuids?: number | undefined, options?: RequestOptions, @@ -47,62 +47,62 @@ export async function libraryGetTopWatchedContent( | ConnectionError > > { - const input$: operations.GetTopWatchedContentRequest = { + const input: operations.GetTopWatchedContentRequest = { type: type, includeGuids: includeGuids, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => - operations.GetTopWatchedContentRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => + operations.GetTopWatchedContentRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/library/all/top")(); + const path = pathToFunc("/library/all/top")(); - const query$ = encodeFormQuery$({ - "includeGuids": payload$.includeGuids, - "type": payload$.type, + const query = encodeFormQuery({ + "includeGuids": payload.includeGuids, + "type": payload.type, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getTopWatchedContent", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -110,7 +110,7 @@ export async function libraryGetTopWatchedContent( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -118,7 +118,7 @@ export async function libraryGetTopWatchedContent( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetTopWatchedContentResponse, | errors.GetTopWatchedContentBadRequest | errors.GetTopWatchedContentUnauthorized @@ -130,16 +130,16 @@ export async function libraryGetTopWatchedContent( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetTopWatchedContentResponse$inboundSchema, { + M.json(200, operations.GetTopWatchedContentResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetTopWatchedContentBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetTopWatchedContentUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetTopWatchedContentBadRequest$inboundSchema), + M.jsonErr(401, errors.GetTopWatchedContentUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/logEnablePaperTrail.ts b/src/funcs/logEnablePaperTrail.ts index c4c78aae..65dad8ed 100644 --- a/src/funcs/logEnablePaperTrail.ts +++ b/src/funcs/logEnablePaperTrail.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -27,7 +27,7 @@ import { Result } from "../sdk/types/fp.js"; * This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time. */ export async function logEnablePaperTrail( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions, ): Promise< Result< @@ -43,38 +43,38 @@ export async function logEnablePaperTrail( | ConnectionError > > { - const path$ = pathToFunc("/log/networked")(); + const path = pathToFunc("/log/networked")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "enablePaperTrail", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "403", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -82,7 +82,7 @@ export async function logEnablePaperTrail( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -90,7 +90,7 @@ export async function logEnablePaperTrail( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.EnablePaperTrailResponse, | errors.EnablePaperTrailBadRequest | errors.EnablePaperTrailUnauthorized @@ -102,14 +102,14 @@ export async function logEnablePaperTrail( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.EnablePaperTrailResponse$inboundSchema), - m$.jsonErr(400, errors.EnablePaperTrailBadRequest$inboundSchema), - m$.jsonErr(401, errors.EnablePaperTrailUnauthorized$inboundSchema), - m$.fail([403, "4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.EnablePaperTrailResponse$inboundSchema), + M.jsonErr(400, errors.EnablePaperTrailBadRequest$inboundSchema), + M.jsonErr(401, errors.EnablePaperTrailUnauthorized$inboundSchema), + M.fail([403, "4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/logLogLine.ts b/src/funcs/logLogLine.ts index f8ff8a41..7c64af4b 100644 --- a/src/funcs/logLogLine.ts +++ b/src/funcs/logLogLine.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log. */ export async function logLogLine( - client$: PlexAPICore, + client: PlexAPICore, level: operations.Level, message: string, source: string, @@ -48,63 +48,63 @@ export async function logLogLine( | ConnectionError > > { - const input$: operations.LogLineRequest = { + const input: operations.LogLineRequest = { level: level, message: message, source: source, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.LogLineRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.LogLineRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/log")(); + const path = pathToFunc("/log")(); - const query$ = encodeFormQuery$({ - "level": payload$.level, - "message": payload$.message, - "source": payload$.source, + const query = encodeFormQuery({ + "level": payload.level, + "message": payload.message, + "source": payload.source, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "logLine", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -112,7 +112,7 @@ export async function logLogLine( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -120,7 +120,7 @@ export async function logLogLine( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.LogLineResponse, | errors.LogLineBadRequest | errors.LogLineUnauthorized @@ -132,14 +132,14 @@ export async function logLogLine( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.LogLineResponse$inboundSchema), - m$.jsonErr(400, errors.LogLineBadRequest$inboundSchema), - m$.jsonErr(401, errors.LogLineUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.LogLineResponse$inboundSchema), + M.jsonErr(400, errors.LogLineBadRequest$inboundSchema), + M.jsonErr(401, errors.LogLineUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/logLogMultiLine.ts b/src/funcs/logLogMultiLine.ts index 067fddaa..ef467c3a 100644 --- a/src/funcs/logLogMultiLine.ts +++ b/src/funcs/logLogMultiLine.ts @@ -4,8 +4,8 @@ import * as z from "zod"; import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -49,7 +49,7 @@ import { Result } from "../sdk/types/fp.js"; * Ensure each parameter is properly URL-encoded to avoid interpretation issues. */ export async function logLogMultiLine( - client$: PlexAPICore, + client: PlexAPICore, request: string, options?: RequestOptions, ): Promise< @@ -66,53 +66,53 @@ export async function logLogMultiLine( | ConnectionError > > { - const input$ = request; + const input = request; - const parsed$ = schemas$.safeParse( - input$, - (value$) => z.string().parse(value$), + const parsed = safeParse( + input, + (value) => z.string().parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = payload$; + const payload = parsed.value; + const body = payload; - const path$ = pathToFunc("/log")(); + const path = pathToFunc("/log")(); - const headers$ = new Headers({ + const headers = new Headers({ "Content-Type": "text/plain", Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "logMultiLine", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "POST", - path: path$, - headers: headers$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -120,7 +120,7 @@ export async function logLogMultiLine( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -128,7 +128,7 @@ export async function logLogMultiLine( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.LogMultiLineResponse, | errors.LogMultiLineBadRequest | errors.LogMultiLineUnauthorized @@ -140,14 +140,14 @@ export async function logLogMultiLine( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.LogMultiLineResponse$inboundSchema), - m$.jsonErr(400, errors.LogMultiLineBadRequest$inboundSchema), - m$.jsonErr(401, errors.LogMultiLineUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.LogMultiLineResponse$inboundSchema), + M.jsonErr(400, errors.LogMultiLineBadRequest$inboundSchema), + M.jsonErr(401, errors.LogMultiLineUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/mediaGetBannerImage.ts b/src/funcs/mediaGetBannerImage.ts index ac25608f..1239a30a 100644 --- a/src/funcs/mediaGetBannerImage.ts +++ b/src/funcs/mediaGetBannerImage.ts @@ -3,12 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -32,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * Gets the banner image of the media item */ export async function mediaGetBannerImage( - client$: PlexAPICore, + client: PlexAPICore, request: operations.GetBannerImageRequest, options?: RequestOptions, ): Promise< @@ -49,68 +46,68 @@ export async function mediaGetBannerImage( | ConnectionError > > { - const input$ = request; + const input = request; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.GetBannerImageRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.GetBannerImageRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const pathParams$ = { - ratingKey: encodeSimple$("ratingKey", payload$.ratingKey, { + const pathParams = { + ratingKey: encodeSimple("ratingKey", payload.ratingKey, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/library/metadata/{ratingKey}/banner")(pathParams$); + const path = pathToFunc("/library/metadata/{ratingKey}/banner")(pathParams); - const query$ = encodeFormQuery$({ - "height": payload$.height, - "minSize": payload$.minSize, - "upscale": payload$.upscale, - "width": payload$.width, - "X-Plex-Token": payload$["X-Plex-Token"], + const query = encodeFormQuery({ + "height": payload.height, + "minSize": payload.minSize, + "upscale": payload.upscale, + "width": payload.width, + "X-Plex-Token": payload["X-Plex-Token"], }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "image/jpeg", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "get-banner-image", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -118,7 +115,7 @@ export async function mediaGetBannerImage( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -126,7 +123,7 @@ export async function mediaGetBannerImage( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetBannerImageResponse, | errors.GetBannerImageBadRequest | errors.GetBannerImageUnauthorized @@ -138,18 +135,18 @@ export async function mediaGetBannerImage( | RequestTimeoutError | ConnectionError >( - m$.stream(200, operations.GetBannerImageResponse$inboundSchema, { + M.stream(200, operations.GetBannerImageResponse$inboundSchema, { ctype: "image/jpeg", hdrs: true, key: "response-stream", }), - m$.jsonErr(400, errors.GetBannerImageBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetBannerImageUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetBannerImageBadRequest$inboundSchema), + M.jsonErr(401, errors.GetBannerImageUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/mediaGetThumbImage.ts b/src/funcs/mediaGetThumbImage.ts index 6f57dc2a..935b5ce0 100644 --- a/src/funcs/mediaGetThumbImage.ts +++ b/src/funcs/mediaGetThumbImage.ts @@ -3,12 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -32,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * Gets the thumbnail image of the media item */ export async function mediaGetThumbImage( - client$: PlexAPICore, + client: PlexAPICore, request: operations.GetThumbImageRequest, options?: RequestOptions, ): Promise< @@ -49,68 +46,68 @@ export async function mediaGetThumbImage( | ConnectionError > > { - const input$ = request; + const input = request; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.GetThumbImageRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.GetThumbImageRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const pathParams$ = { - ratingKey: encodeSimple$("ratingKey", payload$.ratingKey, { + const pathParams = { + ratingKey: encodeSimple("ratingKey", payload.ratingKey, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/library/metadata/{ratingKey}/thumb")(pathParams$); + const path = pathToFunc("/library/metadata/{ratingKey}/thumb")(pathParams); - const query$ = encodeFormQuery$({ - "height": payload$.height, - "minSize": payload$.minSize, - "upscale": payload$.upscale, - "width": payload$.width, - "X-Plex-Token": payload$["X-Plex-Token"], + const query = encodeFormQuery({ + "height": payload.height, + "minSize": payload.minSize, + "upscale": payload.upscale, + "width": payload.width, + "X-Plex-Token": payload["X-Plex-Token"], }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "image/jpeg", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "get-thumb-image", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -118,7 +115,7 @@ export async function mediaGetThumbImage( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -126,7 +123,7 @@ export async function mediaGetThumbImage( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetThumbImageResponse, | errors.GetThumbImageBadRequest | errors.GetThumbImageUnauthorized @@ -138,18 +135,18 @@ export async function mediaGetThumbImage( | RequestTimeoutError | ConnectionError >( - m$.stream(200, operations.GetThumbImageResponse$inboundSchema, { + M.stream(200, operations.GetThumbImageResponse$inboundSchema, { ctype: "image/jpeg", hdrs: true, key: "response-stream", }), - m$.jsonErr(400, errors.GetThumbImageBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetThumbImageUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetThumbImageBadRequest$inboundSchema), + M.jsonErr(401, errors.GetThumbImageUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/mediaMarkPlayed.ts b/src/funcs/mediaMarkPlayed.ts index 213b1c61..fafb70fe 100644 --- a/src/funcs/mediaMarkPlayed.ts +++ b/src/funcs/mediaMarkPlayed.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * This will mark the provided media key as Played. */ export async function mediaMarkPlayed( - client$: PlexAPICore, + client: PlexAPICore, key: number, options?: RequestOptions, ): Promise< @@ -46,59 +46,59 @@ export async function mediaMarkPlayed( | ConnectionError > > { - const input$: operations.MarkPlayedRequest = { + const input: operations.MarkPlayedRequest = { key: key, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.MarkPlayedRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.MarkPlayedRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/:/scrobble")(); + const path = pathToFunc("/:/scrobble")(); - const query$ = encodeFormQuery$({ - "key": payload$.key, + const query = encodeFormQuery({ + "key": payload.key, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "markPlayed", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -106,7 +106,7 @@ export async function mediaMarkPlayed( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -114,7 +114,7 @@ export async function mediaMarkPlayed( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.MarkPlayedResponse, | errors.MarkPlayedBadRequest | errors.MarkPlayedUnauthorized @@ -126,14 +126,14 @@ export async function mediaMarkPlayed( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.MarkPlayedResponse$inboundSchema), - m$.jsonErr(400, errors.MarkPlayedBadRequest$inboundSchema), - m$.jsonErr(401, errors.MarkPlayedUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.MarkPlayedResponse$inboundSchema), + M.jsonErr(400, errors.MarkPlayedBadRequest$inboundSchema), + M.jsonErr(401, errors.MarkPlayedUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/mediaMarkUnplayed.ts b/src/funcs/mediaMarkUnplayed.ts index bd72b3f3..4e707c9e 100644 --- a/src/funcs/mediaMarkUnplayed.ts +++ b/src/funcs/mediaMarkUnplayed.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * This will mark the provided media key as Unplayed. */ export async function mediaMarkUnplayed( - client$: PlexAPICore, + client: PlexAPICore, key: number, options?: RequestOptions, ): Promise< @@ -46,59 +46,59 @@ export async function mediaMarkUnplayed( | ConnectionError > > { - const input$: operations.MarkUnplayedRequest = { + const input: operations.MarkUnplayedRequest = { key: key, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.MarkUnplayedRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.MarkUnplayedRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/:/unscrobble")(); + const path = pathToFunc("/:/unscrobble")(); - const query$ = encodeFormQuery$({ - "key": payload$.key, + const query = encodeFormQuery({ + "key": payload.key, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "markUnplayed", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -106,7 +106,7 @@ export async function mediaMarkUnplayed( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -114,7 +114,7 @@ export async function mediaMarkUnplayed( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.MarkUnplayedResponse, | errors.MarkUnplayedBadRequest | errors.MarkUnplayedUnauthorized @@ -126,14 +126,14 @@ export async function mediaMarkUnplayed( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.MarkUnplayedResponse$inboundSchema), - m$.jsonErr(400, errors.MarkUnplayedBadRequest$inboundSchema), - m$.jsonErr(401, errors.MarkUnplayedUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.MarkUnplayedResponse$inboundSchema), + M.jsonErr(400, errors.MarkUnplayedBadRequest$inboundSchema), + M.jsonErr(401, errors.MarkUnplayedUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/mediaUpdatePlayProgress.ts b/src/funcs/mediaUpdatePlayProgress.ts index 5753fbd7..efcb4bd5 100644 --- a/src/funcs/mediaUpdatePlayProgress.ts +++ b/src/funcs/mediaUpdatePlayProgress.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * This API command can be used to update the play progress of a media item. */ export async function mediaUpdatePlayProgress( - client$: PlexAPICore, + client: PlexAPICore, key: string, time: number, state: string, @@ -48,64 +48,63 @@ export async function mediaUpdatePlayProgress( | ConnectionError > > { - const input$: operations.UpdatePlayProgressRequest = { + const input: operations.UpdatePlayProgressRequest = { key: key, time: time, state: state, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => - operations.UpdatePlayProgressRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.UpdatePlayProgressRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/:/progress")(); + const path = pathToFunc("/:/progress")(); - const query$ = encodeFormQuery$({ - "key": payload$.key, - "state": payload$.state, - "time": payload$.time, + const query = encodeFormQuery({ + "key": payload.key, + "state": payload.state, + "time": payload.time, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "updatePlayProgress", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -113,7 +112,7 @@ export async function mediaUpdatePlayProgress( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -121,7 +120,7 @@ export async function mediaUpdatePlayProgress( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.UpdatePlayProgressResponse, | errors.UpdatePlayProgressBadRequest | errors.UpdatePlayProgressUnauthorized @@ -133,14 +132,14 @@ export async function mediaUpdatePlayProgress( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.UpdatePlayProgressResponse$inboundSchema), - m$.jsonErr(400, errors.UpdatePlayProgressBadRequest$inboundSchema), - m$.jsonErr(401, errors.UpdatePlayProgressUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.UpdatePlayProgressResponse$inboundSchema), + M.jsonErr(400, errors.UpdatePlayProgressBadRequest$inboundSchema), + M.jsonErr(401, errors.UpdatePlayProgressUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/playlistsAddPlaylistContents.ts b/src/funcs/playlistsAddPlaylistContents.ts index 95c440d5..c9eaf0fd 100644 --- a/src/funcs/playlistsAddPlaylistContents.ts +++ b/src/funcs/playlistsAddPlaylistContents.ts @@ -3,12 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -33,7 +30,7 @@ import { Result } from "../sdk/types/fp.js"; * With a smart playlist, passing a new `uri` parameter replaces the rules for the playlist. Returns the playlist. */ export async function playlistsAddPlaylistContents( - client$: PlexAPICore, + client: PlexAPICore, playlistID: number, uri: string, playQueueID?: number | undefined, @@ -52,70 +49,70 @@ export async function playlistsAddPlaylistContents( | ConnectionError > > { - const input$: operations.AddPlaylistContentsRequest = { + const input: operations.AddPlaylistContentsRequest = { playlistID: playlistID, uri: uri, playQueueID: playQueueID, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => - operations.AddPlaylistContentsRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => + operations.AddPlaylistContentsRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const pathParams$ = { - playlistID: encodeSimple$("playlistID", payload$.playlistID, { + const pathParams = { + playlistID: encodeSimple("playlistID", payload.playlistID, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/playlists/{playlistID}/items")(pathParams$); + const path = pathToFunc("/playlists/{playlistID}/items")(pathParams); - const query$ = encodeFormQuery$({ - "playQueueID": payload$.playQueueID, - "uri": payload$.uri, + const query = encodeFormQuery({ + "playQueueID": payload.playQueueID, + "uri": payload.uri, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "addPlaylistContents", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "PUT", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -123,7 +120,7 @@ export async function playlistsAddPlaylistContents( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -131,7 +128,7 @@ export async function playlistsAddPlaylistContents( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.AddPlaylistContentsResponse, | errors.AddPlaylistContentsBadRequest | errors.AddPlaylistContentsUnauthorized @@ -143,16 +140,16 @@ export async function playlistsAddPlaylistContents( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.AddPlaylistContentsResponse$inboundSchema, { + M.json(200, operations.AddPlaylistContentsResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.AddPlaylistContentsBadRequest$inboundSchema), - m$.jsonErr(401, errors.AddPlaylistContentsUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.AddPlaylistContentsBadRequest$inboundSchema), + M.jsonErr(401, errors.AddPlaylistContentsUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/playlistsClearPlaylistContents.ts b/src/funcs/playlistsClearPlaylistContents.ts index bc562e34..e118d70c 100644 --- a/src/funcs/playlistsClearPlaylistContents.ts +++ b/src/funcs/playlistsClearPlaylistContents.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * Clears a playlist, only works with dumb playlists. Returns the playlist. */ export async function playlistsClearPlaylistContents( - client$: PlexAPICore, + client: PlexAPICore, playlistID: number, options?: RequestOptions, ): Promise< @@ -46,62 +46,62 @@ export async function playlistsClearPlaylistContents( | ConnectionError > > { - const input$: operations.ClearPlaylistContentsRequest = { + const input: operations.ClearPlaylistContentsRequest = { playlistID: playlistID, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => - operations.ClearPlaylistContentsRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => + operations.ClearPlaylistContentsRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const pathParams$ = { - playlistID: encodeSimple$("playlistID", payload$.playlistID, { + const pathParams = { + playlistID: encodeSimple("playlistID", payload.playlistID, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/playlists/{playlistID}/items")(pathParams$); + const path = pathToFunc("/playlists/{playlistID}/items")(pathParams); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "clearPlaylistContents", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "DELETE", - path: path$, - headers: headers$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -109,7 +109,7 @@ export async function playlistsClearPlaylistContents( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -117,7 +117,7 @@ export async function playlistsClearPlaylistContents( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.ClearPlaylistContentsResponse, | errors.ClearPlaylistContentsBadRequest | errors.ClearPlaylistContentsUnauthorized @@ -129,14 +129,14 @@ export async function playlistsClearPlaylistContents( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.ClearPlaylistContentsResponse$inboundSchema), - m$.jsonErr(400, errors.ClearPlaylistContentsBadRequest$inboundSchema), - m$.jsonErr(401, errors.ClearPlaylistContentsUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.ClearPlaylistContentsResponse$inboundSchema), + M.jsonErr(400, errors.ClearPlaylistContentsBadRequest$inboundSchema), + M.jsonErr(401, errors.ClearPlaylistContentsUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/playlistsCreatePlaylist.ts b/src/funcs/playlistsCreatePlaylist.ts index 2920cd6f..76a5f396 100644 --- a/src/funcs/playlistsCreatePlaylist.ts +++ b/src/funcs/playlistsCreatePlaylist.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -31,7 +31,7 @@ import { Result } from "../sdk/types/fp.js"; * - `playQueueID` - To create a playlist from an existing play queue. */ export async function playlistsCreatePlaylist( - client$: PlexAPICore, + client: PlexAPICore, request: operations.CreatePlaylistRequest, options?: RequestOptions, ): Promise< @@ -48,61 +48,61 @@ export async function playlistsCreatePlaylist( | ConnectionError > > { - const input$ = request; + const input = request; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.CreatePlaylistRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.CreatePlaylistRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/playlists")(); + const path = pathToFunc("/playlists")(); - const query$ = encodeFormQuery$({ - "playQueueID": payload$.playQueueID, - "smart": payload$.smart, - "title": payload$.title, - "type": payload$.type, - "uri": payload$.uri, + const query = encodeFormQuery({ + "playQueueID": payload.playQueueID, + "smart": payload.smart, + "title": payload.title, + "type": payload.type, + "uri": payload.uri, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "createPlaylist", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -110,7 +110,7 @@ export async function playlistsCreatePlaylist( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -118,7 +118,7 @@ export async function playlistsCreatePlaylist( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.CreatePlaylistResponse, | errors.CreatePlaylistBadRequest | errors.CreatePlaylistUnauthorized @@ -130,16 +130,16 @@ export async function playlistsCreatePlaylist( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.CreatePlaylistResponse$inboundSchema, { + M.json(200, operations.CreatePlaylistResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.CreatePlaylistBadRequest$inboundSchema), - m$.jsonErr(401, errors.CreatePlaylistUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.CreatePlaylistBadRequest$inboundSchema), + M.jsonErr(401, errors.CreatePlaylistUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/playlistsDeletePlaylist.ts b/src/funcs/playlistsDeletePlaylist.ts index 46773242..b4f37c28 100644 --- a/src/funcs/playlistsDeletePlaylist.ts +++ b/src/funcs/playlistsDeletePlaylist.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * This endpoint will delete a playlist */ export async function playlistsDeletePlaylist( - client$: PlexAPICore, + client: PlexAPICore, playlistID: number, options?: RequestOptions, ): Promise< @@ -46,61 +46,61 @@ export async function playlistsDeletePlaylist( | ConnectionError > > { - const input$: operations.DeletePlaylistRequest = { + const input: operations.DeletePlaylistRequest = { playlistID: playlistID, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.DeletePlaylistRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.DeletePlaylistRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const pathParams$ = { - playlistID: encodeSimple$("playlistID", payload$.playlistID, { + const pathParams = { + playlistID: encodeSimple("playlistID", payload.playlistID, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/playlists/{playlistID}")(pathParams$); + const path = pathToFunc("/playlists/{playlistID}")(pathParams); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "deletePlaylist", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "DELETE", - path: path$, - headers: headers$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -108,7 +108,7 @@ export async function playlistsDeletePlaylist( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -116,7 +116,7 @@ export async function playlistsDeletePlaylist( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.DeletePlaylistResponse, | errors.DeletePlaylistBadRequest | errors.DeletePlaylistUnauthorized @@ -128,14 +128,14 @@ export async function playlistsDeletePlaylist( | RequestTimeoutError | ConnectionError >( - m$.nil(204, operations.DeletePlaylistResponse$inboundSchema), - m$.jsonErr(400, errors.DeletePlaylistBadRequest$inboundSchema), - m$.jsonErr(401, errors.DeletePlaylistUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(204, operations.DeletePlaylistResponse$inboundSchema), + M.jsonErr(400, errors.DeletePlaylistBadRequest$inboundSchema), + M.jsonErr(401, errors.DeletePlaylistUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/playlistsGetPlaylist.ts b/src/funcs/playlistsGetPlaylist.ts index 1a935edf..ea4ab7f7 100644 --- a/src/funcs/playlistsGetPlaylist.ts +++ b/src/funcs/playlistsGetPlaylist.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -30,7 +30,7 @@ import { Result } from "../sdk/types/fp.js"; * Smart playlist details contain the `content` attribute. This is the content URI for the generator. This can then be parsed by a client to provide smart playlist editing. */ export async function playlistsGetPlaylist( - client$: PlexAPICore, + client: PlexAPICore, playlistID: number, options?: RequestOptions, ): Promise< @@ -47,61 +47,61 @@ export async function playlistsGetPlaylist( | ConnectionError > > { - const input$: operations.GetPlaylistRequest = { + const input: operations.GetPlaylistRequest = { playlistID: playlistID, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.GetPlaylistRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.GetPlaylistRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const pathParams$ = { - playlistID: encodeSimple$("playlistID", payload$.playlistID, { + const pathParams = { + playlistID: encodeSimple("playlistID", payload.playlistID, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/playlists/{playlistID}")(pathParams$); + const path = pathToFunc("/playlists/{playlistID}")(pathParams); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getPlaylist", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -109,7 +109,7 @@ export async function playlistsGetPlaylist( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -117,7 +117,7 @@ export async function playlistsGetPlaylist( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetPlaylistResponse, | errors.GetPlaylistBadRequest | errors.GetPlaylistUnauthorized @@ -129,16 +129,16 @@ export async function playlistsGetPlaylist( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetPlaylistResponse$inboundSchema, { + M.json(200, operations.GetPlaylistResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetPlaylistBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetPlaylistUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetPlaylistBadRequest$inboundSchema), + M.jsonErr(401, errors.GetPlaylistUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/playlistsGetPlaylistContents.ts b/src/funcs/playlistsGetPlaylistContents.ts index cba739fc..55f86d18 100644 --- a/src/funcs/playlistsGetPlaylistContents.ts +++ b/src/funcs/playlistsGetPlaylistContents.ts @@ -3,12 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -35,7 +32,7 @@ import { Result } from "../sdk/types/fp.js"; * Note that for dumb playlists, items have a `playlistItemID` attribute which is used for deleting or moving items. */ export async function playlistsGetPlaylistContents( - client$: PlexAPICore, + client: PlexAPICore, playlistID: number, type: operations.GetPlaylistContentsQueryParamType, options?: RequestOptions, @@ -53,68 +50,68 @@ export async function playlistsGetPlaylistContents( | ConnectionError > > { - const input$: operations.GetPlaylistContentsRequest = { + const input: operations.GetPlaylistContentsRequest = { playlistID: playlistID, type: type, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => - operations.GetPlaylistContentsRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => + operations.GetPlaylistContentsRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const pathParams$ = { - playlistID: encodeSimple$("playlistID", payload$.playlistID, { + const pathParams = { + playlistID: encodeSimple("playlistID", payload.playlistID, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/playlists/{playlistID}/items")(pathParams$); + const path = pathToFunc("/playlists/{playlistID}/items")(pathParams); - const query$ = encodeFormQuery$({ - "type": payload$.type, + const query = encodeFormQuery({ + "type": payload.type, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getPlaylistContents", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -122,7 +119,7 @@ export async function playlistsGetPlaylistContents( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -130,7 +127,7 @@ export async function playlistsGetPlaylistContents( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetPlaylistContentsResponse, | errors.GetPlaylistContentsBadRequest | errors.GetPlaylistContentsUnauthorized @@ -142,16 +139,16 @@ export async function playlistsGetPlaylistContents( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetPlaylistContentsResponse$inboundSchema, { + M.json(200, operations.GetPlaylistContentsResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetPlaylistContentsBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetPlaylistContentsUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetPlaylistContentsBadRequest$inboundSchema), + M.jsonErr(401, errors.GetPlaylistContentsUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/playlistsGetPlaylists.ts b/src/funcs/playlistsGetPlaylists.ts index ed02112f..50ccf265 100644 --- a/src/funcs/playlistsGetPlaylists.ts +++ b/src/funcs/playlistsGetPlaylists.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * Get All Playlists given the specified filters. */ export async function playlistsGetPlaylists( - client$: PlexAPICore, + client: PlexAPICore, playlistType?: operations.PlaylistType | undefined, smart?: operations.QueryParamSmart | undefined, options?: RequestOptions, @@ -47,61 +47,61 @@ export async function playlistsGetPlaylists( | ConnectionError > > { - const input$: operations.GetPlaylistsRequest = { + const input: operations.GetPlaylistsRequest = { playlistType: playlistType, smart: smart, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.GetPlaylistsRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.GetPlaylistsRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/playlists")(); + const path = pathToFunc("/playlists")(); - const query$ = encodeFormQuery$({ - "playlistType": payload$.playlistType, - "smart": payload$.smart, + const query = encodeFormQuery({ + "playlistType": payload.playlistType, + "smart": payload.smart, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getPlaylists", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -109,7 +109,7 @@ export async function playlistsGetPlaylists( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -117,7 +117,7 @@ export async function playlistsGetPlaylists( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetPlaylistsResponse, | errors.GetPlaylistsBadRequest | errors.GetPlaylistsUnauthorized @@ -129,16 +129,16 @@ export async function playlistsGetPlaylists( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetPlaylistsResponse$inboundSchema, { + M.json(200, operations.GetPlaylistsResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetPlaylistsBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetPlaylistsUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetPlaylistsBadRequest$inboundSchema), + M.jsonErr(401, errors.GetPlaylistsUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/playlistsUpdatePlaylist.ts b/src/funcs/playlistsUpdatePlaylist.ts index 9554e5ae..46cf76be 100644 --- a/src/funcs/playlistsUpdatePlaylist.ts +++ b/src/funcs/playlistsUpdatePlaylist.ts @@ -3,12 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -32,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * From PMS version 1.9.1 clients can also edit playlist metadata using this endpoint as they would via `PUT /library/metadata/{playlistID}` */ export async function playlistsUpdatePlaylist( - client$: PlexAPICore, + client: PlexAPICore, playlistID: number, title?: string | undefined, summary?: string | undefined, @@ -51,69 +48,69 @@ export async function playlistsUpdatePlaylist( | ConnectionError > > { - const input$: operations.UpdatePlaylistRequest = { + const input: operations.UpdatePlaylistRequest = { playlistID: playlistID, title: title, summary: summary, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.UpdatePlaylistRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.UpdatePlaylistRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const pathParams$ = { - playlistID: encodeSimple$("playlistID", payload$.playlistID, { + const pathParams = { + playlistID: encodeSimple("playlistID", payload.playlistID, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/playlists/{playlistID}")(pathParams$); + const path = pathToFunc("/playlists/{playlistID}")(pathParams); - const query$ = encodeFormQuery$({ - "summary": payload$.summary, - "title": payload$.title, + const query = encodeFormQuery({ + "summary": payload.summary, + "title": payload.title, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "updatePlaylist", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "PUT", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -121,7 +118,7 @@ export async function playlistsUpdatePlaylist( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -129,7 +126,7 @@ export async function playlistsUpdatePlaylist( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.UpdatePlaylistResponse, | errors.UpdatePlaylistBadRequest | errors.UpdatePlaylistUnauthorized @@ -141,14 +138,14 @@ export async function playlistsUpdatePlaylist( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.UpdatePlaylistResponse$inboundSchema), - m$.jsonErr(400, errors.UpdatePlaylistBadRequest$inboundSchema), - m$.jsonErr(401, errors.UpdatePlaylistUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.UpdatePlaylistResponse$inboundSchema), + M.jsonErr(400, errors.UpdatePlaylistBadRequest$inboundSchema), + M.jsonErr(401, errors.UpdatePlaylistUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/playlistsUploadPlaylist.ts b/src/funcs/playlistsUploadPlaylist.ts index 5a03a7cd..9b4a3672 100644 --- a/src/funcs/playlistsUploadPlaylist.ts +++ b/src/funcs/playlistsUploadPlaylist.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,9 +29,10 @@ import { Result } from "../sdk/types/fp.js"; * Imports m3u playlists by passing a path on the server to scan for m3u-formatted playlist files, or a path to a single playlist file. */ export async function playlistsUploadPlaylist( - client$: PlexAPICore, + client: PlexAPICore, path: string, force: operations.QueryParamForce, + sectionID: number | undefined, options?: RequestOptions, ): Promise< Result< @@ -47,61 +48,63 @@ export async function playlistsUploadPlaylist( | ConnectionError > > { - const input$: operations.UploadPlaylistRequest = { + const input: operations.UploadPlaylistRequest = { path: path, force: force, + sectionID: sectionID, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.UploadPlaylistRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.UploadPlaylistRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; const path$ = pathToFunc("/playlists/upload")(); - const query$ = encodeFormQuery$({ - "force": payload$.force, - "path": payload$.path, + const query = encodeFormQuery({ + "force": payload.force, + "path": payload.path, + "sectionID": payload.sectionID, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "uploadPlaylist", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "POST", path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -109,7 +112,7 @@ export async function playlistsUploadPlaylist( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -117,7 +120,7 @@ export async function playlistsUploadPlaylist( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.UploadPlaylistResponse, | errors.UploadPlaylistBadRequest | errors.UploadPlaylistUnauthorized @@ -129,14 +132,14 @@ export async function playlistsUploadPlaylist( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.UploadPlaylistResponse$inboundSchema), - m$.jsonErr(400, errors.UploadPlaylistBadRequest$inboundSchema), - m$.jsonErr(401, errors.UploadPlaylistUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.UploadPlaylistResponse$inboundSchema), + M.jsonErr(400, errors.UploadPlaylistBadRequest$inboundSchema), + M.jsonErr(401, errors.UploadPlaylistUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/plexGetCompanionsData.ts b/src/funcs/plexGetCompanionsData.ts index bae1f5f1..2c742abc 100644 --- a/src/funcs/plexGetCompanionsData.ts +++ b/src/funcs/plexGetCompanionsData.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -28,7 +28,7 @@ import { Result } from "../sdk/types/fp.js"; * Get Companions Data */ export async function plexGetCompanionsData( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions & { serverURL?: string }, ): Promise< Result< @@ -44,44 +44,44 @@ export async function plexGetCompanionsData( | ConnectionError > > { - const baseURL$ = options?.serverURL + const baseURL = options?.serverURL || pathToFunc(GetCompanionsDataServerList[0], { charEncoding: "percent", })(); - const path$ = pathToFunc("/companions")(); + const path = pathToFunc("/companions")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getCompanionsData", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - baseURL: baseURL$, - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + baseURL: baseURL, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -89,7 +89,7 @@ export async function plexGetCompanionsData( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -97,7 +97,7 @@ export async function plexGetCompanionsData( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetCompanionsDataResponse, | errors.GetCompanionsDataBadRequest | errors.GetCompanionsDataUnauthorized @@ -109,16 +109,16 @@ export async function plexGetCompanionsData( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetCompanionsDataResponse$inboundSchema, { + M.json(200, operations.GetCompanionsDataResponse$inboundSchema, { key: "responseBodies", }), - m$.jsonErr(400, errors.GetCompanionsDataBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetCompanionsDataUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetCompanionsDataBadRequest$inboundSchema), + M.jsonErr(401, errors.GetCompanionsDataUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/plexGetGeoData.ts b/src/funcs/plexGetGeoData.ts index f9da2e47..50cdb5b9 100644 --- a/src/funcs/plexGetGeoData.ts +++ b/src/funcs/plexGetGeoData.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { pathToFunc } from "../lib/url.js"; import { @@ -27,7 +27,7 @@ import { Result } from "../sdk/types/fp.js"; * Returns the geolocation and locale data of the caller */ export async function plexGetGeoData( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions & { serverURL?: string }, ): Promise< Result< @@ -43,12 +43,12 @@ export async function plexGetGeoData( | ConnectionError > > { - const baseURL$ = options?.serverURL + const baseURL = options?.serverURL || pathToFunc(GetGeoDataServerList[0], { charEncoding: "percent" })(); - const path$ = pathToFunc("/geoip")(); + const path = pathToFunc("/geoip")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); @@ -58,23 +58,23 @@ export async function plexGetGeoData( securitySource: null, }; - const requestRes = client$.createRequest$(context, { + const requestRes = client._createRequest(context, { method: "GET", - baseURL: baseURL$, - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + baseURL: baseURL, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -82,7 +82,7 @@ export async function plexGetGeoData( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -90,7 +90,7 @@ export async function plexGetGeoData( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetGeoDataResponse, | errors.GetGeoDataBadRequest | errors.GetGeoDataUnauthorized @@ -102,16 +102,16 @@ export async function plexGetGeoData( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetGeoDataResponse$inboundSchema, { + M.json(200, operations.GetGeoDataResponse$inboundSchema, { key: "GeoData", }), - m$.jsonErr(400, errors.GetGeoDataBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetGeoDataUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetGeoDataBadRequest$inboundSchema), + M.jsonErr(401, errors.GetGeoDataUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/plexGetHomeData.ts b/src/funcs/plexGetHomeData.ts index ae3ea47f..3a48f058 100644 --- a/src/funcs/plexGetHomeData.ts +++ b/src/funcs/plexGetHomeData.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -27,7 +27,7 @@ import { Result } from "../sdk/types/fp.js"; * Retrieves the home data for the authenticated user, including details like home ID, name, guest access information, and subscription status. */ export async function plexGetHomeData( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions, ): Promise< Result< @@ -43,38 +43,38 @@ export async function plexGetHomeData( | ConnectionError > > { - const path$ = pathToFunc("/home")(); + const path = pathToFunc("/home")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getHomeData", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -82,7 +82,7 @@ export async function plexGetHomeData( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -90,7 +90,7 @@ export async function plexGetHomeData( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetHomeDataResponse, | errors.GetHomeDataBadRequest | errors.GetHomeDataUnauthorized @@ -102,16 +102,16 @@ export async function plexGetHomeData( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetHomeDataResponse$inboundSchema, { + M.json(200, operations.GetHomeDataResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetHomeDataBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetHomeDataUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetHomeDataBadRequest$inboundSchema), + M.jsonErr(401, errors.GetHomeDataUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/plexGetPin.ts b/src/funcs/plexGetPin.ts index 09fea415..3d1f0f17 100644 --- a/src/funcs/plexGetPin.ts +++ b/src/funcs/plexGetPin.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { pathToFunc } from "../lib/url.js"; import { @@ -26,13 +26,11 @@ import { Result } from "../sdk/types/fp.js"; * Get a Pin * * @remarks - * Retrieve a Pin from Plex.tv for authentication flows + * Retrieve a Pin ID from Plex.tv to use for authentication flows */ export async function plexGetPin( - client$: PlexAPICore, - strong?: boolean | undefined, - xPlexClientIdentifier?: string | undefined, - xPlexProduct?: string | undefined, + client: PlexAPICore, + request: operations.GetPinRequest, options?: RequestOptions & { serverURL?: string }, ): Promise< Result< @@ -47,36 +45,39 @@ export async function plexGetPin( | ConnectionError > > { - const input$: operations.GetPinRequest = { - strong: strong, - xPlexClientIdentifier: xPlexClientIdentifier, - xPlexProduct: xPlexProduct, - }; + const input = request; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.GetPinRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.GetPinRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const baseURL$ = options?.serverURL + const baseURL = options?.serverURL || pathToFunc(GetPinServerList[0], { charEncoding: "percent" })(); - const path$ = pathToFunc("/pins")(); + const path = pathToFunc("/pins")(); - const query$ = encodeFormQuery$({ - "strong": payload$.strong, - "X-Plex-Client-Identifier": payload$["X-Plex-Client-Identifier"] - ?? client$.options$.xPlexClientIdentifier, - "X-Plex-Product": payload$["X-Plex-Product"], + const query = encodeFormQuery({ + "strong": payload.strong, + "X-Plex-Client-Identifier": client._options.clientID, + "X-Plex-Client-Identifier": payload.ClientID, + "X-Plex-Device": payload.DeviceName, + "X-Plex-Device": client._options.deviceName, + "X-Plex-Platform": client._options.clientPlatform, + "X-Plex-Platform": payload.ClientPlatform, + "X-Plex-Product": client._options.clientName, + "X-Plex-Product": payload.ClientName, + "X-Plex-Version": payload.ClientVersion, + "X-Plex-Version": client._options.clientVersion, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); @@ -86,25 +87,25 @@ export async function plexGetPin( securitySource: null, }; - const requestRes = client$.createRequest$(context, { + const requestRes = client._createRequest(context, { method: "POST", - baseURL: baseURL$, - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + baseURL: baseURL, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -112,7 +113,7 @@ export async function plexGetPin( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -120,7 +121,7 @@ export async function plexGetPin( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetPinResponse, | errors.GetPinBadRequest | SDKError @@ -131,15 +132,15 @@ export async function plexGetPin( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetPinResponse$inboundSchema, { + M.json(201, operations.GetPinResponse$inboundSchema, { key: "AuthPinContainer", }), - m$.jsonErr(400, errors.GetPinBadRequest$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetPinBadRequest$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/plexGetServerResources.ts b/src/funcs/plexGetServerResources.ts index f1867770..4e9524d8 100644 --- a/src/funcs/plexGetServerResources.ts +++ b/src/funcs/plexGetServerResources.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -30,11 +30,11 @@ import { Result } from "../sdk/types/fp.js"; * Get Plex server access tokens and server connections */ export async function plexGetServerResources( - client$: PlexAPICore, - xPlexClientIdentifier?: string | undefined, + client: PlexAPICore, includeHttps?: operations.IncludeHttps | undefined, includeRelay?: operations.IncludeRelay | undefined, includeIPv6?: operations.IncludeIPv6 | undefined, + clientID?: string | undefined, options?: RequestOptions & { serverURL?: string }, ): Promise< Result< @@ -50,73 +50,72 @@ export async function plexGetServerResources( | ConnectionError > > { - const input$: operations.GetServerResourcesRequest = { - xPlexClientIdentifier: xPlexClientIdentifier, + const input: operations.GetServerResourcesRequest = { includeHttps: includeHttps, includeRelay: includeRelay, includeIPv6: includeIPv6, + clientID: clientID, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => - operations.GetServerResourcesRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.GetServerResourcesRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const baseURL$ = options?.serverURL + const baseURL = options?.serverURL || pathToFunc(GetServerResourcesServerList[0], { charEncoding: "percent", })(); - const path$ = pathToFunc("/resources")(); + const path = pathToFunc("/resources")(); - const query$ = encodeFormQuery$({ - "includeHttps": payload$.includeHttps, - "includeIPv6": payload$.includeIPv6, - "includeRelay": payload$.includeRelay, - "X-Plex-Client-Identifier": payload$["X-Plex-Client-Identifier"] - ?? client$.options$.xPlexClientIdentifier, + const query = encodeFormQuery({ + "includeHttps": payload.includeHttps, + "includeIPv6": payload.includeIPv6, + "includeRelay": payload.includeRelay, + "X-Plex-Client-Identifier": client._options.clientID, + "X-Plex-Client-Identifier": payload.ClientID, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "get-server-resources", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - baseURL: baseURL$, - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + baseURL: baseURL, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -124,7 +123,7 @@ export async function plexGetServerResources( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -132,7 +131,7 @@ export async function plexGetServerResources( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetServerResourcesResponse, | errors.GetServerResourcesBadRequest | errors.GetServerResourcesUnauthorized @@ -144,16 +143,16 @@ export async function plexGetServerResources( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetServerResourcesResponse$inboundSchema, { + M.json(200, operations.GetServerResourcesResponse$inboundSchema, { key: "PlexDevices", }), - m$.jsonErr(400, errors.GetServerResourcesBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetServerResourcesUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetServerResourcesBadRequest$inboundSchema), + M.jsonErr(401, errors.GetServerResourcesUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/plexGetTokenByPinId.ts b/src/funcs/plexGetTokenByPinId.ts index 07d645cd..54ebcd9c 100644 --- a/src/funcs/plexGetTokenByPinId.ts +++ b/src/funcs/plexGetTokenByPinId.ts @@ -3,12 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { pathToFunc } from "../lib/url.js"; import { @@ -32,9 +29,8 @@ import { Result } from "../sdk/types/fp.js"; * Retrieve an Access Token from Plex.tv after the Pin has been authenticated */ export async function plexGetTokenByPinId( - client$: PlexAPICore, - pinID: number, - xPlexClientIdentifier?: string | undefined, + client: PlexAPICore, + request: operations.GetTokenByPinIdRequest, options?: RequestOptions & { serverURL?: string }, ): Promise< Result< @@ -50,40 +46,45 @@ export async function plexGetTokenByPinId( | ConnectionError > > { - const input$: operations.GetTokenByPinIdRequest = { - xPlexClientIdentifier: xPlexClientIdentifier, - pinID: pinID, - }; + const input = request; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.GetTokenByPinIdRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.GetTokenByPinIdRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const baseURL$ = options?.serverURL + const baseURL = options?.serverURL || pathToFunc(GetTokenByPinIdServerList[0], { charEncoding: "percent" })(); - const pathParams$ = { - pinID: encodeSimple$("pinID", payload$.pinID, { + const pathParams = { + pinID: encodeSimple("pinID", payload.pinID, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/pins/{pinID}")(pathParams$); + const path = pathToFunc("/pins/{pinID}")(pathParams); - const query$ = encodeFormQuery$({ - "X-Plex-Client-Identifier": payload$["X-Plex-Client-Identifier"] - ?? client$.options$.xPlexClientIdentifier, + const query = encodeFormQuery({ + "X-Plex-Client-Identifier": client._options.clientID, + "X-Plex-Client-Identifier": payload.ClientID, + "X-Plex-Device": payload.DeviceName, + "X-Plex-Device": client._options.deviceName, + "X-Plex-Platform": client._options.clientPlatform, + "X-Plex-Platform": payload.ClientPlatform, + "X-Plex-Product": payload.ClientName, + "X-Plex-Product": client._options.clientName, + "X-Plex-Version": payload.ClientVersion, + "X-Plex-Version": client._options.clientVersion, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); @@ -93,25 +94,25 @@ export async function plexGetTokenByPinId( securitySource: null, }; - const requestRes = client$.createRequest$(context, { + const requestRes = client._createRequest(context, { method: "GET", - baseURL: baseURL$, - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + baseURL: baseURL, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "404", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -119,7 +120,7 @@ export async function plexGetTokenByPinId( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -127,7 +128,7 @@ export async function plexGetTokenByPinId( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetTokenByPinIdResponse, | errors.GetTokenByPinIdBadRequest | errors.GetTokenByPinIdResponseBody @@ -139,16 +140,16 @@ export async function plexGetTokenByPinId( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetTokenByPinIdResponse$inboundSchema, { + M.json(200, operations.GetTokenByPinIdResponse$inboundSchema, { key: "AuthPinContainer", }), - m$.jsonErr(400, errors.GetTokenByPinIdBadRequest$inboundSchema), - m$.jsonErr(404, errors.GetTokenByPinIdResponseBody$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetTokenByPinIdBadRequest$inboundSchema), + M.jsonErr(404, errors.GetTokenByPinIdResponseBody$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/plexGetUserFriends.ts b/src/funcs/plexGetUserFriends.ts index f9953349..5bd0de90 100644 --- a/src/funcs/plexGetUserFriends.ts +++ b/src/funcs/plexGetUserFriends.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -28,7 +28,7 @@ import { Result } from "../sdk/types/fp.js"; * Get friends of provided auth token. */ export async function plexGetUserFriends( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions & { serverURL?: string }, ): Promise< Result< @@ -44,42 +44,42 @@ export async function plexGetUserFriends( | ConnectionError > > { - const baseURL$ = options?.serverURL + const baseURL = options?.serverURL || pathToFunc(GetUserFriendsServerList[0], { charEncoding: "percent" })(); - const path$ = pathToFunc("/friends")(); + const path = pathToFunc("/friends")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getUserFriends", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - baseURL: baseURL$, - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + baseURL: baseURL, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -87,7 +87,7 @@ export async function plexGetUserFriends( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -95,7 +95,7 @@ export async function plexGetUserFriends( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetUserFriendsResponse, | errors.GetUserFriendsBadRequest | errors.GetUserFriendsUnauthorized @@ -107,16 +107,16 @@ export async function plexGetUserFriends( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetUserFriendsResponse$inboundSchema, { + M.json(200, operations.GetUserFriendsResponse$inboundSchema, { key: "Friends", }), - m$.jsonErr(400, errors.GetUserFriendsBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetUserFriendsUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetUserFriendsBadRequest$inboundSchema), + M.jsonErr(401, errors.GetUserFriendsUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/searchGetSearchResults.ts b/src/funcs/searchGetSearchResults.ts index 81e656c6..31322401 100644 --- a/src/funcs/searchGetSearchResults.ts +++ b/src/funcs/searchGetSearchResults.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * This will search the database for the string provided. */ export async function searchGetSearchResults( - client$: PlexAPICore, + client: PlexAPICore, query: string, options?: RequestOptions, ): Promise< @@ -46,59 +46,59 @@ export async function searchGetSearchResults( | ConnectionError > > { - const input$: operations.GetSearchResultsRequest = { + const input: operations.GetSearchResultsRequest = { query: query, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.GetSearchResultsRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.GetSearchResultsRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/search")(); + const path = pathToFunc("/search")(); - const query$ = encodeFormQuery$({ - "query": payload$.query, + const query$ = encodeFormQuery({ + "query": payload.query, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getSearchResults", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, + path: path, + headers: headers, query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -106,7 +106,7 @@ export async function searchGetSearchResults( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -114,7 +114,7 @@ export async function searchGetSearchResults( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetSearchResultsResponse, | errors.GetSearchResultsBadRequest | errors.GetSearchResultsUnauthorized @@ -126,16 +126,16 @@ export async function searchGetSearchResults( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetSearchResultsResponse$inboundSchema, { + M.json(200, operations.GetSearchResultsResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetSearchResultsBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetSearchResultsUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetSearchResultsBadRequest$inboundSchema), + M.jsonErr(401, errors.GetSearchResultsUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/searchPerformSearch.ts b/src/funcs/searchPerformSearch.ts index 5dec2fff..056ded1b 100644 --- a/src/funcs/searchPerformSearch.ts +++ b/src/funcs/searchPerformSearch.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -40,7 +40,7 @@ import { Result } from "../sdk/types/fp.js"; * This request is intended to be very fast, and called as the user types. */ export async function searchPerformSearch( - client$: PlexAPICore, + client: PlexAPICore, query: string, sectionId?: number | undefined, limit?: number | undefined, @@ -59,63 +59,63 @@ export async function searchPerformSearch( | ConnectionError > > { - const input$: operations.PerformSearchRequest = { + const input: operations.PerformSearchRequest = { query: query, sectionId: sectionId, limit: limit, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.PerformSearchRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.PerformSearchRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/hubs/search")(); + const path = pathToFunc("/hubs/search")(); - const query$ = encodeFormQuery$({ - "limit": payload$.limit, - "query": payload$.query, - "sectionId": payload$.sectionId, + const query$ = encodeFormQuery({ + "limit": payload.limit, + "query": payload.query, + "sectionId": payload.sectionId, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "performSearch", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, + path: path, + headers: headers, query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -123,7 +123,7 @@ export async function searchPerformSearch( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -131,7 +131,7 @@ export async function searchPerformSearch( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.PerformSearchResponse, | errors.PerformSearchBadRequest | errors.PerformSearchUnauthorized @@ -143,14 +143,14 @@ export async function searchPerformSearch( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.PerformSearchResponse$inboundSchema), - m$.jsonErr(400, errors.PerformSearchBadRequest$inboundSchema), - m$.jsonErr(401, errors.PerformSearchUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.PerformSearchResponse$inboundSchema), + M.jsonErr(400, errors.PerformSearchBadRequest$inboundSchema), + M.jsonErr(401, errors.PerformSearchUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/searchPerformVoiceSearch.ts b/src/funcs/searchPerformVoiceSearch.ts index 738aff15..560cc066 100644 --- a/src/funcs/searchPerformVoiceSearch.ts +++ b/src/funcs/searchPerformVoiceSearch.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -32,7 +32,7 @@ import { Result } from "../sdk/types/fp.js"; * Results, as well as their containing per-type hubs, contain a `distance` attribute which can be used to judge result quality. */ export async function searchPerformVoiceSearch( - client$: PlexAPICore, + client: PlexAPICore, query: string, sectionId?: number | undefined, limit?: number | undefined, @@ -51,64 +51,63 @@ export async function searchPerformVoiceSearch( | ConnectionError > > { - const input$: operations.PerformVoiceSearchRequest = { + const input: operations.PerformVoiceSearchRequest = { query: query, sectionId: sectionId, limit: limit, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => - operations.PerformVoiceSearchRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.PerformVoiceSearchRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/hubs/search/voice")(); + const path = pathToFunc("/hubs/search/voice")(); - const query$ = encodeFormQuery$({ - "limit": payload$.limit, - "query": payload$.query, - "sectionId": payload$.sectionId, + const query$ = encodeFormQuery({ + "limit": payload.limit, + "query": payload.query, + "sectionId": payload.sectionId, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "performVoiceSearch", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, + path: path, + headers: headers, query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -116,7 +115,7 @@ export async function searchPerformVoiceSearch( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -124,7 +123,7 @@ export async function searchPerformVoiceSearch( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.PerformVoiceSearchResponse, | errors.PerformVoiceSearchBadRequest | errors.PerformVoiceSearchUnauthorized @@ -136,14 +135,14 @@ export async function searchPerformVoiceSearch( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.PerformVoiceSearchResponse$inboundSchema), - m$.jsonErr(400, errors.PerformVoiceSearchBadRequest$inboundSchema), - m$.jsonErr(401, errors.PerformVoiceSearchUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.PerformVoiceSearchResponse$inboundSchema), + M.jsonErr(400, errors.PerformVoiceSearchBadRequest$inboundSchema), + M.jsonErr(401, errors.PerformVoiceSearchUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/serverGetAvailableClients.ts b/src/funcs/serverGetAvailableClients.ts index ebf88936..e443eaf2 100644 --- a/src/funcs/serverGetAvailableClients.ts +++ b/src/funcs/serverGetAvailableClients.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -27,7 +27,7 @@ import { Result } from "../sdk/types/fp.js"; * Get Available Clients */ export async function serverGetAvailableClients( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions, ): Promise< Result< @@ -43,38 +43,38 @@ export async function serverGetAvailableClients( | ConnectionError > > { - const path$ = pathToFunc("/clients")(); + const path = pathToFunc("/clients")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getAvailableClients", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -82,7 +82,7 @@ export async function serverGetAvailableClients( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -90,7 +90,7 @@ export async function serverGetAvailableClients( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetAvailableClientsResponse, | errors.GetAvailableClientsBadRequest | errors.GetAvailableClientsUnauthorized @@ -102,16 +102,16 @@ export async function serverGetAvailableClients( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetAvailableClientsResponse$inboundSchema, { + M.json(200, operations.GetAvailableClientsResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetAvailableClientsBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetAvailableClientsUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetAvailableClientsBadRequest$inboundSchema), + M.jsonErr(401, errors.GetAvailableClientsUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/serverGetDevices.ts b/src/funcs/serverGetDevices.ts index cd043fe5..b5822b0f 100644 --- a/src/funcs/serverGetDevices.ts +++ b/src/funcs/serverGetDevices.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -27,7 +27,7 @@ import { Result } from "../sdk/types/fp.js"; * Get Devices */ export async function serverGetDevices( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions, ): Promise< Result< @@ -43,38 +43,38 @@ export async function serverGetDevices( | ConnectionError > > { - const path$ = pathToFunc("/devices")(); + const path = pathToFunc("/devices")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getDevices", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -82,7 +82,7 @@ export async function serverGetDevices( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -90,7 +90,7 @@ export async function serverGetDevices( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetDevicesResponse, | errors.GetDevicesBadRequest | errors.GetDevicesUnauthorized @@ -102,16 +102,14 @@ export async function serverGetDevices( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetDevicesResponse$inboundSchema, { - key: "object", - }), - m$.jsonErr(400, errors.GetDevicesBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetDevicesUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.json(200, operations.GetDevicesResponse$inboundSchema, { key: "object" }), + M.jsonErr(400, errors.GetDevicesBadRequest$inboundSchema), + M.jsonErr(401, errors.GetDevicesUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/serverGetMediaProviders.ts b/src/funcs/serverGetMediaProviders.ts index 80258c65..d31091be 100644 --- a/src/funcs/serverGetMediaProviders.ts +++ b/src/funcs/serverGetMediaProviders.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * Retrieves media providers and their features from the Plex server. */ export async function serverGetMediaProviders( - client$: PlexAPICore, + client: PlexAPICore, xPlexToken: string, options?: RequestOptions, ): Promise< @@ -46,60 +46,59 @@ export async function serverGetMediaProviders( | ConnectionError > > { - const input$: operations.GetMediaProvidersRequest = { + const input: operations.GetMediaProvidersRequest = { xPlexToken: xPlexToken, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => - operations.GetMediaProvidersRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.GetMediaProvidersRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/media/providers")(); + const path = pathToFunc("/media/providers")(); - const query$ = encodeFormQuery$({ - "X-Plex-Token": payload$["X-Plex-Token"], + const query = encodeFormQuery({ + "X-Plex-Token": payload["X-Plex-Token"], }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "get-media-providers", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -107,7 +106,7 @@ export async function serverGetMediaProviders( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -115,7 +114,7 @@ export async function serverGetMediaProviders( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetMediaProvidersResponse, | errors.GetMediaProvidersBadRequest | errors.GetMediaProvidersUnauthorized @@ -127,16 +126,16 @@ export async function serverGetMediaProviders( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetMediaProvidersResponse$inboundSchema, { + M.json(200, operations.GetMediaProvidersResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetMediaProvidersBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetMediaProvidersUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetMediaProvidersBadRequest$inboundSchema), + M.jsonErr(401, errors.GetMediaProvidersUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/serverGetMyPlexAccount.ts b/src/funcs/serverGetMyPlexAccount.ts index 3adca75c..4c437869 100644 --- a/src/funcs/serverGetMyPlexAccount.ts +++ b/src/funcs/serverGetMyPlexAccount.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -27,7 +27,7 @@ import { Result } from "../sdk/types/fp.js"; * Returns MyPlex Account Information */ export async function serverGetMyPlexAccount( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions, ): Promise< Result< @@ -43,38 +43,38 @@ export async function serverGetMyPlexAccount( | ConnectionError > > { - const path$ = pathToFunc("/myplex/account")(); + const path = pathToFunc("/myplex/account")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getMyPlexAccount", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -82,7 +82,7 @@ export async function serverGetMyPlexAccount( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -90,7 +90,7 @@ export async function serverGetMyPlexAccount( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetMyPlexAccountResponse, | errors.GetMyPlexAccountBadRequest | errors.GetMyPlexAccountUnauthorized @@ -102,16 +102,16 @@ export async function serverGetMyPlexAccount( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetMyPlexAccountResponse$inboundSchema, { + M.json(200, operations.GetMyPlexAccountResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetMyPlexAccountBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetMyPlexAccountUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetMyPlexAccountBadRequest$inboundSchema), + M.jsonErr(401, errors.GetMyPlexAccountUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/serverGetResizedPhoto.ts b/src/funcs/serverGetResizedPhoto.ts index 0466df0f..b81c8a65 100644 --- a/src/funcs/serverGetResizedPhoto.ts +++ b/src/funcs/serverGetResizedPhoto.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * Plex's Photo transcoder is used throughout the service to serve images at specified sizes. */ export async function serverGetResizedPhoto( - client$: PlexAPICore, + client: PlexAPICore, request: operations.GetResizedPhotoRequest, options?: RequestOptions, ): Promise< @@ -46,63 +46,63 @@ export async function serverGetResizedPhoto( | ConnectionError > > { - const input$ = request; + const input = request; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.GetResizedPhotoRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.GetResizedPhotoRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/photo/:/transcode")(); + const path = pathToFunc("/photo/:/transcode")(); - const query$ = encodeFormQuery$({ - "blur": payload$.blur, - "height": payload$.height, - "minSize": payload$.minSize, - "opacity": payload$.opacity, - "upscale": payload$.upscale, - "url": payload$.url, - "width": payload$.width, + const query = encodeFormQuery({ + "blur": payload.blur, + "height": payload.height, + "minSize": payload.minSize, + "opacity": payload.opacity, + "upscale": payload.upscale, + "url": payload.url, + "width": payload.width, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getResizedPhoto", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -110,7 +110,7 @@ export async function serverGetResizedPhoto( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -118,7 +118,7 @@ export async function serverGetResizedPhoto( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetResizedPhotoResponse, | errors.GetResizedPhotoBadRequest | errors.GetResizedPhotoUnauthorized @@ -130,14 +130,14 @@ export async function serverGetResizedPhoto( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.GetResizedPhotoResponse$inboundSchema), - m$.jsonErr(400, errors.GetResizedPhotoBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetResizedPhotoUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.GetResizedPhotoResponse$inboundSchema), + M.jsonErr(400, errors.GetResizedPhotoBadRequest$inboundSchema), + M.jsonErr(401, errors.GetResizedPhotoUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/serverGetServerCapabilities.ts b/src/funcs/serverGetServerCapabilities.ts index c4fa5c85..753c572d 100644 --- a/src/funcs/serverGetServerCapabilities.ts +++ b/src/funcs/serverGetServerCapabilities.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -27,7 +27,7 @@ import { Result } from "../sdk/types/fp.js"; * Get Server Capabilities */ export async function serverGetServerCapabilities( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions, ): Promise< Result< @@ -43,38 +43,38 @@ export async function serverGetServerCapabilities( | ConnectionError > > { - const path$ = pathToFunc("/")(); + const path = pathToFunc("/")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getServerCapabilities", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -82,7 +82,7 @@ export async function serverGetServerCapabilities( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -90,7 +90,7 @@ export async function serverGetServerCapabilities( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetServerCapabilitiesResponse, | errors.GetServerCapabilitiesBadRequest | errors.GetServerCapabilitiesUnauthorized @@ -102,16 +102,16 @@ export async function serverGetServerCapabilities( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetServerCapabilitiesResponse$inboundSchema, { + M.json(200, operations.GetServerCapabilitiesResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetServerCapabilitiesBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetServerCapabilitiesUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetServerCapabilitiesBadRequest$inboundSchema), + M.jsonErr(401, errors.GetServerCapabilitiesUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/serverGetServerIdentity.ts b/src/funcs/serverGetServerIdentity.ts index 7602915c..9da0e0e5 100644 --- a/src/funcs/serverGetServerIdentity.ts +++ b/src/funcs/serverGetServerIdentity.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { pathToFunc } from "../lib/url.js"; import { @@ -26,7 +26,7 @@ import { Result } from "../sdk/types/fp.js"; * This request is useful to determine if the server is online or offline */ export async function serverGetServerIdentity( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions, ): Promise< Result< @@ -41,9 +41,9 @@ export async function serverGetServerIdentity( | ConnectionError > > { - const path$ = pathToFunc("/identity")(); + const path = pathToFunc("/identity")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); @@ -53,22 +53,22 @@ export async function serverGetServerIdentity( securitySource: null, }; - const requestRes = client$.createRequest$(context, { + const requestRes = client._createRequest(context, { method: "GET", - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["408", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -76,7 +76,7 @@ export async function serverGetServerIdentity( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -84,7 +84,7 @@ export async function serverGetServerIdentity( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetServerIdentityResponse, | errors.GetServerIdentityRequestTimeout | SDKError @@ -95,15 +95,15 @@ export async function serverGetServerIdentity( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetServerIdentityResponse$inboundSchema, { + M.json(200, operations.GetServerIdentityResponse$inboundSchema, { key: "object", }), - m$.jsonErr(408, errors.GetServerIdentityRequestTimeout$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(408, errors.GetServerIdentityRequestTimeout$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/serverGetServerList.ts b/src/funcs/serverGetServerList.ts index 7d23ba1e..806cb23e 100644 --- a/src/funcs/serverGetServerList.ts +++ b/src/funcs/serverGetServerList.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -27,7 +27,7 @@ import { Result } from "../sdk/types/fp.js"; * Get Server List */ export async function serverGetServerList( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions, ): Promise< Result< @@ -43,38 +43,38 @@ export async function serverGetServerList( | ConnectionError > > { - const path$ = pathToFunc("/servers")(); + const path = pathToFunc("/servers")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getServerList", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -82,7 +82,7 @@ export async function serverGetServerList( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -90,7 +90,7 @@ export async function serverGetServerList( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetServerListResponse, | errors.GetServerListBadRequest | errors.GetServerListUnauthorized @@ -102,16 +102,16 @@ export async function serverGetServerList( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetServerListResponse$inboundSchema, { + M.json(200, operations.GetServerListResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetServerListBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetServerListUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetServerListBadRequest$inboundSchema), + M.jsonErr(401, errors.GetServerListUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/serverGetServerPreferences.ts b/src/funcs/serverGetServerPreferences.ts index 4e1be1ff..8e1dfc32 100644 --- a/src/funcs/serverGetServerPreferences.ts +++ b/src/funcs/serverGetServerPreferences.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -27,7 +27,7 @@ import { Result } from "../sdk/types/fp.js"; * Get Server Preferences */ export async function serverGetServerPreferences( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions, ): Promise< Result< @@ -43,38 +43,38 @@ export async function serverGetServerPreferences( | ConnectionError > > { - const path$ = pathToFunc("/:/prefs")(); + const path = pathToFunc("/:/prefs")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getServerPreferences", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -82,7 +82,7 @@ export async function serverGetServerPreferences( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -90,7 +90,7 @@ export async function serverGetServerPreferences( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetServerPreferencesResponse, | errors.GetServerPreferencesBadRequest | errors.GetServerPreferencesUnauthorized @@ -102,16 +102,16 @@ export async function serverGetServerPreferences( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetServerPreferencesResponse$inboundSchema, { + M.json(200, operations.GetServerPreferencesResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetServerPreferencesBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetServerPreferencesUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetServerPreferencesBadRequest$inboundSchema), + M.jsonErr(401, errors.GetServerPreferencesUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/sessionsGetSessionHistory.ts b/src/funcs/sessionsGetSessionHistory.ts index 4d46fe62..849499df 100644 --- a/src/funcs/sessionsGetSessionHistory.ts +++ b/src/funcs/sessionsGetSessionHistory.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * This will Retrieve a listing of all history views. */ export async function sessionsGetSessionHistory( - client$: PlexAPICore, + client: PlexAPICore, sort?: string | undefined, accountId?: number | undefined, filter?: operations.QueryParamFilter | undefined, @@ -49,66 +49,65 @@ export async function sessionsGetSessionHistory( | ConnectionError > > { - const input$: operations.GetSessionHistoryRequest = { + const input: operations.GetSessionHistoryRequest = { sort: sort, accountId: accountId, filter: filter, librarySectionID: librarySectionID, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => - operations.GetSessionHistoryRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.GetSessionHistoryRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/status/sessions/history/all")(); + const path = pathToFunc("/status/sessions/history/all")(); - const query$ = encodeFormQuery$({ - "accountId": payload$.accountId, - "filter": payload$.filter, - "librarySectionID": payload$.librarySectionID, - "sort": payload$.sort, + const query = encodeFormQuery({ + "accountId": payload.accountId, + "filter": payload.filter, + "librarySectionID": payload.librarySectionID, + "sort": payload.sort, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getSessionHistory", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -116,7 +115,7 @@ export async function sessionsGetSessionHistory( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -124,7 +123,7 @@ export async function sessionsGetSessionHistory( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetSessionHistoryResponse, | errors.GetSessionHistoryBadRequest | errors.GetSessionHistoryUnauthorized @@ -136,16 +135,16 @@ export async function sessionsGetSessionHistory( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetSessionHistoryResponse$inboundSchema, { + M.json(200, operations.GetSessionHistoryResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetSessionHistoryBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetSessionHistoryUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetSessionHistoryBadRequest$inboundSchema), + M.jsonErr(401, errors.GetSessionHistoryUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/sessionsGetSessions.ts b/src/funcs/sessionsGetSessions.ts index c1976dc7..f61c4f81 100644 --- a/src/funcs/sessionsGetSessions.ts +++ b/src/funcs/sessionsGetSessions.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -27,7 +27,7 @@ import { Result } from "../sdk/types/fp.js"; * This will retrieve the "Now Playing" Information of the PMS. */ export async function sessionsGetSessions( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions, ): Promise< Result< @@ -43,38 +43,38 @@ export async function sessionsGetSessions( | ConnectionError > > { - const path$ = pathToFunc("/status/sessions")(); + const path = pathToFunc("/status/sessions")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getSessions", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -82,7 +82,7 @@ export async function sessionsGetSessions( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -90,7 +90,7 @@ export async function sessionsGetSessions( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetSessionsResponse, | errors.GetSessionsBadRequest | errors.GetSessionsUnauthorized @@ -102,16 +102,16 @@ export async function sessionsGetSessions( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetSessionsResponse$inboundSchema, { + M.json(200, operations.GetSessionsResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetSessionsBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetSessionsUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetSessionsBadRequest$inboundSchema), + M.jsonErr(401, errors.GetSessionsUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/sessionsGetTranscodeSessions.ts b/src/funcs/sessionsGetTranscodeSessions.ts index 01a22c3f..61622569 100644 --- a/src/funcs/sessionsGetTranscodeSessions.ts +++ b/src/funcs/sessionsGetTranscodeSessions.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -27,7 +27,7 @@ import { Result } from "../sdk/types/fp.js"; * Get Transcode Sessions */ export async function sessionsGetTranscodeSessions( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions, ): Promise< Result< @@ -43,38 +43,38 @@ export async function sessionsGetTranscodeSessions( | ConnectionError > > { - const path$ = pathToFunc("/transcode/sessions")(); + const path = pathToFunc("/transcode/sessions")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getTranscodeSessions", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -82,7 +82,7 @@ export async function sessionsGetTranscodeSessions( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -90,7 +90,7 @@ export async function sessionsGetTranscodeSessions( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetTranscodeSessionsResponse, | errors.GetTranscodeSessionsBadRequest | errors.GetTranscodeSessionsUnauthorized @@ -102,16 +102,16 @@ export async function sessionsGetTranscodeSessions( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetTranscodeSessionsResponse$inboundSchema, { + M.json(200, operations.GetTranscodeSessionsResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetTranscodeSessionsBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetTranscodeSessionsUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetTranscodeSessionsBadRequest$inboundSchema), + M.jsonErr(401, errors.GetTranscodeSessionsUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/sessionsStopTranscodeSession.ts b/src/funcs/sessionsStopTranscodeSession.ts index c8b47a00..8dfb9bd4 100644 --- a/src/funcs/sessionsStopTranscodeSession.ts +++ b/src/funcs/sessionsStopTranscodeSession.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * Stop a Transcode Session */ export async function sessionsStopTranscodeSession( - client$: PlexAPICore, + client: PlexAPICore, sessionKey: string, options?: RequestOptions, ): Promise< @@ -46,62 +46,62 @@ export async function sessionsStopTranscodeSession( | ConnectionError > > { - const input$: operations.StopTranscodeSessionRequest = { + const input: operations.StopTranscodeSessionRequest = { sessionKey: sessionKey, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => - operations.StopTranscodeSessionRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => + operations.StopTranscodeSessionRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const pathParams$ = { - sessionKey: encodeSimple$("sessionKey", payload$.sessionKey, { + const pathParams = { + sessionKey: encodeSimple("sessionKey", payload.sessionKey, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/transcode/sessions/{sessionKey}")(pathParams$); + const path = pathToFunc("/transcode/sessions/{sessionKey}")(pathParams); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "stopTranscodeSession", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "DELETE", - path: path$, - headers: headers$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -109,7 +109,7 @@ export async function sessionsStopTranscodeSession( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -117,7 +117,7 @@ export async function sessionsStopTranscodeSession( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.StopTranscodeSessionResponse, | errors.StopTranscodeSessionBadRequest | errors.StopTranscodeSessionUnauthorized @@ -129,14 +129,14 @@ export async function sessionsStopTranscodeSession( | RequestTimeoutError | ConnectionError >( - m$.nil(204, operations.StopTranscodeSessionResponse$inboundSchema), - m$.jsonErr(400, errors.StopTranscodeSessionBadRequest$inboundSchema), - m$.jsonErr(401, errors.StopTranscodeSessionUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(204, operations.StopTranscodeSessionResponse$inboundSchema), + M.jsonErr(400, errors.StopTranscodeSessionBadRequest$inboundSchema), + M.jsonErr(401, errors.StopTranscodeSessionUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/statisticsGetBandwidthStatistics.ts b/src/funcs/statisticsGetBandwidthStatistics.ts index 207c6659..a368e002 100644 --- a/src/funcs/statisticsGetBandwidthStatistics.ts +++ b/src/funcs/statisticsGetBandwidthStatistics.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * This will return the bandwidth statistics for the server */ export async function statisticsGetBandwidthStatistics( - client$: PlexAPICore, + client: PlexAPICore, timespan?: number | undefined, options?: RequestOptions, ): Promise< @@ -46,60 +46,60 @@ export async function statisticsGetBandwidthStatistics( | ConnectionError > > { - const input$: operations.GetBandwidthStatisticsRequest = { + const input: operations.GetBandwidthStatisticsRequest = { timespan: timespan, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => - operations.GetBandwidthStatisticsRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => + operations.GetBandwidthStatisticsRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/statistics/bandwidth")(); + const path = pathToFunc("/statistics/bandwidth")(); - const query$ = encodeFormQuery$({ - "Timespan": payload$.Timespan, + const query = encodeFormQuery({ + "Timespan": payload.Timespan, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getBandwidthStatistics", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -107,7 +107,7 @@ export async function statisticsGetBandwidthStatistics( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -115,7 +115,7 @@ export async function statisticsGetBandwidthStatistics( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetBandwidthStatisticsResponse, | errors.GetBandwidthStatisticsBadRequest | errors.GetBandwidthStatisticsUnauthorized @@ -127,16 +127,16 @@ export async function statisticsGetBandwidthStatistics( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetBandwidthStatisticsResponse$inboundSchema, { + M.json(200, operations.GetBandwidthStatisticsResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetBandwidthStatisticsBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetBandwidthStatisticsUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetBandwidthStatisticsBadRequest$inboundSchema), + M.jsonErr(401, errors.GetBandwidthStatisticsUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/statisticsGetResourcesStatistics.ts b/src/funcs/statisticsGetResourcesStatistics.ts index 5ebd6b38..60eab53c 100644 --- a/src/funcs/statisticsGetResourcesStatistics.ts +++ b/src/funcs/statisticsGetResourcesStatistics.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * This will return the resources for the server */ export async function statisticsGetResourcesStatistics( - client$: PlexAPICore, + client: PlexAPICore, timespan?: number | undefined, options?: RequestOptions, ): Promise< @@ -46,60 +46,60 @@ export async function statisticsGetResourcesStatistics( | ConnectionError > > { - const input$: operations.GetResourcesStatisticsRequest = { + const input: operations.GetResourcesStatisticsRequest = { timespan: timespan, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => - operations.GetResourcesStatisticsRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => + operations.GetResourcesStatisticsRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/statistics/resources")(); + const path = pathToFunc("/statistics/resources")(); - const query$ = encodeFormQuery$({ - "Timespan": payload$.Timespan, + const query = encodeFormQuery({ + "Timespan": payload.Timespan, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getResourcesStatistics", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -107,7 +107,7 @@ export async function statisticsGetResourcesStatistics( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -115,7 +115,7 @@ export async function statisticsGetResourcesStatistics( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetResourcesStatisticsResponse, | errors.GetResourcesStatisticsBadRequest | errors.GetResourcesStatisticsUnauthorized @@ -127,16 +127,16 @@ export async function statisticsGetResourcesStatistics( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetResourcesStatisticsResponse$inboundSchema, { + M.json(200, operations.GetResourcesStatisticsResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetResourcesStatisticsBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetResourcesStatisticsUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetResourcesStatisticsBadRequest$inboundSchema), + M.jsonErr(401, errors.GetResourcesStatisticsUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/statisticsGetStatistics.ts b/src/funcs/statisticsGetStatistics.ts index 3c411d55..d87de25f 100644 --- a/src/funcs/statisticsGetStatistics.ts +++ b/src/funcs/statisticsGetStatistics.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * This will return the media statistics for the server */ export async function statisticsGetStatistics( - client$: PlexAPICore, + client: PlexAPICore, timespan?: number | undefined, options?: RequestOptions, ): Promise< @@ -46,59 +46,59 @@ export async function statisticsGetStatistics( | ConnectionError > > { - const input$: operations.GetStatisticsRequest = { + const input: operations.GetStatisticsRequest = { timespan: timespan, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.GetStatisticsRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.GetStatisticsRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/statistics/media")(); + const path = pathToFunc("/statistics/media")(); - const query$ = encodeFormQuery$({ - "Timespan": payload$.Timespan, + const query = encodeFormQuery({ + "Timespan": payload.Timespan, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getStatistics", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -106,7 +106,7 @@ export async function statisticsGetStatistics( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -114,7 +114,7 @@ export async function statisticsGetStatistics( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetStatisticsResponse, | errors.GetStatisticsBadRequest | errors.GetStatisticsUnauthorized @@ -126,16 +126,16 @@ export async function statisticsGetStatistics( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetStatisticsResponse$inboundSchema, { + M.json(200, operations.GetStatisticsResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetStatisticsBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetStatisticsUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetStatisticsBadRequest$inboundSchema), + M.jsonErr(401, errors.GetStatisticsUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/updaterApplyUpdates.ts b/src/funcs/updaterApplyUpdates.ts index 296cddbf..4de1c189 100644 --- a/src/funcs/updaterApplyUpdates.ts +++ b/src/funcs/updaterApplyUpdates.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed */ export async function updaterApplyUpdates( - client$: PlexAPICore, + client: PlexAPICore, tonight?: operations.Tonight | undefined, skip?: operations.Skip | undefined, options?: RequestOptions, @@ -47,61 +47,61 @@ export async function updaterApplyUpdates( | ConnectionError > > { - const input$: operations.ApplyUpdatesRequest = { + const input: operations.ApplyUpdatesRequest = { tonight: tonight, skip: skip, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.ApplyUpdatesRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.ApplyUpdatesRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/updater/apply")(); + const path = pathToFunc("/updater/apply")(); - const query$ = encodeFormQuery$({ - "skip": payload$.skip, - "tonight": payload$.tonight, + const query = encodeFormQuery({ + "skip": payload.skip, + "tonight": payload.tonight, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "applyUpdates", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "PUT", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "500", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -109,7 +109,7 @@ export async function updaterApplyUpdates( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -117,7 +117,7 @@ export async function updaterApplyUpdates( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.ApplyUpdatesResponse, | errors.ApplyUpdatesBadRequest | errors.ApplyUpdatesUnauthorized @@ -129,14 +129,14 @@ export async function updaterApplyUpdates( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.ApplyUpdatesResponse$inboundSchema), - m$.jsonErr(400, errors.ApplyUpdatesBadRequest$inboundSchema), - m$.jsonErr(401, errors.ApplyUpdatesUnauthorized$inboundSchema), - m$.fail(["4XX", 500, "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.ApplyUpdatesResponse$inboundSchema), + M.jsonErr(400, errors.ApplyUpdatesBadRequest$inboundSchema), + M.jsonErr(401, errors.ApplyUpdatesUnauthorized$inboundSchema), + M.fail(["4XX", 500, "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/updaterCheckForUpdates.ts b/src/funcs/updaterCheckForUpdates.ts index cc4d2814..ee3aa0ec 100644 --- a/src/funcs/updaterCheckForUpdates.ts +++ b/src/funcs/updaterCheckForUpdates.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * Checking for updates */ export async function updaterCheckForUpdates( - client$: PlexAPICore, + client: PlexAPICore, download?: operations.Download | undefined, options?: RequestOptions, ): Promise< @@ -46,59 +46,59 @@ export async function updaterCheckForUpdates( | ConnectionError > > { - const input$: operations.CheckForUpdatesRequest = { + const input: operations.CheckForUpdatesRequest = { download: download, }; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.CheckForUpdatesRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.CheckForUpdatesRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/updater/check")(); + const path = pathToFunc("/updater/check")(); - const query$ = encodeFormQuery$({ - "download": payload$.download, + const query = encodeFormQuery({ + "download": payload.download, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "checkForUpdates", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "PUT", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -106,7 +106,7 @@ export async function updaterCheckForUpdates( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -114,7 +114,7 @@ export async function updaterCheckForUpdates( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.CheckForUpdatesResponse, | errors.CheckForUpdatesBadRequest | errors.CheckForUpdatesUnauthorized @@ -126,14 +126,14 @@ export async function updaterCheckForUpdates( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.CheckForUpdatesResponse$inboundSchema), - m$.jsonErr(400, errors.CheckForUpdatesBadRequest$inboundSchema), - m$.jsonErr(401, errors.CheckForUpdatesUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.CheckForUpdatesResponse$inboundSchema), + M.jsonErr(400, errors.CheckForUpdatesBadRequest$inboundSchema), + M.jsonErr(401, errors.CheckForUpdatesUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/updaterGetUpdateStatus.ts b/src/funcs/updaterGetUpdateStatus.ts index aa8214a0..59aab923 100644 --- a/src/funcs/updaterGetUpdateStatus.ts +++ b/src/funcs/updaterGetUpdateStatus.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import * as m$ from "../lib/matchers.js"; +import * as M from "../lib/matchers.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -27,7 +27,7 @@ import { Result } from "../sdk/types/fp.js"; * Querying status of updates */ export async function updaterGetUpdateStatus( - client$: PlexAPICore, + client: PlexAPICore, options?: RequestOptions, ): Promise< Result< @@ -43,38 +43,38 @@ export async function updaterGetUpdateStatus( | ConnectionError > > { - const path$ = pathToFunc("/updater/status")(); + const path = pathToFunc("/updater/status")(); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getUpdateStatus", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -82,7 +82,7 @@ export async function updaterGetUpdateStatus( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -90,7 +90,7 @@ export async function updaterGetUpdateStatus( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetUpdateStatusResponse, | errors.GetUpdateStatusBadRequest | errors.GetUpdateStatusUnauthorized @@ -102,16 +102,16 @@ export async function updaterGetUpdateStatus( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetUpdateStatusResponse$inboundSchema, { + M.json(200, operations.GetUpdateStatusResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetUpdateStatusBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetUpdateStatusUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetUpdateStatusBadRequest$inboundSchema), + M.jsonErr(401, errors.GetUpdateStatusUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/videoGetTimeline.ts b/src/funcs/videoGetTimeline.ts index f2d151ac..5ba0795d 100644 --- a/src/funcs/videoGetTimeline.ts +++ b/src/funcs/videoGetTimeline.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * Get the timeline for a media item */ export async function videoGetTimeline( - client$: PlexAPICore, + client: PlexAPICore, request: operations.GetTimelineRequest, options?: RequestOptions, ): Promise< @@ -46,66 +46,66 @@ export async function videoGetTimeline( | ConnectionError > > { - const input$ = request; + const input = request; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.GetTimelineRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.GetTimelineRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/:/timeline")(); + const path = pathToFunc("/:/timeline")(); - const query$ = encodeFormQuery$({ - "context": payload$.context, - "duration": payload$.duration, - "hasMDE": payload$.hasMDE, - "key": payload$.key, - "playBackTime": payload$.playBackTime, - "playQueueItemID": payload$.playQueueItemID, - "ratingKey": payload$.ratingKey, - "row": payload$.row, - "state": payload$.state, - "time": payload$.time, + const query = encodeFormQuery({ + "context": payload.context, + "duration": payload.duration, + "hasMDE": payload.hasMDE, + "key": payload.key, + "playBackTime": payload.playBackTime, + "playQueueItemID": payload.playQueueItemID, + "ratingKey": payload.ratingKey, + "row": payload.row, + "state": payload.state, + "time": payload.time, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "getTimeline", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -113,7 +113,7 @@ export async function videoGetTimeline( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -121,7 +121,7 @@ export async function videoGetTimeline( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetTimelineResponse, | errors.GetTimelineBadRequest | errors.GetTimelineUnauthorized @@ -133,14 +133,14 @@ export async function videoGetTimeline( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.GetTimelineResponse$inboundSchema), - m$.jsonErr(400, errors.GetTimelineBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetTimelineUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.GetTimelineResponse$inboundSchema), + M.jsonErr(400, errors.GetTimelineBadRequest$inboundSchema), + M.jsonErr(401, errors.GetTimelineUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/videoStartUniversalTranscode.ts b/src/funcs/videoStartUniversalTranscode.ts index 45a6194b..16750cd7 100644 --- a/src/funcs/videoStartUniversalTranscode.ts +++ b/src/funcs/videoStartUniversalTranscode.ts @@ -3,9 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; * Begin a Universal Transcode Session */ export async function videoStartUniversalTranscode( - client$: PlexAPICore, + client: PlexAPICore, request: operations.StartUniversalTranscodeRequest, options?: RequestOptions, ): Promise< @@ -46,73 +46,73 @@ export async function videoStartUniversalTranscode( | ConnectionError > > { - const input$ = request; + const input = request; - const parsed$ = schemas$.safeParse( - input$, - (value$) => - operations.StartUniversalTranscodeRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => + operations.StartUniversalTranscodeRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const path$ = pathToFunc("/video/:/transcode/universal/start.mpd")(); + const path = pathToFunc("/video/:/transcode/universal/start.mpd")(); - const query$ = encodeFormQuery$({ - "addDebugOverlay": payload$.addDebugOverlay, - "audioBoost": payload$.audioBoost, - "autoAdjustQuality": payload$.autoAdjustQuality, - "directPlay": payload$.directPlay, - "directStream": payload$.directStream, - "fastSeek": payload$.fastSeek, - "hasMDE": payload$.hasMDE, - "location": payload$.location, - "mediaBufferSize": payload$.mediaBufferSize, - "mediaIndex": payload$.mediaIndex, - "partIndex": payload$.partIndex, - "path": payload$.path, - "protocol": payload$.protocol, - "session": payload$.session, - "subtites": payload$.subtites, - "subtitleSize": payload$.subtitleSize, + const query = encodeFormQuery({ + "addDebugOverlay": payload.addDebugOverlay, + "audioBoost": payload.audioBoost, + "autoAdjustQuality": payload.autoAdjustQuality, + "directPlay": payload.directPlay, + "directStream": payload.directStream, + "fastSeek": payload.fastSeek, + "hasMDE": payload.hasMDE, + "location": payload.location, + "mediaBufferSize": payload.mediaBufferSize, + "mediaIndex": payload.mediaIndex, + "partIndex": payload.partIndex, + "path": payload.path, + "protocol": payload.protocol, + "session": payload.session, + "subtites": payload.subtites, + "subtitleSize": payload.subtitleSize, }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "startUniversalTranscode", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -120,7 +120,7 @@ export async function videoStartUniversalTranscode( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -128,7 +128,7 @@ export async function videoStartUniversalTranscode( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.StartUniversalTranscodeResponse, | errors.StartUniversalTranscodeBadRequest | errors.StartUniversalTranscodeUnauthorized @@ -140,14 +140,14 @@ export async function videoStartUniversalTranscode( | RequestTimeoutError | ConnectionError >( - m$.nil(200, operations.StartUniversalTranscodeResponse$inboundSchema), - m$.jsonErr(400, errors.StartUniversalTranscodeBadRequest$inboundSchema), - m$.jsonErr(401, errors.StartUniversalTranscodeUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.nil(200, operations.StartUniversalTranscodeResponse$inboundSchema), + M.jsonErr(400, errors.StartUniversalTranscodeBadRequest$inboundSchema), + M.jsonErr(401, errors.StartUniversalTranscodeUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/funcs/watchlistGetWatchList.ts b/src/funcs/watchlistGetWatchList.ts index fb0fc7d9..0e000b7f 100644 --- a/src/funcs/watchlistGetWatchList.ts +++ b/src/funcs/watchlistGetWatchList.ts @@ -3,12 +3,9 @@ */ import { PlexAPICore } from "../core.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import * as m$ from "../lib/matchers.js"; -import * as schemas$ from "../lib/schemas.js"; +import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -33,7 +30,7 @@ import { Result } from "../sdk/types/fp.js"; * Get User Watchlist */ export async function watchlistGetWatchList( - client$: PlexAPICore, + client: PlexAPICore, request: operations.GetWatchListRequest, options?: RequestOptions & { serverURL?: string }, ): Promise< @@ -50,75 +47,75 @@ export async function watchlistGetWatchList( | ConnectionError > > { - const input$ = request; + const input = request; - const parsed$ = schemas$.safeParse( - input$, - (value$) => operations.GetWatchListRequest$outboundSchema.parse(value$), + const parsed = safeParse( + input, + (value) => operations.GetWatchListRequest$outboundSchema.parse(value), "Input validation failed", ); - if (!parsed$.ok) { - return parsed$; + if (!parsed.ok) { + return parsed; } - const payload$ = parsed$.value; - const body$ = null; + const payload = parsed.value; + const body = null; - const baseURL$ = options?.serverURL + const baseURL = options?.serverURL || pathToFunc(GetWatchListServerList[0], { charEncoding: "percent" })(); - const pathParams$ = { - filter: encodeSimple$("filter", payload$.filter, { + const pathParams = { + filter: encodeSimple("filter", payload.filter, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/library/sections/watchlist/{filter}")(pathParams$); + const path = pathToFunc("/library/sections/watchlist/{filter}")(pathParams); - const query$ = encodeFormQuery$({ - "includeCollections": payload$.includeCollections, - "includeExternalMedia": payload$.includeExternalMedia, - "libtype": payload$.libtype, - "maxresults": payload$.maxresults, - "sort": payload$.sort, - "X-Plex-Container-Size": payload$["X-Plex-Container-Size"], - "X-Plex-Container-Start": payload$["X-Plex-Container-Start"], - "X-Plex-Token": payload$["X-Plex-Token"], + const query = encodeFormQuery({ + "includeCollections": payload.includeCollections, + "includeExternalMedia": payload.includeExternalMedia, + "libtype": payload.libtype, + "maxresults": payload.maxresults, + "sort": payload.sort, + "X-Plex-Container-Size": payload["X-Plex-Container-Size"], + "X-Plex-Container-Start": payload["X-Plex-Container-Start"], + "X-Plex-Token": payload["X-Plex-Token"], }); - const headers$ = new Headers({ + const headers = new Headers({ Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const secConfig = await extractSecurity(client._options.accessToken); + const securityInput = secConfig == null ? {} : { accessToken: secConfig }; const context = { operationID: "get-watch-list", oAuth2Scopes: [], - securitySource: client$.options$.accessToken, + securitySource: client._options.accessToken, }; - const securitySettings$ = resolveGlobalSecurity(security$); + const requestSecurity = resolveGlobalSecurity(securityInput); - const requestRes = client$.createRequest$(context, { - security: securitySettings$, + const requestRes = client._createRequest(context, { + security: requestSecurity, method: "GET", - baseURL: baseURL$, - path: path$, - headers: headers$, - query: query$, - body: body$, - timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + baseURL: baseURL, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { return requestRes; } - const request$ = requestRes.value; + const req = requestRes.value; - const doResult = await client$.do$(request$, { + const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries - || client$.options$.retryConfig, + || client._options.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); if (!doResult.ok) { @@ -126,7 +123,7 @@ export async function watchlistGetWatchList( } const response = doResult.value; - const responseFields$ = { + const responseFields = { ContentType: response.headers.get("content-type") ?? "application/octet-stream", StatusCode: response.status, @@ -134,7 +131,7 @@ export async function watchlistGetWatchList( Headers: {}, }; - const [result$] = await m$.match< + const [result] = await M.match< operations.GetWatchListResponse, | errors.GetWatchListBadRequest | errors.GetWatchListUnauthorized @@ -146,16 +143,16 @@ export async function watchlistGetWatchList( | RequestTimeoutError | ConnectionError >( - m$.json(200, operations.GetWatchListResponse$inboundSchema, { + M.json(200, operations.GetWatchListResponse$inboundSchema, { key: "object", }), - m$.jsonErr(400, errors.GetWatchListBadRequest$inboundSchema), - m$.jsonErr(401, errors.GetWatchListUnauthorized$inboundSchema), - m$.fail(["4XX", "5XX"]), - )(response, { extraFields: responseFields$ }); - if (!result$.ok) { - return result$; + M.jsonErr(400, errors.GetWatchListBadRequest$inboundSchema), + M.jsonErr(401, errors.GetWatchListUnauthorized$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return result; } - return result$; + return result; } diff --git a/src/lib/config.ts b/src/lib/config.ts index feea7c74..16e6d5e8 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -34,9 +34,29 @@ export type SDKOptions = { accessToken?: string | (() => Promise); /** - * Allows setting the xPlexClientIdentifier parameter for all supported operations + * Allows setting the clientID parameter for all supported operations */ - xPlexClientIdentifier?: string | undefined; + clientID?: string | undefined; + + /** + * Allows setting the clientName parameter for all supported operations + */ + clientName?: string | undefined; + + /** + * Allows setting the clientVersion parameter for all supported operations + */ + clientVersion?: string | undefined; + + /** + * Allows setting the clientPlatform parameter for all supported operations + */ + clientPlatform?: string | undefined; + + /** + * Allows setting the deviceName parameter for all supported operations + */ + deviceName?: string | undefined; httpClient?: HTTPClient; /** @@ -95,7 +115,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "0.0.3", - sdkVersion: "0.23.5", - genVersion: "2.415.8", - userAgent: "speakeasy-sdk/typescript 0.23.5 2.415.8 0.0.3 @lukehagar/plexjs", + sdkVersion: "0.24.0", + genVersion: "2.428.1", + userAgent: "speakeasy-sdk/typescript 0.24.0 2.428.1 0.0.3 @lukehagar/plexjs", } as const; diff --git a/src/lib/sdks.ts b/src/lib/sdks.ts index dc42cb99..bfbe7a5b 100644 --- a/src/lib/sdks.ts +++ b/src/lib/sdks.ts @@ -71,11 +71,11 @@ const isBrowserLike = webWorkerLike || (typeof window === "object" && typeof window.document !== "undefined"); export class ClientSDK { - private readonly httpClient: HTTPClient; - protected readonly baseURL: URL | null; - protected readonly hooks$: SDKHooks; - protected readonly logger?: Logger | undefined; - public readonly options$: SDKOptions & { hooks?: SDKHooks }; + readonly #httpClient: HTTPClient; + readonly #hooks: SDKHooks; + readonly #logger?: Logger | undefined; + protected readonly _baseURL: URL | null; + public readonly _options: SDKOptions & { hooks?: SDKHooks }; constructor(options: SDKOptions = {}) { const opt = options as unknown; @@ -85,33 +85,33 @@ export class ClientSDK { && "hooks" in opt && opt.hooks instanceof SDKHooks ) { - this.hooks$ = opt.hooks; + this.#hooks = opt.hooks; } else { - this.hooks$ = new SDKHooks(); + this.#hooks = new SDKHooks(); } - this.options$ = { ...options, hooks: this.hooks$ }; + this._options = { ...options, hooks: this.#hooks }; const url = serverURLFromOptions(options); if (url) { url.pathname = url.pathname.replace(/\/+$/, "") + "/"; } - const { baseURL, client } = this.hooks$.sdkInit({ + const { baseURL, client } = this.#hooks.sdkInit({ baseURL: url, client: options.httpClient || new HTTPClient(), }); - this.baseURL = baseURL; - this.httpClient = client; - this.logger = options.debugLogger; + this._baseURL = baseURL; + this.#httpClient = client; + this.#logger = options.debugLogger; } - public createRequest$( + public _createRequest( context: HookContext, conf: RequestConfig, options?: RequestOptions, ): Result { const { method, path, query, headers: opHeaders, security } = conf; - const base = conf.baseURL ?? this.baseURL; + const base = conf.baseURL ?? this._baseURL; if (!base) { return ERR(new InvalidRequestError("No base URL provided for operation")); } @@ -195,7 +195,7 @@ export class ClientSDK { let input; try { - input = this.hooks$.beforeCreateRequest(context, { + input = this.#hooks.beforeCreateRequest(context, { url: reqURL, options: { ...fetchOptions, @@ -215,7 +215,7 @@ export class ClientSDK { return OK(new Request(input.url, input.options)); } - public async do$( + public async _do( request: Request, options: { context: HookContext; @@ -238,25 +238,25 @@ export class ClientSDK { return retry( async () => { - const req = await this.hooks$.beforeRequest(context, request.clone()); - await logRequest(this.logger, req).catch((e) => - this.logger?.log("Failed to log request:", e) + const req = await this.#hooks.beforeRequest(context, request.clone()); + await logRequest(this.#logger, req).catch((e) => + this.#logger?.log("Failed to log request:", e) ); - let response = await this.httpClient.request(req); + let response = await this.#httpClient.request(req); if (matchStatusCode(response, errorCodes)) { - const result = await this.hooks$.afterError(context, response, null); + const result = await this.#hooks.afterError(context, response, null); if (result.error) { throw result.error; } response = result.response || response; } else { - response = await this.hooks$.afterSuccess(context, response); + response = await this.#hooks.afterSuccess(context, response); } - await logResponse(this.logger, response, req) - .catch(e => this.logger?.log("Failed to log response:", e)); + await logResponse(this.#logger, response, req) + .catch(e => this.#logger?.log("Failed to log response:", e)); return response; }, diff --git a/src/lib/security.ts b/src/lib/security.ts index 7c28360e..08c566f4 100644 --- a/src/lib/security.ts +++ b/src/lib/security.ts @@ -199,7 +199,7 @@ export function resolveGlobalSecurity( [ { fieldName: "X-Plex-Token", - type: "apiKey:query", + type: "apiKey:header", value: security?.accessToken, }, ], diff --git a/src/sdk/authentication.ts b/src/sdk/authentication.ts index 337f45b7..017cd528 100644 --- a/src/sdk/authentication.ts +++ b/src/sdk/authentication.ts @@ -70,14 +70,12 @@ export class Authentication extends ClientSDK { * Sign in user with username and password and return user data with Plex authentication token */ async postUsersSignInData( - xPlexClientIdentifier?: string | undefined, - requestBody?: operations.PostUsersSignInDataRequestBody | undefined, + request: operations.PostUsersSignInDataRequest, options?: RequestOptions & { serverURL?: string }, ): Promise { return unwrapAsync(authenticationPostUsersSignInData( this, - xPlexClientIdentifier, - requestBody, + request, options, )); } diff --git a/src/sdk/hubs.ts b/src/sdk/hubs.ts index be448fa2..daf04ef7 100644 --- a/src/sdk/hubs.ts +++ b/src/sdk/hubs.ts @@ -4,6 +4,7 @@ import { hubsGetGlobalHubs } from "../funcs/hubsGetGlobalHubs.js"; import { hubsGetLibraryHubs } from "../funcs/hubsGetLibraryHubs.js"; +import { hubsGetRecentlyAdded } from "../funcs/hubsGetRecentlyAdded.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "./models/operations/index.js"; import { unwrapAsync } from "./types/fp.js"; @@ -28,6 +29,23 @@ export class Hubs extends ClientSDK { )); } + /** + * Get Recently Added + * + * @remarks + * This endpoint will return the recently added content. + */ + async getRecentlyAdded( + request: operations.GetRecentlyAddedRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(hubsGetRecentlyAdded( + this, + request, + options, + )); + } + /** * Get library specific hubs * diff --git a/src/sdk/library.ts b/src/sdk/library.ts index 00a7bcee..57691f1f 100644 --- a/src/sdk/library.ts +++ b/src/sdk/library.ts @@ -10,7 +10,7 @@ import { libraryGetLibraryItems } from "../funcs/libraryGetLibraryItems.js"; import { libraryGetMetaDataByRatingKey } from "../funcs/libraryGetMetaDataByRatingKey.js"; import { libraryGetMetadataChildren } from "../funcs/libraryGetMetadataChildren.js"; import { libraryGetOnDeck } from "../funcs/libraryGetOnDeck.js"; -import { libraryGetRecentlyAdded } from "../funcs/libraryGetRecentlyAdded.js"; +import { libraryGetRecentlyAddedLibrary } from "../funcs/libraryGetRecentlyAddedLibrary.js"; import { libraryGetRefreshLibraryMetadata } from "../funcs/libraryGetRefreshLibraryMetadata.js"; import { libraryGetSearchLibrary } from "../funcs/libraryGetSearchLibrary.js"; import { libraryGetTopWatchedContent } from "../funcs/libraryGetTopWatchedContent.js"; @@ -44,15 +44,13 @@ export class Library extends ClientSDK { * @remarks * This endpoint will return the recently added content. */ - async getRecentlyAdded( - xPlexContainerStart?: number | undefined, - xPlexContainerSize?: number | undefined, + async getRecentlyAddedLibrary( + request: operations.GetRecentlyAddedLibraryRequest, options?: RequestOptions, - ): Promise { - return unwrapAsync(libraryGetRecentlyAdded( + ): Promise { + return unwrapAsync(libraryGetRecentlyAddedLibrary( this, - xPlexContainerStart, - xPlexContainerSize, + request, options, )); } @@ -231,7 +229,7 @@ export class Library extends ClientSDK { */ async getSearchLibrary( sectionKey: number, - type: operations.QueryParamType, + type: operations.GetSearchLibraryQueryParamType, options?: RequestOptions, ): Promise { return unwrapAsync(libraryGetSearchLibrary( diff --git a/src/sdk/models/errors/getrecentlyadded.ts b/src/sdk/models/errors/getrecentlyaddedlibrary.ts similarity index 60% rename from src/sdk/models/errors/getrecentlyadded.ts rename to src/sdk/models/errors/getrecentlyaddedlibrary.ts index 2494d8c8..a24386ae 100644 --- a/src/sdk/models/errors/getrecentlyadded.ts +++ b/src/sdk/models/errors/getrecentlyaddedlibrary.ts @@ -5,6 +5,50 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +export type GetRecentlyAddedLibraryLibraryErrors = { + 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 GetRecentlyAddedLibraryUnauthorizedData = { + 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 GetRecentlyAddedLibraryUnauthorized 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$: GetRecentlyAddedLibraryUnauthorizedData; + + constructor(err: GetRecentlyAddedLibraryUnauthorizedData) { + const message = "message" in err && typeof err.message === "string" + ? err.message + : `API error occurred: ${JSON.stringify(err)}`; + super(message); + this.data$ = err; + + if (err.errors != null) this.errors = err.errors; + if (err.rawResponse != null) this.rawResponse = err.rawResponse; + + this.name = "GetRecentlyAddedLibraryUnauthorized"; + } +} + export type GetRecentlyAddedLibraryErrors = { code?: number | undefined; message?: string | undefined; @@ -12,9 +56,9 @@ export type GetRecentlyAddedLibraryErrors = { }; /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + * Bad Request - A parameter was not specified, or was specified incorrectly. */ -export type GetRecentlyAddedUnauthorizedData = { +export type GetRecentlyAddedLibraryBadRequestData = { errors?: Array | undefined; /** * Raw HTTP response; suitable for custom response parsing @@ -23,9 +67,9 @@ export type GetRecentlyAddedUnauthorizedData = { }; /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + * Bad Request - A parameter was not specified, or was specified incorrectly. */ -export class GetRecentlyAddedUnauthorized extends Error { +export class GetRecentlyAddedLibraryBadRequest extends Error { errors?: Array | undefined; /** * Raw HTTP response; suitable for custom response parsing @@ -33,9 +77,9 @@ export class GetRecentlyAddedUnauthorized extends Error { rawResponse?: Response | undefined; /** The original data that was passed to this error instance. */ - data$: GetRecentlyAddedUnauthorizedData; + data$: GetRecentlyAddedLibraryBadRequestData; - constructor(err: GetRecentlyAddedUnauthorizedData) { + constructor(err: GetRecentlyAddedLibraryBadRequestData) { const message = "message" in err && typeof err.message === "string" ? err.message : `API error occurred: ${JSON.stringify(err)}`; @@ -45,52 +89,114 @@ export class GetRecentlyAddedUnauthorized extends Error { if (err.errors != null) this.errors = err.errors; if (err.rawResponse != null) this.rawResponse = err.rawResponse; - this.name = "GetRecentlyAddedUnauthorized"; + this.name = "GetRecentlyAddedLibraryBadRequest"; } } -export type GetRecentlyAddedErrors = { +/** @internal */ +export const GetRecentlyAddedLibraryLibraryErrors$inboundSchema: z.ZodType< + GetRecentlyAddedLibraryLibraryErrors, + z.ZodTypeDef, + unknown +> = z.object({ + code: z.number().int().optional(), + message: z.string().optional(), + status: z.number().int().optional(), +}); + +/** @internal */ +export type GetRecentlyAddedLibraryLibraryErrors$Outbound = { code?: number | undefined; message?: string | undefined; status?: number | undefined; }; +/** @internal */ +export const GetRecentlyAddedLibraryLibraryErrors$outboundSchema: z.ZodType< + GetRecentlyAddedLibraryLibraryErrors$Outbound, + z.ZodTypeDef, + GetRecentlyAddedLibraryLibraryErrors +> = z.object({ + code: z.number().int().optional(), + message: z.string().optional(), + status: z.number().int().optional(), +}); + /** - * Bad Request - A parameter was not specified, or was specified incorrectly. + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export type GetRecentlyAddedBadRequestData = { - errors?: Array | undefined; - /** - * Raw HTTP response; suitable for custom response parsing - */ - rawResponse?: Response | undefined; +export namespace GetRecentlyAddedLibraryLibraryErrors$ { + /** @deprecated use `GetRecentlyAddedLibraryLibraryErrors$inboundSchema` instead. */ + export const inboundSchema = + GetRecentlyAddedLibraryLibraryErrors$inboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryLibraryErrors$outboundSchema` instead. */ + export const outboundSchema = + GetRecentlyAddedLibraryLibraryErrors$outboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryLibraryErrors$Outbound` instead. */ + export type Outbound = GetRecentlyAddedLibraryLibraryErrors$Outbound; +} + +/** @internal */ +export const GetRecentlyAddedLibraryUnauthorized$inboundSchema: z.ZodType< + GetRecentlyAddedLibraryUnauthorized, + z.ZodTypeDef, + unknown +> = z.object({ + errors: z.array( + z.lazy(() => GetRecentlyAddedLibraryLibraryErrors$inboundSchema), + ).optional(), + RawResponse: z.instanceof(Response).optional(), +}) + .transform((v) => { + const remapped = remap$(v, { + "RawResponse": "rawResponse", + }); + + return new GetRecentlyAddedLibraryUnauthorized(remapped); + }); + +/** @internal */ +export type GetRecentlyAddedLibraryUnauthorized$Outbound = { + errors?: Array | undefined; + RawResponse?: never | undefined; }; +/** @internal */ +export const GetRecentlyAddedLibraryUnauthorized$outboundSchema: z.ZodType< + GetRecentlyAddedLibraryUnauthorized$Outbound, + z.ZodTypeDef, + GetRecentlyAddedLibraryUnauthorized +> = z.instanceof(GetRecentlyAddedLibraryUnauthorized) + .transform(v => v.data$) + .pipe( + z.object({ + errors: z.array( + z.lazy(() => GetRecentlyAddedLibraryLibraryErrors$outboundSchema), + ).optional(), + rawResponse: z.instanceof(Response).transform(() => { + throw new Error("Response cannot be serialized"); + }).optional(), + }).transform((v) => { + return remap$(v, { + rawResponse: "RawResponse", + }); + }), + ); + /** - * Bad Request - A parameter was not specified, or was specified incorrectly. + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export class GetRecentlyAddedBadRequest 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$: GetRecentlyAddedBadRequestData; - - constructor(err: GetRecentlyAddedBadRequestData) { - const message = "message" in err && typeof err.message === "string" - ? err.message - : `API error occurred: ${JSON.stringify(err)}`; - super(message); - this.data$ = err; - - if (err.errors != null) this.errors = err.errors; - if (err.rawResponse != null) this.rawResponse = err.rawResponse; - - this.name = "GetRecentlyAddedBadRequest"; - } +export namespace GetRecentlyAddedLibraryUnauthorized$ { + /** @deprecated use `GetRecentlyAddedLibraryUnauthorized$inboundSchema` instead. */ + export const inboundSchema = + GetRecentlyAddedLibraryUnauthorized$inboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryUnauthorized$outboundSchema` instead. */ + export const outboundSchema = + GetRecentlyAddedLibraryUnauthorized$outboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryUnauthorized$Outbound` instead. */ + export type Outbound = GetRecentlyAddedLibraryUnauthorized$Outbound; } /** @internal */ @@ -136,8 +242,8 @@ export namespace GetRecentlyAddedLibraryErrors$ { } /** @internal */ -export const GetRecentlyAddedUnauthorized$inboundSchema: z.ZodType< - GetRecentlyAddedUnauthorized, +export const GetRecentlyAddedLibraryBadRequest$inboundSchema: z.ZodType< + GetRecentlyAddedLibraryBadRequest, z.ZodTypeDef, unknown > = z.object({ @@ -150,21 +256,21 @@ export const GetRecentlyAddedUnauthorized$inboundSchema: z.ZodType< "RawResponse": "rawResponse", }); - return new GetRecentlyAddedUnauthorized(remapped); + return new GetRecentlyAddedLibraryBadRequest(remapped); }); /** @internal */ -export type GetRecentlyAddedUnauthorized$Outbound = { +export type GetRecentlyAddedLibraryBadRequest$Outbound = { errors?: Array | undefined; RawResponse?: never | undefined; }; /** @internal */ -export const GetRecentlyAddedUnauthorized$outboundSchema: z.ZodType< - GetRecentlyAddedUnauthorized$Outbound, +export const GetRecentlyAddedLibraryBadRequest$outboundSchema: z.ZodType< + GetRecentlyAddedLibraryBadRequest$Outbound, z.ZodTypeDef, - GetRecentlyAddedUnauthorized -> = z.instanceof(GetRecentlyAddedUnauthorized) + GetRecentlyAddedLibraryBadRequest +> = z.instanceof(GetRecentlyAddedLibraryBadRequest) .transform(v => v.data$) .pipe( z.object({ @@ -185,111 +291,12 @@ export const GetRecentlyAddedUnauthorized$outboundSchema: z.ZodType< * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace GetRecentlyAddedUnauthorized$ { - /** @deprecated use `GetRecentlyAddedUnauthorized$inboundSchema` instead. */ - export const inboundSchema = GetRecentlyAddedUnauthorized$inboundSchema; - /** @deprecated use `GetRecentlyAddedUnauthorized$outboundSchema` instead. */ - export const outboundSchema = GetRecentlyAddedUnauthorized$outboundSchema; - /** @deprecated use `GetRecentlyAddedUnauthorized$Outbound` instead. */ - export type Outbound = GetRecentlyAddedUnauthorized$Outbound; -} - -/** @internal */ -export const GetRecentlyAddedErrors$inboundSchema: z.ZodType< - GetRecentlyAddedErrors, - z.ZodTypeDef, - unknown -> = z.object({ - code: z.number().int().optional(), - message: z.string().optional(), - status: z.number().int().optional(), -}); - -/** @internal */ -export type GetRecentlyAddedErrors$Outbound = { - code?: number | undefined; - message?: string | undefined; - status?: number | undefined; -}; - -/** @internal */ -export const GetRecentlyAddedErrors$outboundSchema: z.ZodType< - GetRecentlyAddedErrors$Outbound, - z.ZodTypeDef, - GetRecentlyAddedErrors -> = z.object({ - code: z.number().int().optional(), - message: z.string().optional(), - status: z.number().int().optional(), -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetRecentlyAddedErrors$ { - /** @deprecated use `GetRecentlyAddedErrors$inboundSchema` instead. */ - export const inboundSchema = GetRecentlyAddedErrors$inboundSchema; - /** @deprecated use `GetRecentlyAddedErrors$outboundSchema` instead. */ - export const outboundSchema = GetRecentlyAddedErrors$outboundSchema; - /** @deprecated use `GetRecentlyAddedErrors$Outbound` instead. */ - export type Outbound = GetRecentlyAddedErrors$Outbound; -} - -/** @internal */ -export const GetRecentlyAddedBadRequest$inboundSchema: z.ZodType< - GetRecentlyAddedBadRequest, - z.ZodTypeDef, - unknown -> = z.object({ - errors: z.array(z.lazy(() => GetRecentlyAddedErrors$inboundSchema)) - .optional(), - RawResponse: z.instanceof(Response).optional(), -}) - .transform((v) => { - const remapped = remap$(v, { - "RawResponse": "rawResponse", - }); - - return new GetRecentlyAddedBadRequest(remapped); - }); - -/** @internal */ -export type GetRecentlyAddedBadRequest$Outbound = { - errors?: Array | undefined; - RawResponse?: never | undefined; -}; - -/** @internal */ -export const GetRecentlyAddedBadRequest$outboundSchema: z.ZodType< - GetRecentlyAddedBadRequest$Outbound, - z.ZodTypeDef, - GetRecentlyAddedBadRequest -> = z.instanceof(GetRecentlyAddedBadRequest) - .transform(v => v.data$) - .pipe( - z.object({ - errors: z.array(z.lazy(() => GetRecentlyAddedErrors$outboundSchema)) - .optional(), - rawResponse: z.instanceof(Response).transform(() => { - throw new Error("Response cannot be serialized"); - }).optional(), - }).transform((v) => { - return remap$(v, { - rawResponse: "RawResponse", - }); - }), - ); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetRecentlyAddedBadRequest$ { - /** @deprecated use `GetRecentlyAddedBadRequest$inboundSchema` instead. */ - export const inboundSchema = GetRecentlyAddedBadRequest$inboundSchema; - /** @deprecated use `GetRecentlyAddedBadRequest$outboundSchema` instead. */ - export const outboundSchema = GetRecentlyAddedBadRequest$outboundSchema; - /** @deprecated use `GetRecentlyAddedBadRequest$Outbound` instead. */ - export type Outbound = GetRecentlyAddedBadRequest$Outbound; +export namespace GetRecentlyAddedLibraryBadRequest$ { + /** @deprecated use `GetRecentlyAddedLibraryBadRequest$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedLibraryBadRequest$inboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryBadRequest$outboundSchema` instead. */ + export const outboundSchema = + GetRecentlyAddedLibraryBadRequest$outboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryBadRequest$Outbound` instead. */ + export type Outbound = GetRecentlyAddedLibraryBadRequest$Outbound; } diff --git a/src/sdk/models/errors/index.ts b/src/sdk/models/errors/index.ts index e8c00b19..b28de4b1 100644 --- a/src/sdk/models/errors/index.ts +++ b/src/sdk/models/errors/index.ts @@ -34,7 +34,7 @@ export * from "./getpin.js"; export * from "./getplaylist.js"; export * from "./getplaylistcontents.js"; export * from "./getplaylists.js"; -export * from "./getrecentlyadded.js"; +export * from "./getrecentlyaddedlibrary.js"; export * from "./getrefreshlibrarymetadata.js"; export * from "./getresizedphoto.js"; export * from "./getresourcesstatistics.js"; diff --git a/src/sdk/models/operations/getalllibraries.ts b/src/sdk/models/operations/getalllibraries.ts index 7ef515cb..81f92382 100644 --- a/src/sdk/models/operations/getalllibraries.ts +++ b/src/sdk/models/operations/getalllibraries.ts @@ -6,55 +6,58 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; export type Location = { - id?: number | undefined; - path?: string | undefined; + id: number; + path: string; }; export type GetAllLibrariesDirectory = { - allowSync?: boolean | undefined; - art?: string | undefined; - composite?: string | undefined; - filters?: boolean | undefined; - refreshing?: boolean | undefined; - thumb?: string | undefined; - key?: string | undefined; - type?: string | undefined; - title?: string | undefined; - agent?: string | undefined; - scanner?: string | undefined; - language?: string | undefined; - uuid?: string | undefined; + allowSync: boolean; + art: string; + composite: string; + filters: boolean; + refreshing: boolean; + thumb: string; + key: string; + type: string; + title: string; + agent: string; + scanner: string; + language: string; + uuid: string; /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ - updatedAt?: number | undefined; + updatedAt: number; /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ - createdAt?: number | undefined; + createdAt: number; /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ - scannedAt?: number | undefined; - content?: boolean | undefined; - directory?: boolean | undefined; - contentChangedAt?: number | undefined; - hidden?: number | undefined; - location?: Array | undefined; + scannedAt: number; + content: boolean; + directory: boolean; + /** + * Unix epoch datetime in seconds + */ + contentChangedAt: number; + hidden: number; + location: Array; }; export type GetAllLibrariesMediaContainer = { size: number; allowSync: boolean; title1: string; - directory?: Array | undefined; + directory: Array; }; /** * The libraries available on the Server */ export type GetAllLibrariesResponseBody = { - mediaContainer?: GetAllLibrariesMediaContainer | undefined; + mediaContainer: GetAllLibrariesMediaContainer; }; export type GetAllLibrariesResponse = { @@ -82,14 +85,14 @@ export const Location$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - id: z.number().int().optional(), - path: z.string().optional(), + id: z.number().int(), + path: z.string(), }); /** @internal */ export type Location$Outbound = { - id?: number | undefined; - path?: string | undefined; + id: number; + path: string; }; /** @internal */ @@ -98,8 +101,8 @@ export const Location$outboundSchema: z.ZodType< z.ZodTypeDef, Location > = z.object({ - id: z.number().int().optional(), - path: z.string().optional(), + id: z.number().int(), + path: z.string(), }); /** @@ -121,27 +124,27 @@ export const GetAllLibrariesDirectory$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - allowSync: z.boolean().optional(), - art: z.string().optional(), - composite: z.string().optional(), - filters: z.boolean().optional(), - refreshing: z.boolean().optional(), - thumb: z.string().optional(), - key: z.string().optional(), - type: z.string().optional(), - title: z.string().optional(), - agent: z.string().optional(), - scanner: z.string().optional(), - language: z.string().optional(), - uuid: z.string().optional(), - updatedAt: z.number().int().optional(), - createdAt: z.number().int().optional(), - scannedAt: z.number().int().optional(), - content: z.boolean().optional(), - directory: z.boolean().optional(), - contentChangedAt: z.number().int().optional(), - hidden: z.number().int().optional(), - Location: z.array(z.lazy(() => Location$inboundSchema)).optional(), + allowSync: z.boolean(), + art: z.string(), + composite: z.string(), + filters: z.boolean(), + refreshing: z.boolean(), + thumb: z.string(), + key: z.string(), + type: z.string(), + title: z.string(), + agent: z.string(), + scanner: z.string(), + language: z.string(), + uuid: z.string(), + updatedAt: z.number().int(), + createdAt: z.number().int(), + scannedAt: z.number().int(), + content: z.boolean(), + directory: z.boolean(), + contentChangedAt: z.number().int(), + hidden: z.number().int(), + Location: z.array(z.lazy(() => Location$inboundSchema)), }).transform((v) => { return remap$(v, { "Location": "location", @@ -150,27 +153,27 @@ export const GetAllLibrariesDirectory$inboundSchema: z.ZodType< /** @internal */ export type GetAllLibrariesDirectory$Outbound = { - allowSync?: boolean | undefined; - art?: string | undefined; - composite?: string | undefined; - filters?: boolean | undefined; - refreshing?: boolean | undefined; - thumb?: string | undefined; - key?: string | undefined; - type?: string | undefined; - title?: string | undefined; - agent?: string | undefined; - scanner?: string | undefined; - language?: string | undefined; - uuid?: string | undefined; - updatedAt?: number | undefined; - createdAt?: number | undefined; - scannedAt?: number | undefined; - content?: boolean | undefined; - directory?: boolean | undefined; - contentChangedAt?: number | undefined; - hidden?: number | undefined; - Location?: Array | undefined; + allowSync: boolean; + art: string; + composite: string; + filters: boolean; + refreshing: boolean; + thumb: string; + key: string; + type: string; + title: string; + agent: string; + scanner: string; + language: string; + uuid: string; + updatedAt: number; + createdAt: number; + scannedAt: number; + content: boolean; + directory: boolean; + contentChangedAt: number; + hidden: number; + Location: Array; }; /** @internal */ @@ -179,27 +182,27 @@ export const GetAllLibrariesDirectory$outboundSchema: z.ZodType< z.ZodTypeDef, GetAllLibrariesDirectory > = z.object({ - allowSync: z.boolean().optional(), - art: z.string().optional(), - composite: z.string().optional(), - filters: z.boolean().optional(), - refreshing: z.boolean().optional(), - thumb: z.string().optional(), - key: z.string().optional(), - type: z.string().optional(), - title: z.string().optional(), - agent: z.string().optional(), - scanner: z.string().optional(), - language: z.string().optional(), - uuid: z.string().optional(), - updatedAt: z.number().int().optional(), - createdAt: z.number().int().optional(), - scannedAt: z.number().int().optional(), - content: z.boolean().optional(), - directory: z.boolean().optional(), - contentChangedAt: z.number().int().optional(), - hidden: z.number().int().optional(), - location: z.array(z.lazy(() => Location$outboundSchema)).optional(), + allowSync: z.boolean(), + art: z.string(), + composite: z.string(), + filters: z.boolean(), + refreshing: z.boolean(), + thumb: z.string(), + key: z.string(), + type: z.string(), + title: z.string(), + agent: z.string(), + scanner: z.string(), + language: z.string(), + uuid: z.string(), + updatedAt: z.number().int(), + createdAt: z.number().int(), + scannedAt: z.number().int(), + content: z.boolean(), + directory: z.boolean(), + contentChangedAt: z.number().int(), + hidden: z.number().int(), + location: z.array(z.lazy(() => Location$outboundSchema)), }).transform((v) => { return remap$(v, { location: "Location", @@ -228,8 +231,7 @@ export const GetAllLibrariesMediaContainer$inboundSchema: z.ZodType< size: z.number().int(), allowSync: z.boolean(), title1: z.string(), - Directory: z.array(z.lazy(() => GetAllLibrariesDirectory$inboundSchema)) - .optional(), + Directory: z.array(z.lazy(() => GetAllLibrariesDirectory$inboundSchema)), }).transform((v) => { return remap$(v, { "Directory": "directory", @@ -241,7 +243,7 @@ export type GetAllLibrariesMediaContainer$Outbound = { size: number; allowSync: boolean; title1: string; - Directory?: Array | undefined; + Directory: Array; }; /** @internal */ @@ -253,8 +255,7 @@ export const GetAllLibrariesMediaContainer$outboundSchema: z.ZodType< size: z.number().int(), allowSync: z.boolean(), title1: z.string(), - directory: z.array(z.lazy(() => GetAllLibrariesDirectory$outboundSchema)) - .optional(), + directory: z.array(z.lazy(() => GetAllLibrariesDirectory$outboundSchema)), }).transform((v) => { return remap$(v, { directory: "Directory", @@ -280,8 +281,7 @@ export const GetAllLibrariesResponseBody$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - MediaContainer: z.lazy(() => GetAllLibrariesMediaContainer$inboundSchema) - .optional(), + MediaContainer: z.lazy(() => GetAllLibrariesMediaContainer$inboundSchema), }).transform((v) => { return remap$(v, { "MediaContainer": "mediaContainer", @@ -290,7 +290,7 @@ export const GetAllLibrariesResponseBody$inboundSchema: z.ZodType< /** @internal */ export type GetAllLibrariesResponseBody$Outbound = { - MediaContainer?: GetAllLibrariesMediaContainer$Outbound | undefined; + MediaContainer: GetAllLibrariesMediaContainer$Outbound; }; /** @internal */ @@ -299,8 +299,7 @@ export const GetAllLibrariesResponseBody$outboundSchema: z.ZodType< z.ZodTypeDef, GetAllLibrariesResponseBody > = z.object({ - mediaContainer: z.lazy(() => GetAllLibrariesMediaContainer$outboundSchema) - .optional(), + mediaContainer: z.lazy(() => GetAllLibrariesMediaContainer$outboundSchema), }).transform((v) => { return remap$(v, { mediaContainer: "MediaContainer", diff --git a/src/sdk/models/operations/getcompanionsdata.ts b/src/sdk/models/operations/getcompanionsdata.ts index 18d90f72..c243afcd 100644 --- a/src/sdk/models/operations/getcompanionsdata.ts +++ b/src/sdk/models/operations/getcompanionsdata.ts @@ -6,7 +6,7 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; export const GetCompanionsDataServerList = [ - "https://plex.tv/api/v2/", + "https://plex.tv/api/v2", ] as const; export type ResponseBody = { diff --git a/src/sdk/models/operations/getgeodata.ts b/src/sdk/models/operations/getgeodata.ts index c5c8ac30..ceed1b24 100644 --- a/src/sdk/models/operations/getgeodata.ts +++ b/src/sdk/models/operations/getgeodata.ts @@ -6,7 +6,7 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; export const GetGeoDataServerList = [ - "https://plex.tv/api/v2/", + "https://plex.tv/api/v2", ] as const; /** @@ -40,7 +40,7 @@ export type GetGeoDataGeoData = { /** * The postal code of the location. */ - postalCode: number; + postalCode: string; /** * Indicates if the country has privacy restrictions. */ @@ -90,7 +90,7 @@ export const GetGeoDataGeoData$inboundSchema: z.ZodType< city: z.string(), european_union_member: z.boolean().default(false), time_zone: z.string(), - postal_code: z.number().int(), + postal_code: z.string(), in_privacy_restricted_country: z.boolean().default(false), in_privacy_restricted_region: z.boolean().default(false), subdivisions: z.string(), @@ -114,7 +114,7 @@ export type GetGeoDataGeoData$Outbound = { city: string; european_union_member: boolean; time_zone: string; - postal_code: number; + postal_code: string; in_privacy_restricted_country: boolean; in_privacy_restricted_region: boolean; subdivisions: string; @@ -133,7 +133,7 @@ export const GetGeoDataGeoData$outboundSchema: z.ZodType< city: z.string(), europeanUnionMember: z.boolean().default(false), timeZone: z.string(), - postalCode: z.number().int(), + postalCode: z.string(), inPrivacyRestrictedCountry: z.boolean().default(false), inPrivacyRestrictedRegion: z.boolean().default(false), subdivisions: z.string(), diff --git a/src/sdk/models/operations/getlibrarydetails.ts b/src/sdk/models/operations/getlibrarydetails.ts index 2ad6ad02..1c7b03ef 100644 --- a/src/sdk/models/operations/getlibrarydetails.ts +++ b/src/sdk/models/operations/getlibrarydetails.ts @@ -49,7 +49,7 @@ export type GetLibraryDetailsFilter = { type?: string | undefined; }; -export type Sort = { +export type GetLibraryDetailsSort = { default?: string | undefined; defaultDirection?: string | undefined; descKey?: string | undefined; @@ -58,7 +58,7 @@ export type Sort = { title?: string | undefined; }; -export type Field = { +export type GetLibraryDetailsField = { key?: string | undefined; title?: string | undefined; type?: string | undefined; @@ -71,18 +71,18 @@ export type GetLibraryDetailsType = { title?: string | undefined; active?: boolean | undefined; filter?: Array | undefined; - sort?: Array | undefined; - field?: Array | undefined; + sort?: Array | undefined; + field?: Array | undefined; }; -export type Operator = { +export type GetLibraryDetailsOperator = { key?: string | undefined; title?: string | undefined; }; -export type FieldType = { +export type GetLibraryDetailsFieldType = { type?: string | undefined; - operator?: Array | undefined; + operator?: Array | undefined; }; export type GetLibraryDetailsMediaContainer = { @@ -100,7 +100,7 @@ export type GetLibraryDetailsMediaContainer = { viewMode?: number | undefined; directory?: Array | undefined; type?: Array | undefined; - fieldType?: Array | undefined; + fieldType?: Array | undefined; }; /** @@ -286,18 +286,21 @@ export namespace GetLibraryDetailsFilter$ { } /** @internal */ -export const Sort$inboundSchema: z.ZodType = z - .object({ - default: z.string().optional(), - defaultDirection: z.string().optional(), - descKey: z.string().optional(), - firstCharacterKey: z.string().optional(), - key: z.string().optional(), - title: z.string().optional(), - }); +export const GetLibraryDetailsSort$inboundSchema: z.ZodType< + GetLibraryDetailsSort, + z.ZodTypeDef, + unknown +> = z.object({ + default: z.string().optional(), + defaultDirection: z.string().optional(), + descKey: z.string().optional(), + firstCharacterKey: z.string().optional(), + key: z.string().optional(), + title: z.string().optional(), +}); /** @internal */ -export type Sort$Outbound = { +export type GetLibraryDetailsSort$Outbound = { default?: string | undefined; defaultDirection?: string | undefined; descKey?: string | undefined; @@ -307,40 +310,46 @@ export type Sort$Outbound = { }; /** @internal */ -export const Sort$outboundSchema: z.ZodType = - z.object({ - default: z.string().optional(), - defaultDirection: z.string().optional(), - descKey: z.string().optional(), - firstCharacterKey: z.string().optional(), - key: z.string().optional(), - title: z.string().optional(), - }); +export const GetLibraryDetailsSort$outboundSchema: z.ZodType< + GetLibraryDetailsSort$Outbound, + z.ZodTypeDef, + GetLibraryDetailsSort +> = z.object({ + default: z.string().optional(), + defaultDirection: z.string().optional(), + descKey: z.string().optional(), + firstCharacterKey: z.string().optional(), + key: z.string().optional(), + title: z.string().optional(), +}); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace Sort$ { - /** @deprecated use `Sort$inboundSchema` instead. */ - export const inboundSchema = Sort$inboundSchema; - /** @deprecated use `Sort$outboundSchema` instead. */ - export const outboundSchema = Sort$outboundSchema; - /** @deprecated use `Sort$Outbound` instead. */ - export type Outbound = Sort$Outbound; +export namespace GetLibraryDetailsSort$ { + /** @deprecated use `GetLibraryDetailsSort$inboundSchema` instead. */ + export const inboundSchema = GetLibraryDetailsSort$inboundSchema; + /** @deprecated use `GetLibraryDetailsSort$outboundSchema` instead. */ + export const outboundSchema = GetLibraryDetailsSort$outboundSchema; + /** @deprecated use `GetLibraryDetailsSort$Outbound` instead. */ + export type Outbound = GetLibraryDetailsSort$Outbound; } /** @internal */ -export const Field$inboundSchema: z.ZodType = z - .object({ - key: z.string().optional(), - title: z.string().optional(), - type: z.string().optional(), - subType: z.string().optional(), - }); +export const GetLibraryDetailsField$inboundSchema: z.ZodType< + GetLibraryDetailsField, + z.ZodTypeDef, + unknown +> = z.object({ + key: z.string().optional(), + title: z.string().optional(), + type: z.string().optional(), + subType: z.string().optional(), +}); /** @internal */ -export type Field$Outbound = { +export type GetLibraryDetailsField$Outbound = { key?: string | undefined; title?: string | undefined; type?: string | undefined; @@ -348,10 +357,10 @@ export type Field$Outbound = { }; /** @internal */ -export const Field$outboundSchema: z.ZodType< - Field$Outbound, +export const GetLibraryDetailsField$outboundSchema: z.ZodType< + GetLibraryDetailsField$Outbound, z.ZodTypeDef, - Field + GetLibraryDetailsField > = z.object({ key: z.string().optional(), title: z.string().optional(), @@ -363,13 +372,13 @@ export const Field$outboundSchema: z.ZodType< * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace Field$ { - /** @deprecated use `Field$inboundSchema` instead. */ - export const inboundSchema = Field$inboundSchema; - /** @deprecated use `Field$outboundSchema` instead. */ - export const outboundSchema = Field$outboundSchema; - /** @deprecated use `Field$Outbound` instead. */ - export type Outbound = Field$Outbound; +export namespace GetLibraryDetailsField$ { + /** @deprecated use `GetLibraryDetailsField$inboundSchema` instead. */ + export const inboundSchema = GetLibraryDetailsField$inboundSchema; + /** @deprecated use `GetLibraryDetailsField$outboundSchema` instead. */ + export const outboundSchema = GetLibraryDetailsField$outboundSchema; + /** @deprecated use `GetLibraryDetailsField$Outbound` instead. */ + export type Outbound = GetLibraryDetailsField$Outbound; } /** @internal */ @@ -384,8 +393,8 @@ export const GetLibraryDetailsType$inboundSchema: z.ZodType< active: z.boolean().optional(), Filter: z.array(z.lazy(() => GetLibraryDetailsFilter$inboundSchema)) .optional(), - Sort: z.array(z.lazy(() => Sort$inboundSchema)).optional(), - Field: z.array(z.lazy(() => Field$inboundSchema)).optional(), + Sort: z.array(z.lazy(() => GetLibraryDetailsSort$inboundSchema)).optional(), + Field: z.array(z.lazy(() => GetLibraryDetailsField$inboundSchema)).optional(), }).transform((v) => { return remap$(v, { "Filter": "filter", @@ -401,8 +410,8 @@ export type GetLibraryDetailsType$Outbound = { title?: string | undefined; active?: boolean | undefined; Filter?: Array | undefined; - Sort?: Array | undefined; - Field?: Array | undefined; + Sort?: Array | undefined; + Field?: Array | undefined; }; /** @internal */ @@ -417,8 +426,9 @@ export const GetLibraryDetailsType$outboundSchema: z.ZodType< active: z.boolean().optional(), filter: z.array(z.lazy(() => GetLibraryDetailsFilter$outboundSchema)) .optional(), - sort: z.array(z.lazy(() => Sort$outboundSchema)).optional(), - field: z.array(z.lazy(() => Field$outboundSchema)).optional(), + sort: z.array(z.lazy(() => GetLibraryDetailsSort$outboundSchema)).optional(), + field: z.array(z.lazy(() => GetLibraryDetailsField$outboundSchema)) + .optional(), }).transform((v) => { return remap$(v, { filter: "Filter", @@ -441,8 +451,8 @@ export namespace GetLibraryDetailsType$ { } /** @internal */ -export const Operator$inboundSchema: z.ZodType< - Operator, +export const GetLibraryDetailsOperator$inboundSchema: z.ZodType< + GetLibraryDetailsOperator, z.ZodTypeDef, unknown > = z.object({ @@ -451,16 +461,16 @@ export const Operator$inboundSchema: z.ZodType< }); /** @internal */ -export type Operator$Outbound = { +export type GetLibraryDetailsOperator$Outbound = { key?: string | undefined; title?: string | undefined; }; /** @internal */ -export const Operator$outboundSchema: z.ZodType< - Operator$Outbound, +export const GetLibraryDetailsOperator$outboundSchema: z.ZodType< + GetLibraryDetailsOperator$Outbound, z.ZodTypeDef, - Operator + GetLibraryDetailsOperator > = z.object({ key: z.string().optional(), title: z.string().optional(), @@ -470,23 +480,24 @@ export const Operator$outboundSchema: z.ZodType< * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace Operator$ { - /** @deprecated use `Operator$inboundSchema` instead. */ - export const inboundSchema = Operator$inboundSchema; - /** @deprecated use `Operator$outboundSchema` instead. */ - export const outboundSchema = Operator$outboundSchema; - /** @deprecated use `Operator$Outbound` instead. */ - export type Outbound = Operator$Outbound; +export namespace GetLibraryDetailsOperator$ { + /** @deprecated use `GetLibraryDetailsOperator$inboundSchema` instead. */ + export const inboundSchema = GetLibraryDetailsOperator$inboundSchema; + /** @deprecated use `GetLibraryDetailsOperator$outboundSchema` instead. */ + export const outboundSchema = GetLibraryDetailsOperator$outboundSchema; + /** @deprecated use `GetLibraryDetailsOperator$Outbound` instead. */ + export type Outbound = GetLibraryDetailsOperator$Outbound; } /** @internal */ -export const FieldType$inboundSchema: z.ZodType< - FieldType, +export const GetLibraryDetailsFieldType$inboundSchema: z.ZodType< + GetLibraryDetailsFieldType, z.ZodTypeDef, unknown > = z.object({ type: z.string().optional(), - Operator: z.array(z.lazy(() => Operator$inboundSchema)).optional(), + Operator: z.array(z.lazy(() => GetLibraryDetailsOperator$inboundSchema)) + .optional(), }).transform((v) => { return remap$(v, { "Operator": "operator", @@ -494,19 +505,20 @@ export const FieldType$inboundSchema: z.ZodType< }); /** @internal */ -export type FieldType$Outbound = { +export type GetLibraryDetailsFieldType$Outbound = { type?: string | undefined; - Operator?: Array | undefined; + Operator?: Array | undefined; }; /** @internal */ -export const FieldType$outboundSchema: z.ZodType< - FieldType$Outbound, +export const GetLibraryDetailsFieldType$outboundSchema: z.ZodType< + GetLibraryDetailsFieldType$Outbound, z.ZodTypeDef, - FieldType + GetLibraryDetailsFieldType > = z.object({ type: z.string().optional(), - operator: z.array(z.lazy(() => Operator$outboundSchema)).optional(), + operator: z.array(z.lazy(() => GetLibraryDetailsOperator$outboundSchema)) + .optional(), }).transform((v) => { return remap$(v, { operator: "Operator", @@ -517,13 +529,13 @@ export const FieldType$outboundSchema: z.ZodType< * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace FieldType$ { - /** @deprecated use `FieldType$inboundSchema` instead. */ - export const inboundSchema = FieldType$inboundSchema; - /** @deprecated use `FieldType$outboundSchema` instead. */ - export const outboundSchema = FieldType$outboundSchema; - /** @deprecated use `FieldType$Outbound` instead. */ - export type Outbound = FieldType$Outbound; +export namespace GetLibraryDetailsFieldType$ { + /** @deprecated use `GetLibraryDetailsFieldType$inboundSchema` instead. */ + export const inboundSchema = GetLibraryDetailsFieldType$inboundSchema; + /** @deprecated use `GetLibraryDetailsFieldType$outboundSchema` instead. */ + export const outboundSchema = GetLibraryDetailsFieldType$outboundSchema; + /** @deprecated use `GetLibraryDetailsFieldType$Outbound` instead. */ + export type Outbound = GetLibraryDetailsFieldType$Outbound; } /** @internal */ @@ -547,7 +559,8 @@ export const GetLibraryDetailsMediaContainer$inboundSchema: z.ZodType< Directory: z.array(z.lazy(() => GetLibraryDetailsDirectory$inboundSchema)) .optional(), Type: z.array(z.lazy(() => GetLibraryDetailsType$inboundSchema)).optional(), - FieldType: z.array(z.lazy(() => FieldType$inboundSchema)).optional(), + FieldType: z.array(z.lazy(() => GetLibraryDetailsFieldType$inboundSchema)) + .optional(), }).transform((v) => { return remap$(v, { "Directory": "directory", @@ -572,7 +585,7 @@ export type GetLibraryDetailsMediaContainer$Outbound = { viewMode?: number | undefined; Directory?: Array | undefined; Type?: Array | undefined; - FieldType?: Array | undefined; + FieldType?: Array | undefined; }; /** @internal */ @@ -596,7 +609,8 @@ export const GetLibraryDetailsMediaContainer$outboundSchema: z.ZodType< directory: z.array(z.lazy(() => GetLibraryDetailsDirectory$outboundSchema)) .optional(), type: z.array(z.lazy(() => GetLibraryDetailsType$outboundSchema)).optional(), - fieldType: z.array(z.lazy(() => FieldType$outboundSchema)).optional(), + fieldType: z.array(z.lazy(() => GetLibraryDetailsFieldType$outboundSchema)) + .optional(), }).transform((v) => { return remap$(v, { directory: "Directory", diff --git a/src/sdk/models/operations/getlibraryitems.ts b/src/sdk/models/operations/getlibraryitems.ts index 39c15fca..9e604380 100644 --- a/src/sdk/models/operations/getlibraryitems.ts +++ b/src/sdk/models/operations/getlibraryitems.ts @@ -37,18 +37,8 @@ export enum Tag { * @remarks */ export enum IncludeGuids { - Zero = 0, - One = 1, -} - -/** - * Adds the Meta object to the response - * - * @remarks - */ -export enum IncludeMeta { - Zero = 0, - One = 1, + Disable = 0, + Enable = 1, } /** @@ -61,11 +51,21 @@ export enum IncludeMeta { * 4 = episode * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries */ -export enum Type { - One = 1, - Two = 2, - Three = 3, - Four = 4, +export enum GetLibraryItemsQueryParamType { + Movie = 1, + TvShow = 2, + Season = 3, + Episode = 4, +} + +/** + * Adds the Meta object to the response + * + * @remarks + */ +export enum GetLibraryItemsQueryParamIncludeMeta { + Disable = 0, + Enable = 1, } export type GetLibraryItemsRequest = { @@ -86,12 +86,6 @@ export type GetLibraryItemsRequest = { * @remarks */ includeGuids?: IncludeGuids | undefined; - /** - * Adds the Meta object to the response - * - * @remarks - */ - includeMeta?: IncludeMeta | undefined; /** * The type of media to retrieve. * @@ -102,7 +96,13 @@ export type GetLibraryItemsRequest = { * 4 = episode * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries */ - type: Type; + type?: GetLibraryItemsQueryParamType | undefined; + /** + * Adds the Meta object to the response + * + * @remarks + */ + includeMeta?: GetLibraryItemsQueryParamIncludeMeta | undefined; /** * The index of the first item to return. If not specified, the first item will be returned. * @@ -121,33 +121,310 @@ export type GetLibraryItemsRequest = { xPlexContainerSize?: number | undefined; }; -export type LibrarySectionID = number | string; +export type GetLibraryItemsFilter = { + filter: string; + filterType: string; + key: string; + title: string; + type: string; +}; + +/** + * The direction of the sort. Can be either `asc` or `desc`. + * + * @remarks + */ +export enum GetLibraryItemsActiveDirection { + Ascending = "asc", + Descending = "desc", +} + +/** + * The direction of the sort. Can be either `asc` or `desc`. + * + * @remarks + */ +export enum GetLibraryItemsDefaultDirection { + Ascending = "asc", + Descending = "desc", +} + +export type GetLibraryItemsSort = { + default?: string | undefined; + active?: boolean | undefined; + /** + * The direction of the sort. Can be either `asc` or `desc`. + * + * @remarks + */ + activeDirection?: GetLibraryItemsActiveDirection | undefined; + /** + * The direction of the sort. Can be either `asc` or `desc`. + * + * @remarks + */ + defaultDirection?: GetLibraryItemsDefaultDirection | undefined; + descKey?: string | undefined; + firstCharacterKey?: string | undefined; + key: string; + title: string; +}; + +export type GetLibraryItemsField = { + key: string; + title: string; + type: string; + subType?: string | undefined; +}; + +export type GetLibraryItemsType = { + key: string; + type: string; + title: string; + active: boolean; + filter?: Array | undefined; + sort?: Array | undefined; + field?: Array | undefined; +}; + +export type GetLibraryItemsOperator = { + key: string; + title: string; +}; + +export type GetLibraryItemsFieldType = { + type: string; + operator: Array; +}; + +/** + * The type of media content + * + * @remarks + */ +export enum GetLibraryItemsLibraryType { + Movie = "movie", + TvShow = "show", + Season = "season", + Episode = "episode", +} + +export enum GetLibraryItemsFlattenSeasons { + False = "0", + True = "1", +} + +/** + * Setting that indicates the episode ordering for the show + * + * @remarks + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * aired = TheTVDB (Aired), + * dvd = TheTVDB (DVD), + * absolute = TheTVDB (Absolute)). + */ +export enum GetLibraryItemsShowOrdering { + None = "None", + TmdbAiring = "tmdbAiring", + Aired = "aired", + Dvd = "dvd", + Absolute = "absolute", +} + +export enum GetLibraryItemsOptimizedForStreaming { + Disable = 0, + Enable = 1, +} + +export enum GetLibraryItemsHasThumbnail { + False = "0", + True = "1", +} + +export type GetLibraryItemsStream = { + id: number; + /** + * Type of stream (1 = video, 2 = audio, 3 = subtitle) + */ + streamType: number; + /** + * Indicates if this is the default stream + */ + default?: boolean | undefined; + /** + * Indicates if the stream is selected + */ + selected?: boolean | undefined; + /** + * Codec used by the stream + */ + codec: string; + /** + * The index of the stream + */ + index: number; + /** + * The bitrate of the stream in kbps + */ + bitrate?: number | undefined; + /** + * The color primaries of the video stream + */ + colorPrimaries?: string | undefined; + /** + * The color range of the video stream + */ + colorRange?: string | undefined; + /** + * The color space of the video stream + */ + colorSpace?: string | undefined; + /** + * The transfer characteristics (TRC) of the video stream + */ + colorTrc?: string | undefined; + /** + * The bit depth of the video stream + */ + bitDepth?: number | undefined; + /** + * The chroma location of the video stream + */ + chromaLocation?: string | undefined; + /** + * The identifier of the video stream + */ + streamIdentifier?: string | undefined; + /** + * The chroma subsampling format + */ + chromaSubsampling?: string | undefined; + /** + * The coded height of the video stream + */ + codedHeight?: number | undefined; + /** + * The coded width of the video stream + */ + codedWidth?: number | undefined; + /** + * The frame rate of the video stream + */ + frameRate?: number | undefined; + /** + * Indicates if the stream has a scaling matrix + */ + hasScalingMatrix?: boolean | undefined; + hearingImpaired?: boolean | undefined; + closedCaptions?: boolean | undefined; + embeddedInVideo?: string | undefined; + /** + * The height of the video stream + */ + height?: number | undefined; + /** + * The level of the video codec + */ + level?: number | undefined; + /** + * The profile of the video codec + */ + profile?: string | undefined; + /** + * Number of reference frames + */ + refFrames?: number | undefined; + /** + * The scan type (progressive or interlaced) + */ + scanType?: string | undefined; + /** + * The width of the video stream + */ + width?: number | undefined; + /** + * Display title of the stream + */ + displayTitle?: string | undefined; + /** + * Extended display title of the stream + */ + extendedDisplayTitle?: string | undefined; + /** + * Number of audio channels (for audio streams) + */ + channels?: number | undefined; + /** + * The language of the stream (for audio/subtitle streams) + */ + language?: string | undefined; + /** + * Language tag of the stream + */ + languageTag?: string | undefined; + /** + * Language code of the stream + */ + languageCode?: string | undefined; + /** + * The audio channel layout + */ + audioChannelLayout?: string | undefined; + /** + * Sampling rate of the audio stream in Hz + */ + samplingRate?: number | undefined; + /** + * Title of the subtitle track (for subtitle streams) + */ + title?: string | undefined; + /** + * Indicates if the subtitle stream can auto-sync + */ + canAutoSync?: boolean | undefined; +}; export type GetLibraryItemsPart = { - id?: number | undefined; - key?: string | undefined; - duration?: number | undefined; - file?: string | undefined; - size?: number | undefined; - container?: string | undefined; - videoProfile?: string | undefined; + id: number; + key: string; + duration: number; + file: string; + size: number; + /** + * The container format of the media file. + * + * @remarks + */ + container: string; + audioProfile?: string | undefined; + has64bitOffsets?: boolean | undefined; + optimizedForStreaming?: boolean | undefined; + videoProfile: string; + indexes?: string | undefined; + hasThumbnail?: GetLibraryItemsHasThumbnail | undefined; + stream?: Array | undefined; }; export type GetLibraryItemsMedia = { - id?: number | undefined; - duration?: number | undefined; - bitrate?: number | undefined; - width?: number | undefined; - height?: number | undefined; - aspectRatio?: number | undefined; - audioChannels?: number | undefined; - audioCodec?: string | undefined; - videoCodec?: string | undefined; - videoResolution?: string | undefined; - container?: string | undefined; - videoFrameRate?: string | undefined; - videoProfile?: string | undefined; - part?: Array | undefined; + id: number; + duration: number; + bitrate: number; + width: number; + height: number; + aspectRatio: number; + audioProfile?: string | undefined; + audioChannels: number; + audioCodec: string; + videoCodec: string; + videoResolution: string; + container: string; + videoFrameRate: string; + videoProfile: string; + hasVoiceActivity?: boolean | undefined; + optimizedForStreaming?: GetLibraryItemsOptimizedForStreaming | undefined; + has64bitOffsets?: boolean | undefined; + part: Array; }; export type GetLibraryItemsGenre = { @@ -166,28 +443,136 @@ export type GetLibraryItemsWriter = { tag?: string | undefined; }; -export type GetLibraryItemsRole = { +export type GetLibraryItemsCollection = { tag?: string | undefined; }; +export type GetLibraryItemsRole = { + /** + * The ID of the tag or actor. + */ + id?: number | undefined; + /** + * The filter used to find the actor or tag. + */ + filter?: string | undefined; + /** + * The thumbnail of the actor + */ + thumb?: string | undefined; + /** + * The name of the tag or actor. + */ + tag?: string | undefined; + /** + * Unique identifier for the tag. + */ + tagKey?: string | undefined; + /** + * The role of the actor or tag in the media. + */ + role?: string | undefined; +}; + +export type GetLibraryItemsMediaGuid = { + /** + * Can be one of the following formats: + * + * @remarks + * imdb://tt13015952, tmdb://2434012, tvdb://7945991 + */ + id: string; +}; + +export type GetLibraryItemsUltraBlurColors = { + topLeft: string; + topRight: string; + bottomRight: string; + bottomLeft: string; +}; + +export type GetLibraryItemsMetaDataRating = { + /** + * A URI or path to the rating image. + */ + image: string; + /** + * The value of the rating. + */ + value: number; + /** + * The type of rating (e.g., audience, critic). + */ + type: string; +}; + +export enum GetLibraryItemsLibraryResponse200Type { + CoverPoster = "coverPoster", + Background = "background", + Snapshot = "snapshot", + ClearLogo = "clearLogo", +} + +export type GetLibraryItemsImage = { + alt: string; + type: GetLibraryItemsLibraryResponse200Type; + url: string; +}; + export type GetLibraryItemsMetadata = { - ratingKey?: string | undefined; - key?: string | undefined; - guid?: string | undefined; + /** + * The rating key (Media ID) of this media item. + * + * @remarks + * Note: This is always an integer, but is represented as a string in the API. + */ + ratingKey: string; + key: string; + guid: string; studio?: string | undefined; - type?: string | undefined; - title?: string | undefined; + skipChildren?: boolean | undefined; + librarySectionID?: number | undefined; + librarySectionTitle?: string | undefined; + librarySectionKey?: string | undefined; + /** + * The type of media content + * + * @remarks + */ + type: GetLibraryItemsLibraryType; + title: string; + slug?: string | undefined; contentRating?: string | undefined; - summary?: string | undefined; + summary: string; rating?: number | undefined; audienceRating?: number | undefined; year?: number | undefined; + seasonCount?: number | undefined; tagline?: string | undefined; + flattenSeasons?: GetLibraryItemsFlattenSeasons | undefined; + /** + * Setting that indicates the episode ordering for the show + * + * @remarks + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * aired = TheTVDB (Aired), + * dvd = TheTVDB (DVD), + * absolute = TheTVDB (Absolute)). + */ + showOrdering?: GetLibraryItemsShowOrdering | undefined; thumb?: string | undefined; art?: string | undefined; + banner?: string | undefined; duration?: number | undefined; originallyAvailableAt?: RFCDate | undefined; - addedAt?: number | undefined; + /** + * Unix epoch datetime in seconds + */ + addedAt: number; + /** + * Unix epoch datetime in seconds + */ updatedAt?: number | undefined; audienceRatingImage?: string | undefined; chapterSource?: string | undefined; @@ -198,14 +583,31 @@ export type GetLibraryItemsMetadata = { grandparentKey?: string | undefined; grandparentTitle?: string | undefined; grandparentThumb?: string | undefined; + parentSlug?: string | undefined; + grandparentSlug?: string | undefined; grandparentArt?: string | undefined; grandparentTheme?: string | undefined; + /** + * The Media object is only included when type query is `4` or higher. + * + * @remarks + */ media?: Array | undefined; genre?: Array | undefined; country?: Array | undefined; director?: Array | undefined; writer?: Array | undefined; + collection?: Array | undefined; role?: Array | undefined; + /** + * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. + * + * @remarks + */ + mediaGuid?: Array | undefined; + ultraBlurColors?: GetLibraryItemsUltraBlurColors | undefined; + metaDataRating?: Array | undefined; + image?: Array | undefined; titleSort?: string | undefined; viewCount?: number | undefined; lastViewedAt?: number | undefined; @@ -219,6 +621,11 @@ export type GetLibraryItemsMetadata = { childCount?: number | undefined; hasPremiumExtras?: string | undefined; hasPremiumPrimaryExtra?: string | undefined; + /** + * The rating key of the parent item. + * + * @remarks + */ parentRatingKey?: string | undefined; parentGuid?: string | undefined; parentStudio?: string | undefined; @@ -230,23 +637,126 @@ export type GetLibraryItemsMetadata = { parentTheme?: string | undefined; }; +export type GetLibraryItemsLibraryFilter = { + filter: string; + filterType: string; + key: string; + title: string; + type: string; +}; + +/** + * The direction of the sort. Can be either `asc` or `desc`. + * + * @remarks + */ +export enum GetLibraryItemsLibraryActiveDirection { + Ascending = "asc", + Descending = "desc", +} + +/** + * The direction of the sort. Can be either `asc` or `desc`. + * + * @remarks + */ +export enum GetLibraryItemsLibraryDefaultDirection { + Ascending = "asc", + Descending = "desc", +} + +export type GetLibraryItemsLibrarySort = { + default?: string | undefined; + active?: boolean | undefined; + /** + * The direction of the sort. Can be either `asc` or `desc`. + * + * @remarks + */ + activeDirection?: GetLibraryItemsLibraryActiveDirection | undefined; + /** + * The direction of the sort. Can be either `asc` or `desc`. + * + * @remarks + */ + defaultDirection?: GetLibraryItemsLibraryDefaultDirection | undefined; + descKey?: string | undefined; + firstCharacterKey?: string | undefined; + key: string; + title: string; +}; + +export type GetLibraryItemsLibraryField = { + key: string; + title: string; + type: string; + subType?: string | undefined; +}; + +export type GetLibraryItemsLibraryResponseType = { + key: string; + type: string; + title: string; + active: boolean; + filter?: Array | undefined; + sort?: Array | undefined; + field?: Array | undefined; +}; + +export type GetLibraryItemsLibraryOperator = { + key: string; + title: string; +}; + +export type GetLibraryItemsLibraryFieldType = { + type: string; + operator: Array; +}; + +/** + * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + * + * @remarks + */ +export type GetLibraryItemsMeta = { + type?: Array | undefined; + fieldType?: Array | undefined; +}; + +/** + * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + * + * @remarks + */ export type GetLibraryItemsMediaContainer = { - size?: number | undefined; - allowSync?: boolean | undefined; - art?: string | undefined; - identifier?: string | undefined; - librarySectionID?: number | string | undefined; - librarySectionTitle?: string | undefined; - librarySectionUUID?: string | undefined; - mediaTagPrefix?: string | undefined; - mediaTagVersion?: number | undefined; - thumb?: string | undefined; - title1?: string | undefined; - title2?: string | undefined; - viewGroup?: string | undefined; + type?: Array | undefined; + fieldType?: Array | undefined; + size: number; + totalSize: number; + offset: number; + content: string; + allowSync: boolean; + nocache?: boolean | undefined; + art: string; + identifier: string; + librarySectionID: number; + librarySectionTitle: string; + librarySectionUUID: string; + mediaTagPrefix: string; + mediaTagVersion: number; + thumb: string; + title1: string; + title2: string; + viewGroup: string; viewMode?: number | undefined; mixedParents?: boolean | undefined; - metadata?: Array | undefined; + metadata: Array; + /** + * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + * + * @remarks + */ + meta?: GetLibraryItemsMeta | undefined; }; /** @@ -313,42 +823,48 @@ export namespace IncludeGuids$ { } /** @internal */ -export const IncludeMeta$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(IncludeMeta); +export const GetLibraryItemsQueryParamType$inboundSchema: z.ZodNativeEnum< + typeof GetLibraryItemsQueryParamType +> = z.nativeEnum(GetLibraryItemsQueryParamType); /** @internal */ -export const IncludeMeta$outboundSchema: z.ZodNativeEnum = - IncludeMeta$inboundSchema; +export const GetLibraryItemsQueryParamType$outboundSchema: z.ZodNativeEnum< + typeof GetLibraryItemsQueryParamType +> = GetLibraryItemsQueryParamType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace IncludeMeta$ { - /** @deprecated use `IncludeMeta$inboundSchema` instead. */ - export const inboundSchema = IncludeMeta$inboundSchema; - /** @deprecated use `IncludeMeta$outboundSchema` instead. */ - export const outboundSchema = IncludeMeta$outboundSchema; +export namespace GetLibraryItemsQueryParamType$ { + /** @deprecated use `GetLibraryItemsQueryParamType$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsQueryParamType$inboundSchema; + /** @deprecated use `GetLibraryItemsQueryParamType$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsQueryParamType$outboundSchema; } /** @internal */ -export const Type$inboundSchema: z.ZodNativeEnum = z.nativeEnum( - Type, -); +export const GetLibraryItemsQueryParamIncludeMeta$inboundSchema: + z.ZodNativeEnum = z.nativeEnum( + GetLibraryItemsQueryParamIncludeMeta, + ); /** @internal */ -export const Type$outboundSchema: z.ZodNativeEnum = - Type$inboundSchema; +export const GetLibraryItemsQueryParamIncludeMeta$outboundSchema: + z.ZodNativeEnum = + GetLibraryItemsQueryParamIncludeMeta$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace Type$ { - /** @deprecated use `Type$inboundSchema` instead. */ - export const inboundSchema = Type$inboundSchema; - /** @deprecated use `Type$outboundSchema` instead. */ - export const outboundSchema = Type$outboundSchema; +export namespace GetLibraryItemsQueryParamIncludeMeta$ { + /** @deprecated use `GetLibraryItemsQueryParamIncludeMeta$inboundSchema` instead. */ + export const inboundSchema = + GetLibraryItemsQueryParamIncludeMeta$inboundSchema; + /** @deprecated use `GetLibraryItemsQueryParamIncludeMeta$outboundSchema` instead. */ + export const outboundSchema = + GetLibraryItemsQueryParamIncludeMeta$outboundSchema; } /** @internal */ @@ -359,9 +875,9 @@ export const GetLibraryItemsRequest$inboundSchema: z.ZodType< > = z.object({ sectionKey: z.number().int(), tag: Tag$inboundSchema, - includeGuids: IncludeGuids$inboundSchema.optional(), - includeMeta: IncludeMeta$inboundSchema.optional(), - type: Type$inboundSchema, + includeGuids: IncludeGuids$inboundSchema, + type: GetLibraryItemsQueryParamType$inboundSchema.optional(), + includeMeta: GetLibraryItemsQueryParamIncludeMeta$inboundSchema, "X-Plex-Container-Start": z.number().int().default(0), "X-Plex-Container-Size": z.number().int().default(50), }).transform((v) => { @@ -375,9 +891,9 @@ export const GetLibraryItemsRequest$inboundSchema: z.ZodType< export type GetLibraryItemsRequest$Outbound = { sectionKey: number; tag: string; - includeGuids?: number | undefined; - includeMeta?: number | undefined; - type: number; + includeGuids: number; + type?: number | undefined; + includeMeta: number; "X-Plex-Container-Start": number; "X-Plex-Container-Size": number; }; @@ -390,9 +906,11 @@ export const GetLibraryItemsRequest$outboundSchema: z.ZodType< > = z.object({ sectionKey: z.number().int(), tag: Tag$outboundSchema, - includeGuids: IncludeGuids$outboundSchema.optional(), - includeMeta: IncludeMeta$outboundSchema.optional(), - type: Type$outboundSchema, + includeGuids: IncludeGuids$outboundSchema.default(IncludeGuids.Disable), + type: GetLibraryItemsQueryParamType$outboundSchema.optional(), + includeMeta: GetLibraryItemsQueryParamIncludeMeta$outboundSchema.default( + GetLibraryItemsQueryParamIncludeMeta.Disable, + ), xPlexContainerStart: z.number().int().default(0), xPlexContainerSize: z.number().int().default(50), }).transform((v) => { @@ -416,33 +934,611 @@ export namespace GetLibraryItemsRequest$ { } /** @internal */ -export const LibrarySectionID$inboundSchema: z.ZodType< - LibrarySectionID, +export const GetLibraryItemsFilter$inboundSchema: z.ZodType< + GetLibraryItemsFilter, z.ZodTypeDef, unknown -> = z.union([z.number().int(), z.string()]); +> = z.object({ + filter: z.string(), + filterType: z.string(), + key: z.string(), + title: z.string(), + type: z.string(), +}); /** @internal */ -export type LibrarySectionID$Outbound = number | string; +export type GetLibraryItemsFilter$Outbound = { + filter: string; + filterType: string; + key: string; + title: string; + type: string; +}; /** @internal */ -export const LibrarySectionID$outboundSchema: z.ZodType< - LibrarySectionID$Outbound, +export const GetLibraryItemsFilter$outboundSchema: z.ZodType< + GetLibraryItemsFilter$Outbound, z.ZodTypeDef, - LibrarySectionID -> = z.union([z.number().int(), z.string()]); + GetLibraryItemsFilter +> = z.object({ + filter: z.string(), + filterType: z.string(), + key: z.string(), + title: z.string(), + type: z.string(), +}); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace LibrarySectionID$ { - /** @deprecated use `LibrarySectionID$inboundSchema` instead. */ - export const inboundSchema = LibrarySectionID$inboundSchema; - /** @deprecated use `LibrarySectionID$outboundSchema` instead. */ - export const outboundSchema = LibrarySectionID$outboundSchema; - /** @deprecated use `LibrarySectionID$Outbound` instead. */ - export type Outbound = LibrarySectionID$Outbound; +export namespace GetLibraryItemsFilter$ { + /** @deprecated use `GetLibraryItemsFilter$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsFilter$inboundSchema; + /** @deprecated use `GetLibraryItemsFilter$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsFilter$outboundSchema; + /** @deprecated use `GetLibraryItemsFilter$Outbound` instead. */ + export type Outbound = GetLibraryItemsFilter$Outbound; +} + +/** @internal */ +export const GetLibraryItemsActiveDirection$inboundSchema: z.ZodNativeEnum< + typeof GetLibraryItemsActiveDirection +> = z.nativeEnum(GetLibraryItemsActiveDirection); + +/** @internal */ +export const GetLibraryItemsActiveDirection$outboundSchema: z.ZodNativeEnum< + typeof GetLibraryItemsActiveDirection +> = GetLibraryItemsActiveDirection$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsActiveDirection$ { + /** @deprecated use `GetLibraryItemsActiveDirection$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsActiveDirection$inboundSchema; + /** @deprecated use `GetLibraryItemsActiveDirection$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsActiveDirection$outboundSchema; +} + +/** @internal */ +export const GetLibraryItemsDefaultDirection$inboundSchema: z.ZodNativeEnum< + typeof GetLibraryItemsDefaultDirection +> = z.nativeEnum(GetLibraryItemsDefaultDirection); + +/** @internal */ +export const GetLibraryItemsDefaultDirection$outboundSchema: z.ZodNativeEnum< + typeof GetLibraryItemsDefaultDirection +> = GetLibraryItemsDefaultDirection$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsDefaultDirection$ { + /** @deprecated use `GetLibraryItemsDefaultDirection$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsDefaultDirection$inboundSchema; + /** @deprecated use `GetLibraryItemsDefaultDirection$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsDefaultDirection$outboundSchema; +} + +/** @internal */ +export const GetLibraryItemsSort$inboundSchema: z.ZodType< + GetLibraryItemsSort, + z.ZodTypeDef, + unknown +> = z.object({ + default: z.string().optional(), + active: z.boolean().optional(), + activeDirection: GetLibraryItemsActiveDirection$inboundSchema.default( + GetLibraryItemsActiveDirection.Ascending, + ), + defaultDirection: GetLibraryItemsDefaultDirection$inboundSchema.default( + GetLibraryItemsDefaultDirection.Ascending, + ), + descKey: z.string().optional(), + firstCharacterKey: z.string().optional(), + key: z.string(), + title: z.string(), +}); + +/** @internal */ +export type GetLibraryItemsSort$Outbound = { + default?: string | undefined; + active?: boolean | undefined; + activeDirection: string; + defaultDirection: string; + descKey?: string | undefined; + firstCharacterKey?: string | undefined; + key: string; + title: string; +}; + +/** @internal */ +export const GetLibraryItemsSort$outboundSchema: z.ZodType< + GetLibraryItemsSort$Outbound, + z.ZodTypeDef, + GetLibraryItemsSort +> = z.object({ + default: z.string().optional(), + active: z.boolean().optional(), + activeDirection: GetLibraryItemsActiveDirection$outboundSchema.default( + GetLibraryItemsActiveDirection.Ascending, + ), + defaultDirection: GetLibraryItemsDefaultDirection$outboundSchema.default( + GetLibraryItemsDefaultDirection.Ascending, + ), + descKey: z.string().optional(), + firstCharacterKey: z.string().optional(), + key: z.string(), + title: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsSort$ { + /** @deprecated use `GetLibraryItemsSort$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsSort$inboundSchema; + /** @deprecated use `GetLibraryItemsSort$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsSort$outboundSchema; + /** @deprecated use `GetLibraryItemsSort$Outbound` instead. */ + export type Outbound = GetLibraryItemsSort$Outbound; +} + +/** @internal */ +export const GetLibraryItemsField$inboundSchema: z.ZodType< + GetLibraryItemsField, + z.ZodTypeDef, + unknown +> = z.object({ + key: z.string(), + title: z.string(), + type: z.string(), + subType: z.string().optional(), +}); + +/** @internal */ +export type GetLibraryItemsField$Outbound = { + key: string; + title: string; + type: string; + subType?: string | undefined; +}; + +/** @internal */ +export const GetLibraryItemsField$outboundSchema: z.ZodType< + GetLibraryItemsField$Outbound, + z.ZodTypeDef, + GetLibraryItemsField +> = z.object({ + key: z.string(), + title: z.string(), + type: z.string(), + subType: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsField$ { + /** @deprecated use `GetLibraryItemsField$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsField$inboundSchema; + /** @deprecated use `GetLibraryItemsField$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsField$outboundSchema; + /** @deprecated use `GetLibraryItemsField$Outbound` instead. */ + export type Outbound = GetLibraryItemsField$Outbound; +} + +/** @internal */ +export const GetLibraryItemsType$inboundSchema: z.ZodType< + GetLibraryItemsType, + z.ZodTypeDef, + unknown +> = z.object({ + key: z.string(), + type: z.string(), + title: z.string(), + active: z.boolean(), + Filter: z.array(z.lazy(() => GetLibraryItemsFilter$inboundSchema)).optional(), + Sort: z.array(z.lazy(() => GetLibraryItemsSort$inboundSchema)).optional(), + Field: z.array(z.lazy(() => GetLibraryItemsField$inboundSchema)).optional(), +}).transform((v) => { + return remap$(v, { + "Filter": "filter", + "Sort": "sort", + "Field": "field", + }); +}); + +/** @internal */ +export type GetLibraryItemsType$Outbound = { + key: string; + type: string; + title: string; + active: boolean; + Filter?: Array | undefined; + Sort?: Array | undefined; + Field?: Array | undefined; +}; + +/** @internal */ +export const GetLibraryItemsType$outboundSchema: z.ZodType< + GetLibraryItemsType$Outbound, + z.ZodTypeDef, + GetLibraryItemsType +> = z.object({ + key: z.string(), + type: z.string(), + title: z.string(), + active: z.boolean(), + filter: z.array(z.lazy(() => GetLibraryItemsFilter$outboundSchema)) + .optional(), + sort: z.array(z.lazy(() => GetLibraryItemsSort$outboundSchema)).optional(), + field: z.array(z.lazy(() => GetLibraryItemsField$outboundSchema)).optional(), +}).transform((v) => { + return remap$(v, { + filter: "Filter", + sort: "Sort", + field: "Field", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsType$ { + /** @deprecated use `GetLibraryItemsType$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsType$inboundSchema; + /** @deprecated use `GetLibraryItemsType$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsType$outboundSchema; + /** @deprecated use `GetLibraryItemsType$Outbound` instead. */ + export type Outbound = GetLibraryItemsType$Outbound; +} + +/** @internal */ +export const GetLibraryItemsOperator$inboundSchema: z.ZodType< + GetLibraryItemsOperator, + z.ZodTypeDef, + unknown +> = z.object({ + key: z.string(), + title: z.string(), +}); + +/** @internal */ +export type GetLibraryItemsOperator$Outbound = { + key: string; + title: string; +}; + +/** @internal */ +export const GetLibraryItemsOperator$outboundSchema: z.ZodType< + GetLibraryItemsOperator$Outbound, + z.ZodTypeDef, + GetLibraryItemsOperator +> = z.object({ + key: z.string(), + title: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsOperator$ { + /** @deprecated use `GetLibraryItemsOperator$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsOperator$inboundSchema; + /** @deprecated use `GetLibraryItemsOperator$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsOperator$outboundSchema; + /** @deprecated use `GetLibraryItemsOperator$Outbound` instead. */ + export type Outbound = GetLibraryItemsOperator$Outbound; +} + +/** @internal */ +export const GetLibraryItemsFieldType$inboundSchema: z.ZodType< + GetLibraryItemsFieldType, + z.ZodTypeDef, + unknown +> = z.object({ + type: z.string(), + Operator: z.array(z.lazy(() => GetLibraryItemsOperator$inboundSchema)), +}).transform((v) => { + return remap$(v, { + "Operator": "operator", + }); +}); + +/** @internal */ +export type GetLibraryItemsFieldType$Outbound = { + type: string; + Operator: Array; +}; + +/** @internal */ +export const GetLibraryItemsFieldType$outboundSchema: z.ZodType< + GetLibraryItemsFieldType$Outbound, + z.ZodTypeDef, + GetLibraryItemsFieldType +> = z.object({ + type: z.string(), + operator: z.array(z.lazy(() => GetLibraryItemsOperator$outboundSchema)), +}).transform((v) => { + return remap$(v, { + operator: "Operator", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsFieldType$ { + /** @deprecated use `GetLibraryItemsFieldType$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsFieldType$inboundSchema; + /** @deprecated use `GetLibraryItemsFieldType$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsFieldType$outboundSchema; + /** @deprecated use `GetLibraryItemsFieldType$Outbound` instead. */ + export type Outbound = GetLibraryItemsFieldType$Outbound; +} + +/** @internal */ +export const GetLibraryItemsLibraryType$inboundSchema: z.ZodNativeEnum< + typeof GetLibraryItemsLibraryType +> = z.nativeEnum(GetLibraryItemsLibraryType); + +/** @internal */ +export const GetLibraryItemsLibraryType$outboundSchema: z.ZodNativeEnum< + typeof GetLibraryItemsLibraryType +> = GetLibraryItemsLibraryType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsLibraryType$ { + /** @deprecated use `GetLibraryItemsLibraryType$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsLibraryType$inboundSchema; + /** @deprecated use `GetLibraryItemsLibraryType$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsLibraryType$outboundSchema; +} + +/** @internal */ +export const GetLibraryItemsFlattenSeasons$inboundSchema: z.ZodNativeEnum< + typeof GetLibraryItemsFlattenSeasons +> = z.nativeEnum(GetLibraryItemsFlattenSeasons); + +/** @internal */ +export const GetLibraryItemsFlattenSeasons$outboundSchema: z.ZodNativeEnum< + typeof GetLibraryItemsFlattenSeasons +> = GetLibraryItemsFlattenSeasons$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsFlattenSeasons$ { + /** @deprecated use `GetLibraryItemsFlattenSeasons$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsFlattenSeasons$inboundSchema; + /** @deprecated use `GetLibraryItemsFlattenSeasons$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsFlattenSeasons$outboundSchema; +} + +/** @internal */ +export const GetLibraryItemsShowOrdering$inboundSchema: z.ZodNativeEnum< + typeof GetLibraryItemsShowOrdering +> = z.nativeEnum(GetLibraryItemsShowOrdering); + +/** @internal */ +export const GetLibraryItemsShowOrdering$outboundSchema: z.ZodNativeEnum< + typeof GetLibraryItemsShowOrdering +> = GetLibraryItemsShowOrdering$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsShowOrdering$ { + /** @deprecated use `GetLibraryItemsShowOrdering$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsShowOrdering$inboundSchema; + /** @deprecated use `GetLibraryItemsShowOrdering$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsShowOrdering$outboundSchema; +} + +/** @internal */ +export const GetLibraryItemsOptimizedForStreaming$inboundSchema: + z.ZodNativeEnum = z.nativeEnum( + GetLibraryItemsOptimizedForStreaming, + ); + +/** @internal */ +export const GetLibraryItemsOptimizedForStreaming$outboundSchema: + z.ZodNativeEnum = + GetLibraryItemsOptimizedForStreaming$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsOptimizedForStreaming$ { + /** @deprecated use `GetLibraryItemsOptimizedForStreaming$inboundSchema` instead. */ + export const inboundSchema = + GetLibraryItemsOptimizedForStreaming$inboundSchema; + /** @deprecated use `GetLibraryItemsOptimizedForStreaming$outboundSchema` instead. */ + export const outboundSchema = + GetLibraryItemsOptimizedForStreaming$outboundSchema; +} + +/** @internal */ +export const GetLibraryItemsHasThumbnail$inboundSchema: z.ZodNativeEnum< + typeof GetLibraryItemsHasThumbnail +> = z.nativeEnum(GetLibraryItemsHasThumbnail); + +/** @internal */ +export const GetLibraryItemsHasThumbnail$outboundSchema: z.ZodNativeEnum< + typeof GetLibraryItemsHasThumbnail +> = GetLibraryItemsHasThumbnail$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsHasThumbnail$ { + /** @deprecated use `GetLibraryItemsHasThumbnail$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsHasThumbnail$inboundSchema; + /** @deprecated use `GetLibraryItemsHasThumbnail$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsHasThumbnail$outboundSchema; +} + +/** @internal */ +export const GetLibraryItemsStream$inboundSchema: z.ZodType< + GetLibraryItemsStream, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.number().int(), + streamType: z.number().int(), + default: z.boolean().optional(), + selected: z.boolean().optional(), + codec: z.string(), + index: z.number().int(), + bitrate: z.number().int().optional(), + colorPrimaries: z.string().optional(), + colorRange: z.string().optional(), + colorSpace: z.string().optional(), + colorTrc: z.string().optional(), + bitDepth: z.number().int().optional(), + chromaLocation: z.string().optional(), + streamIdentifier: z.string().optional(), + chromaSubsampling: z.string().optional(), + codedHeight: z.number().int().optional(), + codedWidth: z.number().int().optional(), + frameRate: z.number().optional(), + hasScalingMatrix: z.boolean().optional(), + hearingImpaired: z.boolean().optional(), + closedCaptions: z.boolean().optional(), + embeddedInVideo: z.string().optional(), + height: z.number().int().optional(), + level: z.number().int().optional(), + profile: z.string().optional(), + refFrames: z.number().int().optional(), + scanType: z.string().optional(), + width: z.number().int().optional(), + displayTitle: z.string().optional(), + extendedDisplayTitle: z.string().optional(), + channels: z.number().int().optional(), + language: z.string().optional(), + languageTag: z.string().optional(), + languageCode: z.string().optional(), + audioChannelLayout: z.string().optional(), + samplingRate: z.number().int().optional(), + title: z.string().optional(), + canAutoSync: z.boolean().optional(), +}); + +/** @internal */ +export type GetLibraryItemsStream$Outbound = { + id: number; + streamType: number; + default?: boolean | undefined; + selected?: boolean | undefined; + codec: string; + index: number; + bitrate?: number | undefined; + colorPrimaries?: string | undefined; + colorRange?: string | undefined; + colorSpace?: string | undefined; + colorTrc?: string | undefined; + bitDepth?: number | undefined; + chromaLocation?: string | undefined; + streamIdentifier?: string | undefined; + chromaSubsampling?: string | undefined; + codedHeight?: number | undefined; + codedWidth?: number | undefined; + frameRate?: number | undefined; + hasScalingMatrix?: boolean | undefined; + hearingImpaired?: boolean | undefined; + closedCaptions?: boolean | undefined; + embeddedInVideo?: string | undefined; + height?: number | undefined; + level?: number | undefined; + profile?: string | undefined; + refFrames?: number | undefined; + scanType?: string | undefined; + width?: number | undefined; + displayTitle?: string | undefined; + extendedDisplayTitle?: string | undefined; + channels?: number | undefined; + language?: string | undefined; + languageTag?: string | undefined; + languageCode?: string | undefined; + audioChannelLayout?: string | undefined; + samplingRate?: number | undefined; + title?: string | undefined; + canAutoSync?: boolean | undefined; +}; + +/** @internal */ +export const GetLibraryItemsStream$outboundSchema: z.ZodType< + GetLibraryItemsStream$Outbound, + z.ZodTypeDef, + GetLibraryItemsStream +> = z.object({ + id: z.number().int(), + streamType: z.number().int(), + default: z.boolean().optional(), + selected: z.boolean().optional(), + codec: z.string(), + index: z.number().int(), + bitrate: z.number().int().optional(), + colorPrimaries: z.string().optional(), + colorRange: z.string().optional(), + colorSpace: z.string().optional(), + colorTrc: z.string().optional(), + bitDepth: z.number().int().optional(), + chromaLocation: z.string().optional(), + streamIdentifier: z.string().optional(), + chromaSubsampling: z.string().optional(), + codedHeight: z.number().int().optional(), + codedWidth: z.number().int().optional(), + frameRate: z.number().optional(), + hasScalingMatrix: z.boolean().optional(), + hearingImpaired: z.boolean().optional(), + closedCaptions: z.boolean().optional(), + embeddedInVideo: z.string().optional(), + height: z.number().int().optional(), + level: z.number().int().optional(), + profile: z.string().optional(), + refFrames: z.number().int().optional(), + scanType: z.string().optional(), + width: z.number().int().optional(), + displayTitle: z.string().optional(), + extendedDisplayTitle: z.string().optional(), + channels: z.number().int().optional(), + language: z.string().optional(), + languageTag: z.string().optional(), + languageCode: z.string().optional(), + audioChannelLayout: z.string().optional(), + samplingRate: z.number().int().optional(), + title: z.string().optional(), + canAutoSync: z.boolean().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsStream$ { + /** @deprecated use `GetLibraryItemsStream$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsStream$inboundSchema; + /** @deprecated use `GetLibraryItemsStream$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsStream$outboundSchema; + /** @deprecated use `GetLibraryItemsStream$Outbound` instead. */ + export type Outbound = GetLibraryItemsStream$Outbound; } /** @internal */ @@ -451,24 +1547,42 @@ export const GetLibraryItemsPart$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - id: z.number().int().optional(), - key: z.string().optional(), - duration: z.number().int().optional(), - file: z.string().optional(), - size: z.number().int().optional(), - container: z.string().optional(), - videoProfile: z.string().optional(), + id: z.number().int(), + key: z.string(), + duration: z.number().int(), + file: z.string(), + size: z.number().int(), + container: z.string(), + audioProfile: z.string().optional(), + has64bitOffsets: z.boolean().optional(), + optimizedForStreaming: z.boolean().optional(), + videoProfile: z.string(), + indexes: z.string().optional(), + hasThumbnail: GetLibraryItemsHasThumbnail$inboundSchema.default( + GetLibraryItemsHasThumbnail.False, + ), + Stream: z.array(z.lazy(() => GetLibraryItemsStream$inboundSchema)).optional(), +}).transform((v) => { + return remap$(v, { + "Stream": "stream", + }); }); /** @internal */ export type GetLibraryItemsPart$Outbound = { - id?: number | undefined; - key?: string | undefined; - duration?: number | undefined; - file?: string | undefined; - size?: number | undefined; - container?: string | undefined; - videoProfile?: string | undefined; + id: number; + key: string; + duration: number; + file: string; + size: number; + container: string; + audioProfile?: string | undefined; + has64bitOffsets?: boolean | undefined; + optimizedForStreaming?: boolean | undefined; + videoProfile: string; + indexes?: string | undefined; + hasThumbnail: string; + Stream?: Array | undefined; }; /** @internal */ @@ -477,13 +1591,26 @@ export const GetLibraryItemsPart$outboundSchema: z.ZodType< z.ZodTypeDef, GetLibraryItemsPart > = z.object({ - id: z.number().int().optional(), - key: z.string().optional(), - duration: z.number().int().optional(), - file: z.string().optional(), - size: z.number().int().optional(), - container: z.string().optional(), - videoProfile: z.string().optional(), + id: z.number().int(), + key: z.string(), + duration: z.number().int(), + file: z.string(), + size: z.number().int(), + container: z.string(), + audioProfile: z.string().optional(), + has64bitOffsets: z.boolean().optional(), + optimizedForStreaming: z.boolean().optional(), + videoProfile: z.string(), + indexes: z.string().optional(), + hasThumbnail: GetLibraryItemsHasThumbnail$outboundSchema.default( + GetLibraryItemsHasThumbnail.False, + ), + stream: z.array(z.lazy(() => GetLibraryItemsStream$outboundSchema)) + .optional(), +}).transform((v) => { + return remap$(v, { + stream: "Stream", + }); }); /** @@ -505,20 +1632,24 @@ export const GetLibraryItemsMedia$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - id: z.number().int().optional(), - duration: z.number().int().optional(), - bitrate: z.number().int().optional(), - width: z.number().int().optional(), - height: z.number().int().optional(), - aspectRatio: z.number().optional(), - audioChannels: z.number().int().optional(), - audioCodec: z.string().optional(), - videoCodec: z.string().optional(), - videoResolution: z.string().optional(), - container: z.string().optional(), - videoFrameRate: z.string().optional(), - videoProfile: z.string().optional(), - Part: z.array(z.lazy(() => GetLibraryItemsPart$inboundSchema)).optional(), + id: z.number().int(), + duration: z.number().int(), + bitrate: z.number().int(), + width: z.number().int(), + height: z.number().int(), + aspectRatio: z.number(), + audioProfile: z.string().optional(), + audioChannels: z.number().int(), + audioCodec: z.string(), + videoCodec: z.string(), + videoResolution: z.string(), + container: z.string(), + videoFrameRate: z.string(), + videoProfile: z.string(), + hasVoiceActivity: z.boolean().optional(), + optimizedForStreaming: GetLibraryItemsOptimizedForStreaming$inboundSchema, + has64bitOffsets: z.boolean().optional(), + Part: z.array(z.lazy(() => GetLibraryItemsPart$inboundSchema)), }).transform((v) => { return remap$(v, { "Part": "part", @@ -527,20 +1658,24 @@ export const GetLibraryItemsMedia$inboundSchema: z.ZodType< /** @internal */ export type GetLibraryItemsMedia$Outbound = { - id?: number | undefined; - duration?: number | undefined; - bitrate?: number | undefined; - width?: number | undefined; - height?: number | undefined; - aspectRatio?: number | undefined; - audioChannels?: number | undefined; - audioCodec?: string | undefined; - videoCodec?: string | undefined; - videoResolution?: string | undefined; - container?: string | undefined; - videoFrameRate?: string | undefined; - videoProfile?: string | undefined; - Part?: Array | undefined; + id: number; + duration: number; + bitrate: number; + width: number; + height: number; + aspectRatio: number; + audioProfile?: string | undefined; + audioChannels: number; + audioCodec: string; + videoCodec: string; + videoResolution: string; + container: string; + videoFrameRate: string; + videoProfile: string; + hasVoiceActivity?: boolean | undefined; + optimizedForStreaming: number; + has64bitOffsets?: boolean | undefined; + Part: Array; }; /** @internal */ @@ -549,20 +1684,25 @@ export const GetLibraryItemsMedia$outboundSchema: z.ZodType< z.ZodTypeDef, GetLibraryItemsMedia > = z.object({ - id: z.number().int().optional(), - duration: z.number().int().optional(), - bitrate: z.number().int().optional(), - width: z.number().int().optional(), - height: z.number().int().optional(), - aspectRatio: z.number().optional(), - audioChannels: z.number().int().optional(), - audioCodec: z.string().optional(), - videoCodec: z.string().optional(), - videoResolution: z.string().optional(), - container: z.string().optional(), - videoFrameRate: z.string().optional(), - videoProfile: z.string().optional(), - part: z.array(z.lazy(() => GetLibraryItemsPart$outboundSchema)).optional(), + id: z.number().int(), + duration: z.number().int(), + bitrate: z.number().int(), + width: z.number().int(), + height: z.number().int(), + aspectRatio: z.number(), + audioProfile: z.string().optional(), + audioChannels: z.number().int(), + audioCodec: z.string(), + videoCodec: z.string(), + videoResolution: z.string(), + container: z.string(), + videoFrameRate: z.string(), + videoProfile: z.string(), + hasVoiceActivity: z.boolean().optional(), + optimizedForStreaming: GetLibraryItemsOptimizedForStreaming$outboundSchema + .default(GetLibraryItemsOptimizedForStreaming.Disable), + has64bitOffsets: z.boolean().optional(), + part: z.array(z.lazy(() => GetLibraryItemsPart$outboundSchema)), }).transform((v) => { return remap$(v, { part: "Part", @@ -727,8 +1867,8 @@ export namespace GetLibraryItemsWriter$ { } /** @internal */ -export const GetLibraryItemsRole$inboundSchema: z.ZodType< - GetLibraryItemsRole, +export const GetLibraryItemsCollection$inboundSchema: z.ZodType< + GetLibraryItemsCollection, z.ZodTypeDef, unknown > = z.object({ @@ -736,17 +1876,68 @@ export const GetLibraryItemsRole$inboundSchema: z.ZodType< }); /** @internal */ -export type GetLibraryItemsRole$Outbound = { +export type GetLibraryItemsCollection$Outbound = { tag?: string | undefined; }; +/** @internal */ +export const GetLibraryItemsCollection$outboundSchema: z.ZodType< + GetLibraryItemsCollection$Outbound, + z.ZodTypeDef, + GetLibraryItemsCollection +> = z.object({ + tag: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsCollection$ { + /** @deprecated use `GetLibraryItemsCollection$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsCollection$inboundSchema; + /** @deprecated use `GetLibraryItemsCollection$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsCollection$outboundSchema; + /** @deprecated use `GetLibraryItemsCollection$Outbound` instead. */ + export type Outbound = GetLibraryItemsCollection$Outbound; +} + +/** @internal */ +export const GetLibraryItemsRole$inboundSchema: z.ZodType< + GetLibraryItemsRole, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.number().int().optional(), + filter: z.string().optional(), + thumb: z.string().optional(), + tag: z.string().optional(), + tagKey: z.string().optional(), + role: z.string().optional(), +}); + +/** @internal */ +export type GetLibraryItemsRole$Outbound = { + id?: number | undefined; + filter?: string | undefined; + thumb?: string | undefined; + tag?: string | undefined; + tagKey?: string | undefined; + role?: string | undefined; +}; + /** @internal */ export const GetLibraryItemsRole$outboundSchema: z.ZodType< GetLibraryItemsRole$Outbound, z.ZodTypeDef, GetLibraryItemsRole > = z.object({ + id: z.number().int().optional(), + filter: z.string().optional(), + thumb: z.string().optional(), tag: z.string().optional(), + tagKey: z.string().optional(), + role: z.string().optional(), }); /** @@ -762,29 +1953,229 @@ export namespace GetLibraryItemsRole$ { export type Outbound = GetLibraryItemsRole$Outbound; } +/** @internal */ +export const GetLibraryItemsMediaGuid$inboundSchema: z.ZodType< + GetLibraryItemsMediaGuid, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string(), +}); + +/** @internal */ +export type GetLibraryItemsMediaGuid$Outbound = { + id: string; +}; + +/** @internal */ +export const GetLibraryItemsMediaGuid$outboundSchema: z.ZodType< + GetLibraryItemsMediaGuid$Outbound, + z.ZodTypeDef, + GetLibraryItemsMediaGuid +> = z.object({ + id: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsMediaGuid$ { + /** @deprecated use `GetLibraryItemsMediaGuid$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsMediaGuid$inboundSchema; + /** @deprecated use `GetLibraryItemsMediaGuid$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsMediaGuid$outboundSchema; + /** @deprecated use `GetLibraryItemsMediaGuid$Outbound` instead. */ + export type Outbound = GetLibraryItemsMediaGuid$Outbound; +} + +/** @internal */ +export const GetLibraryItemsUltraBlurColors$inboundSchema: z.ZodType< + GetLibraryItemsUltraBlurColors, + z.ZodTypeDef, + unknown +> = z.object({ + topLeft: z.string(), + topRight: z.string(), + bottomRight: z.string(), + bottomLeft: z.string(), +}); + +/** @internal */ +export type GetLibraryItemsUltraBlurColors$Outbound = { + topLeft: string; + topRight: string; + bottomRight: string; + bottomLeft: string; +}; + +/** @internal */ +export const GetLibraryItemsUltraBlurColors$outboundSchema: z.ZodType< + GetLibraryItemsUltraBlurColors$Outbound, + z.ZodTypeDef, + GetLibraryItemsUltraBlurColors +> = z.object({ + topLeft: z.string(), + topRight: z.string(), + bottomRight: z.string(), + bottomLeft: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsUltraBlurColors$ { + /** @deprecated use `GetLibraryItemsUltraBlurColors$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsUltraBlurColors$inboundSchema; + /** @deprecated use `GetLibraryItemsUltraBlurColors$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsUltraBlurColors$outboundSchema; + /** @deprecated use `GetLibraryItemsUltraBlurColors$Outbound` instead. */ + export type Outbound = GetLibraryItemsUltraBlurColors$Outbound; +} + +/** @internal */ +export const GetLibraryItemsMetaDataRating$inboundSchema: z.ZodType< + GetLibraryItemsMetaDataRating, + z.ZodTypeDef, + unknown +> = z.object({ + image: z.string(), + value: z.number(), + type: z.string(), +}); + +/** @internal */ +export type GetLibraryItemsMetaDataRating$Outbound = { + image: string; + value: number; + type: string; +}; + +/** @internal */ +export const GetLibraryItemsMetaDataRating$outboundSchema: z.ZodType< + GetLibraryItemsMetaDataRating$Outbound, + z.ZodTypeDef, + GetLibraryItemsMetaDataRating +> = z.object({ + image: z.string(), + value: z.number(), + type: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsMetaDataRating$ { + /** @deprecated use `GetLibraryItemsMetaDataRating$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsMetaDataRating$inboundSchema; + /** @deprecated use `GetLibraryItemsMetaDataRating$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsMetaDataRating$outboundSchema; + /** @deprecated use `GetLibraryItemsMetaDataRating$Outbound` instead. */ + export type Outbound = GetLibraryItemsMetaDataRating$Outbound; +} + +/** @internal */ +export const GetLibraryItemsLibraryResponse200Type$inboundSchema: + z.ZodNativeEnum = z.nativeEnum( + GetLibraryItemsLibraryResponse200Type, + ); + +/** @internal */ +export const GetLibraryItemsLibraryResponse200Type$outboundSchema: + z.ZodNativeEnum = + GetLibraryItemsLibraryResponse200Type$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsLibraryResponse200Type$ { + /** @deprecated use `GetLibraryItemsLibraryResponse200Type$inboundSchema` instead. */ + export const inboundSchema = + GetLibraryItemsLibraryResponse200Type$inboundSchema; + /** @deprecated use `GetLibraryItemsLibraryResponse200Type$outboundSchema` instead. */ + export const outboundSchema = + GetLibraryItemsLibraryResponse200Type$outboundSchema; +} + +/** @internal */ +export const GetLibraryItemsImage$inboundSchema: z.ZodType< + GetLibraryItemsImage, + z.ZodTypeDef, + unknown +> = z.object({ + alt: z.string(), + type: GetLibraryItemsLibraryResponse200Type$inboundSchema, + url: z.string(), +}); + +/** @internal */ +export type GetLibraryItemsImage$Outbound = { + alt: string; + type: string; + url: string; +}; + +/** @internal */ +export const GetLibraryItemsImage$outboundSchema: z.ZodType< + GetLibraryItemsImage$Outbound, + z.ZodTypeDef, + GetLibraryItemsImage +> = z.object({ + alt: z.string(), + type: GetLibraryItemsLibraryResponse200Type$outboundSchema, + url: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsImage$ { + /** @deprecated use `GetLibraryItemsImage$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsImage$inboundSchema; + /** @deprecated use `GetLibraryItemsImage$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsImage$outboundSchema; + /** @deprecated use `GetLibraryItemsImage$Outbound` instead. */ + export type Outbound = GetLibraryItemsImage$Outbound; +} + /** @internal */ export const GetLibraryItemsMetadata$inboundSchema: z.ZodType< GetLibraryItemsMetadata, z.ZodTypeDef, unknown > = z.object({ - ratingKey: z.string().optional(), - key: z.string().optional(), - guid: z.string().optional(), + ratingKey: z.string(), + key: z.string(), + guid: z.string(), studio: z.string().optional(), - type: z.string().optional(), - title: z.string().optional(), + skipChildren: z.boolean().optional(), + librarySectionID: z.number().int().optional(), + librarySectionTitle: z.string().optional(), + librarySectionKey: z.string().optional(), + type: GetLibraryItemsLibraryType$inboundSchema, + title: z.string(), + slug: z.string().optional(), contentRating: z.string().optional(), - summary: z.string().optional(), + summary: z.string(), rating: z.number().optional(), audienceRating: z.number().optional(), year: z.number().int().optional(), + seasonCount: z.number().int().optional(), tagline: z.string().optional(), + flattenSeasons: GetLibraryItemsFlattenSeasons$inboundSchema.default( + GetLibraryItemsFlattenSeasons.False, + ), + showOrdering: GetLibraryItemsShowOrdering$inboundSchema.optional(), thumb: z.string().optional(), art: z.string().optional(), + banner: z.string().optional(), duration: z.number().int().optional(), originallyAvailableAt: z.string().transform(v => new RFCDate(v)).optional(), - addedAt: z.number().int().optional(), + addedAt: z.number().int(), updatedAt: z.number().int().optional(), audienceRatingImage: z.string().optional(), chapterSource: z.string().optional(), @@ -795,6 +2186,8 @@ export const GetLibraryItemsMetadata$inboundSchema: z.ZodType< grandparentKey: z.string().optional(), grandparentTitle: z.string().optional(), grandparentThumb: z.string().optional(), + parentSlug: z.string().optional(), + grandparentSlug: z.string().optional(), grandparentArt: z.string().optional(), grandparentTheme: z.string().optional(), Media: z.array(z.lazy(() => GetLibraryItemsMedia$inboundSchema)).optional(), @@ -804,7 +2197,16 @@ export const GetLibraryItemsMetadata$inboundSchema: z.ZodType< Director: z.array(z.lazy(() => GetLibraryItemsDirector$inboundSchema)) .optional(), Writer: z.array(z.lazy(() => GetLibraryItemsWriter$inboundSchema)).optional(), + Collection: z.array(z.lazy(() => GetLibraryItemsCollection$inboundSchema)) + .optional(), Role: z.array(z.lazy(() => GetLibraryItemsRole$inboundSchema)).optional(), + Guid: z.array(z.lazy(() => GetLibraryItemsMediaGuid$inboundSchema)) + .optional(), + UltraBlurColors: z.lazy(() => GetLibraryItemsUltraBlurColors$inboundSchema) + .optional(), + Rating: z.array(z.lazy(() => GetLibraryItemsMetaDataRating$inboundSchema)) + .optional(), + Image: z.array(z.lazy(() => GetLibraryItemsImage$inboundSchema)).optional(), titleSort: z.string().optional(), viewCount: z.number().int().optional(), lastViewedAt: z.number().int().optional(), @@ -834,29 +2236,43 @@ export const GetLibraryItemsMetadata$inboundSchema: z.ZodType< "Country": "country", "Director": "director", "Writer": "writer", + "Collection": "collection", "Role": "role", + "Guid": "mediaGuid", + "UltraBlurColors": "ultraBlurColors", + "Rating": "metaDataRating", + "Image": "image", }); }); /** @internal */ export type GetLibraryItemsMetadata$Outbound = { - ratingKey?: string | undefined; - key?: string | undefined; - guid?: string | undefined; + ratingKey: string; + key: string; + guid: string; studio?: string | undefined; - type?: string | undefined; - title?: string | undefined; + skipChildren?: boolean | undefined; + librarySectionID?: number | undefined; + librarySectionTitle?: string | undefined; + librarySectionKey?: string | undefined; + type: string; + title: string; + slug?: string | undefined; contentRating?: string | undefined; - summary?: string | undefined; + summary: string; rating?: number | undefined; audienceRating?: number | undefined; year?: number | undefined; + seasonCount?: number | undefined; tagline?: string | undefined; + flattenSeasons: string; + showOrdering?: string | undefined; thumb?: string | undefined; art?: string | undefined; + banner?: string | undefined; duration?: number | undefined; originallyAvailableAt?: string | undefined; - addedAt?: number | undefined; + addedAt: number; updatedAt?: number | undefined; audienceRatingImage?: string | undefined; chapterSource?: string | undefined; @@ -867,6 +2283,8 @@ export type GetLibraryItemsMetadata$Outbound = { grandparentKey?: string | undefined; grandparentTitle?: string | undefined; grandparentThumb?: string | undefined; + parentSlug?: string | undefined; + grandparentSlug?: string | undefined; grandparentArt?: string | undefined; grandparentTheme?: string | undefined; Media?: Array | undefined; @@ -874,7 +2292,12 @@ export type GetLibraryItemsMetadata$Outbound = { Country?: Array | undefined; Director?: Array | undefined; Writer?: Array | undefined; + Collection?: Array | undefined; Role?: Array | undefined; + Guid?: Array | undefined; + UltraBlurColors?: GetLibraryItemsUltraBlurColors$Outbound | undefined; + Rating?: Array | undefined; + Image?: Array | undefined; titleSort?: string | undefined; viewCount?: number | undefined; lastViewedAt?: number | undefined; @@ -905,24 +2328,35 @@ export const GetLibraryItemsMetadata$outboundSchema: z.ZodType< z.ZodTypeDef, GetLibraryItemsMetadata > = z.object({ - ratingKey: z.string().optional(), - key: z.string().optional(), - guid: z.string().optional(), + ratingKey: z.string(), + key: z.string(), + guid: z.string(), studio: z.string().optional(), - type: z.string().optional(), - title: z.string().optional(), + skipChildren: z.boolean().optional(), + librarySectionID: z.number().int().optional(), + librarySectionTitle: z.string().optional(), + librarySectionKey: z.string().optional(), + type: GetLibraryItemsLibraryType$outboundSchema, + title: z.string(), + slug: z.string().optional(), contentRating: z.string().optional(), - summary: z.string().optional(), + summary: z.string(), rating: z.number().optional(), audienceRating: z.number().optional(), year: z.number().int().optional(), + seasonCount: z.number().int().optional(), tagline: z.string().optional(), + flattenSeasons: GetLibraryItemsFlattenSeasons$outboundSchema.default( + GetLibraryItemsFlattenSeasons.False, + ), + showOrdering: GetLibraryItemsShowOrdering$outboundSchema.optional(), thumb: z.string().optional(), art: z.string().optional(), + banner: z.string().optional(), duration: z.number().int().optional(), originallyAvailableAt: z.instanceof(RFCDate).transform(v => v.toString()) .optional(), - addedAt: z.number().int().optional(), + addedAt: z.number().int(), updatedAt: z.number().int().optional(), audienceRatingImage: z.string().optional(), chapterSource: z.string().optional(), @@ -933,6 +2367,8 @@ export const GetLibraryItemsMetadata$outboundSchema: z.ZodType< grandparentKey: z.string().optional(), grandparentTitle: z.string().optional(), grandparentThumb: z.string().optional(), + parentSlug: z.string().optional(), + grandparentSlug: z.string().optional(), grandparentArt: z.string().optional(), grandparentTheme: z.string().optional(), media: z.array(z.lazy(() => GetLibraryItemsMedia$outboundSchema)).optional(), @@ -943,7 +2379,17 @@ export const GetLibraryItemsMetadata$outboundSchema: z.ZodType< .optional(), writer: z.array(z.lazy(() => GetLibraryItemsWriter$outboundSchema)) .optional(), + collection: z.array(z.lazy(() => GetLibraryItemsCollection$outboundSchema)) + .optional(), role: z.array(z.lazy(() => GetLibraryItemsRole$outboundSchema)).optional(), + mediaGuid: z.array(z.lazy(() => GetLibraryItemsMediaGuid$outboundSchema)) + .optional(), + ultraBlurColors: z.lazy(() => GetLibraryItemsUltraBlurColors$outboundSchema) + .optional(), + metaDataRating: z.array( + z.lazy(() => GetLibraryItemsMetaDataRating$outboundSchema), + ).optional(), + image: z.array(z.lazy(() => GetLibraryItemsImage$outboundSchema)).optional(), titleSort: z.string().optional(), viewCount: z.number().int().optional(), lastViewedAt: z.number().int().optional(), @@ -973,7 +2419,12 @@ export const GetLibraryItemsMetadata$outboundSchema: z.ZodType< country: "Country", director: "Director", writer: "Writer", + collection: "Collection", role: "Role", + mediaGuid: "Guid", + ultraBlurColors: "UltraBlurColors", + metaDataRating: "Rating", + image: "Image", }); }); @@ -990,53 +2441,490 @@ export namespace GetLibraryItemsMetadata$ { export type Outbound = GetLibraryItemsMetadata$Outbound; } +/** @internal */ +export const GetLibraryItemsLibraryFilter$inboundSchema: z.ZodType< + GetLibraryItemsLibraryFilter, + z.ZodTypeDef, + unknown +> = z.object({ + filter: z.string(), + filterType: z.string(), + key: z.string(), + title: z.string(), + type: z.string(), +}); + +/** @internal */ +export type GetLibraryItemsLibraryFilter$Outbound = { + filter: string; + filterType: string; + key: string; + title: string; + type: string; +}; + +/** @internal */ +export const GetLibraryItemsLibraryFilter$outboundSchema: z.ZodType< + GetLibraryItemsLibraryFilter$Outbound, + z.ZodTypeDef, + GetLibraryItemsLibraryFilter +> = z.object({ + filter: z.string(), + filterType: z.string(), + key: z.string(), + title: z.string(), + type: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsLibraryFilter$ { + /** @deprecated use `GetLibraryItemsLibraryFilter$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsLibraryFilter$inboundSchema; + /** @deprecated use `GetLibraryItemsLibraryFilter$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsLibraryFilter$outboundSchema; + /** @deprecated use `GetLibraryItemsLibraryFilter$Outbound` instead. */ + export type Outbound = GetLibraryItemsLibraryFilter$Outbound; +} + +/** @internal */ +export const GetLibraryItemsLibraryActiveDirection$inboundSchema: + z.ZodNativeEnum = z.nativeEnum( + GetLibraryItemsLibraryActiveDirection, + ); + +/** @internal */ +export const GetLibraryItemsLibraryActiveDirection$outboundSchema: + z.ZodNativeEnum = + GetLibraryItemsLibraryActiveDirection$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsLibraryActiveDirection$ { + /** @deprecated use `GetLibraryItemsLibraryActiveDirection$inboundSchema` instead. */ + export const inboundSchema = + GetLibraryItemsLibraryActiveDirection$inboundSchema; + /** @deprecated use `GetLibraryItemsLibraryActiveDirection$outboundSchema` instead. */ + export const outboundSchema = + GetLibraryItemsLibraryActiveDirection$outboundSchema; +} + +/** @internal */ +export const GetLibraryItemsLibraryDefaultDirection$inboundSchema: + z.ZodNativeEnum = z.nativeEnum( + GetLibraryItemsLibraryDefaultDirection, + ); + +/** @internal */ +export const GetLibraryItemsLibraryDefaultDirection$outboundSchema: + z.ZodNativeEnum = + GetLibraryItemsLibraryDefaultDirection$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsLibraryDefaultDirection$ { + /** @deprecated use `GetLibraryItemsLibraryDefaultDirection$inboundSchema` instead. */ + export const inboundSchema = + GetLibraryItemsLibraryDefaultDirection$inboundSchema; + /** @deprecated use `GetLibraryItemsLibraryDefaultDirection$outboundSchema` instead. */ + export const outboundSchema = + GetLibraryItemsLibraryDefaultDirection$outboundSchema; +} + +/** @internal */ +export const GetLibraryItemsLibrarySort$inboundSchema: z.ZodType< + GetLibraryItemsLibrarySort, + z.ZodTypeDef, + unknown +> = z.object({ + default: z.string().optional(), + active: z.boolean().optional(), + activeDirection: GetLibraryItemsLibraryActiveDirection$inboundSchema.default( + GetLibraryItemsLibraryActiveDirection.Ascending, + ), + defaultDirection: GetLibraryItemsLibraryDefaultDirection$inboundSchema + .default(GetLibraryItemsLibraryDefaultDirection.Ascending), + descKey: z.string().optional(), + firstCharacterKey: z.string().optional(), + key: z.string(), + title: z.string(), +}); + +/** @internal */ +export type GetLibraryItemsLibrarySort$Outbound = { + default?: string | undefined; + active?: boolean | undefined; + activeDirection: string; + defaultDirection: string; + descKey?: string | undefined; + firstCharacterKey?: string | undefined; + key: string; + title: string; +}; + +/** @internal */ +export const GetLibraryItemsLibrarySort$outboundSchema: z.ZodType< + GetLibraryItemsLibrarySort$Outbound, + z.ZodTypeDef, + GetLibraryItemsLibrarySort +> = z.object({ + default: z.string().optional(), + active: z.boolean().optional(), + activeDirection: GetLibraryItemsLibraryActiveDirection$outboundSchema.default( + GetLibraryItemsLibraryActiveDirection.Ascending, + ), + defaultDirection: GetLibraryItemsLibraryDefaultDirection$outboundSchema + .default(GetLibraryItemsLibraryDefaultDirection.Ascending), + descKey: z.string().optional(), + firstCharacterKey: z.string().optional(), + key: z.string(), + title: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsLibrarySort$ { + /** @deprecated use `GetLibraryItemsLibrarySort$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsLibrarySort$inboundSchema; + /** @deprecated use `GetLibraryItemsLibrarySort$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsLibrarySort$outboundSchema; + /** @deprecated use `GetLibraryItemsLibrarySort$Outbound` instead. */ + export type Outbound = GetLibraryItemsLibrarySort$Outbound; +} + +/** @internal */ +export const GetLibraryItemsLibraryField$inboundSchema: z.ZodType< + GetLibraryItemsLibraryField, + z.ZodTypeDef, + unknown +> = z.object({ + key: z.string(), + title: z.string(), + type: z.string(), + subType: z.string().optional(), +}); + +/** @internal */ +export type GetLibraryItemsLibraryField$Outbound = { + key: string; + title: string; + type: string; + subType?: string | undefined; +}; + +/** @internal */ +export const GetLibraryItemsLibraryField$outboundSchema: z.ZodType< + GetLibraryItemsLibraryField$Outbound, + z.ZodTypeDef, + GetLibraryItemsLibraryField +> = z.object({ + key: z.string(), + title: z.string(), + type: z.string(), + subType: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsLibraryField$ { + /** @deprecated use `GetLibraryItemsLibraryField$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsLibraryField$inboundSchema; + /** @deprecated use `GetLibraryItemsLibraryField$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsLibraryField$outboundSchema; + /** @deprecated use `GetLibraryItemsLibraryField$Outbound` instead. */ + export type Outbound = GetLibraryItemsLibraryField$Outbound; +} + +/** @internal */ +export const GetLibraryItemsLibraryResponseType$inboundSchema: z.ZodType< + GetLibraryItemsLibraryResponseType, + z.ZodTypeDef, + unknown +> = z.object({ + key: z.string(), + type: z.string(), + title: z.string(), + active: z.boolean(), + Filter: z.array(z.lazy(() => GetLibraryItemsLibraryFilter$inboundSchema)) + .optional(), + Sort: z.array(z.lazy(() => GetLibraryItemsLibrarySort$inboundSchema)) + .optional(), + Field: z.array(z.lazy(() => GetLibraryItemsLibraryField$inboundSchema)) + .optional(), +}).transform((v) => { + return remap$(v, { + "Filter": "filter", + "Sort": "sort", + "Field": "field", + }); +}); + +/** @internal */ +export type GetLibraryItemsLibraryResponseType$Outbound = { + key: string; + type: string; + title: string; + active: boolean; + Filter?: Array | undefined; + Sort?: Array | undefined; + Field?: Array | undefined; +}; + +/** @internal */ +export const GetLibraryItemsLibraryResponseType$outboundSchema: z.ZodType< + GetLibraryItemsLibraryResponseType$Outbound, + z.ZodTypeDef, + GetLibraryItemsLibraryResponseType +> = z.object({ + key: z.string(), + type: z.string(), + title: z.string(), + active: z.boolean(), + filter: z.array(z.lazy(() => GetLibraryItemsLibraryFilter$outboundSchema)) + .optional(), + sort: z.array(z.lazy(() => GetLibraryItemsLibrarySort$outboundSchema)) + .optional(), + field: z.array(z.lazy(() => GetLibraryItemsLibraryField$outboundSchema)) + .optional(), +}).transform((v) => { + return remap$(v, { + filter: "Filter", + sort: "Sort", + field: "Field", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsLibraryResponseType$ { + /** @deprecated use `GetLibraryItemsLibraryResponseType$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsLibraryResponseType$inboundSchema; + /** @deprecated use `GetLibraryItemsLibraryResponseType$outboundSchema` instead. */ + export const outboundSchema = + GetLibraryItemsLibraryResponseType$outboundSchema; + /** @deprecated use `GetLibraryItemsLibraryResponseType$Outbound` instead. */ + export type Outbound = GetLibraryItemsLibraryResponseType$Outbound; +} + +/** @internal */ +export const GetLibraryItemsLibraryOperator$inboundSchema: z.ZodType< + GetLibraryItemsLibraryOperator, + z.ZodTypeDef, + unknown +> = z.object({ + key: z.string(), + title: z.string(), +}); + +/** @internal */ +export type GetLibraryItemsLibraryOperator$Outbound = { + key: string; + title: string; +}; + +/** @internal */ +export const GetLibraryItemsLibraryOperator$outboundSchema: z.ZodType< + GetLibraryItemsLibraryOperator$Outbound, + z.ZodTypeDef, + GetLibraryItemsLibraryOperator +> = z.object({ + key: z.string(), + title: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsLibraryOperator$ { + /** @deprecated use `GetLibraryItemsLibraryOperator$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsLibraryOperator$inboundSchema; + /** @deprecated use `GetLibraryItemsLibraryOperator$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsLibraryOperator$outboundSchema; + /** @deprecated use `GetLibraryItemsLibraryOperator$Outbound` instead. */ + export type Outbound = GetLibraryItemsLibraryOperator$Outbound; +} + +/** @internal */ +export const GetLibraryItemsLibraryFieldType$inboundSchema: z.ZodType< + GetLibraryItemsLibraryFieldType, + z.ZodTypeDef, + unknown +> = z.object({ + type: z.string(), + Operator: z.array(z.lazy(() => GetLibraryItemsLibraryOperator$inboundSchema)), +}).transform((v) => { + return remap$(v, { + "Operator": "operator", + }); +}); + +/** @internal */ +export type GetLibraryItemsLibraryFieldType$Outbound = { + type: string; + Operator: Array; +}; + +/** @internal */ +export const GetLibraryItemsLibraryFieldType$outboundSchema: z.ZodType< + GetLibraryItemsLibraryFieldType$Outbound, + z.ZodTypeDef, + GetLibraryItemsLibraryFieldType +> = z.object({ + type: z.string(), + operator: z.array( + z.lazy(() => GetLibraryItemsLibraryOperator$outboundSchema), + ), +}).transform((v) => { + return remap$(v, { + operator: "Operator", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsLibraryFieldType$ { + /** @deprecated use `GetLibraryItemsLibraryFieldType$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsLibraryFieldType$inboundSchema; + /** @deprecated use `GetLibraryItemsLibraryFieldType$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsLibraryFieldType$outboundSchema; + /** @deprecated use `GetLibraryItemsLibraryFieldType$Outbound` instead. */ + export type Outbound = GetLibraryItemsLibraryFieldType$Outbound; +} + +/** @internal */ +export const GetLibraryItemsMeta$inboundSchema: z.ZodType< + GetLibraryItemsMeta, + z.ZodTypeDef, + unknown +> = z.object({ + Type: z.array(z.lazy(() => GetLibraryItemsLibraryResponseType$inboundSchema)) + .optional(), + FieldType: z.array( + z.lazy(() => GetLibraryItemsLibraryFieldType$inboundSchema), + ).optional(), +}).transform((v) => { + return remap$(v, { + "Type": "type", + "FieldType": "fieldType", + }); +}); + +/** @internal */ +export type GetLibraryItemsMeta$Outbound = { + Type?: Array | undefined; + FieldType?: Array | undefined; +}; + +/** @internal */ +export const GetLibraryItemsMeta$outboundSchema: z.ZodType< + GetLibraryItemsMeta$Outbound, + z.ZodTypeDef, + GetLibraryItemsMeta +> = z.object({ + type: z.array(z.lazy(() => GetLibraryItemsLibraryResponseType$outboundSchema)) + .optional(), + fieldType: z.array( + z.lazy(() => GetLibraryItemsLibraryFieldType$outboundSchema), + ).optional(), +}).transform((v) => { + return remap$(v, { + type: "Type", + fieldType: "FieldType", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLibraryItemsMeta$ { + /** @deprecated use `GetLibraryItemsMeta$inboundSchema` instead. */ + export const inboundSchema = GetLibraryItemsMeta$inboundSchema; + /** @deprecated use `GetLibraryItemsMeta$outboundSchema` instead. */ + export const outboundSchema = GetLibraryItemsMeta$outboundSchema; + /** @deprecated use `GetLibraryItemsMeta$Outbound` instead. */ + export type Outbound = GetLibraryItemsMeta$Outbound; +} + /** @internal */ export const GetLibraryItemsMediaContainer$inboundSchema: z.ZodType< GetLibraryItemsMediaContainer, z.ZodTypeDef, unknown > = z.object({ - size: z.number().int().optional(), - allowSync: z.boolean().optional(), - art: z.string().optional(), - identifier: z.string().optional(), - librarySectionID: z.union([z.number().int(), z.string()]).optional(), - librarySectionTitle: z.string().optional(), - librarySectionUUID: z.string().optional(), - mediaTagPrefix: z.string().optional(), - mediaTagVersion: z.number().int().optional(), - thumb: z.string().optional(), - title1: z.string().optional(), - title2: z.string().optional(), - viewGroup: z.string().optional(), + Type: z.array(z.lazy(() => GetLibraryItemsType$inboundSchema)).optional(), + FieldType: z.array(z.lazy(() => GetLibraryItemsFieldType$inboundSchema)) + .optional(), + size: z.number().int(), + totalSize: z.number().int(), + offset: z.number().int(), + content: z.string(), + allowSync: z.boolean(), + nocache: z.boolean().optional(), + art: z.string(), + identifier: z.string(), + librarySectionID: z.number().int(), + librarySectionTitle: z.string(), + librarySectionUUID: z.string(), + mediaTagPrefix: z.string(), + mediaTagVersion: z.number().int(), + thumb: z.string(), + title1: z.string(), + title2: z.string(), + viewGroup: z.string(), viewMode: z.number().int().optional(), mixedParents: z.boolean().optional(), - Metadata: z.array(z.lazy(() => GetLibraryItemsMetadata$inboundSchema)) - .optional(), + Metadata: z.array(z.lazy(() => GetLibraryItemsMetadata$inboundSchema)), + Meta: z.lazy(() => GetLibraryItemsMeta$inboundSchema).optional(), }).transform((v) => { return remap$(v, { + "Type": "type", + "FieldType": "fieldType", "Metadata": "metadata", + "Meta": "meta", }); }); /** @internal */ export type GetLibraryItemsMediaContainer$Outbound = { - size?: number | undefined; - allowSync?: boolean | undefined; - art?: string | undefined; - identifier?: string | undefined; - librarySectionID?: number | string | undefined; - librarySectionTitle?: string | undefined; - librarySectionUUID?: string | undefined; - mediaTagPrefix?: string | undefined; - mediaTagVersion?: number | undefined; - thumb?: string | undefined; - title1?: string | undefined; - title2?: string | undefined; - viewGroup?: string | undefined; + Type?: Array | undefined; + FieldType?: Array | undefined; + size: number; + totalSize: number; + offset: number; + content: string; + allowSync: boolean; + nocache?: boolean | undefined; + art: string; + identifier: string; + librarySectionID: number; + librarySectionTitle: string; + librarySectionUUID: string; + mediaTagPrefix: string; + mediaTagVersion: number; + thumb: string; + title1: string; + title2: string; + viewGroup: string; viewMode?: number | undefined; mixedParents?: boolean | undefined; - Metadata?: Array | undefined; + Metadata: Array; + Meta?: GetLibraryItemsMeta$Outbound | undefined; }; /** @internal */ @@ -1045,26 +2933,36 @@ export const GetLibraryItemsMediaContainer$outboundSchema: z.ZodType< z.ZodTypeDef, GetLibraryItemsMediaContainer > = z.object({ - size: z.number().int().optional(), - allowSync: z.boolean().optional(), - art: z.string().optional(), - identifier: z.string().optional(), - librarySectionID: z.union([z.number().int(), z.string()]).optional(), - librarySectionTitle: z.string().optional(), - librarySectionUUID: z.string().optional(), - mediaTagPrefix: z.string().optional(), - mediaTagVersion: z.number().int().optional(), - thumb: z.string().optional(), - title1: z.string().optional(), - title2: z.string().optional(), - viewGroup: z.string().optional(), + type: z.array(z.lazy(() => GetLibraryItemsType$outboundSchema)).optional(), + fieldType: z.array(z.lazy(() => GetLibraryItemsFieldType$outboundSchema)) + .optional(), + size: z.number().int(), + totalSize: z.number().int(), + offset: z.number().int(), + content: z.string(), + allowSync: z.boolean(), + nocache: z.boolean().optional(), + art: z.string(), + identifier: z.string(), + librarySectionID: z.number().int(), + librarySectionTitle: z.string(), + librarySectionUUID: z.string(), + mediaTagPrefix: z.string(), + mediaTagVersion: z.number().int(), + thumb: z.string(), + title1: z.string(), + title2: z.string(), + viewGroup: z.string(), viewMode: z.number().int().optional(), mixedParents: z.boolean().optional(), - metadata: z.array(z.lazy(() => GetLibraryItemsMetadata$outboundSchema)) - .optional(), + metadata: z.array(z.lazy(() => GetLibraryItemsMetadata$outboundSchema)), + meta: z.lazy(() => GetLibraryItemsMeta$outboundSchema).optional(), }).transform((v) => { return remap$(v, { + type: "Type", + fieldType: "FieldType", metadata: "Metadata", + meta: "Meta", }); }); diff --git a/src/sdk/models/operations/getmediaproviders.ts b/src/sdk/models/operations/getmediaproviders.ts index da5a2f2f..6e195760 100644 --- a/src/sdk/models/operations/getmediaproviders.ts +++ b/src/sdk/models/operations/getmediaproviders.ts @@ -38,10 +38,19 @@ export type GetMediaProvidersDirectory = { pivot?: Array | undefined; }; +export type Action = { + id: string; + key: string; +}; + export type Feature = { key?: string | undefined; - type?: string | undefined; + type: string; + flavor?: string | undefined; + scrobbleKey?: string | undefined; + unscrobbleKey?: string | undefined; directory?: Array | undefined; + action?: Array | undefined; }; export type MediaProvider = { @@ -300,24 +309,69 @@ export namespace GetMediaProvidersDirectory$ { export type Outbound = GetMediaProvidersDirectory$Outbound; } +/** @internal */ +export const Action$inboundSchema: z.ZodType = z + .object({ + id: z.string(), + key: z.string(), + }); + +/** @internal */ +export type Action$Outbound = { + id: string; + key: string; +}; + +/** @internal */ +export const Action$outboundSchema: z.ZodType< + Action$Outbound, + z.ZodTypeDef, + Action +> = z.object({ + id: z.string(), + key: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Action$ { + /** @deprecated use `Action$inboundSchema` instead. */ + export const inboundSchema = Action$inboundSchema; + /** @deprecated use `Action$outboundSchema` instead. */ + export const outboundSchema = Action$outboundSchema; + /** @deprecated use `Action$Outbound` instead. */ + export type Outbound = Action$Outbound; +} + /** @internal */ export const Feature$inboundSchema: z.ZodType = z.object({ key: z.string().optional(), - type: z.string().optional(), + type: z.string(), + flavor: z.string().optional(), + scrobbleKey: z.string().optional(), + unscrobbleKey: z.string().optional(), Directory: z.array(z.lazy(() => GetMediaProvidersDirectory$inboundSchema)) .optional(), + Action: z.array(z.lazy(() => Action$inboundSchema)).optional(), }).transform((v) => { return remap$(v, { "Directory": "directory", + "Action": "action", }); }); /** @internal */ export type Feature$Outbound = { key?: string | undefined; - type?: string | undefined; + type: string; + flavor?: string | undefined; + scrobbleKey?: string | undefined; + unscrobbleKey?: string | undefined; Directory?: Array | undefined; + Action?: Array | undefined; }; /** @internal */ @@ -327,12 +381,17 @@ export const Feature$outboundSchema: z.ZodType< Feature > = z.object({ key: z.string().optional(), - type: z.string().optional(), + type: z.string(), + flavor: z.string().optional(), + scrobbleKey: z.string().optional(), + unscrobbleKey: z.string().optional(), directory: z.array(z.lazy(() => GetMediaProvidersDirectory$outboundSchema)) .optional(), + action: z.array(z.lazy(() => Action$outboundSchema)).optional(), }).transform((v) => { return remap$(v, { directory: "Directory", + action: "Action", }); }); diff --git a/src/sdk/models/operations/getmetadatabyratingkey.ts b/src/sdk/models/operations/getmetadatabyratingkey.ts index 66c73083..0ced9c3f 100644 --- a/src/sdk/models/operations/getmetadatabyratingkey.ts +++ b/src/sdk/models/operations/getmetadatabyratingkey.ts @@ -13,7 +13,7 @@ export type GetMetaDataByRatingKeyRequest = { ratingKey: number; }; -export type Stream = { +export type GetMetaDataByRatingKeyStream = { id?: number | undefined; streamType?: number | undefined; default?: boolean | undefined; @@ -59,7 +59,7 @@ export type GetMetaDataByRatingKeyPart = { has64bitOffsets?: boolean | undefined; optimizedForStreaming?: boolean | undefined; videoProfile?: string | undefined; - stream?: Array | undefined; + stream?: Array | undefined; }; export type GetMetaDataByRatingKeyMedia = { @@ -248,44 +248,47 @@ export namespace GetMetaDataByRatingKeyRequest$ { } /** @internal */ -export const Stream$inboundSchema: z.ZodType = z - .object({ - id: z.number().int().optional(), - streamType: z.number().int().optional(), - default: z.boolean().optional(), - codec: z.string().optional(), - index: z.number().int().optional(), - bitrate: z.number().int().optional(), - bitDepth: z.number().int().optional(), - chromaLocation: z.string().optional(), - chromaSubsampling: z.string().optional(), - codedHeight: z.number().int().optional(), - codedWidth: z.number().int().optional(), - colorPrimaries: z.string().optional(), - colorRange: z.string().optional(), - colorSpace: z.string().optional(), - colorTrc: z.string().optional(), - frameRate: z.number().int().optional(), - hasScalingMatrix: z.boolean().optional(), - height: z.number().int().optional(), - level: z.number().int().optional(), - profile: z.string().optional(), - refFrames: z.number().int().optional(), - scanType: z.string().optional(), - streamIdentifier: z.string().optional(), - width: z.number().int().optional(), - displayTitle: z.string().optional(), - extendedDisplayTitle: z.string().optional(), - selected: z.boolean().optional(), - channels: z.number().int().optional(), - language: z.string().optional(), - languageTag: z.string().optional(), - languageCode: z.string().optional(), - samplingRate: z.number().int().optional(), - }); +export const GetMetaDataByRatingKeyStream$inboundSchema: z.ZodType< + GetMetaDataByRatingKeyStream, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.number().int().optional(), + streamType: z.number().int().optional(), + default: z.boolean().optional(), + codec: z.string().optional(), + index: z.number().int().optional(), + bitrate: z.number().int().optional(), + bitDepth: z.number().int().optional(), + chromaLocation: z.string().optional(), + chromaSubsampling: z.string().optional(), + codedHeight: z.number().int().optional(), + codedWidth: z.number().int().optional(), + colorPrimaries: z.string().optional(), + colorRange: z.string().optional(), + colorSpace: z.string().optional(), + colorTrc: z.string().optional(), + frameRate: z.number().int().optional(), + hasScalingMatrix: z.boolean().optional(), + height: z.number().int().optional(), + level: z.number().int().optional(), + profile: z.string().optional(), + refFrames: z.number().int().optional(), + scanType: z.string().optional(), + streamIdentifier: z.string().optional(), + width: z.number().int().optional(), + displayTitle: z.string().optional(), + extendedDisplayTitle: z.string().optional(), + selected: z.boolean().optional(), + channels: z.number().int().optional(), + language: z.string().optional(), + languageTag: z.string().optional(), + languageCode: z.string().optional(), + samplingRate: z.number().int().optional(), +}); /** @internal */ -export type Stream$Outbound = { +export type GetMetaDataByRatingKeyStream$Outbound = { id?: number | undefined; streamType?: number | undefined; default?: boolean | undefined; @@ -321,10 +324,10 @@ export type Stream$Outbound = { }; /** @internal */ -export const Stream$outboundSchema: z.ZodType< - Stream$Outbound, +export const GetMetaDataByRatingKeyStream$outboundSchema: z.ZodType< + GetMetaDataByRatingKeyStream$Outbound, z.ZodTypeDef, - Stream + GetMetaDataByRatingKeyStream > = z.object({ id: z.number().int().optional(), streamType: z.number().int().optional(), @@ -364,13 +367,13 @@ export const Stream$outboundSchema: z.ZodType< * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace Stream$ { - /** @deprecated use `Stream$inboundSchema` instead. */ - export const inboundSchema = Stream$inboundSchema; - /** @deprecated use `Stream$outboundSchema` instead. */ - export const outboundSchema = Stream$outboundSchema; - /** @deprecated use `Stream$Outbound` instead. */ - export type Outbound = Stream$Outbound; +export namespace GetMetaDataByRatingKeyStream$ { + /** @deprecated use `GetMetaDataByRatingKeyStream$inboundSchema` instead. */ + export const inboundSchema = GetMetaDataByRatingKeyStream$inboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyStream$outboundSchema` instead. */ + export const outboundSchema = GetMetaDataByRatingKeyStream$outboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyStream$Outbound` instead. */ + export type Outbound = GetMetaDataByRatingKeyStream$Outbound; } /** @internal */ @@ -389,7 +392,8 @@ export const GetMetaDataByRatingKeyPart$inboundSchema: z.ZodType< has64bitOffsets: z.boolean().optional(), optimizedForStreaming: z.boolean().optional(), videoProfile: z.string().optional(), - Stream: z.array(z.lazy(() => Stream$inboundSchema)).optional(), + Stream: z.array(z.lazy(() => GetMetaDataByRatingKeyStream$inboundSchema)) + .optional(), }).transform((v) => { return remap$(v, { "Stream": "stream", @@ -408,7 +412,7 @@ export type GetMetaDataByRatingKeyPart$Outbound = { has64bitOffsets?: boolean | undefined; optimizedForStreaming?: boolean | undefined; videoProfile?: string | undefined; - Stream?: Array | undefined; + Stream?: Array | undefined; }; /** @internal */ @@ -427,7 +431,8 @@ export const GetMetaDataByRatingKeyPart$outboundSchema: z.ZodType< has64bitOffsets: z.boolean().optional(), optimizedForStreaming: z.boolean().optional(), videoProfile: z.string().optional(), - stream: z.array(z.lazy(() => Stream$outboundSchema)).optional(), + stream: z.array(z.lazy(() => GetMetaDataByRatingKeyStream$outboundSchema)) + .optional(), }).transform((v) => { return remap$(v, { stream: "Stream", diff --git a/src/sdk/models/operations/getpin.ts b/src/sdk/models/operations/getpin.ts index 5438763f..5c65ae28 100644 --- a/src/sdk/models/operations/getpin.ts +++ b/src/sdk/models/operations/getpin.ts @@ -6,18 +6,18 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; export const GetPinServerList = [ - "https://plex.tv/api/v2/", + "https://plex.tv/api/v2", ] as const; export type GetPinGlobals = { /** - * The unique identifier for the client application - * - * @remarks - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) + * 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) */ - xPlexClientIdentifier?: string | undefined; + clientID?: string | undefined; + clientName?: string | undefined; + deviceName?: string | undefined; + clientVersion?: string | undefined; + clientPlatform?: string | undefined; }; export type GetPinRequest = { @@ -30,14 +30,13 @@ export type GetPinRequest = { */ strong?: boolean | undefined; /** - * The unique identifier for the client application - * - * @remarks - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) + * 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) */ - xPlexClientIdentifier?: string | undefined; - xPlexProduct?: string | undefined; + clientID?: string | undefined; + clientName?: string | undefined; + deviceName?: string | undefined; + clientVersion?: string | undefined; + clientPlatform?: string | undefined; }; /** @@ -71,7 +70,7 @@ export type GeoData = { /** * The postal code of the location. */ - postalCode: number; + postalCode: string; /** * Indicates if the country has privacy restrictions. */ @@ -113,7 +112,7 @@ export type GetPinAuthPinContainer = { expiresIn?: number | undefined; createdAt: Date; expiresAt: Date; - authToken?: any | null | undefined; + authToken?: string | null | undefined; newRegistration?: any | null | undefined; }; @@ -142,16 +141,28 @@ export const GetPinGlobals$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - "X-Plex-Client-Identifier": z.string().optional(), + ClientID: z.string().optional(), + ClientName: z.string().optional(), + DeviceName: z.string().optional(), + ClientVersion: z.string().optional(), + ClientPlatform: z.string().optional(), }).transform((v) => { return remap$(v, { - "X-Plex-Client-Identifier": "xPlexClientIdentifier", + "ClientID": "clientID", + "ClientName": "clientName", + "DeviceName": "deviceName", + "ClientVersion": "clientVersion", + "ClientPlatform": "clientPlatform", }); }); /** @internal */ export type GetPinGlobals$Outbound = { - "X-Plex-Client-Identifier"?: string | undefined; + ClientID?: string | undefined; + ClientName?: string | undefined; + DeviceName?: string | undefined; + ClientVersion?: string | undefined; + ClientPlatform?: string | undefined; }; /** @internal */ @@ -160,10 +171,18 @@ export const GetPinGlobals$outboundSchema: z.ZodType< z.ZodTypeDef, GetPinGlobals > = z.object({ - xPlexClientIdentifier: z.string().optional(), + clientID: z.string().optional(), + clientName: z.string().optional(), + deviceName: z.string().optional(), + clientVersion: z.string().optional(), + clientPlatform: z.string().optional(), }).transform((v) => { return remap$(v, { - xPlexClientIdentifier: "X-Plex-Client-Identifier", + clientID: "ClientID", + clientName: "ClientName", + deviceName: "DeviceName", + clientVersion: "ClientVersion", + clientPlatform: "ClientPlatform", }); }); @@ -187,20 +206,29 @@ export const GetPinRequest$inboundSchema: z.ZodType< unknown > = z.object({ strong: z.boolean().default(false), - "X-Plex-Client-Identifier": z.string().optional(), - "X-Plex-Product": z.string().optional(), + ClientID: z.string().optional(), + ClientName: z.string().optional(), + DeviceName: z.string().optional(), + ClientVersion: z.string().optional(), + ClientPlatform: z.string().optional(), }).transform((v) => { return remap$(v, { - "X-Plex-Client-Identifier": "xPlexClientIdentifier", - "X-Plex-Product": "xPlexProduct", + "ClientID": "clientID", + "ClientName": "clientName", + "DeviceName": "deviceName", + "ClientVersion": "clientVersion", + "ClientPlatform": "clientPlatform", }); }); /** @internal */ export type GetPinRequest$Outbound = { strong: boolean; - "X-Plex-Client-Identifier"?: string | undefined; - "X-Plex-Product"?: string | undefined; + ClientID?: string | undefined; + ClientName?: string | undefined; + DeviceName?: string | undefined; + ClientVersion?: string | undefined; + ClientPlatform?: string | undefined; }; /** @internal */ @@ -210,12 +238,18 @@ export const GetPinRequest$outboundSchema: z.ZodType< GetPinRequest > = z.object({ strong: z.boolean().default(false), - xPlexClientIdentifier: z.string().optional(), - xPlexProduct: z.string().optional(), + clientID: z.string().optional(), + clientName: z.string().optional(), + deviceName: z.string().optional(), + clientVersion: z.string().optional(), + clientPlatform: z.string().optional(), }).transform((v) => { return remap$(v, { - xPlexClientIdentifier: "X-Plex-Client-Identifier", - xPlexProduct: "X-Plex-Product", + clientID: "ClientID", + clientName: "ClientName", + deviceName: "DeviceName", + clientVersion: "ClientVersion", + clientPlatform: "ClientPlatform", }); }); @@ -241,7 +275,7 @@ export const GeoData$inboundSchema: z.ZodType = city: z.string(), european_union_member: z.boolean().default(false), time_zone: z.string(), - postal_code: z.number().int(), + postal_code: z.string(), in_privacy_restricted_country: z.boolean().default(false), in_privacy_restricted_region: z.boolean().default(false), subdivisions: z.string(), @@ -265,7 +299,7 @@ export type GeoData$Outbound = { city: string; european_union_member: boolean; time_zone: string; - postal_code: number; + postal_code: string; in_privacy_restricted_country: boolean; in_privacy_restricted_region: boolean; subdivisions: string; @@ -284,7 +318,7 @@ export const GeoData$outboundSchema: z.ZodType< city: z.string(), europeanUnionMember: z.boolean().default(false), timeZone: z.string(), - postalCode: z.number().int(), + postalCode: z.string(), inPrivacyRestrictedCountry: z.boolean().default(false), inPrivacyRestrictedRegion: z.boolean().default(false), subdivisions: z.string(), @@ -329,7 +363,7 @@ export const GetPinAuthPinContainer$inboundSchema: z.ZodType< expiresIn: z.number().int().default(900), createdAt: z.string().datetime({ offset: true }).transform(v => new Date(v)), expiresAt: z.string().datetime({ offset: true }).transform(v => new Date(v)), - authToken: z.nullable(z.any()).optional(), + authToken: z.nullable(z.string()).optional(), newRegistration: z.nullable(z.any()).optional(), }); @@ -345,7 +379,7 @@ export type GetPinAuthPinContainer$Outbound = { expiresIn: number; createdAt: string; expiresAt: string; - authToken?: any | null | undefined; + authToken?: string | null | undefined; newRegistration?: any | null | undefined; }; @@ -365,7 +399,7 @@ export const GetPinAuthPinContainer$outboundSchema: z.ZodType< expiresIn: z.number().int().default(900), createdAt: z.date().transform(v => v.toISOString()), expiresAt: z.date().transform(v => v.toISOString()), - authToken: z.nullable(z.any()).optional(), + authToken: z.nullable(z.string()).optional(), newRegistration: z.nullable(z.any()).optional(), }); diff --git a/src/sdk/models/operations/getplaylistcontents.ts b/src/sdk/models/operations/getplaylistcontents.ts index 4da301c8..e42080a0 100644 --- a/src/sdk/models/operations/getplaylistcontents.ts +++ b/src/sdk/models/operations/getplaylistcontents.ts @@ -17,10 +17,10 @@ import { RFCDate } from "../../types/rfcdate.js"; * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries */ export enum GetPlaylistContentsQueryParamType { - One = 1, - Two = 2, - Three = 3, - Four = 4, + Movie = 1, + TvShow = 2, + Season = 3, + Episode = 4, } export type GetPlaylistContentsRequest = { diff --git a/src/sdk/models/operations/getrecentlyadded.ts b/src/sdk/models/operations/getrecentlyadded.ts index 095b5552..875cba64 100644 --- a/src/sdk/models/operations/getrecentlyadded.ts +++ b/src/sdk/models/operations/getrecentlyadded.ts @@ -4,8 +4,65 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { RFCDate } from "../../types/rfcdate.js"; + +/** + * The type of media to retrieve. + * + * @remarks + * 1 = movie + * 2 = show + * 3 = season + * 4 = episode + * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries + */ +export enum Type { + Movie = 1, + TvShow = 2, + Season = 3, + Episode = 4, +} + +/** + * Adds the Meta object to the response + * + * @remarks + */ +export enum IncludeMeta { + Disable = 0, + Enable = 1, +} export type GetRecentlyAddedRequest = { + /** + * The content directory ID. + */ + contentDirectoryID: number; + /** + * Comma-separated list of pinned content directory IDs. + */ + pinnedContentDirectoryID?: string | undefined; + /** + * The library section ID for filtering content. + */ + sectionID?: number | undefined; + /** + * The type of media to retrieve. + * + * @remarks + * 1 = movie + * 2 = show + * 3 = season + * 4 = episode + * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries + */ + type: Type; + /** + * Adds the Meta object to the response + * + * @remarks + */ + includeMeta?: IncludeMeta | undefined; /** * The index of the first item to return. If not specified, the first item will be returned. * @@ -24,42 +81,330 @@ export type GetRecentlyAddedRequest = { xPlexContainerSize?: number | undefined; }; +export type GetRecentlyAddedFilter = { + filter: string; + filterType: string; + key: string; + title: string; + type: string; +}; + +/** + * The direction of the sort. Can be either `asc` or `desc`. + * + * @remarks + */ +export enum GetRecentlyAddedActiveDirection { + Ascending = "asc", + Descending = "desc", +} + +/** + * The direction of the sort. Can be either `asc` or `desc`. + * + * @remarks + */ +export enum GetRecentlyAddedDefaultDirection { + Ascending = "asc", + Descending = "desc", +} + +export type GetRecentlyAddedSort = { + default?: string | undefined; + active?: boolean | undefined; + /** + * The direction of the sort. Can be either `asc` or `desc`. + * + * @remarks + */ + activeDirection?: GetRecentlyAddedActiveDirection | undefined; + /** + * The direction of the sort. Can be either `asc` or `desc`. + * + * @remarks + */ + defaultDirection?: GetRecentlyAddedDefaultDirection | undefined; + descKey?: string | undefined; + firstCharacterKey?: string | undefined; + key: string; + title: string; +}; + +export type GetRecentlyAddedField = { + key: string; + title: string; + type: string; + subType?: string | undefined; +}; + +export type GetRecentlyAddedType = { + key: string; + type: string; + title: string; + active: boolean; + filter?: Array | undefined; + sort?: Array | undefined; + field?: Array | undefined; +}; + +export type GetRecentlyAddedOperator = { + key: string; + title: string; +}; + +export type GetRecentlyAddedFieldType = { + type: string; + operator: Array; +}; + +/** + * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + * + * @remarks + */ +export type Meta = { + type?: Array | undefined; + fieldType?: Array | undefined; +}; + +/** + * The type of media content + * + * @remarks + */ +export enum GetRecentlyAddedHubsType { + Movie = "movie", + TvShow = "show", + Season = "season", + Episode = "episode", +} + +export enum FlattenSeasons { + False = "0", + True = "1", +} + +/** + * Setting that indicates the episode ordering for the show + * + * @remarks + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * aired = TheTVDB (Aired), + * dvd = TheTVDB (DVD), + * absolute = TheTVDB (Absolute)). + */ +export enum ShowOrdering { + None = "None", + TmdbAiring = "tmdbAiring", + Aired = "aired", + Dvd = "dvd", + Absolute = "absolute", +} + +export enum OptimizedForStreaming { + Disable = 0, + Enable = 1, +} + +export enum HasThumbnail { + False = "0", + True = "1", +} + +export type Stream = { + id: number; + /** + * Type of stream (1 = video, 2 = audio, 3 = subtitle) + */ + streamType: number; + /** + * Indicates if this is the default stream + */ + default?: boolean | undefined; + /** + * Indicates if the stream is selected + */ + selected?: boolean | undefined; + /** + * Codec used by the stream + */ + codec: string; + /** + * The index of the stream + */ + index: number; + /** + * The bitrate of the stream in kbps + */ + bitrate?: number | undefined; + /** + * The color primaries of the video stream + */ + colorPrimaries?: string | undefined; + /** + * The color range of the video stream + */ + colorRange?: string | undefined; + /** + * The color space of the video stream + */ + colorSpace?: string | undefined; + /** + * The transfer characteristics (TRC) of the video stream + */ + colorTrc?: string | undefined; + /** + * The bit depth of the video stream + */ + bitDepth?: number | undefined; + /** + * The chroma location of the video stream + */ + chromaLocation?: string | undefined; + /** + * The identifier of the video stream + */ + streamIdentifier?: string | undefined; + /** + * The chroma subsampling format + */ + chromaSubsampling?: string | undefined; + /** + * The coded height of the video stream + */ + codedHeight?: number | undefined; + /** + * The coded width of the video stream + */ + codedWidth?: number | undefined; + /** + * The frame rate of the video stream + */ + frameRate?: number | undefined; + /** + * Indicates if the stream has a scaling matrix + */ + hasScalingMatrix?: boolean | undefined; + hearingImpaired?: boolean | undefined; + closedCaptions?: boolean | undefined; + embeddedInVideo?: string | undefined; + /** + * The height of the video stream + */ + height?: number | undefined; + /** + * The level of the video codec + */ + level?: number | undefined; + /** + * The profile of the video codec + */ + profile?: string | undefined; + /** + * Number of reference frames + */ + refFrames?: number | undefined; + /** + * The scan type (progressive or interlaced) + */ + scanType?: string | undefined; + /** + * The width of the video stream + */ + width?: number | undefined; + /** + * Display title of the stream + */ + displayTitle?: string | undefined; + /** + * Extended display title of the stream + */ + extendedDisplayTitle?: string | undefined; + /** + * Number of audio channels (for audio streams) + */ + channels?: number | undefined; + /** + * The language of the stream (for audio/subtitle streams) + */ + language?: string | undefined; + /** + * Language tag of the stream + */ + languageTag?: string | undefined; + /** + * Language code of the stream + */ + languageCode?: string | undefined; + /** + * The audio channel layout + */ + audioChannelLayout?: string | undefined; + /** + * Sampling rate of the audio stream in Hz + */ + samplingRate?: number | undefined; + /** + * Title of the subtitle track (for subtitle streams) + */ + title?: string | undefined; + /** + * Indicates if the subtitle stream can auto-sync + */ + canAutoSync?: boolean | undefined; +}; + export type Part = { - id?: number | undefined; - key?: string | undefined; - duration?: number | undefined; - file?: string | undefined; - size?: number | undefined; - container?: string | undefined; + id: number; + key: string; + duration: number; + file: string; + size: number; + /** + * The container format of the media file. + * + * @remarks + */ + container: string; + audioProfile?: string | undefined; has64bitOffsets?: boolean | undefined; - hasThumbnail?: number | undefined; optimizedForStreaming?: boolean | undefined; - videoProfile?: string | undefined; + videoProfile: string; + indexes?: string | undefined; + hasThumbnail?: HasThumbnail | undefined; + stream?: Array | undefined; }; export type Media = { - id?: number | undefined; - duration?: number | undefined; - bitrate?: number | undefined; - width?: number | undefined; - height?: number | undefined; - aspectRatio?: number | undefined; - audioChannels?: number | undefined; - audioCodec?: string | undefined; - videoCodec?: string | undefined; - videoResolution?: number | undefined; - container?: string | undefined; - videoFrameRate?: string | undefined; - optimizedForStreaming?: number | undefined; + id: number; + duration: number; + bitrate: number; + width: number; + height: number; + aspectRatio: number; + audioProfile?: string | undefined; + audioChannels: number; + audioCodec: string; + videoCodec: string; + videoResolution: string; + container: string; + videoFrameRate: string; + videoProfile: string; + hasVoiceActivity?: boolean | undefined; + optimizedForStreaming?: OptimizedForStreaming | undefined; has64bitOffsets?: boolean | undefined; - videoProfile?: string | undefined; - part?: Array | undefined; + part: Array; }; export type Genre = { tag?: string | undefined; }; +export type Country = { + tag?: string | undefined; +}; + export type Director = { tag?: string | undefined; }; @@ -68,61 +413,217 @@ export type Writer = { tag?: string | undefined; }; -export type Country = { +export type Collection = { tag?: string | undefined; }; export type Role = { + /** + * The ID of the tag or actor. + */ + id?: number | undefined; + /** + * The filter used to find the actor or tag. + */ + filter?: string | undefined; + /** + * The thumbnail of the actor + */ + thumb?: string | undefined; + /** + * The name of the tag or actor. + */ tag?: string | undefined; + /** + * Unique identifier for the tag. + */ + tagKey?: string | undefined; + /** + * The role of the actor or tag in the media. + */ + role?: string | undefined; +}; + +export type MediaGuid = { + /** + * Can be one of the following formats: + * + * @remarks + * imdb://tt13015952, tmdb://2434012, tvdb://7945991 + */ + id: string; +}; + +export type UltraBlurColors = { + topLeft: string; + topRight: string; + bottomRight: string; + bottomLeft: string; +}; + +export type MetaDataRating = { + /** + * A URI or path to the rating image. + */ + image: string; + /** + * The value of the rating. + */ + value: number; + /** + * The type of rating (e.g., audience, critic). + */ + type: string; +}; + +export enum GetRecentlyAddedHubsResponseType { + CoverPoster = "coverPoster", + Background = "background", + Snapshot = "snapshot", + ClearLogo = "clearLogo", +} + +export type GetRecentlyAddedImage = { + alt: string; + type: GetRecentlyAddedHubsResponseType; + url: string; }; export type GetRecentlyAddedMetadata = { - allowSync?: boolean | undefined; + /** + * The rating key (Media ID) of this media item. + * + * @remarks + * Note: This is always an integer, but is represented as a string in the API. + */ + ratingKey: string; + key: string; + guid: string; + studio?: string | undefined; + skipChildren?: boolean | undefined; librarySectionID?: number | undefined; librarySectionTitle?: string | undefined; - librarySectionUUID?: string | undefined; - ratingKey?: number | undefined; - key?: string | undefined; - guid?: string | undefined; - studio?: string | undefined; - type?: string | undefined; - title?: string | undefined; + librarySectionKey?: string | undefined; + /** + * The type of media content + * + * @remarks + */ + type: GetRecentlyAddedHubsType; + title: string; + slug?: string | undefined; contentRating?: string | undefined; - summary?: string | undefined; + summary: string; rating?: number | undefined; audienceRating?: number | undefined; year?: number | undefined; + seasonCount?: number | undefined; tagline?: string | undefined; + flattenSeasons?: FlattenSeasons | undefined; + /** + * Setting that indicates the episode ordering for the show + * + * @remarks + * None = Library default, + * tmdbAiring = The Movie Database (Aired), + * aired = TheTVDB (Aired), + * dvd = TheTVDB (DVD), + * absolute = TheTVDB (Absolute)). + */ + showOrdering?: ShowOrdering | undefined; thumb?: string | undefined; art?: string | undefined; + banner?: string | undefined; duration?: number | undefined; - originallyAvailableAt?: Date | undefined; - addedAt?: number | undefined; + originallyAvailableAt?: RFCDate | undefined; + /** + * Unix epoch datetime in seconds + */ + addedAt: number; + /** + * Unix epoch datetime in seconds + */ updatedAt?: number | undefined; audienceRatingImage?: string | undefined; chapterSource?: string | undefined; primaryExtraKey?: string | undefined; ratingImage?: string | undefined; + grandparentRatingKey?: string | undefined; + grandparentGuid?: string | undefined; + grandparentKey?: string | undefined; + grandparentTitle?: string | undefined; + grandparentThumb?: string | undefined; + parentSlug?: string | undefined; + grandparentSlug?: string | undefined; + grandparentArt?: string | undefined; + grandparentTheme?: string | undefined; + /** + * The Media object is only included when type query is `4` or higher. + * + * @remarks + */ media?: Array | undefined; genre?: Array | undefined; + country?: Array | undefined; director?: Array | undefined; writer?: Array | undefined; - country?: Array | undefined; + collection?: Array | undefined; role?: Array | undefined; + /** + * The Guid object is only included in the response if the `includeGuids` parameter is set to `1`. + * + * @remarks + */ + mediaGuid?: Array | undefined; + ultraBlurColors?: UltraBlurColors | undefined; + metaDataRating?: Array | undefined; + image?: Array | undefined; + titleSort?: string | undefined; + viewCount?: number | undefined; + lastViewedAt?: number | undefined; + originalTitle?: string | undefined; + viewOffset?: number | undefined; + skipCount?: number | undefined; + index?: number | undefined; + theme?: string | undefined; + leafCount?: number | undefined; + viewedLeafCount?: number | undefined; + childCount?: number | undefined; + hasPremiumExtras?: string | undefined; + hasPremiumPrimaryExtra?: string | undefined; + /** + * The rating key of the parent item. + * + * @remarks + */ + parentRatingKey?: string | undefined; + parentGuid?: string | undefined; + parentStudio?: string | undefined; + parentKey?: string | undefined; + parentTitle?: string | undefined; + parentIndex?: number | undefined; + parentYear?: number | undefined; + parentThumb?: string | undefined; + parentTheme?: string | undefined; }; export type GetRecentlyAddedMediaContainer = { - size?: number | undefined; - allowSync?: boolean | undefined; + size: number; + offset?: number | undefined; + totalSize?: number | undefined; identifier?: string | undefined; - mediaTagPrefix?: string | undefined; - mediaTagVersion?: number | undefined; - mixedParents?: boolean | undefined; + allowSync?: boolean | undefined; + /** + * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + * + * @remarks + */ + meta?: Meta | undefined; metadata?: Array | undefined; }; /** - * The recently added content + * A successful response with recently added content. */ export type GetRecentlyAddedResponseBody = { mediaContainer?: GetRecentlyAddedMediaContainer | undefined; @@ -142,17 +643,61 @@ export type GetRecentlyAddedResponse = { */ rawResponse: Response; /** - * The recently added content + * A successful response with recently added content. */ object?: GetRecentlyAddedResponseBody | undefined; }; +/** @internal */ +export const Type$inboundSchema: z.ZodNativeEnum = z.nativeEnum( + Type, +); + +/** @internal */ +export const Type$outboundSchema: z.ZodNativeEnum = + Type$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Type$ { + /** @deprecated use `Type$inboundSchema` instead. */ + export const inboundSchema = Type$inboundSchema; + /** @deprecated use `Type$outboundSchema` instead. */ + export const outboundSchema = Type$outboundSchema; +} + +/** @internal */ +export const IncludeMeta$inboundSchema: z.ZodNativeEnum = z + .nativeEnum(IncludeMeta); + +/** @internal */ +export const IncludeMeta$outboundSchema: z.ZodNativeEnum = + IncludeMeta$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace IncludeMeta$ { + /** @deprecated use `IncludeMeta$inboundSchema` instead. */ + export const inboundSchema = IncludeMeta$inboundSchema; + /** @deprecated use `IncludeMeta$outboundSchema` instead. */ + export const outboundSchema = IncludeMeta$outboundSchema; +} + /** @internal */ export const GetRecentlyAddedRequest$inboundSchema: z.ZodType< GetRecentlyAddedRequest, z.ZodTypeDef, unknown > = z.object({ + contentDirectoryID: z.number().int(), + pinnedContentDirectoryID: z.string().optional(), + sectionID: z.number().int().optional(), + type: Type$inboundSchema, + includeMeta: IncludeMeta$inboundSchema, "X-Plex-Container-Start": z.number().int().default(0), "X-Plex-Container-Size": z.number().int().default(50), }).transform((v) => { @@ -164,6 +709,11 @@ export const GetRecentlyAddedRequest$inboundSchema: z.ZodType< /** @internal */ export type GetRecentlyAddedRequest$Outbound = { + contentDirectoryID: number; + pinnedContentDirectoryID?: string | undefined; + sectionID?: number | undefined; + type: number; + includeMeta: number; "X-Plex-Container-Start": number; "X-Plex-Container-Size": number; }; @@ -174,6 +724,11 @@ export const GetRecentlyAddedRequest$outboundSchema: z.ZodType< z.ZodTypeDef, GetRecentlyAddedRequest > = z.object({ + contentDirectoryID: z.number().int(), + pinnedContentDirectoryID: z.string().optional(), + sectionID: z.number().int().optional(), + type: Type$outboundSchema, + includeMeta: IncludeMeta$outboundSchema.default(IncludeMeta.Disable), xPlexContainerStart: z.number().int().default(0), xPlexContainerSize: z.number().int().default(50), }).transform((v) => { @@ -196,48 +751,709 @@ export namespace GetRecentlyAddedRequest$ { export type Outbound = GetRecentlyAddedRequest$Outbound; } +/** @internal */ +export const GetRecentlyAddedFilter$inboundSchema: z.ZodType< + GetRecentlyAddedFilter, + z.ZodTypeDef, + unknown +> = z.object({ + filter: z.string(), + filterType: z.string(), + key: z.string(), + title: z.string(), + type: z.string(), +}); + +/** @internal */ +export type GetRecentlyAddedFilter$Outbound = { + filter: string; + filterType: string; + key: string; + title: string; + type: string; +}; + +/** @internal */ +export const GetRecentlyAddedFilter$outboundSchema: z.ZodType< + GetRecentlyAddedFilter$Outbound, + z.ZodTypeDef, + GetRecentlyAddedFilter +> = z.object({ + filter: z.string(), + filterType: z.string(), + key: z.string(), + title: z.string(), + type: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedFilter$ { + /** @deprecated use `GetRecentlyAddedFilter$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedFilter$inboundSchema; + /** @deprecated use `GetRecentlyAddedFilter$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedFilter$outboundSchema; + /** @deprecated use `GetRecentlyAddedFilter$Outbound` instead. */ + export type Outbound = GetRecentlyAddedFilter$Outbound; +} + +/** @internal */ +export const GetRecentlyAddedActiveDirection$inboundSchema: z.ZodNativeEnum< + typeof GetRecentlyAddedActiveDirection +> = z.nativeEnum(GetRecentlyAddedActiveDirection); + +/** @internal */ +export const GetRecentlyAddedActiveDirection$outboundSchema: z.ZodNativeEnum< + typeof GetRecentlyAddedActiveDirection +> = GetRecentlyAddedActiveDirection$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedActiveDirection$ { + /** @deprecated use `GetRecentlyAddedActiveDirection$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedActiveDirection$inboundSchema; + /** @deprecated use `GetRecentlyAddedActiveDirection$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedActiveDirection$outboundSchema; +} + +/** @internal */ +export const GetRecentlyAddedDefaultDirection$inboundSchema: z.ZodNativeEnum< + typeof GetRecentlyAddedDefaultDirection +> = z.nativeEnum(GetRecentlyAddedDefaultDirection); + +/** @internal */ +export const GetRecentlyAddedDefaultDirection$outboundSchema: z.ZodNativeEnum< + typeof GetRecentlyAddedDefaultDirection +> = GetRecentlyAddedDefaultDirection$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedDefaultDirection$ { + /** @deprecated use `GetRecentlyAddedDefaultDirection$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedDefaultDirection$inboundSchema; + /** @deprecated use `GetRecentlyAddedDefaultDirection$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedDefaultDirection$outboundSchema; +} + +/** @internal */ +export const GetRecentlyAddedSort$inboundSchema: z.ZodType< + GetRecentlyAddedSort, + z.ZodTypeDef, + unknown +> = z.object({ + default: z.string().optional(), + active: z.boolean().optional(), + activeDirection: GetRecentlyAddedActiveDirection$inboundSchema.default( + GetRecentlyAddedActiveDirection.Ascending, + ), + defaultDirection: GetRecentlyAddedDefaultDirection$inboundSchema.default( + GetRecentlyAddedDefaultDirection.Ascending, + ), + descKey: z.string().optional(), + firstCharacterKey: z.string().optional(), + key: z.string(), + title: z.string(), +}); + +/** @internal */ +export type GetRecentlyAddedSort$Outbound = { + default?: string | undefined; + active?: boolean | undefined; + activeDirection: string; + defaultDirection: string; + descKey?: string | undefined; + firstCharacterKey?: string | undefined; + key: string; + title: string; +}; + +/** @internal */ +export const GetRecentlyAddedSort$outboundSchema: z.ZodType< + GetRecentlyAddedSort$Outbound, + z.ZodTypeDef, + GetRecentlyAddedSort +> = z.object({ + default: z.string().optional(), + active: z.boolean().optional(), + activeDirection: GetRecentlyAddedActiveDirection$outboundSchema.default( + GetRecentlyAddedActiveDirection.Ascending, + ), + defaultDirection: GetRecentlyAddedDefaultDirection$outboundSchema.default( + GetRecentlyAddedDefaultDirection.Ascending, + ), + descKey: z.string().optional(), + firstCharacterKey: z.string().optional(), + key: z.string(), + title: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedSort$ { + /** @deprecated use `GetRecentlyAddedSort$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedSort$inboundSchema; + /** @deprecated use `GetRecentlyAddedSort$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedSort$outboundSchema; + /** @deprecated use `GetRecentlyAddedSort$Outbound` instead. */ + export type Outbound = GetRecentlyAddedSort$Outbound; +} + +/** @internal */ +export const GetRecentlyAddedField$inboundSchema: z.ZodType< + GetRecentlyAddedField, + z.ZodTypeDef, + unknown +> = z.object({ + key: z.string(), + title: z.string(), + type: z.string(), + subType: z.string().optional(), +}); + +/** @internal */ +export type GetRecentlyAddedField$Outbound = { + key: string; + title: string; + type: string; + subType?: string | undefined; +}; + +/** @internal */ +export const GetRecentlyAddedField$outboundSchema: z.ZodType< + GetRecentlyAddedField$Outbound, + z.ZodTypeDef, + GetRecentlyAddedField +> = z.object({ + key: z.string(), + title: z.string(), + type: z.string(), + subType: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedField$ { + /** @deprecated use `GetRecentlyAddedField$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedField$inboundSchema; + /** @deprecated use `GetRecentlyAddedField$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedField$outboundSchema; + /** @deprecated use `GetRecentlyAddedField$Outbound` instead. */ + export type Outbound = GetRecentlyAddedField$Outbound; +} + +/** @internal */ +export const GetRecentlyAddedType$inboundSchema: z.ZodType< + GetRecentlyAddedType, + z.ZodTypeDef, + unknown +> = z.object({ + key: z.string(), + type: z.string(), + title: z.string(), + active: z.boolean(), + Filter: z.array(z.lazy(() => GetRecentlyAddedFilter$inboundSchema)) + .optional(), + Sort: z.array(z.lazy(() => GetRecentlyAddedSort$inboundSchema)).optional(), + Field: z.array(z.lazy(() => GetRecentlyAddedField$inboundSchema)).optional(), +}).transform((v) => { + return remap$(v, { + "Filter": "filter", + "Sort": "sort", + "Field": "field", + }); +}); + +/** @internal */ +export type GetRecentlyAddedType$Outbound = { + key: string; + type: string; + title: string; + active: boolean; + Filter?: Array | undefined; + Sort?: Array | undefined; + Field?: Array | undefined; +}; + +/** @internal */ +export const GetRecentlyAddedType$outboundSchema: z.ZodType< + GetRecentlyAddedType$Outbound, + z.ZodTypeDef, + GetRecentlyAddedType +> = z.object({ + key: z.string(), + type: z.string(), + title: z.string(), + active: z.boolean(), + filter: z.array(z.lazy(() => GetRecentlyAddedFilter$outboundSchema)) + .optional(), + sort: z.array(z.lazy(() => GetRecentlyAddedSort$outboundSchema)).optional(), + field: z.array(z.lazy(() => GetRecentlyAddedField$outboundSchema)).optional(), +}).transform((v) => { + return remap$(v, { + filter: "Filter", + sort: "Sort", + field: "Field", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedType$ { + /** @deprecated use `GetRecentlyAddedType$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedType$inboundSchema; + /** @deprecated use `GetRecentlyAddedType$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedType$outboundSchema; + /** @deprecated use `GetRecentlyAddedType$Outbound` instead. */ + export type Outbound = GetRecentlyAddedType$Outbound; +} + +/** @internal */ +export const GetRecentlyAddedOperator$inboundSchema: z.ZodType< + GetRecentlyAddedOperator, + z.ZodTypeDef, + unknown +> = z.object({ + key: z.string(), + title: z.string(), +}); + +/** @internal */ +export type GetRecentlyAddedOperator$Outbound = { + key: string; + title: string; +}; + +/** @internal */ +export const GetRecentlyAddedOperator$outboundSchema: z.ZodType< + GetRecentlyAddedOperator$Outbound, + z.ZodTypeDef, + GetRecentlyAddedOperator +> = z.object({ + key: z.string(), + title: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedOperator$ { + /** @deprecated use `GetRecentlyAddedOperator$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedOperator$inboundSchema; + /** @deprecated use `GetRecentlyAddedOperator$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedOperator$outboundSchema; + /** @deprecated use `GetRecentlyAddedOperator$Outbound` instead. */ + export type Outbound = GetRecentlyAddedOperator$Outbound; +} + +/** @internal */ +export const GetRecentlyAddedFieldType$inboundSchema: z.ZodType< + GetRecentlyAddedFieldType, + z.ZodTypeDef, + unknown +> = z.object({ + type: z.string(), + Operator: z.array(z.lazy(() => GetRecentlyAddedOperator$inboundSchema)), +}).transform((v) => { + return remap$(v, { + "Operator": "operator", + }); +}); + +/** @internal */ +export type GetRecentlyAddedFieldType$Outbound = { + type: string; + Operator: Array; +}; + +/** @internal */ +export const GetRecentlyAddedFieldType$outboundSchema: z.ZodType< + GetRecentlyAddedFieldType$Outbound, + z.ZodTypeDef, + GetRecentlyAddedFieldType +> = z.object({ + type: z.string(), + operator: z.array(z.lazy(() => GetRecentlyAddedOperator$outboundSchema)), +}).transform((v) => { + return remap$(v, { + operator: "Operator", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedFieldType$ { + /** @deprecated use `GetRecentlyAddedFieldType$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedFieldType$inboundSchema; + /** @deprecated use `GetRecentlyAddedFieldType$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedFieldType$outboundSchema; + /** @deprecated use `GetRecentlyAddedFieldType$Outbound` instead. */ + export type Outbound = GetRecentlyAddedFieldType$Outbound; +} + +/** @internal */ +export const Meta$inboundSchema: z.ZodType = z + .object({ + Type: z.array(z.lazy(() => GetRecentlyAddedType$inboundSchema)).optional(), + FieldType: z.array(z.lazy(() => GetRecentlyAddedFieldType$inboundSchema)) + .optional(), + }).transform((v) => { + return remap$(v, { + "Type": "type", + "FieldType": "fieldType", + }); + }); + +/** @internal */ +export type Meta$Outbound = { + Type?: Array | undefined; + FieldType?: Array | undefined; +}; + +/** @internal */ +export const Meta$outboundSchema: z.ZodType = + z.object({ + type: z.array(z.lazy(() => GetRecentlyAddedType$outboundSchema)).optional(), + fieldType: z.array(z.lazy(() => GetRecentlyAddedFieldType$outboundSchema)) + .optional(), + }).transform((v) => { + return remap$(v, { + type: "Type", + fieldType: "FieldType", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Meta$ { + /** @deprecated use `Meta$inboundSchema` instead. */ + export const inboundSchema = Meta$inboundSchema; + /** @deprecated use `Meta$outboundSchema` instead. */ + export const outboundSchema = Meta$outboundSchema; + /** @deprecated use `Meta$Outbound` instead. */ + export type Outbound = Meta$Outbound; +} + +/** @internal */ +export const GetRecentlyAddedHubsType$inboundSchema: z.ZodNativeEnum< + typeof GetRecentlyAddedHubsType +> = z.nativeEnum(GetRecentlyAddedHubsType); + +/** @internal */ +export const GetRecentlyAddedHubsType$outboundSchema: z.ZodNativeEnum< + typeof GetRecentlyAddedHubsType +> = GetRecentlyAddedHubsType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedHubsType$ { + /** @deprecated use `GetRecentlyAddedHubsType$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedHubsType$inboundSchema; + /** @deprecated use `GetRecentlyAddedHubsType$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedHubsType$outboundSchema; +} + +/** @internal */ +export const FlattenSeasons$inboundSchema: z.ZodNativeEnum< + typeof FlattenSeasons +> = z.nativeEnum(FlattenSeasons); + +/** @internal */ +export const FlattenSeasons$outboundSchema: z.ZodNativeEnum< + typeof FlattenSeasons +> = FlattenSeasons$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace FlattenSeasons$ { + /** @deprecated use `FlattenSeasons$inboundSchema` instead. */ + export const inboundSchema = FlattenSeasons$inboundSchema; + /** @deprecated use `FlattenSeasons$outboundSchema` instead. */ + export const outboundSchema = FlattenSeasons$outboundSchema; +} + +/** @internal */ +export const ShowOrdering$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(ShowOrdering); + +/** @internal */ +export const ShowOrdering$outboundSchema: z.ZodNativeEnum = + ShowOrdering$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ShowOrdering$ { + /** @deprecated use `ShowOrdering$inboundSchema` instead. */ + export const inboundSchema = ShowOrdering$inboundSchema; + /** @deprecated use `ShowOrdering$outboundSchema` instead. */ + export const outboundSchema = ShowOrdering$outboundSchema; +} + +/** @internal */ +export const OptimizedForStreaming$inboundSchema: z.ZodNativeEnum< + typeof OptimizedForStreaming +> = z.nativeEnum(OptimizedForStreaming); + +/** @internal */ +export const OptimizedForStreaming$outboundSchema: z.ZodNativeEnum< + typeof OptimizedForStreaming +> = OptimizedForStreaming$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace OptimizedForStreaming$ { + /** @deprecated use `OptimizedForStreaming$inboundSchema` instead. */ + export const inboundSchema = OptimizedForStreaming$inboundSchema; + /** @deprecated use `OptimizedForStreaming$outboundSchema` instead. */ + export const outboundSchema = OptimizedForStreaming$outboundSchema; +} + +/** @internal */ +export const HasThumbnail$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(HasThumbnail); + +/** @internal */ +export const HasThumbnail$outboundSchema: z.ZodNativeEnum = + HasThumbnail$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace HasThumbnail$ { + /** @deprecated use `HasThumbnail$inboundSchema` instead. */ + export const inboundSchema = HasThumbnail$inboundSchema; + /** @deprecated use `HasThumbnail$outboundSchema` instead. */ + export const outboundSchema = HasThumbnail$outboundSchema; +} + +/** @internal */ +export const Stream$inboundSchema: z.ZodType = z + .object({ + id: z.number().int(), + streamType: z.number().int(), + default: z.boolean().optional(), + selected: z.boolean().optional(), + codec: z.string(), + index: z.number().int(), + bitrate: z.number().int().optional(), + colorPrimaries: z.string().optional(), + colorRange: z.string().optional(), + colorSpace: z.string().optional(), + colorTrc: z.string().optional(), + bitDepth: z.number().int().optional(), + chromaLocation: z.string().optional(), + streamIdentifier: z.string().optional(), + chromaSubsampling: z.string().optional(), + codedHeight: z.number().int().optional(), + codedWidth: z.number().int().optional(), + frameRate: z.number().optional(), + hasScalingMatrix: z.boolean().optional(), + hearingImpaired: z.boolean().optional(), + closedCaptions: z.boolean().optional(), + embeddedInVideo: z.string().optional(), + height: z.number().int().optional(), + level: z.number().int().optional(), + profile: z.string().optional(), + refFrames: z.number().int().optional(), + scanType: z.string().optional(), + width: z.number().int().optional(), + displayTitle: z.string().optional(), + extendedDisplayTitle: z.string().optional(), + channels: z.number().int().optional(), + language: z.string().optional(), + languageTag: z.string().optional(), + languageCode: z.string().optional(), + audioChannelLayout: z.string().optional(), + samplingRate: z.number().int().optional(), + title: z.string().optional(), + canAutoSync: z.boolean().optional(), + }); + +/** @internal */ +export type Stream$Outbound = { + id: number; + streamType: number; + default?: boolean | undefined; + selected?: boolean | undefined; + codec: string; + index: number; + bitrate?: number | undefined; + colorPrimaries?: string | undefined; + colorRange?: string | undefined; + colorSpace?: string | undefined; + colorTrc?: string | undefined; + bitDepth?: number | undefined; + chromaLocation?: string | undefined; + streamIdentifier?: string | undefined; + chromaSubsampling?: string | undefined; + codedHeight?: number | undefined; + codedWidth?: number | undefined; + frameRate?: number | undefined; + hasScalingMatrix?: boolean | undefined; + hearingImpaired?: boolean | undefined; + closedCaptions?: boolean | undefined; + embeddedInVideo?: string | undefined; + height?: number | undefined; + level?: number | undefined; + profile?: string | undefined; + refFrames?: number | undefined; + scanType?: string | undefined; + width?: number | undefined; + displayTitle?: string | undefined; + extendedDisplayTitle?: string | undefined; + channels?: number | undefined; + language?: string | undefined; + languageTag?: string | undefined; + languageCode?: string | undefined; + audioChannelLayout?: string | undefined; + samplingRate?: number | undefined; + title?: string | undefined; + canAutoSync?: boolean | undefined; +}; + +/** @internal */ +export const Stream$outboundSchema: z.ZodType< + Stream$Outbound, + z.ZodTypeDef, + Stream +> = z.object({ + id: z.number().int(), + streamType: z.number().int(), + default: z.boolean().optional(), + selected: z.boolean().optional(), + codec: z.string(), + index: z.number().int(), + bitrate: z.number().int().optional(), + colorPrimaries: z.string().optional(), + colorRange: z.string().optional(), + colorSpace: z.string().optional(), + colorTrc: z.string().optional(), + bitDepth: z.number().int().optional(), + chromaLocation: z.string().optional(), + streamIdentifier: z.string().optional(), + chromaSubsampling: z.string().optional(), + codedHeight: z.number().int().optional(), + codedWidth: z.number().int().optional(), + frameRate: z.number().optional(), + hasScalingMatrix: z.boolean().optional(), + hearingImpaired: z.boolean().optional(), + closedCaptions: z.boolean().optional(), + embeddedInVideo: z.string().optional(), + height: z.number().int().optional(), + level: z.number().int().optional(), + profile: z.string().optional(), + refFrames: z.number().int().optional(), + scanType: z.string().optional(), + width: z.number().int().optional(), + displayTitle: z.string().optional(), + extendedDisplayTitle: z.string().optional(), + channels: z.number().int().optional(), + language: z.string().optional(), + languageTag: z.string().optional(), + languageCode: z.string().optional(), + audioChannelLayout: z.string().optional(), + samplingRate: z.number().int().optional(), + title: z.string().optional(), + canAutoSync: z.boolean().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Stream$ { + /** @deprecated use `Stream$inboundSchema` instead. */ + export const inboundSchema = Stream$inboundSchema; + /** @deprecated use `Stream$outboundSchema` instead. */ + export const outboundSchema = Stream$outboundSchema; + /** @deprecated use `Stream$Outbound` instead. */ + export type Outbound = Stream$Outbound; +} + /** @internal */ export const Part$inboundSchema: z.ZodType = z .object({ - id: z.number().optional(), - key: z.string().optional(), - duration: z.number().optional(), - file: z.string().optional(), - size: z.number().optional(), - container: z.string().optional(), + id: z.number().int(), + key: z.string(), + duration: z.number().int(), + file: z.string(), + size: z.number().int(), + container: z.string(), + audioProfile: z.string().optional(), has64bitOffsets: z.boolean().optional(), - hasThumbnail: z.number().optional(), optimizedForStreaming: z.boolean().optional(), - videoProfile: z.string().optional(), + videoProfile: z.string(), + indexes: z.string().optional(), + hasThumbnail: HasThumbnail$inboundSchema.default(HasThumbnail.False), + Stream: z.array(z.lazy(() => Stream$inboundSchema)).optional(), + }).transform((v) => { + return remap$(v, { + "Stream": "stream", + }); }); /** @internal */ export type Part$Outbound = { - id?: number | undefined; - key?: string | undefined; - duration?: number | undefined; - file?: string | undefined; - size?: number | undefined; - container?: string | undefined; + id: number; + key: string; + duration: number; + file: string; + size: number; + container: string; + audioProfile?: string | undefined; has64bitOffsets?: boolean | undefined; - hasThumbnail?: number | undefined; optimizedForStreaming?: boolean | undefined; - videoProfile?: string | undefined; + videoProfile: string; + indexes?: string | undefined; + hasThumbnail: string; + Stream?: Array | undefined; }; /** @internal */ export const Part$outboundSchema: z.ZodType = z.object({ - id: z.number().optional(), - key: z.string().optional(), - duration: z.number().optional(), - file: z.string().optional(), - size: z.number().optional(), - container: z.string().optional(), + id: z.number().int(), + key: z.string(), + duration: z.number().int(), + file: z.string(), + size: z.number().int(), + container: z.string(), + audioProfile: z.string().optional(), has64bitOffsets: z.boolean().optional(), - hasThumbnail: z.number().optional(), optimizedForStreaming: z.boolean().optional(), - videoProfile: z.string().optional(), + videoProfile: z.string(), + indexes: z.string().optional(), + hasThumbnail: HasThumbnail$outboundSchema.default(HasThumbnail.False), + stream: z.array(z.lazy(() => Stream$outboundSchema)).optional(), + }).transform((v) => { + return remap$(v, { + stream: "Stream", + }); }); /** @@ -256,22 +1472,24 @@ export namespace Part$ { /** @internal */ export const Media$inboundSchema: z.ZodType = z .object({ - id: z.number().optional(), - duration: z.number().optional(), - bitrate: z.number().optional(), - width: z.number().optional(), - height: z.number().optional(), - aspectRatio: z.number().optional(), - audioChannels: z.number().optional(), - audioCodec: z.string().optional(), - videoCodec: z.string().optional(), - videoResolution: z.number().optional(), - container: z.string().optional(), - videoFrameRate: z.string().optional(), - optimizedForStreaming: z.number().optional(), + id: z.number().int(), + duration: z.number().int(), + bitrate: z.number().int(), + width: z.number().int(), + height: z.number().int(), + aspectRatio: z.number(), + audioProfile: z.string().optional(), + audioChannels: z.number().int(), + audioCodec: z.string(), + videoCodec: z.string(), + videoResolution: z.string(), + container: z.string(), + videoFrameRate: z.string(), + videoProfile: z.string(), + hasVoiceActivity: z.boolean().optional(), + optimizedForStreaming: OptimizedForStreaming$inboundSchema, has64bitOffsets: z.boolean().optional(), - videoProfile: z.string().optional(), - Part: z.array(z.lazy(() => Part$inboundSchema)).optional(), + Part: z.array(z.lazy(() => Part$inboundSchema)), }).transform((v) => { return remap$(v, { "Part": "part", @@ -280,22 +1498,24 @@ export const Media$inboundSchema: z.ZodType = z /** @internal */ export type Media$Outbound = { - id?: number | undefined; - duration?: number | undefined; - bitrate?: number | undefined; - width?: number | undefined; - height?: number | undefined; - aspectRatio?: number | undefined; - audioChannels?: number | undefined; - audioCodec?: string | undefined; - videoCodec?: string | undefined; - videoResolution?: number | undefined; - container?: string | undefined; - videoFrameRate?: string | undefined; - optimizedForStreaming?: number | undefined; + id: number; + duration: number; + bitrate: number; + width: number; + height: number; + aspectRatio: number; + audioProfile?: string | undefined; + audioChannels: number; + audioCodec: string; + videoCodec: string; + videoResolution: string; + container: string; + videoFrameRate: string; + videoProfile: string; + hasVoiceActivity?: boolean | undefined; + optimizedForStreaming: number; has64bitOffsets?: boolean | undefined; - videoProfile?: string | undefined; - Part?: Array | undefined; + Part: Array; }; /** @internal */ @@ -304,22 +1524,26 @@ export const Media$outboundSchema: z.ZodType< z.ZodTypeDef, Media > = z.object({ - id: z.number().optional(), - duration: z.number().optional(), - bitrate: z.number().optional(), - width: z.number().optional(), - height: z.number().optional(), - aspectRatio: z.number().optional(), - audioChannels: z.number().optional(), - audioCodec: z.string().optional(), - videoCodec: z.string().optional(), - videoResolution: z.number().optional(), - container: z.string().optional(), - videoFrameRate: z.string().optional(), - optimizedForStreaming: z.number().optional(), + id: z.number().int(), + duration: z.number().int(), + bitrate: z.number().int(), + width: z.number().int(), + height: z.number().int(), + aspectRatio: z.number(), + audioProfile: z.string().optional(), + audioChannels: z.number().int(), + audioCodec: z.string(), + videoCodec: z.string(), + videoResolution: z.string(), + container: z.string(), + videoFrameRate: z.string(), + videoProfile: z.string(), + hasVoiceActivity: z.boolean().optional(), + optimizedForStreaming: OptimizedForStreaming$outboundSchema.default( + OptimizedForStreaming.Disable, + ), has64bitOffsets: z.boolean().optional(), - videoProfile: z.string().optional(), - part: z.array(z.lazy(() => Part$outboundSchema)).optional(), + part: z.array(z.lazy(() => Part$outboundSchema)), }).transform((v) => { return remap$(v, { part: "Part", @@ -372,6 +1596,39 @@ export namespace Genre$ { export type Outbound = Genre$Outbound; } +/** @internal */ +export const Country$inboundSchema: z.ZodType = + z.object({ + tag: z.string().optional(), + }); + +/** @internal */ +export type Country$Outbound = { + tag?: string | undefined; +}; + +/** @internal */ +export const Country$outboundSchema: z.ZodType< + Country$Outbound, + z.ZodTypeDef, + Country +> = z.object({ + tag: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Country$ { + /** @deprecated use `Country$inboundSchema` instead. */ + export const inboundSchema = Country$inboundSchema; + /** @deprecated use `Country$outboundSchema` instead. */ + export const outboundSchema = Country$outboundSchema; + /** @deprecated use `Country$Outbound` instead. */ + export type Outbound = Country$Outbound; +} + /** @internal */ export const Director$inboundSchema: z.ZodType< Director, @@ -442,21 +1699,24 @@ export namespace Writer$ { } /** @internal */ -export const Country$inboundSchema: z.ZodType = - z.object({ - tag: z.string().optional(), - }); +export const Collection$inboundSchema: z.ZodType< + Collection, + z.ZodTypeDef, + unknown +> = z.object({ + tag: z.string().optional(), +}); /** @internal */ -export type Country$Outbound = { +export type Collection$Outbound = { tag?: string | undefined; }; /** @internal */ -export const Country$outboundSchema: z.ZodType< - Country$Outbound, +export const Collection$outboundSchema: z.ZodType< + Collection$Outbound, z.ZodTypeDef, - Country + Collection > = z.object({ tag: z.string().optional(), }); @@ -465,30 +1725,45 @@ export const Country$outboundSchema: z.ZodType< * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace Country$ { - /** @deprecated use `Country$inboundSchema` instead. */ - export const inboundSchema = Country$inboundSchema; - /** @deprecated use `Country$outboundSchema` instead. */ - export const outboundSchema = Country$outboundSchema; - /** @deprecated use `Country$Outbound` instead. */ - export type Outbound = Country$Outbound; +export namespace Collection$ { + /** @deprecated use `Collection$inboundSchema` instead. */ + export const inboundSchema = Collection$inboundSchema; + /** @deprecated use `Collection$outboundSchema` instead. */ + export const outboundSchema = Collection$outboundSchema; + /** @deprecated use `Collection$Outbound` instead. */ + export type Outbound = Collection$Outbound; } /** @internal */ export const Role$inboundSchema: z.ZodType = z .object({ + id: z.number().int().optional(), + filter: z.string().optional(), + thumb: z.string().optional(), tag: z.string().optional(), + tagKey: z.string().optional(), + role: z.string().optional(), }); /** @internal */ export type Role$Outbound = { + id?: number | undefined; + filter?: string | undefined; + thumb?: string | undefined; tag?: string | undefined; + tagKey?: string | undefined; + role?: string | undefined; }; /** @internal */ export const Role$outboundSchema: z.ZodType = z.object({ + id: z.number().int().optional(), + filter: z.string().optional(), + thumb: z.string().optional(), tag: z.string().optional(), + tagKey: z.string().optional(), + role: z.string().optional(), }); /** @@ -504,91 +1779,362 @@ export namespace Role$ { export type Outbound = Role$Outbound; } +/** @internal */ +export const MediaGuid$inboundSchema: z.ZodType< + MediaGuid, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string(), +}); + +/** @internal */ +export type MediaGuid$Outbound = { + id: string; +}; + +/** @internal */ +export const MediaGuid$outboundSchema: z.ZodType< + MediaGuid$Outbound, + z.ZodTypeDef, + MediaGuid +> = z.object({ + id: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace MediaGuid$ { + /** @deprecated use `MediaGuid$inboundSchema` instead. */ + export const inboundSchema = MediaGuid$inboundSchema; + /** @deprecated use `MediaGuid$outboundSchema` instead. */ + export const outboundSchema = MediaGuid$outboundSchema; + /** @deprecated use `MediaGuid$Outbound` instead. */ + export type Outbound = MediaGuid$Outbound; +} + +/** @internal */ +export const UltraBlurColors$inboundSchema: z.ZodType< + UltraBlurColors, + z.ZodTypeDef, + unknown +> = z.object({ + topLeft: z.string(), + topRight: z.string(), + bottomRight: z.string(), + bottomLeft: z.string(), +}); + +/** @internal */ +export type UltraBlurColors$Outbound = { + topLeft: string; + topRight: string; + bottomRight: string; + bottomLeft: string; +}; + +/** @internal */ +export const UltraBlurColors$outboundSchema: z.ZodType< + UltraBlurColors$Outbound, + z.ZodTypeDef, + UltraBlurColors +> = z.object({ + topLeft: z.string(), + topRight: z.string(), + bottomRight: z.string(), + bottomLeft: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UltraBlurColors$ { + /** @deprecated use `UltraBlurColors$inboundSchema` instead. */ + export const inboundSchema = UltraBlurColors$inboundSchema; + /** @deprecated use `UltraBlurColors$outboundSchema` instead. */ + export const outboundSchema = UltraBlurColors$outboundSchema; + /** @deprecated use `UltraBlurColors$Outbound` instead. */ + export type Outbound = UltraBlurColors$Outbound; +} + +/** @internal */ +export const MetaDataRating$inboundSchema: z.ZodType< + MetaDataRating, + z.ZodTypeDef, + unknown +> = z.object({ + image: z.string(), + value: z.number(), + type: z.string(), +}); + +/** @internal */ +export type MetaDataRating$Outbound = { + image: string; + value: number; + type: string; +}; + +/** @internal */ +export const MetaDataRating$outboundSchema: z.ZodType< + MetaDataRating$Outbound, + z.ZodTypeDef, + MetaDataRating +> = z.object({ + image: z.string(), + value: z.number(), + type: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace MetaDataRating$ { + /** @deprecated use `MetaDataRating$inboundSchema` instead. */ + export const inboundSchema = MetaDataRating$inboundSchema; + /** @deprecated use `MetaDataRating$outboundSchema` instead. */ + export const outboundSchema = MetaDataRating$outboundSchema; + /** @deprecated use `MetaDataRating$Outbound` instead. */ + export type Outbound = MetaDataRating$Outbound; +} + +/** @internal */ +export const GetRecentlyAddedHubsResponseType$inboundSchema: z.ZodNativeEnum< + typeof GetRecentlyAddedHubsResponseType +> = z.nativeEnum(GetRecentlyAddedHubsResponseType); + +/** @internal */ +export const GetRecentlyAddedHubsResponseType$outboundSchema: z.ZodNativeEnum< + typeof GetRecentlyAddedHubsResponseType +> = GetRecentlyAddedHubsResponseType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedHubsResponseType$ { + /** @deprecated use `GetRecentlyAddedHubsResponseType$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedHubsResponseType$inboundSchema; + /** @deprecated use `GetRecentlyAddedHubsResponseType$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedHubsResponseType$outboundSchema; +} + +/** @internal */ +export const GetRecentlyAddedImage$inboundSchema: z.ZodType< + GetRecentlyAddedImage, + z.ZodTypeDef, + unknown +> = z.object({ + alt: z.string(), + type: GetRecentlyAddedHubsResponseType$inboundSchema, + url: z.string(), +}); + +/** @internal */ +export type GetRecentlyAddedImage$Outbound = { + alt: string; + type: string; + url: string; +}; + +/** @internal */ +export const GetRecentlyAddedImage$outboundSchema: z.ZodType< + GetRecentlyAddedImage$Outbound, + z.ZodTypeDef, + GetRecentlyAddedImage +> = z.object({ + alt: z.string(), + type: GetRecentlyAddedHubsResponseType$outboundSchema, + url: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedImage$ { + /** @deprecated use `GetRecentlyAddedImage$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedImage$inboundSchema; + /** @deprecated use `GetRecentlyAddedImage$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedImage$outboundSchema; + /** @deprecated use `GetRecentlyAddedImage$Outbound` instead. */ + export type Outbound = GetRecentlyAddedImage$Outbound; +} + /** @internal */ export const GetRecentlyAddedMetadata$inboundSchema: z.ZodType< GetRecentlyAddedMetadata, z.ZodTypeDef, unknown > = z.object({ - allowSync: z.boolean().optional(), - librarySectionID: z.number().optional(), - librarySectionTitle: z.string().optional(), - librarySectionUUID: z.string().optional(), - ratingKey: z.number().optional(), - key: z.string().optional(), - guid: z.string().optional(), + ratingKey: z.string(), + key: z.string(), + guid: z.string(), studio: z.string().optional(), - type: z.string().optional(), - title: z.string().optional(), + skipChildren: z.boolean().optional(), + librarySectionID: z.number().int().optional(), + librarySectionTitle: z.string().optional(), + librarySectionKey: z.string().optional(), + type: GetRecentlyAddedHubsType$inboundSchema, + title: z.string(), + slug: z.string().optional(), contentRating: z.string().optional(), - summary: z.string().optional(), + summary: z.string(), rating: z.number().optional(), audienceRating: z.number().optional(), - year: z.number().optional(), + year: z.number().int().optional(), + seasonCount: z.number().int().optional(), tagline: z.string().optional(), + flattenSeasons: FlattenSeasons$inboundSchema.default(FlattenSeasons.False), + showOrdering: ShowOrdering$inboundSchema.optional(), thumb: z.string().optional(), art: z.string().optional(), - duration: z.number().optional(), - originallyAvailableAt: z.string().datetime({ offset: true }).transform(v => - new Date(v) - ).optional(), - addedAt: z.number().optional(), - updatedAt: z.number().optional(), + banner: z.string().optional(), + duration: z.number().int().optional(), + originallyAvailableAt: z.string().transform(v => new RFCDate(v)).optional(), + addedAt: z.number().int(), + updatedAt: z.number().int().optional(), audienceRatingImage: z.string().optional(), chapterSource: z.string().optional(), primaryExtraKey: z.string().optional(), ratingImage: z.string().optional(), + grandparentRatingKey: z.string().optional(), + grandparentGuid: z.string().optional(), + grandparentKey: z.string().optional(), + grandparentTitle: z.string().optional(), + grandparentThumb: z.string().optional(), + parentSlug: z.string().optional(), + grandparentSlug: z.string().optional(), + grandparentArt: z.string().optional(), + grandparentTheme: z.string().optional(), Media: z.array(z.lazy(() => Media$inboundSchema)).optional(), Genre: z.array(z.lazy(() => Genre$inboundSchema)).optional(), + Country: z.array(z.lazy(() => Country$inboundSchema)).optional(), Director: z.array(z.lazy(() => Director$inboundSchema)).optional(), Writer: z.array(z.lazy(() => Writer$inboundSchema)).optional(), - Country: z.array(z.lazy(() => Country$inboundSchema)).optional(), + Collection: z.array(z.lazy(() => Collection$inboundSchema)).optional(), Role: z.array(z.lazy(() => Role$inboundSchema)).optional(), + Guid: z.array(z.lazy(() => MediaGuid$inboundSchema)).optional(), + UltraBlurColors: z.lazy(() => UltraBlurColors$inboundSchema).optional(), + Rating: z.array(z.lazy(() => MetaDataRating$inboundSchema)).optional(), + Image: z.array(z.lazy(() => GetRecentlyAddedImage$inboundSchema)).optional(), + titleSort: z.string().optional(), + viewCount: z.number().int().optional(), + lastViewedAt: z.number().int().optional(), + originalTitle: z.string().optional(), + viewOffset: z.number().int().optional(), + skipCount: z.number().int().optional(), + index: z.number().int().optional(), + theme: z.string().optional(), + leafCount: z.number().int().optional(), + viewedLeafCount: z.number().int().optional(), + childCount: z.number().int().optional(), + hasPremiumExtras: z.string().optional(), + hasPremiumPrimaryExtra: z.string().optional(), + parentRatingKey: z.string().optional(), + parentGuid: z.string().optional(), + parentStudio: z.string().optional(), + parentKey: z.string().optional(), + parentTitle: z.string().optional(), + parentIndex: z.number().int().optional(), + parentYear: z.number().int().optional(), + parentThumb: z.string().optional(), + parentTheme: z.string().optional(), }).transform((v) => { return remap$(v, { "Media": "media", "Genre": "genre", + "Country": "country", "Director": "director", "Writer": "writer", - "Country": "country", + "Collection": "collection", "Role": "role", + "Guid": "mediaGuid", + "UltraBlurColors": "ultraBlurColors", + "Rating": "metaDataRating", + "Image": "image", }); }); /** @internal */ export type GetRecentlyAddedMetadata$Outbound = { - allowSync?: boolean | undefined; + ratingKey: string; + key: string; + guid: string; + studio?: string | undefined; + skipChildren?: boolean | undefined; librarySectionID?: number | undefined; librarySectionTitle?: string | undefined; - librarySectionUUID?: string | undefined; - ratingKey?: number | undefined; - key?: string | undefined; - guid?: string | undefined; - studio?: string | undefined; - type?: string | undefined; - title?: string | undefined; + librarySectionKey?: string | undefined; + type: string; + title: string; + slug?: string | undefined; contentRating?: string | undefined; - summary?: string | undefined; + summary: string; rating?: number | undefined; audienceRating?: number | undefined; year?: number | undefined; + seasonCount?: number | undefined; tagline?: string | undefined; + flattenSeasons: string; + showOrdering?: string | undefined; thumb?: string | undefined; art?: string | undefined; + banner?: string | undefined; duration?: number | undefined; originallyAvailableAt?: string | undefined; - addedAt?: number | undefined; + addedAt: number; updatedAt?: number | undefined; audienceRatingImage?: string | undefined; chapterSource?: string | undefined; primaryExtraKey?: string | undefined; ratingImage?: string | undefined; + grandparentRatingKey?: string | undefined; + grandparentGuid?: string | undefined; + grandparentKey?: string | undefined; + grandparentTitle?: string | undefined; + grandparentThumb?: string | undefined; + parentSlug?: string | undefined; + grandparentSlug?: string | undefined; + grandparentArt?: string | undefined; + grandparentTheme?: string | undefined; Media?: Array | undefined; Genre?: Array | undefined; + Country?: Array | undefined; Director?: Array | undefined; Writer?: Array | undefined; - Country?: Array | undefined; + Collection?: Array | undefined; Role?: Array | undefined; + Guid?: Array | undefined; + UltraBlurColors?: UltraBlurColors$Outbound | undefined; + Rating?: Array | undefined; + Image?: Array | undefined; + titleSort?: string | undefined; + viewCount?: number | undefined; + lastViewedAt?: number | undefined; + originalTitle?: string | undefined; + viewOffset?: number | undefined; + skipCount?: number | undefined; + index?: number | undefined; + theme?: string | undefined; + leafCount?: number | undefined; + viewedLeafCount?: number | undefined; + childCount?: number | undefined; + hasPremiumExtras?: string | undefined; + hasPremiumPrimaryExtra?: string | undefined; + parentRatingKey?: string | undefined; + parentGuid?: string | undefined; + parentStudio?: string | undefined; + parentKey?: string | undefined; + parentTitle?: string | undefined; + parentIndex?: number | undefined; + parentYear?: number | undefined; + parentThumb?: string | undefined; + parentTheme?: string | undefined; }; /** @internal */ @@ -597,46 +2143,94 @@ export const GetRecentlyAddedMetadata$outboundSchema: z.ZodType< z.ZodTypeDef, GetRecentlyAddedMetadata > = z.object({ - allowSync: z.boolean().optional(), - librarySectionID: z.number().optional(), - librarySectionTitle: z.string().optional(), - librarySectionUUID: z.string().optional(), - ratingKey: z.number().optional(), - key: z.string().optional(), - guid: z.string().optional(), + ratingKey: z.string(), + key: z.string(), + guid: z.string(), studio: z.string().optional(), - type: z.string().optional(), - title: z.string().optional(), + skipChildren: z.boolean().optional(), + librarySectionID: z.number().int().optional(), + librarySectionTitle: z.string().optional(), + librarySectionKey: z.string().optional(), + type: GetRecentlyAddedHubsType$outboundSchema, + title: z.string(), + slug: z.string().optional(), contentRating: z.string().optional(), - summary: z.string().optional(), + summary: z.string(), rating: z.number().optional(), audienceRating: z.number().optional(), - year: z.number().optional(), + year: z.number().int().optional(), + seasonCount: z.number().int().optional(), tagline: z.string().optional(), + flattenSeasons: FlattenSeasons$outboundSchema.default(FlattenSeasons.False), + showOrdering: ShowOrdering$outboundSchema.optional(), thumb: z.string().optional(), art: z.string().optional(), - duration: z.number().optional(), - originallyAvailableAt: z.date().transform(v => v.toISOString()).optional(), - addedAt: z.number().optional(), - updatedAt: z.number().optional(), + banner: z.string().optional(), + duration: z.number().int().optional(), + originallyAvailableAt: z.instanceof(RFCDate).transform(v => v.toString()) + .optional(), + addedAt: z.number().int(), + updatedAt: z.number().int().optional(), audienceRatingImage: z.string().optional(), chapterSource: z.string().optional(), primaryExtraKey: z.string().optional(), ratingImage: z.string().optional(), + grandparentRatingKey: z.string().optional(), + grandparentGuid: z.string().optional(), + grandparentKey: z.string().optional(), + grandparentTitle: z.string().optional(), + grandparentThumb: z.string().optional(), + parentSlug: z.string().optional(), + grandparentSlug: z.string().optional(), + grandparentArt: z.string().optional(), + grandparentTheme: z.string().optional(), media: z.array(z.lazy(() => Media$outboundSchema)).optional(), genre: z.array(z.lazy(() => Genre$outboundSchema)).optional(), + country: z.array(z.lazy(() => Country$outboundSchema)).optional(), director: z.array(z.lazy(() => Director$outboundSchema)).optional(), writer: z.array(z.lazy(() => Writer$outboundSchema)).optional(), - country: z.array(z.lazy(() => Country$outboundSchema)).optional(), + collection: z.array(z.lazy(() => Collection$outboundSchema)).optional(), role: z.array(z.lazy(() => Role$outboundSchema)).optional(), + mediaGuid: z.array(z.lazy(() => MediaGuid$outboundSchema)).optional(), + ultraBlurColors: z.lazy(() => UltraBlurColors$outboundSchema).optional(), + metaDataRating: z.array(z.lazy(() => MetaDataRating$outboundSchema)) + .optional(), + image: z.array(z.lazy(() => GetRecentlyAddedImage$outboundSchema)).optional(), + titleSort: z.string().optional(), + viewCount: z.number().int().optional(), + lastViewedAt: z.number().int().optional(), + originalTitle: z.string().optional(), + viewOffset: z.number().int().optional(), + skipCount: z.number().int().optional(), + index: z.number().int().optional(), + theme: z.string().optional(), + leafCount: z.number().int().optional(), + viewedLeafCount: z.number().int().optional(), + childCount: z.number().int().optional(), + hasPremiumExtras: z.string().optional(), + hasPremiumPrimaryExtra: z.string().optional(), + parentRatingKey: z.string().optional(), + parentGuid: z.string().optional(), + parentStudio: z.string().optional(), + parentKey: z.string().optional(), + parentTitle: z.string().optional(), + parentIndex: z.number().int().optional(), + parentYear: z.number().int().optional(), + parentThumb: z.string().optional(), + parentTheme: z.string().optional(), }).transform((v) => { return remap$(v, { media: "Media", genre: "Genre", + country: "Country", director: "Director", writer: "Writer", - country: "Country", + collection: "Collection", role: "Role", + mediaGuid: "Guid", + ultraBlurColors: "UltraBlurColors", + metaDataRating: "Rating", + image: "Image", }); }); @@ -659,28 +2253,29 @@ export const GetRecentlyAddedMediaContainer$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - size: z.number().optional(), - allowSync: z.boolean().optional(), + size: z.number(), + offset: z.number().int().optional(), + totalSize: z.number().int().optional(), identifier: z.string().optional(), - mediaTagPrefix: z.string().optional(), - mediaTagVersion: z.number().optional(), - mixedParents: z.boolean().optional(), + allowSync: z.boolean().optional(), + Meta: z.lazy(() => Meta$inboundSchema).optional(), Metadata: z.array(z.lazy(() => GetRecentlyAddedMetadata$inboundSchema)) .optional(), }).transform((v) => { return remap$(v, { + "Meta": "meta", "Metadata": "metadata", }); }); /** @internal */ export type GetRecentlyAddedMediaContainer$Outbound = { - size?: number | undefined; - allowSync?: boolean | undefined; + size: number; + offset?: number | undefined; + totalSize?: number | undefined; identifier?: string | undefined; - mediaTagPrefix?: string | undefined; - mediaTagVersion?: number | undefined; - mixedParents?: boolean | undefined; + allowSync?: boolean | undefined; + Meta?: Meta$Outbound | undefined; Metadata?: Array | undefined; }; @@ -690,16 +2285,17 @@ export const GetRecentlyAddedMediaContainer$outboundSchema: z.ZodType< z.ZodTypeDef, GetRecentlyAddedMediaContainer > = z.object({ - size: z.number().optional(), - allowSync: z.boolean().optional(), + size: z.number(), + offset: z.number().int().optional(), + totalSize: z.number().int().optional(), identifier: z.string().optional(), - mediaTagPrefix: z.string().optional(), - mediaTagVersion: z.number().optional(), - mixedParents: z.boolean().optional(), + allowSync: z.boolean().optional(), + meta: z.lazy(() => Meta$outboundSchema).optional(), metadata: z.array(z.lazy(() => GetRecentlyAddedMetadata$outboundSchema)) .optional(), }).transform((v) => { return remap$(v, { + meta: "Meta", metadata: "Metadata", }); }); diff --git a/src/sdk/models/operations/getrecentlyaddedlibrary.ts b/src/sdk/models/operations/getrecentlyaddedlibrary.ts new file mode 100644 index 00000000..1aa5a895 --- /dev/null +++ b/src/sdk/models/operations/getrecentlyaddedlibrary.ts @@ -0,0 +1,1420 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../../lib/primitives.js"; + +/** + * The type of media to retrieve. + * + * @remarks + * 1 = movie + * 2 = show + * 3 = season + * 4 = episode + * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries + */ +export enum QueryParamType { + Movie = 1, + TvShow = 2, + Season = 3, + Episode = 4, +} + +/** + * Adds the Meta object to the response + * + * @remarks + */ +export enum QueryParamIncludeMeta { + Disable = 0, + Enable = 1, +} + +export type GetRecentlyAddedLibraryRequest = { + contentDirectoryID?: number | undefined; + pinnedContentDirectoryID?: Array | undefined; + /** + * The library section ID for filtering content. + */ + sectionID?: number | undefined; + /** + * The type of media to retrieve. + * + * @remarks + * 1 = movie + * 2 = show + * 3 = season + * 4 = episode + * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries + */ + type: QueryParamType; + /** + * Adds the Meta object to the response + * + * @remarks + */ + includeMeta?: QueryParamIncludeMeta | undefined; + /** + * The index of the first item to return. If not specified, the first item will be returned. + * + * @remarks + * If the number of items exceeds the limit, the response will be paginated. + * By default this is 0 + */ + xPlexContainerStart?: number | undefined; + /** + * The number of items to return. If not specified, all items will be returned. + * + * @remarks + * If the number of items exceeds the limit, the response will be paginated. + * By default this is 50 + */ + xPlexContainerSize?: number | undefined; +}; + +export type GetRecentlyAddedLibraryFilter = { + filter: string; + filterType: string; + key: string; + title: string; + type: string; +}; + +/** + * The direction of the sort. Can be either `asc` or `desc`. + * + * @remarks + */ +export enum ActiveDirection { + Ascending = "asc", + Descending = "desc", +} + +/** + * The direction of the sort. Can be either `asc` or `desc`. + * + * @remarks + */ +export enum DefaultDirection { + Ascending = "asc", + Descending = "desc", +} + +export type Sort = { + default?: string | undefined; + active?: boolean | undefined; + /** + * The direction of the sort. Can be either `asc` or `desc`. + * + * @remarks + */ + activeDirection?: ActiveDirection | undefined; + /** + * The direction of the sort. Can be either `asc` or `desc`. + * + * @remarks + */ + defaultDirection?: DefaultDirection | undefined; + descKey?: string | undefined; + firstCharacterKey?: string | undefined; + key: string; + title: string; +}; + +export type Field = { + key: string; + title: string; + type: string; + subType?: string | undefined; +}; + +export type GetRecentlyAddedLibraryType = { + key: string; + type: string; + title: string; + active: boolean; + filter?: Array | undefined; + sort?: Array | undefined; + field?: Array | undefined; +}; + +export type Operator = { + key: string; + title: string; +}; + +export type FieldType = { + type: string; + operator: Array; +}; + +export type GetRecentlyAddedLibraryPart = { + id?: number | undefined; + key?: string | undefined; + duration?: number | undefined; + file?: string | undefined; + size?: number | undefined; + container?: string | undefined; + has64bitOffsets?: boolean | undefined; + hasThumbnail?: number | undefined; + optimizedForStreaming?: boolean | undefined; + videoProfile?: string | undefined; +}; + +export type GetRecentlyAddedLibraryMedia = { + id?: number | undefined; + duration?: number | undefined; + bitrate?: number | undefined; + width?: number | undefined; + height?: number | undefined; + aspectRatio?: number | undefined; + audioChannels?: number | undefined; + audioCodec?: string | undefined; + videoCodec?: string | undefined; + videoResolution?: number | undefined; + container?: string | undefined; + videoFrameRate?: string | undefined; + optimizedForStreaming?: number | undefined; + has64bitOffsets?: boolean | undefined; + videoProfile?: string | undefined; + part?: Array | undefined; +}; + +export type GetRecentlyAddedLibraryGenre = { + tag?: string | undefined; +}; + +export type GetRecentlyAddedLibraryDirector = { + tag?: string | undefined; +}; + +export type GetRecentlyAddedLibraryWriter = { + tag?: string | undefined; +}; + +export type GetRecentlyAddedLibraryCountry = { + tag?: string | undefined; +}; + +export type GetRecentlyAddedLibraryRole = { + tag?: string | undefined; +}; + +export type GetRecentlyAddedLibraryMetadata = { + allowSync?: boolean | undefined; + librarySectionID?: number | undefined; + librarySectionTitle?: string | undefined; + librarySectionUUID?: string | undefined; + ratingKey?: number | undefined; + key?: string | undefined; + guid?: string | undefined; + studio?: string | undefined; + type?: string | undefined; + title?: string | undefined; + contentRating?: string | undefined; + summary?: string | undefined; + rating?: number | undefined; + audienceRating?: number | undefined; + year?: number | undefined; + tagline?: string | undefined; + thumb?: string | undefined; + art?: string | undefined; + duration?: number | undefined; + originallyAvailableAt?: Date | undefined; + addedAt?: number | undefined; + updatedAt?: number | undefined; + audienceRatingImage?: string | undefined; + chapterSource?: string | undefined; + primaryExtraKey?: string | undefined; + ratingImage?: string | undefined; + media?: Array | undefined; + genre?: Array | undefined; + director?: Array | undefined; + writer?: Array | undefined; + country?: Array | undefined; + role?: Array | undefined; +}; + +/** + * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. + * + * @remarks + */ +export type GetRecentlyAddedLibraryMediaContainer = { + type?: Array | undefined; + fieldType?: Array | undefined; + size?: number | undefined; + allowSync?: boolean | undefined; + identifier?: string | undefined; + mediaTagPrefix?: string | undefined; + mediaTagVersion?: number | undefined; + mixedParents?: boolean | undefined; + metadata?: Array | undefined; +}; + +/** + * The recently added content + */ +export type GetRecentlyAddedLibraryResponseBody = { + mediaContainer?: GetRecentlyAddedLibraryMediaContainer | undefined; +}; + +export type GetRecentlyAddedLibraryResponse = { + /** + * 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 recently added content + */ + object?: GetRecentlyAddedLibraryResponseBody | undefined; +}; + +/** @internal */ +export const QueryParamType$inboundSchema: z.ZodNativeEnum< + typeof QueryParamType +> = z.nativeEnum(QueryParamType); + +/** @internal */ +export const QueryParamType$outboundSchema: z.ZodNativeEnum< + typeof QueryParamType +> = QueryParamType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace QueryParamType$ { + /** @deprecated use `QueryParamType$inboundSchema` instead. */ + export const inboundSchema = QueryParamType$inboundSchema; + /** @deprecated use `QueryParamType$outboundSchema` instead. */ + export const outboundSchema = QueryParamType$outboundSchema; +} + +/** @internal */ +export const QueryParamIncludeMeta$inboundSchema: z.ZodNativeEnum< + typeof QueryParamIncludeMeta +> = z.nativeEnum(QueryParamIncludeMeta); + +/** @internal */ +export const QueryParamIncludeMeta$outboundSchema: z.ZodNativeEnum< + typeof QueryParamIncludeMeta +> = QueryParamIncludeMeta$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace QueryParamIncludeMeta$ { + /** @deprecated use `QueryParamIncludeMeta$inboundSchema` instead. */ + export const inboundSchema = QueryParamIncludeMeta$inboundSchema; + /** @deprecated use `QueryParamIncludeMeta$outboundSchema` instead. */ + export const outboundSchema = QueryParamIncludeMeta$outboundSchema; +} + +/** @internal */ +export const GetRecentlyAddedLibraryRequest$inboundSchema: z.ZodType< + GetRecentlyAddedLibraryRequest, + z.ZodTypeDef, + unknown +> = z.object({ + contentDirectoryID: z.number().int().optional(), + pinnedContentDirectoryID: z.array(z.number().int()).optional(), + sectionID: z.number().int().optional(), + type: QueryParamType$inboundSchema, + includeMeta: QueryParamIncludeMeta$inboundSchema, + "X-Plex-Container-Start": z.number().int().default(0), + "X-Plex-Container-Size": z.number().int().default(50), +}).transform((v) => { + return remap$(v, { + "X-Plex-Container-Start": "xPlexContainerStart", + "X-Plex-Container-Size": "xPlexContainerSize", + }); +}); + +/** @internal */ +export type GetRecentlyAddedLibraryRequest$Outbound = { + contentDirectoryID?: number | undefined; + pinnedContentDirectoryID?: Array | undefined; + sectionID?: number | undefined; + type: number; + includeMeta: number; + "X-Plex-Container-Start": number; + "X-Plex-Container-Size": number; +}; + +/** @internal */ +export const GetRecentlyAddedLibraryRequest$outboundSchema: z.ZodType< + GetRecentlyAddedLibraryRequest$Outbound, + z.ZodTypeDef, + GetRecentlyAddedLibraryRequest +> = z.object({ + contentDirectoryID: z.number().int().optional(), + pinnedContentDirectoryID: z.array(z.number().int()).optional(), + sectionID: z.number().int().optional(), + type: QueryParamType$outboundSchema, + includeMeta: QueryParamIncludeMeta$outboundSchema.default( + QueryParamIncludeMeta.Disable, + ), + xPlexContainerStart: z.number().int().default(0), + xPlexContainerSize: z.number().int().default(50), +}).transform((v) => { + return remap$(v, { + xPlexContainerStart: "X-Plex-Container-Start", + xPlexContainerSize: "X-Plex-Container-Size", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedLibraryRequest$ { + /** @deprecated use `GetRecentlyAddedLibraryRequest$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedLibraryRequest$inboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryRequest$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedLibraryRequest$outboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryRequest$Outbound` instead. */ + export type Outbound = GetRecentlyAddedLibraryRequest$Outbound; +} + +/** @internal */ +export const GetRecentlyAddedLibraryFilter$inboundSchema: z.ZodType< + GetRecentlyAddedLibraryFilter, + z.ZodTypeDef, + unknown +> = z.object({ + filter: z.string(), + filterType: z.string(), + key: z.string(), + title: z.string(), + type: z.string(), +}); + +/** @internal */ +export type GetRecentlyAddedLibraryFilter$Outbound = { + filter: string; + filterType: string; + key: string; + title: string; + type: string; +}; + +/** @internal */ +export const GetRecentlyAddedLibraryFilter$outboundSchema: z.ZodType< + GetRecentlyAddedLibraryFilter$Outbound, + z.ZodTypeDef, + GetRecentlyAddedLibraryFilter +> = z.object({ + filter: z.string(), + filterType: z.string(), + key: z.string(), + title: z.string(), + type: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedLibraryFilter$ { + /** @deprecated use `GetRecentlyAddedLibraryFilter$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedLibraryFilter$inboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryFilter$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedLibraryFilter$outboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryFilter$Outbound` instead. */ + export type Outbound = GetRecentlyAddedLibraryFilter$Outbound; +} + +/** @internal */ +export const ActiveDirection$inboundSchema: z.ZodNativeEnum< + typeof ActiveDirection +> = z.nativeEnum(ActiveDirection); + +/** @internal */ +export const ActiveDirection$outboundSchema: z.ZodNativeEnum< + typeof ActiveDirection +> = ActiveDirection$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ActiveDirection$ { + /** @deprecated use `ActiveDirection$inboundSchema` instead. */ + export const inboundSchema = ActiveDirection$inboundSchema; + /** @deprecated use `ActiveDirection$outboundSchema` instead. */ + export const outboundSchema = ActiveDirection$outboundSchema; +} + +/** @internal */ +export const DefaultDirection$inboundSchema: z.ZodNativeEnum< + typeof DefaultDirection +> = z.nativeEnum(DefaultDirection); + +/** @internal */ +export const DefaultDirection$outboundSchema: z.ZodNativeEnum< + typeof DefaultDirection +> = DefaultDirection$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DefaultDirection$ { + /** @deprecated use `DefaultDirection$inboundSchema` instead. */ + export const inboundSchema = DefaultDirection$inboundSchema; + /** @deprecated use `DefaultDirection$outboundSchema` instead. */ + export const outboundSchema = DefaultDirection$outboundSchema; +} + +/** @internal */ +export const Sort$inboundSchema: z.ZodType = z + .object({ + default: z.string().optional(), + active: z.boolean().optional(), + activeDirection: ActiveDirection$inboundSchema.default( + ActiveDirection.Ascending, + ), + defaultDirection: DefaultDirection$inboundSchema.default( + DefaultDirection.Ascending, + ), + descKey: z.string().optional(), + firstCharacterKey: z.string().optional(), + key: z.string(), + title: z.string(), + }); + +/** @internal */ +export type Sort$Outbound = { + default?: string | undefined; + active?: boolean | undefined; + activeDirection: string; + defaultDirection: string; + descKey?: string | undefined; + firstCharacterKey?: string | undefined; + key: string; + title: string; +}; + +/** @internal */ +export const Sort$outboundSchema: z.ZodType = + z.object({ + default: z.string().optional(), + active: z.boolean().optional(), + activeDirection: ActiveDirection$outboundSchema.default( + ActiveDirection.Ascending, + ), + defaultDirection: DefaultDirection$outboundSchema.default( + DefaultDirection.Ascending, + ), + descKey: z.string().optional(), + firstCharacterKey: z.string().optional(), + key: z.string(), + title: z.string(), + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Sort$ { + /** @deprecated use `Sort$inboundSchema` instead. */ + export const inboundSchema = Sort$inboundSchema; + /** @deprecated use `Sort$outboundSchema` instead. */ + export const outboundSchema = Sort$outboundSchema; + /** @deprecated use `Sort$Outbound` instead. */ + export type Outbound = Sort$Outbound; +} + +/** @internal */ +export const Field$inboundSchema: z.ZodType = z + .object({ + key: z.string(), + title: z.string(), + type: z.string(), + subType: z.string().optional(), + }); + +/** @internal */ +export type Field$Outbound = { + key: string; + title: string; + type: string; + subType?: string | undefined; +}; + +/** @internal */ +export const Field$outboundSchema: z.ZodType< + Field$Outbound, + z.ZodTypeDef, + Field +> = z.object({ + key: z.string(), + title: z.string(), + type: z.string(), + subType: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Field$ { + /** @deprecated use `Field$inboundSchema` instead. */ + export const inboundSchema = Field$inboundSchema; + /** @deprecated use `Field$outboundSchema` instead. */ + export const outboundSchema = Field$outboundSchema; + /** @deprecated use `Field$Outbound` instead. */ + export type Outbound = Field$Outbound; +} + +/** @internal */ +export const GetRecentlyAddedLibraryType$inboundSchema: z.ZodType< + GetRecentlyAddedLibraryType, + z.ZodTypeDef, + unknown +> = z.object({ + key: z.string(), + type: z.string(), + title: z.string(), + active: z.boolean(), + Filter: z.array(z.lazy(() => GetRecentlyAddedLibraryFilter$inboundSchema)) + .optional(), + Sort: z.array(z.lazy(() => Sort$inboundSchema)).optional(), + Field: z.array(z.lazy(() => Field$inboundSchema)).optional(), +}).transform((v) => { + return remap$(v, { + "Filter": "filter", + "Sort": "sort", + "Field": "field", + }); +}); + +/** @internal */ +export type GetRecentlyAddedLibraryType$Outbound = { + key: string; + type: string; + title: string; + active: boolean; + Filter?: Array | undefined; + Sort?: Array | undefined; + Field?: Array | undefined; +}; + +/** @internal */ +export const GetRecentlyAddedLibraryType$outboundSchema: z.ZodType< + GetRecentlyAddedLibraryType$Outbound, + z.ZodTypeDef, + GetRecentlyAddedLibraryType +> = z.object({ + key: z.string(), + type: z.string(), + title: z.string(), + active: z.boolean(), + filter: z.array(z.lazy(() => GetRecentlyAddedLibraryFilter$outboundSchema)) + .optional(), + sort: z.array(z.lazy(() => Sort$outboundSchema)).optional(), + field: z.array(z.lazy(() => Field$outboundSchema)).optional(), +}).transform((v) => { + return remap$(v, { + filter: "Filter", + sort: "Sort", + field: "Field", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedLibraryType$ { + /** @deprecated use `GetRecentlyAddedLibraryType$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedLibraryType$inboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryType$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedLibraryType$outboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryType$Outbound` instead. */ + export type Outbound = GetRecentlyAddedLibraryType$Outbound; +} + +/** @internal */ +export const Operator$inboundSchema: z.ZodType< + Operator, + z.ZodTypeDef, + unknown +> = z.object({ + key: z.string(), + title: z.string(), +}); + +/** @internal */ +export type Operator$Outbound = { + key: string; + title: string; +}; + +/** @internal */ +export const Operator$outboundSchema: z.ZodType< + Operator$Outbound, + z.ZodTypeDef, + Operator +> = z.object({ + key: z.string(), + title: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Operator$ { + /** @deprecated use `Operator$inboundSchema` instead. */ + export const inboundSchema = Operator$inboundSchema; + /** @deprecated use `Operator$outboundSchema` instead. */ + export const outboundSchema = Operator$outboundSchema; + /** @deprecated use `Operator$Outbound` instead. */ + export type Outbound = Operator$Outbound; +} + +/** @internal */ +export const FieldType$inboundSchema: z.ZodType< + FieldType, + z.ZodTypeDef, + unknown +> = z.object({ + type: z.string(), + Operator: z.array(z.lazy(() => Operator$inboundSchema)), +}).transform((v) => { + return remap$(v, { + "Operator": "operator", + }); +}); + +/** @internal */ +export type FieldType$Outbound = { + type: string; + Operator: Array; +}; + +/** @internal */ +export const FieldType$outboundSchema: z.ZodType< + FieldType$Outbound, + z.ZodTypeDef, + FieldType +> = z.object({ + type: z.string(), + operator: z.array(z.lazy(() => Operator$outboundSchema)), +}).transform((v) => { + return remap$(v, { + operator: "Operator", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace FieldType$ { + /** @deprecated use `FieldType$inboundSchema` instead. */ + export const inboundSchema = FieldType$inboundSchema; + /** @deprecated use `FieldType$outboundSchema` instead. */ + export const outboundSchema = FieldType$outboundSchema; + /** @deprecated use `FieldType$Outbound` instead. */ + export type Outbound = FieldType$Outbound; +} + +/** @internal */ +export const GetRecentlyAddedLibraryPart$inboundSchema: z.ZodType< + GetRecentlyAddedLibraryPart, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.number().optional(), + key: z.string().optional(), + duration: z.number().optional(), + file: z.string().optional(), + size: z.number().optional(), + container: z.string().optional(), + has64bitOffsets: z.boolean().optional(), + hasThumbnail: z.number().optional(), + optimizedForStreaming: z.boolean().optional(), + videoProfile: z.string().optional(), +}); + +/** @internal */ +export type GetRecentlyAddedLibraryPart$Outbound = { + id?: number | undefined; + key?: string | undefined; + duration?: number | undefined; + file?: string | undefined; + size?: number | undefined; + container?: string | undefined; + has64bitOffsets?: boolean | undefined; + hasThumbnail?: number | undefined; + optimizedForStreaming?: boolean | undefined; + videoProfile?: string | undefined; +}; + +/** @internal */ +export const GetRecentlyAddedLibraryPart$outboundSchema: z.ZodType< + GetRecentlyAddedLibraryPart$Outbound, + z.ZodTypeDef, + GetRecentlyAddedLibraryPart +> = z.object({ + id: z.number().optional(), + key: z.string().optional(), + duration: z.number().optional(), + file: z.string().optional(), + size: z.number().optional(), + container: z.string().optional(), + has64bitOffsets: z.boolean().optional(), + hasThumbnail: z.number().optional(), + optimizedForStreaming: z.boolean().optional(), + videoProfile: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedLibraryPart$ { + /** @deprecated use `GetRecentlyAddedLibraryPart$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedLibraryPart$inboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryPart$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedLibraryPart$outboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryPart$Outbound` instead. */ + export type Outbound = GetRecentlyAddedLibraryPart$Outbound; +} + +/** @internal */ +export const GetRecentlyAddedLibraryMedia$inboundSchema: z.ZodType< + GetRecentlyAddedLibraryMedia, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.number().optional(), + duration: z.number().optional(), + bitrate: z.number().optional(), + width: z.number().optional(), + height: z.number().optional(), + aspectRatio: z.number().optional(), + audioChannels: z.number().optional(), + audioCodec: z.string().optional(), + videoCodec: z.string().optional(), + videoResolution: z.number().optional(), + container: z.string().optional(), + videoFrameRate: z.string().optional(), + optimizedForStreaming: z.number().optional(), + has64bitOffsets: z.boolean().optional(), + videoProfile: z.string().optional(), + Part: z.array(z.lazy(() => GetRecentlyAddedLibraryPart$inboundSchema)) + .optional(), +}).transform((v) => { + return remap$(v, { + "Part": "part", + }); +}); + +/** @internal */ +export type GetRecentlyAddedLibraryMedia$Outbound = { + id?: number | undefined; + duration?: number | undefined; + bitrate?: number | undefined; + width?: number | undefined; + height?: number | undefined; + aspectRatio?: number | undefined; + audioChannels?: number | undefined; + audioCodec?: string | undefined; + videoCodec?: string | undefined; + videoResolution?: number | undefined; + container?: string | undefined; + videoFrameRate?: string | undefined; + optimizedForStreaming?: number | undefined; + has64bitOffsets?: boolean | undefined; + videoProfile?: string | undefined; + Part?: Array | undefined; +}; + +/** @internal */ +export const GetRecentlyAddedLibraryMedia$outboundSchema: z.ZodType< + GetRecentlyAddedLibraryMedia$Outbound, + z.ZodTypeDef, + GetRecentlyAddedLibraryMedia +> = z.object({ + id: z.number().optional(), + duration: z.number().optional(), + bitrate: z.number().optional(), + width: z.number().optional(), + height: z.number().optional(), + aspectRatio: z.number().optional(), + audioChannels: z.number().optional(), + audioCodec: z.string().optional(), + videoCodec: z.string().optional(), + videoResolution: z.number().optional(), + container: z.string().optional(), + videoFrameRate: z.string().optional(), + optimizedForStreaming: z.number().optional(), + has64bitOffsets: z.boolean().optional(), + videoProfile: z.string().optional(), + part: z.array(z.lazy(() => GetRecentlyAddedLibraryPart$outboundSchema)) + .optional(), +}).transform((v) => { + return remap$(v, { + part: "Part", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedLibraryMedia$ { + /** @deprecated use `GetRecentlyAddedLibraryMedia$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedLibraryMedia$inboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryMedia$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedLibraryMedia$outboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryMedia$Outbound` instead. */ + export type Outbound = GetRecentlyAddedLibraryMedia$Outbound; +} + +/** @internal */ +export const GetRecentlyAddedLibraryGenre$inboundSchema: z.ZodType< + GetRecentlyAddedLibraryGenre, + z.ZodTypeDef, + unknown +> = z.object({ + tag: z.string().optional(), +}); + +/** @internal */ +export type GetRecentlyAddedLibraryGenre$Outbound = { + tag?: string | undefined; +}; + +/** @internal */ +export const GetRecentlyAddedLibraryGenre$outboundSchema: z.ZodType< + GetRecentlyAddedLibraryGenre$Outbound, + z.ZodTypeDef, + GetRecentlyAddedLibraryGenre +> = z.object({ + tag: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedLibraryGenre$ { + /** @deprecated use `GetRecentlyAddedLibraryGenre$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedLibraryGenre$inboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryGenre$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedLibraryGenre$outboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryGenre$Outbound` instead. */ + export type Outbound = GetRecentlyAddedLibraryGenre$Outbound; +} + +/** @internal */ +export const GetRecentlyAddedLibraryDirector$inboundSchema: z.ZodType< + GetRecentlyAddedLibraryDirector, + z.ZodTypeDef, + unknown +> = z.object({ + tag: z.string().optional(), +}); + +/** @internal */ +export type GetRecentlyAddedLibraryDirector$Outbound = { + tag?: string | undefined; +}; + +/** @internal */ +export const GetRecentlyAddedLibraryDirector$outboundSchema: z.ZodType< + GetRecentlyAddedLibraryDirector$Outbound, + z.ZodTypeDef, + GetRecentlyAddedLibraryDirector +> = z.object({ + tag: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedLibraryDirector$ { + /** @deprecated use `GetRecentlyAddedLibraryDirector$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedLibraryDirector$inboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryDirector$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedLibraryDirector$outboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryDirector$Outbound` instead. */ + export type Outbound = GetRecentlyAddedLibraryDirector$Outbound; +} + +/** @internal */ +export const GetRecentlyAddedLibraryWriter$inboundSchema: z.ZodType< + GetRecentlyAddedLibraryWriter, + z.ZodTypeDef, + unknown +> = z.object({ + tag: z.string().optional(), +}); + +/** @internal */ +export type GetRecentlyAddedLibraryWriter$Outbound = { + tag?: string | undefined; +}; + +/** @internal */ +export const GetRecentlyAddedLibraryWriter$outboundSchema: z.ZodType< + GetRecentlyAddedLibraryWriter$Outbound, + z.ZodTypeDef, + GetRecentlyAddedLibraryWriter +> = z.object({ + tag: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedLibraryWriter$ { + /** @deprecated use `GetRecentlyAddedLibraryWriter$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedLibraryWriter$inboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryWriter$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedLibraryWriter$outboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryWriter$Outbound` instead. */ + export type Outbound = GetRecentlyAddedLibraryWriter$Outbound; +} + +/** @internal */ +export const GetRecentlyAddedLibraryCountry$inboundSchema: z.ZodType< + GetRecentlyAddedLibraryCountry, + z.ZodTypeDef, + unknown +> = z.object({ + tag: z.string().optional(), +}); + +/** @internal */ +export type GetRecentlyAddedLibraryCountry$Outbound = { + tag?: string | undefined; +}; + +/** @internal */ +export const GetRecentlyAddedLibraryCountry$outboundSchema: z.ZodType< + GetRecentlyAddedLibraryCountry$Outbound, + z.ZodTypeDef, + GetRecentlyAddedLibraryCountry +> = z.object({ + tag: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedLibraryCountry$ { + /** @deprecated use `GetRecentlyAddedLibraryCountry$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedLibraryCountry$inboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryCountry$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedLibraryCountry$outboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryCountry$Outbound` instead. */ + export type Outbound = GetRecentlyAddedLibraryCountry$Outbound; +} + +/** @internal */ +export const GetRecentlyAddedLibraryRole$inboundSchema: z.ZodType< + GetRecentlyAddedLibraryRole, + z.ZodTypeDef, + unknown +> = z.object({ + tag: z.string().optional(), +}); + +/** @internal */ +export type GetRecentlyAddedLibraryRole$Outbound = { + tag?: string | undefined; +}; + +/** @internal */ +export const GetRecentlyAddedLibraryRole$outboundSchema: z.ZodType< + GetRecentlyAddedLibraryRole$Outbound, + z.ZodTypeDef, + GetRecentlyAddedLibraryRole +> = z.object({ + tag: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedLibraryRole$ { + /** @deprecated use `GetRecentlyAddedLibraryRole$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedLibraryRole$inboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryRole$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedLibraryRole$outboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryRole$Outbound` instead. */ + export type Outbound = GetRecentlyAddedLibraryRole$Outbound; +} + +/** @internal */ +export const GetRecentlyAddedLibraryMetadata$inboundSchema: z.ZodType< + GetRecentlyAddedLibraryMetadata, + z.ZodTypeDef, + unknown +> = z.object({ + allowSync: z.boolean().optional(), + librarySectionID: z.number().optional(), + librarySectionTitle: z.string().optional(), + librarySectionUUID: z.string().optional(), + ratingKey: z.number().optional(), + key: z.string().optional(), + guid: z.string().optional(), + studio: z.string().optional(), + type: z.string().optional(), + title: z.string().optional(), + contentRating: z.string().optional(), + summary: z.string().optional(), + rating: z.number().optional(), + audienceRating: z.number().optional(), + year: z.number().optional(), + tagline: z.string().optional(), + thumb: z.string().optional(), + art: z.string().optional(), + duration: z.number().optional(), + originallyAvailableAt: z.string().datetime({ offset: true }).transform(v => + new Date(v) + ).optional(), + addedAt: z.number().optional(), + updatedAt: z.number().optional(), + audienceRatingImage: z.string().optional(), + chapterSource: z.string().optional(), + primaryExtraKey: z.string().optional(), + ratingImage: z.string().optional(), + Media: z.array(z.lazy(() => GetRecentlyAddedLibraryMedia$inboundSchema)) + .optional(), + Genre: z.array(z.lazy(() => GetRecentlyAddedLibraryGenre$inboundSchema)) + .optional(), + Director: z.array(z.lazy(() => GetRecentlyAddedLibraryDirector$inboundSchema)) + .optional(), + Writer: z.array(z.lazy(() => GetRecentlyAddedLibraryWriter$inboundSchema)) + .optional(), + Country: z.array(z.lazy(() => GetRecentlyAddedLibraryCountry$inboundSchema)) + .optional(), + Role: z.array(z.lazy(() => GetRecentlyAddedLibraryRole$inboundSchema)) + .optional(), +}).transform((v) => { + return remap$(v, { + "Media": "media", + "Genre": "genre", + "Director": "director", + "Writer": "writer", + "Country": "country", + "Role": "role", + }); +}); + +/** @internal */ +export type GetRecentlyAddedLibraryMetadata$Outbound = { + allowSync?: boolean | undefined; + librarySectionID?: number | undefined; + librarySectionTitle?: string | undefined; + librarySectionUUID?: string | undefined; + ratingKey?: number | undefined; + key?: string | undefined; + guid?: string | undefined; + studio?: string | undefined; + type?: string | undefined; + title?: string | undefined; + contentRating?: string | undefined; + summary?: string | undefined; + rating?: number | undefined; + audienceRating?: number | undefined; + year?: number | undefined; + tagline?: string | undefined; + thumb?: string | undefined; + art?: string | undefined; + duration?: number | undefined; + originallyAvailableAt?: string | undefined; + addedAt?: number | undefined; + updatedAt?: number | undefined; + audienceRatingImage?: string | undefined; + chapterSource?: string | undefined; + primaryExtraKey?: string | undefined; + ratingImage?: string | undefined; + Media?: Array | undefined; + Genre?: Array | undefined; + Director?: Array | undefined; + Writer?: Array | undefined; + Country?: Array | undefined; + Role?: Array | undefined; +}; + +/** @internal */ +export const GetRecentlyAddedLibraryMetadata$outboundSchema: z.ZodType< + GetRecentlyAddedLibraryMetadata$Outbound, + z.ZodTypeDef, + GetRecentlyAddedLibraryMetadata +> = z.object({ + allowSync: z.boolean().optional(), + librarySectionID: z.number().optional(), + librarySectionTitle: z.string().optional(), + librarySectionUUID: z.string().optional(), + ratingKey: z.number().optional(), + key: z.string().optional(), + guid: z.string().optional(), + studio: z.string().optional(), + type: z.string().optional(), + title: z.string().optional(), + contentRating: z.string().optional(), + summary: z.string().optional(), + rating: z.number().optional(), + audienceRating: z.number().optional(), + year: z.number().optional(), + tagline: z.string().optional(), + thumb: z.string().optional(), + art: z.string().optional(), + duration: z.number().optional(), + originallyAvailableAt: z.date().transform(v => v.toISOString()).optional(), + addedAt: z.number().optional(), + updatedAt: z.number().optional(), + audienceRatingImage: z.string().optional(), + chapterSource: z.string().optional(), + primaryExtraKey: z.string().optional(), + ratingImage: z.string().optional(), + media: z.array(z.lazy(() => GetRecentlyAddedLibraryMedia$outboundSchema)) + .optional(), + genre: z.array(z.lazy(() => GetRecentlyAddedLibraryGenre$outboundSchema)) + .optional(), + director: z.array( + z.lazy(() => GetRecentlyAddedLibraryDirector$outboundSchema), + ).optional(), + writer: z.array(z.lazy(() => GetRecentlyAddedLibraryWriter$outboundSchema)) + .optional(), + country: z.array(z.lazy(() => GetRecentlyAddedLibraryCountry$outboundSchema)) + .optional(), + role: z.array(z.lazy(() => GetRecentlyAddedLibraryRole$outboundSchema)) + .optional(), +}).transform((v) => { + return remap$(v, { + media: "Media", + genre: "Genre", + director: "Director", + writer: "Writer", + country: "Country", + role: "Role", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedLibraryMetadata$ { + /** @deprecated use `GetRecentlyAddedLibraryMetadata$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedLibraryMetadata$inboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryMetadata$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedLibraryMetadata$outboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryMetadata$Outbound` instead. */ + export type Outbound = GetRecentlyAddedLibraryMetadata$Outbound; +} + +/** @internal */ +export const GetRecentlyAddedLibraryMediaContainer$inboundSchema: z.ZodType< + GetRecentlyAddedLibraryMediaContainer, + z.ZodTypeDef, + unknown +> = z.object({ + Type: z.array(z.lazy(() => GetRecentlyAddedLibraryType$inboundSchema)) + .optional(), + FieldType: z.array(z.lazy(() => FieldType$inboundSchema)).optional(), + size: z.number().optional(), + allowSync: z.boolean().optional(), + identifier: z.string().optional(), + mediaTagPrefix: z.string().optional(), + mediaTagVersion: z.number().optional(), + mixedParents: z.boolean().optional(), + Metadata: z.array(z.lazy(() => GetRecentlyAddedLibraryMetadata$inboundSchema)) + .optional(), +}).transform((v) => { + return remap$(v, { + "Type": "type", + "FieldType": "fieldType", + "Metadata": "metadata", + }); +}); + +/** @internal */ +export type GetRecentlyAddedLibraryMediaContainer$Outbound = { + Type?: Array | undefined; + FieldType?: Array | undefined; + size?: number | undefined; + allowSync?: boolean | undefined; + identifier?: string | undefined; + mediaTagPrefix?: string | undefined; + mediaTagVersion?: number | undefined; + mixedParents?: boolean | undefined; + Metadata?: Array | undefined; +}; + +/** @internal */ +export const GetRecentlyAddedLibraryMediaContainer$outboundSchema: z.ZodType< + GetRecentlyAddedLibraryMediaContainer$Outbound, + z.ZodTypeDef, + GetRecentlyAddedLibraryMediaContainer +> = z.object({ + type: z.array(z.lazy(() => GetRecentlyAddedLibraryType$outboundSchema)) + .optional(), + fieldType: z.array(z.lazy(() => FieldType$outboundSchema)).optional(), + size: z.number().optional(), + allowSync: z.boolean().optional(), + identifier: z.string().optional(), + mediaTagPrefix: z.string().optional(), + mediaTagVersion: z.number().optional(), + mixedParents: z.boolean().optional(), + metadata: z.array( + z.lazy(() => GetRecentlyAddedLibraryMetadata$outboundSchema), + ).optional(), +}).transform((v) => { + return remap$(v, { + type: "Type", + fieldType: "FieldType", + metadata: "Metadata", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedLibraryMediaContainer$ { + /** @deprecated use `GetRecentlyAddedLibraryMediaContainer$inboundSchema` instead. */ + export const inboundSchema = + GetRecentlyAddedLibraryMediaContainer$inboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryMediaContainer$outboundSchema` instead. */ + export const outboundSchema = + GetRecentlyAddedLibraryMediaContainer$outboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryMediaContainer$Outbound` instead. */ + export type Outbound = GetRecentlyAddedLibraryMediaContainer$Outbound; +} + +/** @internal */ +export const GetRecentlyAddedLibraryResponseBody$inboundSchema: z.ZodType< + GetRecentlyAddedLibraryResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + MediaContainer: z.lazy(() => + GetRecentlyAddedLibraryMediaContainer$inboundSchema + ).optional(), +}).transform((v) => { + return remap$(v, { + "MediaContainer": "mediaContainer", + }); +}); + +/** @internal */ +export type GetRecentlyAddedLibraryResponseBody$Outbound = { + MediaContainer?: GetRecentlyAddedLibraryMediaContainer$Outbound | undefined; +}; + +/** @internal */ +export const GetRecentlyAddedLibraryResponseBody$outboundSchema: z.ZodType< + GetRecentlyAddedLibraryResponseBody$Outbound, + z.ZodTypeDef, + GetRecentlyAddedLibraryResponseBody +> = z.object({ + mediaContainer: z.lazy(() => + GetRecentlyAddedLibraryMediaContainer$outboundSchema + ).optional(), +}).transform((v) => { + return remap$(v, { + mediaContainer: "MediaContainer", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedLibraryResponseBody$ { + /** @deprecated use `GetRecentlyAddedLibraryResponseBody$inboundSchema` instead. */ + export const inboundSchema = + GetRecentlyAddedLibraryResponseBody$inboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryResponseBody$outboundSchema` instead. */ + export const outboundSchema = + GetRecentlyAddedLibraryResponseBody$outboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryResponseBody$Outbound` instead. */ + export type Outbound = GetRecentlyAddedLibraryResponseBody$Outbound; +} + +/** @internal */ +export const GetRecentlyAddedLibraryResponse$inboundSchema: z.ZodType< + GetRecentlyAddedLibraryResponse, + z.ZodTypeDef, + unknown +> = z.object({ + ContentType: z.string(), + StatusCode: z.number().int(), + RawResponse: z.instanceof(Response), + object: z.lazy(() => GetRecentlyAddedLibraryResponseBody$inboundSchema) + .optional(), +}).transform((v) => { + return remap$(v, { + "ContentType": "contentType", + "StatusCode": "statusCode", + "RawResponse": "rawResponse", + }); +}); + +/** @internal */ +export type GetRecentlyAddedLibraryResponse$Outbound = { + ContentType: string; + StatusCode: number; + RawResponse: never; + object?: GetRecentlyAddedLibraryResponseBody$Outbound | undefined; +}; + +/** @internal */ +export const GetRecentlyAddedLibraryResponse$outboundSchema: z.ZodType< + GetRecentlyAddedLibraryResponse$Outbound, + z.ZodTypeDef, + GetRecentlyAddedLibraryResponse +> = z.object({ + contentType: z.string(), + statusCode: z.number().int(), + rawResponse: z.instanceof(Response).transform(() => { + throw new Error("Response cannot be serialized"); + }), + object: z.lazy(() => GetRecentlyAddedLibraryResponseBody$outboundSchema) + .optional(), +}).transform((v) => { + return remap$(v, { + contentType: "ContentType", + statusCode: "StatusCode", + rawResponse: "RawResponse", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecentlyAddedLibraryResponse$ { + /** @deprecated use `GetRecentlyAddedLibraryResponse$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedLibraryResponse$inboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryResponse$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedLibraryResponse$outboundSchema; + /** @deprecated use `GetRecentlyAddedLibraryResponse$Outbound` instead. */ + export type Outbound = GetRecentlyAddedLibraryResponse$Outbound; +} diff --git a/src/sdk/models/operations/getsearchlibrary.ts b/src/sdk/models/operations/getsearchlibrary.ts index 81ab6370..59656e92 100644 --- a/src/sdk/models/operations/getsearchlibrary.ts +++ b/src/sdk/models/operations/getsearchlibrary.ts @@ -15,11 +15,11 @@ import { remap as remap$ } from "../../../lib/primitives.js"; * 4 = episode * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries */ -export enum QueryParamType { - One = 1, - Two = 2, - Three = 3, - Four = 4, +export enum GetSearchLibraryQueryParamType { + Movie = 1, + TvShow = 2, + Season = 3, + Episode = 4, } export type GetSearchLibraryRequest = { @@ -40,7 +40,7 @@ export type GetSearchLibraryRequest = { * 4 = episode * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries */ - type: QueryParamType; + type: GetSearchLibraryQueryParamType; }; export type GetSearchLibraryMetadata = { @@ -109,24 +109,24 @@ export type GetSearchLibraryResponse = { }; /** @internal */ -export const QueryParamType$inboundSchema: z.ZodNativeEnum< - typeof QueryParamType -> = z.nativeEnum(QueryParamType); +export const GetSearchLibraryQueryParamType$inboundSchema: z.ZodNativeEnum< + typeof GetSearchLibraryQueryParamType +> = z.nativeEnum(GetSearchLibraryQueryParamType); /** @internal */ -export const QueryParamType$outboundSchema: z.ZodNativeEnum< - typeof QueryParamType -> = QueryParamType$inboundSchema; +export const GetSearchLibraryQueryParamType$outboundSchema: z.ZodNativeEnum< + typeof GetSearchLibraryQueryParamType +> = GetSearchLibraryQueryParamType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace QueryParamType$ { - /** @deprecated use `QueryParamType$inboundSchema` instead. */ - export const inboundSchema = QueryParamType$inboundSchema; - /** @deprecated use `QueryParamType$outboundSchema` instead. */ - export const outboundSchema = QueryParamType$outboundSchema; +export namespace GetSearchLibraryQueryParamType$ { + /** @deprecated use `GetSearchLibraryQueryParamType$inboundSchema` instead. */ + export const inboundSchema = GetSearchLibraryQueryParamType$inboundSchema; + /** @deprecated use `GetSearchLibraryQueryParamType$outboundSchema` instead. */ + export const outboundSchema = GetSearchLibraryQueryParamType$outboundSchema; } /** @internal */ @@ -136,7 +136,7 @@ export const GetSearchLibraryRequest$inboundSchema: z.ZodType< unknown > = z.object({ sectionKey: z.number().int(), - type: QueryParamType$inboundSchema, + type: GetSearchLibraryQueryParamType$inboundSchema, }); /** @internal */ @@ -152,7 +152,7 @@ export const GetSearchLibraryRequest$outboundSchema: z.ZodType< GetSearchLibraryRequest > = z.object({ sectionKey: z.number().int(), - type: QueryParamType$outboundSchema, + type: GetSearchLibraryQueryParamType$outboundSchema, }); /** diff --git a/src/sdk/models/operations/getserverresources.ts b/src/sdk/models/operations/getserverresources.ts index 576837e2..080bdb85 100644 --- a/src/sdk/models/operations/getserverresources.ts +++ b/src/sdk/models/operations/getserverresources.ts @@ -6,26 +6,22 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; export const GetServerResourcesServerList = [ - "https://plex.tv/api/v2/", + "https://plex.tv/api/v2", ] as const; export type GetServerResourcesGlobals = { /** - * The unique identifier for the client application - * - * @remarks - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) + * 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) */ - xPlexClientIdentifier?: string | undefined; + clientID?: string | undefined; }; /** * Include Https entries in the results */ export enum IncludeHttps { - Zero = 0, - One = 1, + Disable = 0, + Enable = 1, } /** @@ -35,27 +31,19 @@ export enum IncludeHttps { * E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400 */ export enum IncludeRelay { - Zero = 0, - One = 1, + Disable = 0, + Enable = 1, } /** * Include IPv6 entries in the results */ export enum IncludeIPv6 { - Zero = 0, - One = 1, + Disable = 0, + Enable = 1, } export type GetServerResourcesRequest = { - /** - * The unique identifier for the client application - * - * @remarks - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - */ - xPlexClientIdentifier?: string | undefined; /** * Include Https entries in the results */ @@ -71,15 +59,48 @@ export type GetServerResourcesRequest = { * Include IPv6 entries in the results */ includeIPv6?: IncludeIPv6 | undefined; + /** + * 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) + */ + clientID?: string | undefined; }; +/** + * The protocol used for the connection (http, https, etc) + */ +export enum Protocol { + Http = "http", + Https = "https", +} + export type Connections = { - protocol: string; + /** + * The protocol used for the connection (http, https, etc) + */ + protocol: Protocol; + /** + * The (ip) address or domain name used for the connection + */ address: string; + /** + * The port used for the connection + */ port: number; + /** + * The full URI of the connection + */ uri: string; + /** + * If the connection is local address + */ local: boolean; + /** + * If the connection is relayed through plex.direct + */ relay: boolean; + /** + * If the connection is using IPv6 + */ iPv6: boolean; }; @@ -138,16 +159,16 @@ export const GetServerResourcesGlobals$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - "X-Plex-Client-Identifier": z.string().optional(), + ClientID: z.string().optional(), }).transform((v) => { return remap$(v, { - "X-Plex-Client-Identifier": "xPlexClientIdentifier", + "ClientID": "clientID", }); }); /** @internal */ export type GetServerResourcesGlobals$Outbound = { - "X-Plex-Client-Identifier"?: string | undefined; + ClientID?: string | undefined; }; /** @internal */ @@ -156,10 +177,10 @@ export const GetServerResourcesGlobals$outboundSchema: z.ZodType< z.ZodTypeDef, GetServerResourcesGlobals > = z.object({ - xPlexClientIdentifier: z.string().optional(), + clientID: z.string().optional(), }).transform((v) => { return remap$(v, { - xPlexClientIdentifier: "X-Plex-Client-Identifier", + clientID: "ClientID", }); }); @@ -239,22 +260,22 @@ export const GetServerResourcesRequest$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - "X-Plex-Client-Identifier": z.string().optional(), includeHttps: IncludeHttps$inboundSchema, includeRelay: IncludeRelay$inboundSchema, includeIPv6: IncludeIPv6$inboundSchema, + ClientID: z.string().optional(), }).transform((v) => { return remap$(v, { - "X-Plex-Client-Identifier": "xPlexClientIdentifier", + "ClientID": "clientID", }); }); /** @internal */ export type GetServerResourcesRequest$Outbound = { - "X-Plex-Client-Identifier"?: string | undefined; includeHttps: number; includeRelay: number; includeIPv6: number; + ClientID?: string | undefined; }; /** @internal */ @@ -263,13 +284,13 @@ export const GetServerResourcesRequest$outboundSchema: z.ZodType< z.ZodTypeDef, GetServerResourcesRequest > = z.object({ - xPlexClientIdentifier: z.string().optional(), - includeHttps: IncludeHttps$outboundSchema.default(IncludeHttps.Zero), - includeRelay: IncludeRelay$outboundSchema.default(IncludeRelay.Zero), - includeIPv6: IncludeIPv6$outboundSchema.default(IncludeIPv6.Zero), + includeHttps: IncludeHttps$outboundSchema.default(IncludeHttps.Disable), + includeRelay: IncludeRelay$outboundSchema.default(IncludeRelay.Disable), + includeIPv6: IncludeIPv6$outboundSchema.default(IncludeIPv6.Disable), + clientID: z.string().optional(), }).transform((v) => { return remap$(v, { - xPlexClientIdentifier: "X-Plex-Client-Identifier", + clientID: "ClientID", }); }); @@ -286,15 +307,34 @@ export namespace GetServerResourcesRequest$ { export type Outbound = GetServerResourcesRequest$Outbound; } +/** @internal */ +export const Protocol$inboundSchema: z.ZodNativeEnum = z + .nativeEnum(Protocol); + +/** @internal */ +export const Protocol$outboundSchema: z.ZodNativeEnum = + Protocol$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Protocol$ { + /** @deprecated use `Protocol$inboundSchema` instead. */ + export const inboundSchema = Protocol$inboundSchema; + /** @deprecated use `Protocol$outboundSchema` instead. */ + export const outboundSchema = Protocol$outboundSchema; +} + /** @internal */ export const Connections$inboundSchema: z.ZodType< Connections, z.ZodTypeDef, unknown > = z.object({ - protocol: z.string(), + protocol: Protocol$inboundSchema, address: z.string(), - port: z.number(), + port: z.number().int(), uri: z.string(), local: z.boolean(), relay: z.boolean(), @@ -322,9 +362,9 @@ export const Connections$outboundSchema: z.ZodType< z.ZodTypeDef, Connections > = z.object({ - protocol: z.string(), + protocol: Protocol$outboundSchema, address: z.string(), - port: z.number(), + port: z.number().int(), uri: z.string(), local: z.boolean(), relay: z.boolean(), diff --git a/src/sdk/models/operations/gettokenbypinid.ts b/src/sdk/models/operations/gettokenbypinid.ts index 3830362a..53955b53 100644 --- a/src/sdk/models/operations/gettokenbypinid.ts +++ b/src/sdk/models/operations/gettokenbypinid.ts @@ -6,33 +6,33 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; export const GetTokenByPinIdServerList = [ - "https://plex.tv/api/v2/", + "https://plex.tv/api/v2", ] as const; export type GetTokenByPinIdGlobals = { /** - * The unique identifier for the client application - * - * @remarks - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) + * 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) */ - xPlexClientIdentifier?: string | undefined; + clientID?: string | undefined; + clientName?: string | undefined; + deviceName?: string | undefined; + clientVersion?: string | undefined; + clientPlatform?: string | undefined; }; export type GetTokenByPinIdRequest = { - /** - * The unique identifier for the client application - * - * @remarks - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) - */ - xPlexClientIdentifier?: string | undefined; /** * The PinID to retrieve an access token for */ pinID: number; + /** + * 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) + */ + clientID?: string | undefined; + clientName?: string | undefined; + deviceName?: string | undefined; + clientVersion?: string | undefined; + clientPlatform?: string | undefined; }; /** @@ -66,7 +66,7 @@ export type GetTokenByPinIdGeoData = { /** * The postal code of the location. */ - postalCode: number; + postalCode: string; /** * Indicates if the country has privacy restrictions. */ @@ -108,7 +108,7 @@ export type GetTokenByPinIdAuthPinContainer = { expiresIn?: number | undefined; createdAt: Date; expiresAt: Date; - authToken?: any | null | undefined; + authToken?: string | null | undefined; newRegistration?: any | null | undefined; }; @@ -137,16 +137,28 @@ export const GetTokenByPinIdGlobals$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - "X-Plex-Client-Identifier": z.string().optional(), + ClientID: z.string().optional(), + ClientName: z.string().optional(), + DeviceName: z.string().optional(), + ClientVersion: z.string().optional(), + ClientPlatform: z.string().optional(), }).transform((v) => { return remap$(v, { - "X-Plex-Client-Identifier": "xPlexClientIdentifier", + "ClientID": "clientID", + "ClientName": "clientName", + "DeviceName": "deviceName", + "ClientVersion": "clientVersion", + "ClientPlatform": "clientPlatform", }); }); /** @internal */ export type GetTokenByPinIdGlobals$Outbound = { - "X-Plex-Client-Identifier"?: string | undefined; + ClientID?: string | undefined; + ClientName?: string | undefined; + DeviceName?: string | undefined; + ClientVersion?: string | undefined; + ClientPlatform?: string | undefined; }; /** @internal */ @@ -155,10 +167,18 @@ export const GetTokenByPinIdGlobals$outboundSchema: z.ZodType< z.ZodTypeDef, GetTokenByPinIdGlobals > = z.object({ - xPlexClientIdentifier: z.string().optional(), + clientID: z.string().optional(), + clientName: z.string().optional(), + deviceName: z.string().optional(), + clientVersion: z.string().optional(), + clientPlatform: z.string().optional(), }).transform((v) => { return remap$(v, { - xPlexClientIdentifier: "X-Plex-Client-Identifier", + clientID: "ClientID", + clientName: "ClientName", + deviceName: "DeviceName", + clientVersion: "ClientVersion", + clientPlatform: "ClientPlatform", }); }); @@ -181,18 +201,30 @@ export const GetTokenByPinIdRequest$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - "X-Plex-Client-Identifier": z.string().optional(), pinID: z.number().int(), + ClientID: z.string().optional(), + ClientName: z.string().optional(), + DeviceName: z.string().optional(), + ClientVersion: z.string().optional(), + ClientPlatform: z.string().optional(), }).transform((v) => { return remap$(v, { - "X-Plex-Client-Identifier": "xPlexClientIdentifier", + "ClientID": "clientID", + "ClientName": "clientName", + "DeviceName": "deviceName", + "ClientVersion": "clientVersion", + "ClientPlatform": "clientPlatform", }); }); /** @internal */ export type GetTokenByPinIdRequest$Outbound = { - "X-Plex-Client-Identifier"?: string | undefined; pinID: number; + ClientID?: string | undefined; + ClientName?: string | undefined; + DeviceName?: string | undefined; + ClientVersion?: string | undefined; + ClientPlatform?: string | undefined; }; /** @internal */ @@ -201,11 +233,19 @@ export const GetTokenByPinIdRequest$outboundSchema: z.ZodType< z.ZodTypeDef, GetTokenByPinIdRequest > = z.object({ - xPlexClientIdentifier: z.string().optional(), pinID: z.number().int(), + clientID: z.string().optional(), + clientName: z.string().optional(), + deviceName: z.string().optional(), + clientVersion: z.string().optional(), + clientPlatform: z.string().optional(), }).transform((v) => { return remap$(v, { - xPlexClientIdentifier: "X-Plex-Client-Identifier", + clientID: "ClientID", + clientName: "ClientName", + deviceName: "DeviceName", + clientVersion: "ClientVersion", + clientPlatform: "ClientPlatform", }); }); @@ -234,7 +274,7 @@ export const GetTokenByPinIdGeoData$inboundSchema: z.ZodType< city: z.string(), european_union_member: z.boolean().default(false), time_zone: z.string(), - postal_code: z.number().int(), + postal_code: z.string(), in_privacy_restricted_country: z.boolean().default(false), in_privacy_restricted_region: z.boolean().default(false), subdivisions: z.string(), @@ -258,7 +298,7 @@ export type GetTokenByPinIdGeoData$Outbound = { city: string; european_union_member: boolean; time_zone: string; - postal_code: number; + postal_code: string; in_privacy_restricted_country: boolean; in_privacy_restricted_region: boolean; subdivisions: string; @@ -277,7 +317,7 @@ export const GetTokenByPinIdGeoData$outboundSchema: z.ZodType< city: z.string(), europeanUnionMember: z.boolean().default(false), timeZone: z.string(), - postalCode: z.number().int(), + postalCode: z.string(), inPrivacyRestrictedCountry: z.boolean().default(false), inPrivacyRestrictedRegion: z.boolean().default(false), subdivisions: z.string(), @@ -322,7 +362,7 @@ export const GetTokenByPinIdAuthPinContainer$inboundSchema: z.ZodType< expiresIn: z.number().int().default(900), createdAt: z.string().datetime({ offset: true }).transform(v => new Date(v)), expiresAt: z.string().datetime({ offset: true }).transform(v => new Date(v)), - authToken: z.nullable(z.any()).optional(), + authToken: z.nullable(z.string()).optional(), newRegistration: z.nullable(z.any()).optional(), }); @@ -338,7 +378,7 @@ export type GetTokenByPinIdAuthPinContainer$Outbound = { expiresIn: number; createdAt: string; expiresAt: string; - authToken?: any | null | undefined; + authToken?: string | null | undefined; newRegistration?: any | null | undefined; }; @@ -358,7 +398,7 @@ export const GetTokenByPinIdAuthPinContainer$outboundSchema: z.ZodType< expiresIn: z.number().int().default(900), createdAt: z.date().transform(v => v.toISOString()), expiresAt: z.date().transform(v => v.toISOString()), - authToken: z.nullable(z.any()).optional(), + authToken: z.nullable(z.string()).optional(), newRegistration: z.nullable(z.any()).optional(), }); diff --git a/src/sdk/models/operations/gettokendetails.ts b/src/sdk/models/operations/gettokendetails.ts index 1dc2fde2..f2d0bb0c 100644 --- a/src/sdk/models/operations/gettokendetails.ts +++ b/src/sdk/models/operations/gettokendetails.ts @@ -4,13 +4,18 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { + catchUnrecognizedEnum, + OpenEnum, + Unrecognized, +} from "../../types/enums.js"; export const GetTokenDetailsServerList = [ - "https://plex.tv/api/v2/", + "https://plex.tv/api/v2", ] as const; /** - * Your current mailing list status + * Your current mailing list status (active or unsubscribed) */ export enum MailingListStatus { Active = "active", @@ -21,34 +26,40 @@ export enum MailingListStatus { * The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) */ export enum AutoSelectSubtitle { - Zero = "0", - One = "1", + Disable = 0, + Enable = 1, } /** - * The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles) + * The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only show non-SDH subtitles) */ export enum DefaultSubtitleAccessibility { - Zero = "0", - One = "1", + Disable = 0, + Enable = 1, } /** * The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles) */ export enum DefaultSubtitleForced { - Zero = "0", - One = "1", + Disable = 0, + Enable = 1, } +/** + * Whether or not media watched indicators are enabled (little orange dot on media) + */ export enum WatchedIndicator { - Zero = "0", - One = "1", + Disable = 0, + Enable = 1, } +/** + * Whether or not the account has media reviews visibility enabled + */ export enum MediaReviewsVisibility { - Zero = 0, - One = 1, + Disable = 0, + Enable = 1, } export type UserProfile = { @@ -64,17 +75,8 @@ export type UserProfile = { * The preferred subtitle language for the account */ defaultSubtitleLanguage: string | null; - /** - * The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) - */ autoSelectSubtitle?: AutoSelectSubtitle | undefined; - /** - * The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles) - */ defaultSubtitleAccessibility?: DefaultSubtitleAccessibility | undefined; - /** - * The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles) - */ defaultSubtitleForced?: DefaultSubtitleForced | undefined; watchedIndicator?: WatchedIndicator | undefined; mediaReviewsVisibility?: MediaReviewsVisibility | undefined; @@ -101,29 +103,44 @@ export enum Features { TREBLEShowFeatures = "TREBLE-show-features", AdCountdownTimer = "ad-countdown-timer", AdaptiveBitrate = "adaptive_bitrate", + AlbumTypes = "album-types", + AllowDvr = "allow_dvr", AmazonLoopDebug = "amazon-loop-debug", AvodAdAnalysis = "avod-ad-analysis", AvodNewMedia = "avod-new-media", BlacklistGetSignin = "blacklist_get_signin", + BoostVoices = "boost-voices", + CameraUpload = "camera_upload", ClientRadioStations = "client-radio-stations", CloudflareTurnstileRequired = "cloudflare-turnstile-required", + Cloudsync = "cloudsync", Collections = "collections", CommentsAndRepliesPushNotifications = "comments_and_replies_push_notifications", CommunityAccessPlexTv = "community_access_plex_tv", CompanionsSonos = "companions_sonos", + ContentFilter = "content_filter", CustomHomeRemoval = "custom-home-removal", DisableHomeUserFriendships = "disable_home_user_friendships", DisableSharingFriendships = "disable_sharing_friendships", + DownloadsGating = "downloads-gating", DrmSupport = "drm_support", + Dvr = "dvr", + DvrBlockUnsupportedCountries = "dvr-block-unsupported-countries", + EpgRecentChannels = "epg-recent-channels", ExcludeRestrictions = "exclude restrictions", FederatedAuth = "federated-auth", FriendRequestPushNotifications = "friend_request_push_notifications", + GrandfatherSync = "grandfather-sync", GuidedUpgrade = "guided-upgrade", + HardwareTranscoding = "hardware_transcoding", Home = "home", + Hwtranscode = "hwtranscode", + ImaggaV2 = "imagga-v2", IncreasePasswordComplexity = "increase-password-complexity", Ios14PrivacyBanner = "ios14-privacy-banner", IterableNotificationTokens = "iterable-notification-tokens", + ItemClusters = "item_clusters", KeepPaymentMethod = "keep-payment-method", KevinBacon = "kevin-bacon", KoreaConsent = "korea-consent", @@ -132,29 +149,51 @@ export enum Features { LightningDvrPivot = "lightning-dvr-pivot", LiveTvSupportIncompleteSegments = "live-tv-support-incomplete-segments", Livetv = "livetv", + Lyrics = "lyrics", MetadataSearch = "metadata_search", + MusicAnalysis = "music-analysis", + MusicVideos = "music_videos", NewPlexPassPrices = "new_plex_pass_prices", NewsProviderSunsetModal = "news-provider-sunset-modal", + Nominatim = "nominatim", + Pass = "pass", PhotosFavorites = "photos-favorites", PhotosMetadataEdition = "photos-metadata-edition", + PhotosV6Edit = "photosV6-edit", + PhotosV6TvAlbums = "photosV6-tv-albums", PmsHealth = "pms_health", + PremiumDashboard = "premium-dashboard", + PremiumMusicMetadata = "premium_music_metadata", Radio = "radio", RateLimitClientToken = "rate-limit-client-token", ScrobblingServicePlexTv = "scrobbling-service-plex-tv", + SessionBandwidthRestrictions = "session_bandwidth_restrictions", + SessionKick = "session_kick", SharedServerNotification = "shared_server_notification", SharedSourceNotification = "shared_source_notification", + SigninNotification = "signin_notification", SigninWithApple = "signin_with_apple", + SilenceRemoval = "silence-removal", + SleepTimer = "sleep-timer", SpringServeAdProvider = "spring_serve_ad_provider", + Sync = "sync", + SweetFades = "sweet-fades", TranscoderCache = "transcoder_cache", + Trailers = "trailers", TunerSharing = "tuner-sharing", TwoFactorAuthentication = "two-factor-authentication", Unsupportedtuners = "unsupportedtuners", Upgrade3ds2 = "upgrade-3ds2", + Visualizers = "visualizers", VodSchema = "vod-schema", VodCloudflare = "vod_cloudflare", + VolumeLeveling = "volume-leveling", WatchTogetherInvite = "watch-together-invite", + WatchlistRss = "watchlist-rss", WebServerDashboard = "web_server_dashboard", + Webhooks = "webhooks", } +export type FeaturesOpen = OpenEnum; /** * String representation of subscriptionActive @@ -171,7 +210,7 @@ export type Subscription = { /** * List of features allowed on your Plex Pass subscription */ - features?: Array | undefined; + features?: Array | undefined; /** * If the account's Plex Pass subscription is active */ @@ -202,29 +241,44 @@ export enum GetTokenDetailsFeatures { TREBLEShowFeatures = "TREBLE-show-features", AdCountdownTimer = "ad-countdown-timer", AdaptiveBitrate = "adaptive_bitrate", + AlbumTypes = "album-types", + AllowDvr = "allow_dvr", AmazonLoopDebug = "amazon-loop-debug", AvodAdAnalysis = "avod-ad-analysis", AvodNewMedia = "avod-new-media", BlacklistGetSignin = "blacklist_get_signin", + BoostVoices = "boost-voices", + CameraUpload = "camera_upload", ClientRadioStations = "client-radio-stations", CloudflareTurnstileRequired = "cloudflare-turnstile-required", + Cloudsync = "cloudsync", Collections = "collections", CommentsAndRepliesPushNotifications = "comments_and_replies_push_notifications", CommunityAccessPlexTv = "community_access_plex_tv", CompanionsSonos = "companions_sonos", + ContentFilter = "content_filter", CustomHomeRemoval = "custom-home-removal", DisableHomeUserFriendships = "disable_home_user_friendships", DisableSharingFriendships = "disable_sharing_friendships", + DownloadsGating = "downloads-gating", DrmSupport = "drm_support", + Dvr = "dvr", + DvrBlockUnsupportedCountries = "dvr-block-unsupported-countries", + EpgRecentChannels = "epg-recent-channels", ExcludeRestrictions = "exclude restrictions", FederatedAuth = "federated-auth", FriendRequestPushNotifications = "friend_request_push_notifications", + GrandfatherSync = "grandfather-sync", GuidedUpgrade = "guided-upgrade", + HardwareTranscoding = "hardware_transcoding", Home = "home", + Hwtranscode = "hwtranscode", + ImaggaV2 = "imagga-v2", IncreasePasswordComplexity = "increase-password-complexity", Ios14PrivacyBanner = "ios14-privacy-banner", IterableNotificationTokens = "iterable-notification-tokens", + ItemClusters = "item_clusters", KeepPaymentMethod = "keep-payment-method", KevinBacon = "kevin-bacon", KoreaConsent = "korea-consent", @@ -233,29 +287,53 @@ export enum GetTokenDetailsFeatures { LightningDvrPivot = "lightning-dvr-pivot", LiveTvSupportIncompleteSegments = "live-tv-support-incomplete-segments", Livetv = "livetv", + Lyrics = "lyrics", MetadataSearch = "metadata_search", + MusicAnalysis = "music-analysis", + MusicVideos = "music_videos", NewPlexPassPrices = "new_plex_pass_prices", NewsProviderSunsetModal = "news-provider-sunset-modal", + Nominatim = "nominatim", + Pass = "pass", PhotosFavorites = "photos-favorites", PhotosMetadataEdition = "photos-metadata-edition", + PhotosV6Edit = "photosV6-edit", + PhotosV6TvAlbums = "photosV6-tv-albums", PmsHealth = "pms_health", + PremiumDashboard = "premium-dashboard", + PremiumMusicMetadata = "premium_music_metadata", Radio = "radio", RateLimitClientToken = "rate-limit-client-token", ScrobblingServicePlexTv = "scrobbling-service-plex-tv", + SessionBandwidthRestrictions = "session_bandwidth_restrictions", + SessionKick = "session_kick", SharedServerNotification = "shared_server_notification", SharedSourceNotification = "shared_source_notification", + SigninNotification = "signin_notification", SigninWithApple = "signin_with_apple", + SilenceRemoval = "silence-removal", + SleepTimer = "sleep-timer", SpringServeAdProvider = "spring_serve_ad_provider", + Sync = "sync", + SweetFades = "sweet-fades", TranscoderCache = "transcoder_cache", + Trailers = "trailers", TunerSharing = "tuner-sharing", TwoFactorAuthentication = "two-factor-authentication", Unsupportedtuners = "unsupportedtuners", Upgrade3ds2 = "upgrade-3ds2", + Visualizers = "visualizers", VodSchema = "vod-schema", VodCloudflare = "vod_cloudflare", + VolumeLeveling = "volume-leveling", WatchTogetherInvite = "watch-together-invite", + WatchlistRss = "watchlist-rss", WebServerDashboard = "web_server_dashboard", + Webhooks = "webhooks", } +export type GetTokenDetailsFeaturesOpen = OpenEnum< + typeof GetTokenDetailsFeatures +>; /** * String representation of subscriptionActive @@ -269,7 +347,7 @@ export type GetTokenDetailsSubscription = { /** * List of features allowed on your Plex Pass subscription */ - features?: Array | undefined; + features?: Array | undefined; /** * If the account's Plex Pass subscription is active */ @@ -373,7 +451,7 @@ export type GetTokenDetailsUserPlexAccount = { */ id: number; /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ joinedAt: number; /** @@ -385,7 +463,7 @@ export type GetTokenDetailsUserPlexAccount = { */ mailingListActive?: boolean | undefined; /** - * Your current mailing list status + * Your current mailing list status (active or unsubscribed) */ mailingListStatus: MailingListStatus; /** @@ -404,7 +482,7 @@ export type GetTokenDetailsUserPlexAccount = { */ protected?: boolean | undefined; /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ rememberExpiresAt: number; /** @@ -449,6 +527,7 @@ export type GetTokenDetailsUserPlexAccount = { * The account UUID */ uuid: string; + attributionPartner: string | null; }; export type GetTokenDetailsResponse = { @@ -605,12 +684,11 @@ export const UserProfile$inboundSchema: z.ZodType< autoSelectAudio: z.boolean().default(true), defaultAudioLanguage: z.nullable(z.string()), defaultSubtitleLanguage: z.nullable(z.string()), - autoSelectSubtitle: AutoSelectSubtitle$inboundSchema.optional(), - defaultSubtitleAccessibility: DefaultSubtitleAccessibility$inboundSchema - .optional(), - defaultSubtitleForced: DefaultSubtitleForced$inboundSchema.optional(), - watchedIndicator: WatchedIndicator$inboundSchema.optional(), - mediaReviewsVisibility: MediaReviewsVisibility$inboundSchema.optional(), + autoSelectSubtitle: AutoSelectSubtitle$inboundSchema, + defaultSubtitleAccessibility: DefaultSubtitleAccessibility$inboundSchema, + defaultSubtitleForced: DefaultSubtitleForced$inboundSchema, + watchedIndicator: WatchedIndicator$inboundSchema, + mediaReviewsVisibility: MediaReviewsVisibility$inboundSchema, }); /** @internal */ @@ -618,11 +696,11 @@ export type UserProfile$Outbound = { autoSelectAudio: boolean; defaultAudioLanguage: string | null; defaultSubtitleLanguage: string | null; - autoSelectSubtitle?: string | undefined; - defaultSubtitleAccessibility?: string | undefined; - defaultSubtitleForced?: string | undefined; - watchedIndicator?: string | undefined; - mediaReviewsVisibility?: number | undefined; + autoSelectSubtitle: number; + defaultSubtitleAccessibility: number; + defaultSubtitleForced: number; + watchedIndicator: number; + mediaReviewsVisibility: number; }; /** @internal */ @@ -634,12 +712,20 @@ export const UserProfile$outboundSchema: z.ZodType< autoSelectAudio: z.boolean().default(true), defaultAudioLanguage: z.nullable(z.string()), defaultSubtitleLanguage: z.nullable(z.string()), - autoSelectSubtitle: AutoSelectSubtitle$outboundSchema.optional(), + autoSelectSubtitle: AutoSelectSubtitle$outboundSchema.default( + AutoSelectSubtitle.Disable, + ), defaultSubtitleAccessibility: DefaultSubtitleAccessibility$outboundSchema - .optional(), - defaultSubtitleForced: DefaultSubtitleForced$outboundSchema.optional(), - watchedIndicator: WatchedIndicator$outboundSchema.optional(), - mediaReviewsVisibility: MediaReviewsVisibility$outboundSchema.optional(), + .default(DefaultSubtitleAccessibility.Disable), + defaultSubtitleForced: DefaultSubtitleForced$outboundSchema.default( + DefaultSubtitleForced.Disable, + ), + watchedIndicator: WatchedIndicator$outboundSchema.default( + WatchedIndicator.Disable, + ), + mediaReviewsVisibility: MediaReviewsVisibility$outboundSchema.default( + MediaReviewsVisibility.Disable, + ), }); /** @@ -725,12 +811,25 @@ export namespace Services$ { } /** @internal */ -export const Features$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(Features); +export const Features$inboundSchema: z.ZodType< + FeaturesOpen, + z.ZodTypeDef, + unknown +> = z + .union([ + z.nativeEnum(Features), + z.string().transform(catchUnrecognizedEnum), + ]); /** @internal */ -export const Features$outboundSchema: z.ZodNativeEnum = - Features$inboundSchema; +export const Features$outboundSchema: z.ZodType< + FeaturesOpen, + z.ZodTypeDef, + FeaturesOpen +> = z.union([ + z.nativeEnum(Features), + z.string().and(z.custom>()), +]); /** * @internal @@ -818,14 +917,25 @@ export namespace Subscription$ { } /** @internal */ -export const GetTokenDetailsFeatures$inboundSchema: z.ZodNativeEnum< - typeof GetTokenDetailsFeatures -> = z.nativeEnum(GetTokenDetailsFeatures); +export const GetTokenDetailsFeatures$inboundSchema: z.ZodType< + GetTokenDetailsFeaturesOpen, + z.ZodTypeDef, + unknown +> = z + .union([ + z.nativeEnum(GetTokenDetailsFeatures), + z.string().transform(catchUnrecognizedEnum), + ]); /** @internal */ -export const GetTokenDetailsFeatures$outboundSchema: z.ZodNativeEnum< - typeof GetTokenDetailsFeatures -> = GetTokenDetailsFeatures$inboundSchema; +export const GetTokenDetailsFeatures$outboundSchema: z.ZodType< + GetTokenDetailsFeaturesOpen, + z.ZodTypeDef, + GetTokenDetailsFeaturesOpen +> = z.union([ + z.nativeEnum(GetTokenDetailsFeatures), + z.string().and(z.custom>()), +]); /** * @internal @@ -964,6 +1074,7 @@ export const GetTokenDetailsUserPlexAccount$inboundSchema: z.ZodType< twoFactorEnabled: z.boolean().default(false), username: z.string(), uuid: z.string(), + attributionPartner: z.nullable(z.string()), }); /** @internal */ @@ -1008,6 +1119,7 @@ export type GetTokenDetailsUserPlexAccount$Outbound = { twoFactorEnabled: boolean; username: string; uuid: string; + attributionPartner: string | null; }; /** @internal */ @@ -1058,6 +1170,7 @@ export const GetTokenDetailsUserPlexAccount$outboundSchema: z.ZodType< twoFactorEnabled: z.boolean().default(false), username: z.string(), uuid: z.string(), + attributionPartner: z.nullable(z.string()), }); /** diff --git a/src/sdk/models/operations/gettopwatchedcontent.ts b/src/sdk/models/operations/gettopwatchedcontent.ts index 6ab7534c..eacc6d73 100644 --- a/src/sdk/models/operations/gettopwatchedcontent.ts +++ b/src/sdk/models/operations/gettopwatchedcontent.ts @@ -17,10 +17,10 @@ import { RFCDate } from "../../types/rfcdate.js"; * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries */ export enum GetTopWatchedContentQueryParamType { - One = 1, - Two = 2, - Three = 3, - Four = 4, + Movie = 1, + TvShow = 2, + Season = 3, + Episode = 4, } export type GetTopWatchedContentRequest = { diff --git a/src/sdk/models/operations/getuserfriends.ts b/src/sdk/models/operations/getuserfriends.ts index c0cfe805..0a7ee301 100644 --- a/src/sdk/models/operations/getuserfriends.ts +++ b/src/sdk/models/operations/getuserfriends.ts @@ -6,7 +6,7 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; export const GetUserFriendsServerList = [ - "https://plex.tv/api/v2/", + "https://plex.tv/api/v2", ] as const; export type SharedServers = {}; diff --git a/src/sdk/models/operations/index.ts b/src/sdk/models/operations/index.ts index 21dc2f4b..2f86ca70 100644 --- a/src/sdk/models/operations/index.ts +++ b/src/sdk/models/operations/index.ts @@ -35,6 +35,7 @@ export * from "./getplaylist.js"; export * from "./getplaylistcontents.js"; export * from "./getplaylists.js"; export * from "./getrecentlyadded.js"; +export * from "./getrecentlyaddedlibrary.js"; export * from "./getrefreshlibrarymetadata.js"; export * from "./getresizedphoto.js"; export * from "./getresourcesstatistics.js"; diff --git a/src/sdk/models/operations/postuserssignindata.ts b/src/sdk/models/operations/postuserssignindata.ts index 2fcf2992..a9da737a 100644 --- a/src/sdk/models/operations/postuserssignindata.ts +++ b/src/sdk/models/operations/postuserssignindata.ts @@ -4,20 +4,25 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { + catchUnrecognizedEnum, + OpenEnum, + Unrecognized, +} from "../../types/enums.js"; export const PostUsersSignInDataServerList = [ - "https://plex.tv/api/v2/", + "https://plex.tv/api/v2", ] as const; export type PostUsersSignInDataGlobals = { /** - * The unique identifier for the client application - * - * @remarks - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) + * 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) */ - xPlexClientIdentifier?: string | undefined; + clientID?: string | undefined; + clientName?: string | undefined; + deviceName?: string | undefined; + clientVersion?: string | undefined; + clientPlatform?: string | undefined; }; /** @@ -32,13 +37,13 @@ export type PostUsersSignInDataRequestBody = { export type PostUsersSignInDataRequest = { /** - * The unique identifier for the client application - * - * @remarks - * This is used to track the client application and its usage - * (UUID, serial number, or other number unique per device) + * 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) */ - xPlexClientIdentifier?: string | undefined; + clientID?: string | undefined; + clientName?: string | undefined; + deviceName?: string | undefined; + clientVersion?: string | undefined; + clientPlatform?: string | undefined; /** * Login credentials */ @@ -46,7 +51,7 @@ export type PostUsersSignInDataRequest = { }; /** - * Your current mailing list status + * Your current mailing list status (active or unsubscribed) */ export enum PostUsersSignInDataMailingListStatus { Active = "active", @@ -57,34 +62,40 @@ export enum PostUsersSignInDataMailingListStatus { * The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) */ export enum PostUsersSignInDataAutoSelectSubtitle { - Zero = "0", - One = "1", + Disable = 0, + Enable = 1, } /** - * The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles) + * The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only show non-SDH subtitles) */ export enum PostUsersSignInDataDefaultSubtitleAccessibility { - Zero = "0", - One = "1", + Disable = 0, + Enable = 1, } /** * The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles) */ export enum PostUsersSignInDataDefaultSubtitleForced { - Zero = "0", - One = "1", + Disable = 0, + Enable = 1, } +/** + * Whether or not media watched indicators are enabled (little orange dot on media) + */ export enum PostUsersSignInDataWatchedIndicator { - Zero = "0", - One = "1", + Disable = 0, + Enable = 1, } +/** + * Whether or not the account has media reviews visibility enabled + */ export enum PostUsersSignInDataMediaReviewsVisibility { - Zero = 0, - One = 1, + Disable = 0, + Enable = 1, } export type PostUsersSignInDataUserProfile = { @@ -100,19 +111,10 @@ export type PostUsersSignInDataUserProfile = { * The preferred subtitle language for the account */ defaultSubtitleLanguage: string | null; - /** - * The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) - */ autoSelectSubtitle?: PostUsersSignInDataAutoSelectSubtitle | undefined; - /** - * The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles) - */ defaultSubtitleAccessibility?: | PostUsersSignInDataDefaultSubtitleAccessibility | undefined; - /** - * The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles) - */ defaultSubtitleForced?: PostUsersSignInDataDefaultSubtitleForced | undefined; watchedIndicator?: PostUsersSignInDataWatchedIndicator | undefined; mediaReviewsVisibility?: @@ -141,29 +143,44 @@ export enum PostUsersSignInDataFeatures { TREBLEShowFeatures = "TREBLE-show-features", AdCountdownTimer = "ad-countdown-timer", AdaptiveBitrate = "adaptive_bitrate", + AlbumTypes = "album-types", + AllowDvr = "allow_dvr", AmazonLoopDebug = "amazon-loop-debug", AvodAdAnalysis = "avod-ad-analysis", AvodNewMedia = "avod-new-media", BlacklistGetSignin = "blacklist_get_signin", + BoostVoices = "boost-voices", + CameraUpload = "camera_upload", ClientRadioStations = "client-radio-stations", CloudflareTurnstileRequired = "cloudflare-turnstile-required", + Cloudsync = "cloudsync", Collections = "collections", CommentsAndRepliesPushNotifications = "comments_and_replies_push_notifications", CommunityAccessPlexTv = "community_access_plex_tv", CompanionsSonos = "companions_sonos", + ContentFilter = "content_filter", CustomHomeRemoval = "custom-home-removal", DisableHomeUserFriendships = "disable_home_user_friendships", DisableSharingFriendships = "disable_sharing_friendships", + DownloadsGating = "downloads-gating", DrmSupport = "drm_support", + Dvr = "dvr", + DvrBlockUnsupportedCountries = "dvr-block-unsupported-countries", + EpgRecentChannels = "epg-recent-channels", ExcludeRestrictions = "exclude restrictions", FederatedAuth = "federated-auth", FriendRequestPushNotifications = "friend_request_push_notifications", + GrandfatherSync = "grandfather-sync", GuidedUpgrade = "guided-upgrade", + HardwareTranscoding = "hardware_transcoding", Home = "home", + Hwtranscode = "hwtranscode", + ImaggaV2 = "imagga-v2", IncreasePasswordComplexity = "increase-password-complexity", Ios14PrivacyBanner = "ios14-privacy-banner", IterableNotificationTokens = "iterable-notification-tokens", + ItemClusters = "item_clusters", KeepPaymentMethod = "keep-payment-method", KevinBacon = "kevin-bacon", KoreaConsent = "korea-consent", @@ -172,29 +189,53 @@ export enum PostUsersSignInDataFeatures { LightningDvrPivot = "lightning-dvr-pivot", LiveTvSupportIncompleteSegments = "live-tv-support-incomplete-segments", Livetv = "livetv", + Lyrics = "lyrics", MetadataSearch = "metadata_search", + MusicAnalysis = "music-analysis", + MusicVideos = "music_videos", NewPlexPassPrices = "new_plex_pass_prices", NewsProviderSunsetModal = "news-provider-sunset-modal", + Nominatim = "nominatim", + Pass = "pass", PhotosFavorites = "photos-favorites", PhotosMetadataEdition = "photos-metadata-edition", + PhotosV6Edit = "photosV6-edit", + PhotosV6TvAlbums = "photosV6-tv-albums", PmsHealth = "pms_health", + PremiumDashboard = "premium-dashboard", + PremiumMusicMetadata = "premium_music_metadata", Radio = "radio", RateLimitClientToken = "rate-limit-client-token", ScrobblingServicePlexTv = "scrobbling-service-plex-tv", + SessionBandwidthRestrictions = "session_bandwidth_restrictions", + SessionKick = "session_kick", SharedServerNotification = "shared_server_notification", SharedSourceNotification = "shared_source_notification", + SigninNotification = "signin_notification", SigninWithApple = "signin_with_apple", + SilenceRemoval = "silence-removal", + SleepTimer = "sleep-timer", SpringServeAdProvider = "spring_serve_ad_provider", + Sync = "sync", + SweetFades = "sweet-fades", TranscoderCache = "transcoder_cache", + Trailers = "trailers", TunerSharing = "tuner-sharing", TwoFactorAuthentication = "two-factor-authentication", Unsupportedtuners = "unsupportedtuners", Upgrade3ds2 = "upgrade-3ds2", + Visualizers = "visualizers", VodSchema = "vod-schema", VodCloudflare = "vod_cloudflare", + VolumeLeveling = "volume-leveling", WatchTogetherInvite = "watch-together-invite", + WatchlistRss = "watchlist-rss", WebServerDashboard = "web_server_dashboard", + Webhooks = "webhooks", } +export type PostUsersSignInDataFeaturesOpen = OpenEnum< + typeof PostUsersSignInDataFeatures +>; /** * String representation of subscriptionActive @@ -211,7 +252,7 @@ export type PostUsersSignInDataSubscription = { /** * List of features allowed on your Plex Pass subscription */ - features?: Array | undefined; + features?: Array | undefined; /** * If the account's Plex Pass subscription is active */ @@ -242,29 +283,44 @@ export enum PostUsersSignInDataAuthenticationFeatures { TREBLEShowFeatures = "TREBLE-show-features", AdCountdownTimer = "ad-countdown-timer", AdaptiveBitrate = "adaptive_bitrate", + AlbumTypes = "album-types", + AllowDvr = "allow_dvr", AmazonLoopDebug = "amazon-loop-debug", AvodAdAnalysis = "avod-ad-analysis", AvodNewMedia = "avod-new-media", BlacklistGetSignin = "blacklist_get_signin", + BoostVoices = "boost-voices", + CameraUpload = "camera_upload", ClientRadioStations = "client-radio-stations", CloudflareTurnstileRequired = "cloudflare-turnstile-required", + Cloudsync = "cloudsync", Collections = "collections", CommentsAndRepliesPushNotifications = "comments_and_replies_push_notifications", CommunityAccessPlexTv = "community_access_plex_tv", CompanionsSonos = "companions_sonos", + ContentFilter = "content_filter", CustomHomeRemoval = "custom-home-removal", DisableHomeUserFriendships = "disable_home_user_friendships", DisableSharingFriendships = "disable_sharing_friendships", + DownloadsGating = "downloads-gating", DrmSupport = "drm_support", + Dvr = "dvr", + DvrBlockUnsupportedCountries = "dvr-block-unsupported-countries", + EpgRecentChannels = "epg-recent-channels", ExcludeRestrictions = "exclude restrictions", FederatedAuth = "federated-auth", FriendRequestPushNotifications = "friend_request_push_notifications", + GrandfatherSync = "grandfather-sync", GuidedUpgrade = "guided-upgrade", + HardwareTranscoding = "hardware_transcoding", Home = "home", + Hwtranscode = "hwtranscode", + ImaggaV2 = "imagga-v2", IncreasePasswordComplexity = "increase-password-complexity", Ios14PrivacyBanner = "ios14-privacy-banner", IterableNotificationTokens = "iterable-notification-tokens", + ItemClusters = "item_clusters", KeepPaymentMethod = "keep-payment-method", KevinBacon = "kevin-bacon", KoreaConsent = "korea-consent", @@ -273,29 +329,53 @@ export enum PostUsersSignInDataAuthenticationFeatures { LightningDvrPivot = "lightning-dvr-pivot", LiveTvSupportIncompleteSegments = "live-tv-support-incomplete-segments", Livetv = "livetv", + Lyrics = "lyrics", MetadataSearch = "metadata_search", + MusicAnalysis = "music-analysis", + MusicVideos = "music_videos", NewPlexPassPrices = "new_plex_pass_prices", NewsProviderSunsetModal = "news-provider-sunset-modal", + Nominatim = "nominatim", + Pass = "pass", PhotosFavorites = "photos-favorites", PhotosMetadataEdition = "photos-metadata-edition", + PhotosV6Edit = "photosV6-edit", + PhotosV6TvAlbums = "photosV6-tv-albums", PmsHealth = "pms_health", + PremiumDashboard = "premium-dashboard", + PremiumMusicMetadata = "premium_music_metadata", Radio = "radio", RateLimitClientToken = "rate-limit-client-token", ScrobblingServicePlexTv = "scrobbling-service-plex-tv", + SessionBandwidthRestrictions = "session_bandwidth_restrictions", + SessionKick = "session_kick", SharedServerNotification = "shared_server_notification", SharedSourceNotification = "shared_source_notification", + SigninNotification = "signin_notification", SigninWithApple = "signin_with_apple", + SilenceRemoval = "silence-removal", + SleepTimer = "sleep-timer", SpringServeAdProvider = "spring_serve_ad_provider", + Sync = "sync", + SweetFades = "sweet-fades", TranscoderCache = "transcoder_cache", + Trailers = "trailers", TunerSharing = "tuner-sharing", TwoFactorAuthentication = "two-factor-authentication", Unsupportedtuners = "unsupportedtuners", Upgrade3ds2 = "upgrade-3ds2", + Visualizers = "visualizers", VodSchema = "vod-schema", VodCloudflare = "vod_cloudflare", + VolumeLeveling = "volume-leveling", WatchTogetherInvite = "watch-together-invite", + WatchlistRss = "watchlist-rss", WebServerDashboard = "web_server_dashboard", + Webhooks = "webhooks", } +export type PostUsersSignInDataAuthenticationFeaturesOpen = OpenEnum< + typeof PostUsersSignInDataAuthenticationFeatures +>; /** * String representation of subscriptionActive @@ -309,7 +389,7 @@ export type PostUsersSignInDataAuthenticationSubscription = { /** * List of features allowed on your Plex Pass subscription */ - features?: Array | undefined; + features?: Array | undefined; /** * If the account's Plex Pass subscription is active */ @@ -444,7 +524,7 @@ export type PostUsersSignInDataUserPlexAccount = { */ id: number; /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ joinedAt: number; /** @@ -456,7 +536,7 @@ export type PostUsersSignInDataUserPlexAccount = { */ mailingListActive?: boolean | undefined; /** - * Your current mailing list status + * Your current mailing list status (active or unsubscribed) */ mailingListStatus: PostUsersSignInDataMailingListStatus; /** @@ -475,7 +555,7 @@ export type PostUsersSignInDataUserPlexAccount = { */ protected?: boolean | undefined; /** - * Unix epoch datetime + * Unix epoch datetime in seconds */ rememberExpiresAt: number; /** @@ -520,6 +600,7 @@ export type PostUsersSignInDataUserPlexAccount = { * The account UUID */ uuid: string; + attributionPartner: string | null; pastSubscriptions: Array; trials: Array; }; @@ -549,16 +630,28 @@ export const PostUsersSignInDataGlobals$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - "X-Plex-Client-Identifier": z.string().optional(), + ClientID: z.string().optional(), + ClientName: z.string().optional(), + DeviceName: z.string().optional(), + ClientVersion: z.string().optional(), + ClientPlatform: z.string().optional(), }).transform((v) => { return remap$(v, { - "X-Plex-Client-Identifier": "xPlexClientIdentifier", + "ClientID": "clientID", + "ClientName": "clientName", + "DeviceName": "deviceName", + "ClientVersion": "clientVersion", + "ClientPlatform": "clientPlatform", }); }); /** @internal */ export type PostUsersSignInDataGlobals$Outbound = { - "X-Plex-Client-Identifier"?: string | undefined; + ClientID?: string | undefined; + ClientName?: string | undefined; + DeviceName?: string | undefined; + ClientVersion?: string | undefined; + ClientPlatform?: string | undefined; }; /** @internal */ @@ -567,10 +660,18 @@ export const PostUsersSignInDataGlobals$outboundSchema: z.ZodType< z.ZodTypeDef, PostUsersSignInDataGlobals > = z.object({ - xPlexClientIdentifier: z.string().optional(), + clientID: z.string().optional(), + clientName: z.string().optional(), + deviceName: z.string().optional(), + clientVersion: z.string().optional(), + clientPlatform: z.string().optional(), }).transform((v) => { return remap$(v, { - xPlexClientIdentifier: "X-Plex-Client-Identifier", + clientID: "ClientID", + clientName: "ClientName", + deviceName: "DeviceName", + clientVersion: "ClientVersion", + clientPlatform: "ClientPlatform", }); }); @@ -638,19 +739,31 @@ export const PostUsersSignInDataRequest$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - "X-Plex-Client-Identifier": z.string().optional(), + ClientID: z.string().optional(), + ClientName: z.string().optional(), + DeviceName: z.string().optional(), + ClientVersion: z.string().optional(), + ClientPlatform: z.string().optional(), RequestBody: z.lazy(() => PostUsersSignInDataRequestBody$inboundSchema) .optional(), }).transform((v) => { return remap$(v, { - "X-Plex-Client-Identifier": "xPlexClientIdentifier", + "ClientID": "clientID", + "ClientName": "clientName", + "DeviceName": "deviceName", + "ClientVersion": "clientVersion", + "ClientPlatform": "clientPlatform", "RequestBody": "requestBody", }); }); /** @internal */ export type PostUsersSignInDataRequest$Outbound = { - "X-Plex-Client-Identifier"?: string | undefined; + ClientID?: string | undefined; + ClientName?: string | undefined; + DeviceName?: string | undefined; + ClientVersion?: string | undefined; + ClientPlatform?: string | undefined; RequestBody?: PostUsersSignInDataRequestBody$Outbound | undefined; }; @@ -660,12 +773,20 @@ export const PostUsersSignInDataRequest$outboundSchema: z.ZodType< z.ZodTypeDef, PostUsersSignInDataRequest > = z.object({ - xPlexClientIdentifier: z.string().optional(), + clientID: z.string().optional(), + clientName: z.string().optional(), + deviceName: z.string().optional(), + clientVersion: z.string().optional(), + clientPlatform: z.string().optional(), requestBody: z.lazy(() => PostUsersSignInDataRequestBody$outboundSchema) .optional(), }).transform((v) => { return remap$(v, { - xPlexClientIdentifier: "X-Plex-Client-Identifier", + clientID: "ClientID", + clientName: "ClientName", + deviceName: "DeviceName", + clientVersion: "ClientVersion", + clientPlatform: "ClientPlatform", requestBody: "RequestBody", }); }); @@ -832,16 +953,13 @@ export const PostUsersSignInDataUserProfile$inboundSchema: z.ZodType< autoSelectAudio: z.boolean().default(true), defaultAudioLanguage: z.nullable(z.string()), defaultSubtitleLanguage: z.nullable(z.string()), - autoSelectSubtitle: PostUsersSignInDataAutoSelectSubtitle$inboundSchema - .optional(), + autoSelectSubtitle: PostUsersSignInDataAutoSelectSubtitle$inboundSchema, defaultSubtitleAccessibility: - PostUsersSignInDataDefaultSubtitleAccessibility$inboundSchema.optional(), - defaultSubtitleForced: PostUsersSignInDataDefaultSubtitleForced$inboundSchema - .optional(), - watchedIndicator: PostUsersSignInDataWatchedIndicator$inboundSchema - .optional(), + PostUsersSignInDataDefaultSubtitleAccessibility$inboundSchema, + defaultSubtitleForced: PostUsersSignInDataDefaultSubtitleForced$inboundSchema, + watchedIndicator: PostUsersSignInDataWatchedIndicator$inboundSchema, mediaReviewsVisibility: - PostUsersSignInDataMediaReviewsVisibility$inboundSchema.optional(), + PostUsersSignInDataMediaReviewsVisibility$inboundSchema, }); /** @internal */ @@ -849,11 +967,11 @@ export type PostUsersSignInDataUserProfile$Outbound = { autoSelectAudio: boolean; defaultAudioLanguage: string | null; defaultSubtitleLanguage: string | null; - autoSelectSubtitle?: string | undefined; - defaultSubtitleAccessibility?: string | undefined; - defaultSubtitleForced?: string | undefined; - watchedIndicator?: string | undefined; - mediaReviewsVisibility?: number | undefined; + autoSelectSubtitle: number; + defaultSubtitleAccessibility: number; + defaultSubtitleForced: number; + watchedIndicator: number; + mediaReviewsVisibility: number; }; /** @internal */ @@ -866,15 +984,20 @@ export const PostUsersSignInDataUserProfile$outboundSchema: z.ZodType< defaultAudioLanguage: z.nullable(z.string()), defaultSubtitleLanguage: z.nullable(z.string()), autoSelectSubtitle: PostUsersSignInDataAutoSelectSubtitle$outboundSchema - .optional(), + .default(PostUsersSignInDataAutoSelectSubtitle.Disable), defaultSubtitleAccessibility: - PostUsersSignInDataDefaultSubtitleAccessibility$outboundSchema.optional(), + PostUsersSignInDataDefaultSubtitleAccessibility$outboundSchema.default( + PostUsersSignInDataDefaultSubtitleAccessibility.Disable, + ), defaultSubtitleForced: PostUsersSignInDataDefaultSubtitleForced$outboundSchema - .optional(), - watchedIndicator: PostUsersSignInDataWatchedIndicator$outboundSchema - .optional(), + .default(PostUsersSignInDataDefaultSubtitleForced.Disable), + watchedIndicator: PostUsersSignInDataWatchedIndicator$outboundSchema.default( + PostUsersSignInDataWatchedIndicator.Disable, + ), mediaReviewsVisibility: - PostUsersSignInDataMediaReviewsVisibility$outboundSchema.optional(), + PostUsersSignInDataMediaReviewsVisibility$outboundSchema.default( + PostUsersSignInDataMediaReviewsVisibility.Disable, + ), }); /** @@ -960,14 +1083,25 @@ export namespace PostUsersSignInDataServices$ { } /** @internal */ -export const PostUsersSignInDataFeatures$inboundSchema: z.ZodNativeEnum< - typeof PostUsersSignInDataFeatures -> = z.nativeEnum(PostUsersSignInDataFeatures); +export const PostUsersSignInDataFeatures$inboundSchema: z.ZodType< + PostUsersSignInDataFeaturesOpen, + z.ZodTypeDef, + unknown +> = z + .union([ + z.nativeEnum(PostUsersSignInDataFeatures), + z.string().transform(catchUnrecognizedEnum), + ]); /** @internal */ -export const PostUsersSignInDataFeatures$outboundSchema: z.ZodNativeEnum< - typeof PostUsersSignInDataFeatures -> = PostUsersSignInDataFeatures$inboundSchema; +export const PostUsersSignInDataFeatures$outboundSchema: z.ZodType< + PostUsersSignInDataFeaturesOpen, + z.ZodTypeDef, + PostUsersSignInDataFeaturesOpen +> = z.union([ + z.nativeEnum(PostUsersSignInDataFeatures), + z.string().and(z.custom>()), +]); /** * @internal @@ -1055,14 +1189,26 @@ export namespace PostUsersSignInDataSubscription$ { } /** @internal */ -export const PostUsersSignInDataAuthenticationFeatures$inboundSchema: - z.ZodNativeEnum = z - .nativeEnum(PostUsersSignInDataAuthenticationFeatures); +export const PostUsersSignInDataAuthenticationFeatures$inboundSchema: z.ZodType< + PostUsersSignInDataAuthenticationFeaturesOpen, + z.ZodTypeDef, + unknown +> = z + .union([ + z.nativeEnum(PostUsersSignInDataAuthenticationFeatures), + z.string().transform(catchUnrecognizedEnum), + ]); /** @internal */ export const PostUsersSignInDataAuthenticationFeatures$outboundSchema: - z.ZodNativeEnum = - PostUsersSignInDataAuthenticationFeatures$inboundSchema; + z.ZodType< + PostUsersSignInDataAuthenticationFeaturesOpen, + z.ZodTypeDef, + PostUsersSignInDataAuthenticationFeaturesOpen + > = z.union([ + z.nativeEnum(PostUsersSignInDataAuthenticationFeatures), + z.string().and(z.custom>()), + ]); /** * @internal @@ -1403,6 +1549,7 @@ export const PostUsersSignInDataUserPlexAccount$inboundSchema: z.ZodType< twoFactorEnabled: z.boolean().default(false), username: z.string(), uuid: z.string(), + attributionPartner: z.nullable(z.string()), pastSubscriptions: z.array(z.lazy(() => PastSubscription$inboundSchema)), trials: z.array(z.lazy(() => Trials$inboundSchema)), }); @@ -1449,6 +1596,7 @@ export type PostUsersSignInDataUserPlexAccount$Outbound = { twoFactorEnabled: boolean; username: string; uuid: string; + attributionPartner: string | null; pastSubscriptions: Array; trials: Array; }; @@ -1501,6 +1649,7 @@ export const PostUsersSignInDataUserPlexAccount$outboundSchema: z.ZodType< twoFactorEnabled: z.boolean().default(false), username: z.string(), uuid: z.string(), + attributionPartner: z.nullable(z.string()), pastSubscriptions: z.array(z.lazy(() => PastSubscription$outboundSchema)), trials: z.array(z.lazy(() => Trials$outboundSchema)), }); diff --git a/src/sdk/models/operations/uploadplaylist.ts b/src/sdk/models/operations/uploadplaylist.ts index 808c5ae5..b9ac20f9 100644 --- a/src/sdk/models/operations/uploadplaylist.ts +++ b/src/sdk/models/operations/uploadplaylist.ts @@ -39,6 +39,10 @@ export type UploadPlaylistRequest = { * If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded. */ force: QueryParamForce; + /** + * Possibly the section ID to upload the playlist to, we are not certain. + */ + sectionID?: number | undefined; }; export type UploadPlaylistResponse = { @@ -85,12 +89,14 @@ export const UploadPlaylistRequest$inboundSchema: z.ZodType< > = z.object({ path: z.string(), force: QueryParamForce$inboundSchema, + sectionID: z.number().int().default(1), }); /** @internal */ export type UploadPlaylistRequest$Outbound = { path: string; force: number; + sectionID: number; }; /** @internal */ @@ -101,6 +107,7 @@ export const UploadPlaylistRequest$outboundSchema: z.ZodType< > = z.object({ path: z.string(), force: QueryParamForce$outboundSchema, + sectionID: z.number().int().default(1), }); /** diff --git a/src/sdk/playlists.ts b/src/sdk/playlists.ts index 6410e146..ddaadc62 100644 --- a/src/sdk/playlists.ts +++ b/src/sdk/playlists.ts @@ -180,12 +180,14 @@ export class Playlists extends ClientSDK { async uploadPlaylist( path: string, force: operations.QueryParamForce, + sectionID: number | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(playlistsUploadPlaylist( this, path, force, + sectionID, options, )); } diff --git a/src/sdk/plex.ts b/src/sdk/plex.ts index d9f597ab..c020538c 100644 --- a/src/sdk/plex.ts +++ b/src/sdk/plex.ts @@ -81,18 +81,18 @@ export class Plex extends ClientSDK { * Get Plex server access tokens and server connections */ async getServerResources( - xPlexClientIdentifier?: string | undefined, includeHttps?: operations.IncludeHttps | undefined, includeRelay?: operations.IncludeRelay | undefined, includeIPv6?: operations.IncludeIPv6 | undefined, + clientID?: string | undefined, options?: RequestOptions & { serverURL?: string }, ): Promise { return unwrapAsync(plexGetServerResources( this, - xPlexClientIdentifier, includeHttps, includeRelay, includeIPv6, + clientID, options, )); } @@ -101,19 +101,15 @@ export class Plex extends ClientSDK { * Get a Pin * * @remarks - * Retrieve a Pin from Plex.tv for authentication flows + * Retrieve a Pin ID from Plex.tv to use for authentication flows */ async getPin( - strong?: boolean | undefined, - xPlexClientIdentifier?: string | undefined, - xPlexProduct?: string | undefined, + request: operations.GetPinRequest, options?: RequestOptions & { serverURL?: string }, ): Promise { return unwrapAsync(plexGetPin( this, - strong, - xPlexClientIdentifier, - xPlexProduct, + request, options, )); } @@ -125,14 +121,12 @@ export class Plex extends ClientSDK { * Retrieve an Access Token from Plex.tv after the Pin has been authenticated */ async getTokenByPinId( - pinID: number, - xPlexClientIdentifier?: string | undefined, + request: operations.GetTokenByPinIdRequest, options?: RequestOptions & { serverURL?: string }, ): Promise { return unwrapAsync(plexGetTokenByPinId( this, - pinID, - xPlexClientIdentifier, + request, options, )); } diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 47b2af32..a3ab3b0c 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -23,81 +23,81 @@ import { Watchlist } from "./watchlist.js"; export class PlexAPI extends ClientSDK { private _server?: Server; get server(): Server { - return (this._server ??= new Server(this.options$)); + return (this._server ??= new Server(this._options)); } private _media?: Media; get media(): Media { - return (this._media ??= new Media(this.options$)); + return (this._media ??= new Media(this._options)); } private _video?: Video; get video(): Video { - return (this._video ??= new Video(this.options$)); + return (this._video ??= new Video(this._options)); } private _activities?: Activities; get activities(): Activities { - return (this._activities ??= new Activities(this.options$)); + return (this._activities ??= new Activities(this._options)); } private _butler?: Butler; get butler(): Butler { - return (this._butler ??= new Butler(this.options$)); + return (this._butler ??= new Butler(this._options)); } private _plex?: Plex; get plex(): Plex { - return (this._plex ??= new Plex(this.options$)); + return (this._plex ??= new Plex(this._options)); } private _hubs?: Hubs; get hubs(): Hubs { - return (this._hubs ??= new Hubs(this.options$)); + return (this._hubs ??= new Hubs(this._options)); } private _search?: Search; get search(): Search { - return (this._search ??= new Search(this.options$)); + return (this._search ??= new Search(this._options)); } private _library?: Library; get library(): Library { - return (this._library ??= new Library(this.options$)); + return (this._library ??= new Library(this._options)); } private _watchlist?: Watchlist; get watchlist(): Watchlist { - return (this._watchlist ??= new Watchlist(this.options$)); + return (this._watchlist ??= new Watchlist(this._options)); } private _log?: Log; get log(): Log { - return (this._log ??= new Log(this.options$)); + return (this._log ??= new Log(this._options)); } private _playlists?: Playlists; get playlists(): Playlists { - return (this._playlists ??= new Playlists(this.options$)); + return (this._playlists ??= new Playlists(this._options)); } private _authentication?: Authentication; get authentication(): Authentication { - return (this._authentication ??= new Authentication(this.options$)); + return (this._authentication ??= new Authentication(this._options)); } private _statistics?: Statistics; get statistics(): Statistics { - return (this._statistics ??= new Statistics(this.options$)); + return (this._statistics ??= new Statistics(this._options)); } private _sessions?: Sessions; get sessions(): Sessions { - return (this._sessions ??= new Sessions(this.options$)); + return (this._sessions ??= new Sessions(this._options)); } private _updater?: Updater; get updater(): Updater { - return (this._updater ??= new Updater(this.options$)); + return (this._updater ??= new Updater(this._options)); } }