diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index f4c02c20..ccef3cbc 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: 2ad2b4c59994082e04faa0c3e7675f3e + docChecksum: f627107f2ac6c53325be4f291ae2dea7 docVersion: 0.0.3 - speakeasyVersion: 1.377.1 - generationVersion: 2.404.1 - releaseVersion: 0.19.0 - configChecksum: 685039d8e4f59693f709afebf0849817 + speakeasyVersion: 1.390.7 + generationVersion: 2.409.8 + releaseVersion: 0.20.0 + configChecksum: 1eb0f35569735ddf4ea84adabb3887ba repoURL: https://github.com/LukeHagar/plexjs.git repoSubDirectory: . installationURL: https://github.com/LukeHagar/plexjs @@ -14,10 +14,11 @@ management: features: typescript: additionalDependencies: 0.1.0 - constsAndDefaults: 0.1.10 - core: 3.14.1 + constsAndDefaults: 0.1.11 + core: 3.16.1 defaultEnabledRetries: 0.1.0 deprecations: 2.81.1 + downloadStreams: 0.1.1 envVarSecurityUsage: 0.1.1 flattening: 2.81.1 globalSecurity: 2.82.11 @@ -31,7 +32,6 @@ features: responseFormat: 0.2.3 retries: 2.83.0 sdkHooks: 0.1.0 - typeOverrides: 2.81.1 unions: 2.85.7 generatedFiles: - src/funcs/serverGetServerCapabilities.ts @@ -41,10 +41,13 @@ generatedFiles: - src/funcs/serverGetServerIdentity.ts - src/funcs/serverGetMyPlexAccount.ts - src/funcs/serverGetResizedPhoto.ts + - src/funcs/serverGetMediaProviders.ts - src/funcs/serverGetServerList.ts - src/funcs/mediaMarkPlayed.ts - src/funcs/mediaMarkUnplayed.ts - src/funcs/mediaUpdatePlayProgress.ts + - src/funcs/mediaGetBannerImage.ts + - src/funcs/mediaGetThumbImage.ts - src/funcs/videoGetTimeline.ts - src/funcs/videoStartUniversalTranscode.ts - src/funcs/activitiesGetServerActivities.ts @@ -58,10 +61,9 @@ generatedFiles: - src/funcs/plexGetUserFriends.ts - src/funcs/plexGetGeoData.ts - src/funcs/plexGetHomeData.ts - - src/funcs/plexGetResources.ts + - src/funcs/plexGetServerResources.ts - src/funcs/plexGetPin.ts - src/funcs/plexGetTokenByPinId.ts - - src/funcs/plexGetUserDetails.ts - src/funcs/hubsGetGlobalHubs.ts - src/funcs/hubsGetLibraryHubs.ts - src/funcs/searchPerformSearch.ts @@ -69,16 +71,17 @@ generatedFiles: - src/funcs/searchGetSearchResults.ts - src/funcs/libraryGetFileHash.ts - src/funcs/libraryGetRecentlyAdded.ts - - src/funcs/libraryGetLibraries.ts - - src/funcs/libraryGetLibrary.ts + - src/funcs/libraryGetAllLibraries.ts + - src/funcs/libraryGetLibraryDetails.ts - src/funcs/libraryDeleteLibrary.ts - src/funcs/libraryGetLibraryItems.ts - - src/funcs/libraryRefreshLibrary.ts - - src/funcs/librarySearchLibrary.ts - - src/funcs/libraryGetMetadata.ts + - src/funcs/libraryGetRefreshLibraryMetadata.ts + - src/funcs/libraryGetSearchLibrary.ts + - src/funcs/libraryGetMetaDataByRatingKey.ts - src/funcs/libraryGetMetadataChildren.ts - src/funcs/libraryGetTopWatchedContent.ts - src/funcs/libraryGetOnDeck.ts + - src/funcs/watchlistGetWatchList.ts - src/funcs/logLogLine.ts - src/funcs/logLogMultiLine.ts - src/funcs/logEnablePaperTrail.ts @@ -93,6 +96,8 @@ generatedFiles: - src/funcs/playlistsUploadPlaylist.ts - src/funcs/authenticationGetTransientToken.ts - src/funcs/authenticationGetSourceConnectionInformation.ts + - src/funcs/authenticationGetUserDetails.ts + - src/funcs/authenticationPostUsersSignInData.ts - src/funcs/statisticsGetStatistics.ts - src/funcs/statisticsGetResourcesStatistics.ts - src/funcs/statisticsGetBandwidthStatistics.ts @@ -103,8 +108,6 @@ generatedFiles: - src/funcs/updaterGetUpdateStatus.ts - src/funcs/updaterCheckForUpdates.ts - src/funcs/updaterApplyUpdates.ts - - src/funcs/userPostUsersSigninData.ts - - src/funcs/watchlistGetWatchlist.ts - src/sdk/server.ts - src/sdk/media.ts - src/sdk/video.ts @@ -114,14 +117,13 @@ generatedFiles: - src/sdk/hubs.ts - src/sdk/search.ts - src/sdk/library.ts + - src/sdk/watchlist.ts - src/sdk/log.ts - src/sdk/playlists.ts - src/sdk/authentication.ts - src/sdk/statistics.ts - src/sdk/sessions.ts - src/sdk/updater.ts - - src/sdk/user.ts - - src/sdk/watchlist.ts - src/sdk/sdk.ts - .eslintrc.cjs - .npmignore @@ -135,6 +137,7 @@ generatedFiles: - src/lib/config.ts - src/lib/dlv.ts - src/lib/encodings.ts + - src/lib/files.ts - src/lib/http.ts - src/lib/is-plain-object.ts - src/lib/logger.ts @@ -156,6 +159,7 @@ generatedFiles: - src/types/index.ts - src/types/operations.ts - src/types/rfcdate.ts + - src/types/streams.ts - tsconfig.json - src/models/getservercapabilitiesop.ts - src/models/getserverpreferencesop.ts @@ -164,10 +168,13 @@ generatedFiles: - src/models/getserveridentityop.ts - src/models/getmyplexaccountop.ts - src/models/getresizedphotoop.ts + - src/models/getmediaprovidersop.ts - src/models/getserverlistop.ts - src/models/markplayedop.ts - src/models/markunplayedop.ts - src/models/updateplayprogressop.ts + - src/models/getbannerimageop.ts + - src/models/getthumbimageop.ts - src/models/gettimelineop.ts - src/models/startuniversaltranscodeop.ts - src/models/getserveractivitiesop.ts @@ -181,10 +188,9 @@ generatedFiles: - src/models/getuserfriendsop.ts - src/models/getgeodataop.ts - src/models/gethomedataop.ts - - src/models/getresourcesop.ts + - src/models/getserverresourcesop.ts - src/models/getpinop.ts - src/models/gettokenbypinidop.ts - - src/models/getuserdetailsop.ts - src/models/getglobalhubsop.ts - src/models/getlibraryhubsop.ts - src/models/performsearchop.ts @@ -192,16 +198,17 @@ generatedFiles: - src/models/getsearchresultsop.ts - src/models/getfilehashop.ts - src/models/getrecentlyaddedop.ts - - src/models/getlibrariesop.ts - - src/models/getlibraryop.ts + - src/models/getalllibrariesop.ts + - src/models/getlibrarydetailsop.ts - src/models/deletelibraryop.ts - src/models/getlibraryitemsop.ts - - src/models/refreshlibraryop.ts - - src/models/searchlibraryop.ts - - src/models/getmetadataop.ts + - src/models/getrefreshlibrarymetadataop.ts + - src/models/getsearchlibraryop.ts + - src/models/getmetadatabyratingkeyop.ts - src/models/getmetadatachildrenop.ts - src/models/gettopwatchedcontentop.ts - src/models/getondeckop.ts + - src/models/getwatchlistop.ts - src/models/loglineop.ts - src/models/logmultilineop.ts - src/models/enablepapertrailop.ts @@ -216,6 +223,8 @@ generatedFiles: - src/models/uploadplaylistop.ts - src/models/gettransienttokenop.ts - src/models/getsourceconnectioninformationop.ts + - src/models/getuserdetailsop.ts + - src/models/postuserssignindataop.ts - src/models/getstatisticsop.ts - src/models/getresourcesstatisticsop.ts - src/models/getbandwidthstatisticsop.ts @@ -226,8 +235,6 @@ generatedFiles: - src/models/getupdatestatusop.ts - src/models/checkforupdatesop.ts - src/models/applyupdatesop.ts - - src/models/postuserssignindataop.ts - - src/models/getwatchlistop.ts - src/models/security.ts - src/models/index.ts - docs/models/errors.md @@ -254,7 +261,6 @@ generatedFiles: - docs/models/getdevicesmediacontainer.md - docs/models/getdevicesresponsebody.md - docs/models/getdevicesresponse.md - - docs/models/getserveridentityerrors.md - docs/models/getserveridentityserverresponsebody.md - docs/models/getserveridentitymediacontainer.md - docs/models/getserveridentityresponsebody.md @@ -270,6 +276,16 @@ generatedFiles: - docs/models/getresizedphotoerrors.md - docs/models/getresizedphotoresponsebody.md - docs/models/getresizedphotoresponse.md + - docs/models/getmediaprovidersrequest.md + - docs/models/getmediaproviderserrors.md + - docs/models/getmediaprovidersserverresponsebody.md + - docs/models/pivot.md + - docs/models/getmediaprovidersdirectory.md + - docs/models/feature.md + - docs/models/mediaprovider.md + - docs/models/getmediaprovidersmediacontainer.md + - docs/models/getmediaprovidersresponsebody.md + - docs/models/getmediaprovidersresponse.md - docs/models/getserverlisterrors.md - docs/models/getserverlistserverresponsebody.md - docs/models/getserverlistserver.md @@ -288,6 +304,14 @@ generatedFiles: - docs/models/updateplayprogresserrors.md - docs/models/updateplayprogressresponsebody.md - docs/models/updateplayprogressresponse.md + - docs/models/getbannerimagerequest.md + - docs/models/getbannerimageerrors.md + - docs/models/getbannerimageresponsebody.md + - docs/models/getbannerimageresponse.md + - docs/models/getthumbimagerequest.md + - docs/models/getthumbimageerrors.md + - docs/models/getthumbimageresponsebody.md + - docs/models/getthumbimageresponse.md - docs/models/state.md - docs/models/gettimelinerequest.md - docs/models/gettimelineerrors.md @@ -349,16 +373,16 @@ generatedFiles: - docs/models/gethomedataplexresponsebody.md - docs/models/gethomedataresponsebody.md - docs/models/gethomedataresponse.md - - docs/models/getresourcesglobals.md + - docs/models/getserverresourcesglobals.md - docs/models/includehttps.md - docs/models/includerelay.md - docs/models/includeipv6.md - - docs/models/getresourcesrequest.md - - docs/models/getresourceserrors.md - - docs/models/getresourcesresponsebody.md + - docs/models/getserverresourcesrequest.md + - docs/models/getserverresourceserrors.md + - docs/models/getserverresourcesresponsebody.md - docs/models/connections.md - docs/models/plexdevice.md - - docs/models/getresourcesresponse.md + - docs/models/getserverresourcesresponse.md - docs/models/getpinglobals.md - docs/models/getpinrequest.md - docs/models/getpinerrors.md @@ -368,25 +392,13 @@ generatedFiles: - docs/models/getpinresponse.md - docs/models/gettokenbypinidglobals.md - docs/models/gettokenbypinidrequest.md + - docs/models/gettokenbypinidplexerrors.md + - docs/models/gettokenbypinidplexresponsebody.md - docs/models/gettokenbypiniderrors.md - docs/models/gettokenbypinidresponsebody.md - docs/models/gettokenbypinidgeodata.md - docs/models/gettokenbypinidauthpincontainer.md - docs/models/gettokenbypinidresponse.md - - docs/models/getuserdetailserrors.md - - docs/models/getuserdetailsresponsebody.md - - docs/models/mailingliststatus.md - - docs/models/userprofile.md - - docs/models/getuserdetailsstatus.md - - docs/models/services.md - - docs/models/features.md - - docs/models/getuserdetailsplexstatus.md - - docs/models/subscription.md - - docs/models/getuserdetailsfeatures.md - - docs/models/getuserdetailsplexresponsestatus.md - - docs/models/getuserdetailssubscription.md - - docs/models/getuserdetailsuserplexaccount.md - - docs/models/getuserdetailsresponse.md - docs/models/onlytransient.md - docs/models/getglobalhubsrequest.md - docs/models/getglobalhubserrors.md @@ -440,6 +452,7 @@ generatedFiles: - docs/models/getfilehasherrors.md - docs/models/getfilehashresponsebody.md - docs/models/getfilehashresponse.md + - docs/models/getrecentlyaddedrequest.md - docs/models/getrecentlyaddederrors.md - docs/models/getrecentlyaddedlibraryresponsebody.md - docs/models/part.md @@ -453,32 +466,35 @@ generatedFiles: - docs/models/getrecentlyaddedmediacontainer.md - docs/models/getrecentlyaddedresponsebody.md - docs/models/getrecentlyaddedresponse.md - - docs/models/getlibrarieserrors.md - - docs/models/getlibrarieslibraryresponsebody.md + - docs/models/getalllibrarieserrors.md + - docs/models/getalllibrarieslibraryresponsebody.md - docs/models/location.md - - docs/models/getlibrariesdirectory.md - - docs/models/getlibrariesmediacontainer.md - - docs/models/getlibrariesresponsebody.md - - docs/models/getlibrariesresponse.md + - docs/models/getalllibrariesdirectory.md + - docs/models/getalllibrariesmediacontainer.md + - docs/models/getalllibrariesresponsebody.md + - docs/models/getalllibrariesresponse.md - docs/models/includedetails.md - - docs/models/getlibraryrequest.md - - docs/models/getlibraryerrors.md - - docs/models/getlibrarylibraryresponsebody.md - - docs/models/getlibrarydirectory.md - - docs/models/getlibraryfilter.md + - docs/models/getlibrarydetailsrequest.md + - docs/models/getlibrarydetailserrors.md + - docs/models/getlibrarydetailslibraryresponsebody.md + - docs/models/getlibrarydetailsdirectory.md + - docs/models/getlibrarydetailsfilter.md - docs/models/sort.md - docs/models/field.md - - docs/models/getlibrarytype.md + - docs/models/getlibrarydetailstype.md - docs/models/operator.md - docs/models/fieldtype.md - - docs/models/getlibrarymediacontainer.md - - docs/models/getlibraryresponsebody.md - - docs/models/getlibraryresponse.md + - docs/models/getlibrarydetailsmediacontainer.md + - docs/models/getlibrarydetailsresponsebody.md + - docs/models/getlibrarydetailsresponse.md - docs/models/deletelibraryrequest.md - docs/models/deletelibraryerrors.md - docs/models/deletelibraryresponsebody.md - docs/models/deletelibraryresponse.md - docs/models/tag.md + - docs/models/includeguids.md + - docs/models/includemeta.md + - docs/models/type.md - docs/models/getlibraryitemsrequest.md - docs/models/getlibraryitemserrors.md - docs/models/getlibraryitemslibraryresponsebody.md @@ -494,36 +510,37 @@ generatedFiles: - docs/models/getlibraryitemsmediacontainer.md - docs/models/getlibraryitemsresponsebody.md - docs/models/getlibraryitemsresponse.md - - docs/models/refreshlibraryrequest.md - - docs/models/refreshlibraryerrors.md - - docs/models/refreshlibraryresponsebody.md - - docs/models/refreshlibraryresponse.md - - docs/models/type.md - - docs/models/searchlibraryrequest.md - - docs/models/searchlibraryerrors.md - - docs/models/searchlibrarylibraryresponsebody.md - - docs/models/searchlibrarymetadata.md - - docs/models/searchlibrarymediacontainer.md - - docs/models/searchlibraryresponsebody.md - - docs/models/searchlibraryresponse.md - - docs/models/getmetadatarequest.md - - docs/models/getmetadataerrors.md - - docs/models/getmetadatalibraryresponsebody.md + - docs/models/force.md + - docs/models/getrefreshlibrarymetadatarequest.md + - docs/models/getrefreshlibrarymetadataerrors.md + - docs/models/getrefreshlibrarymetadataresponsebody.md + - docs/models/getrefreshlibrarymetadataresponse.md + - docs/models/queryparamtype.md + - docs/models/getsearchlibraryrequest.md + - docs/models/getsearchlibraryerrors.md + - docs/models/getsearchlibrarylibraryresponsebody.md + - docs/models/getsearchlibrarymetadata.md + - docs/models/getsearchlibrarymediacontainer.md + - docs/models/getsearchlibraryresponsebody.md + - docs/models/getsearchlibraryresponse.md + - docs/models/getmetadatabyratingkeyrequest.md + - docs/models/getmetadatabyratingkeyerrors.md + - docs/models/getmetadatabyratingkeylibraryresponsebody.md - docs/models/stream.md - - docs/models/getmetadatapart.md - - docs/models/getmetadatamedia.md - - docs/models/getmetadatagenre.md - - docs/models/getmetadatacountry.md + - docs/models/getmetadatabyratingkeypart.md + - docs/models/getmetadatabyratingkeymedia.md + - docs/models/getmetadatabyratingkeygenre.md + - docs/models/getmetadatabyratingkeycountry.md - docs/models/guids.md - docs/models/ratings.md - - docs/models/getmetadatadirector.md - - docs/models/getmetadatawriter.md - - docs/models/getmetadatarole.md + - docs/models/getmetadatabyratingkeydirector.md + - docs/models/getmetadatabyratingkeywriter.md + - docs/models/getmetadatabyratingkeyrole.md - docs/models/producer.md - - docs/models/getmetadatametadata.md - - docs/models/getmetadatamediacontainer.md - - docs/models/getmetadataresponsebody.md - - docs/models/getmetadataresponse.md + - docs/models/getmetadatabyratingkeymetadata.md + - docs/models/getmetadatabyratingkeymediacontainer.md + - docs/models/getmetadatabyratingkeyresponsebody.md + - docs/models/getmetadatabyratingkeyresponse.md - docs/models/getmetadatachildrenrequest.md - docs/models/getmetadatachildrenerrors.md - docs/models/getmetadatachildrenlibraryresponsebody.md @@ -532,12 +549,15 @@ generatedFiles: - docs/models/getmetadatachildrenmediacontainer.md - docs/models/getmetadatachildrenresponsebody.md - docs/models/getmetadatachildrenresponse.md + - docs/models/gettopwatchedcontentqueryparamtype.md - docs/models/gettopwatchedcontentrequest.md + - docs/models/gettopwatchedcontenterrors.md + - docs/models/gettopwatchedcontentlibraryresponsebody.md - docs/models/gettopwatchedcontentgenre.md - docs/models/gettopwatchedcontentcountry.md - docs/models/gettopwatchedcontentguids.md - docs/models/gettopwatchedcontentrole.md - - docs/models/gettopwatchedcontentuser.md + - docs/models/user.md - docs/models/gettopwatchedcontentmetadata.md - docs/models/gettopwatchedcontentmediacontainer.md - docs/models/gettopwatchedcontentresponsebody.md @@ -552,6 +572,17 @@ generatedFiles: - docs/models/getondeckmediacontainer.md - docs/models/getondeckresponsebody.md - docs/models/getondeckresponse.md + - docs/models/filter.md + - docs/models/libtype.md + - docs/models/includecollections.md + - docs/models/includeexternalmedia.md + - docs/models/getwatchlistrequest.md + - docs/models/getwatchlisterrors.md + - docs/models/getwatchlistwatchlistresponsebody.md + - docs/models/image.md + - docs/models/metadata.md + - docs/models/getwatchlistresponsebody.md + - docs/models/getwatchlistresponse.md - docs/models/level.md - docs/models/loglinerequest.md - docs/models/loglineerrors.md @@ -563,7 +594,7 @@ generatedFiles: - docs/models/enablepapertrailerrors.md - docs/models/enablepapertrailresponsebody.md - docs/models/enablepapertrailresponse.md - - docs/models/queryparamtype.md + - docs/models/createplaylistqueryparamtype.md - docs/models/smart.md - docs/models/createplaylistrequest.md - docs/models/createplaylisterrors.md @@ -596,6 +627,7 @@ generatedFiles: - docs/models/updateplaylisterrors.md - docs/models/updateplaylistresponsebody.md - docs/models/updateplaylistresponse.md + - docs/models/getplaylistcontentsqueryparamtype.md - docs/models/getplaylistcontentsrequest.md - docs/models/getplaylistcontentserrors.md - docs/models/getplaylistcontentsplaylistsresponsebody.md @@ -621,7 +653,7 @@ generatedFiles: - docs/models/addplaylistcontentsmediacontainer.md - docs/models/addplaylistcontentsresponsebody.md - docs/models/addplaylistcontentsresponse.md - - docs/models/force.md + - docs/models/queryparamforce.md - docs/models/uploadplaylistrequest.md - docs/models/uploadplaylisterrors.md - docs/models/uploadplaylistresponsebody.md @@ -636,6 +668,53 @@ generatedFiles: - docs/models/getsourceconnectioninformationerrors.md - docs/models/getsourceconnectioninformationresponsebody.md - docs/models/getsourceconnectioninformationresponse.md + - docs/models/getuserdetailsrequest.md + - docs/models/getuserdetailserrors.md + - docs/models/getuserdetailsresponsebody.md + - docs/models/mailingliststatus.md + - docs/models/autoselectsubtitle.md + - docs/models/defaultsubtitleaccessibility.md + - docs/models/defaultsubtitleforced.md + - docs/models/watchedindicator.md + - docs/models/mediareviewsvisibility.md + - docs/models/userprofile.md + - docs/models/getuserdetailsstatus.md + - docs/models/services.md + - docs/models/features.md + - docs/models/getuserdetailsauthenticationstatus.md + - docs/models/subscription.md + - docs/models/getuserdetailsfeatures.md + - docs/models/getuserdetailsauthenticationresponsestatus.md + - docs/models/getuserdetailssubscription.md + - docs/models/getuserdetailsuserplexaccount.md + - docs/models/getuserdetailsresponse.md + - docs/models/postuserssignindataglobals.md + - docs/models/postuserssignindatarequestbody.md + - docs/models/postuserssignindatarequest.md + - docs/models/postuserssignindataerrors.md + - docs/models/postuserssignindataresponsebody.md + - docs/models/postuserssignindatamailingliststatus.md + - docs/models/postuserssignindataautoselectsubtitle.md + - docs/models/postuserssignindatadefaultsubtitleaccessibility.md + - docs/models/postuserssignindatadefaultsubtitleforced.md + - docs/models/postuserssignindatawatchedindicator.md + - docs/models/postuserssignindatamediareviewsvisibility.md + - docs/models/postuserssignindatauserprofile.md + - docs/models/postuserssignindatastatus.md + - docs/models/postuserssignindataservices.md + - docs/models/postuserssignindatafeatures.md + - docs/models/postuserssignindataauthenticationstatus.md + - docs/models/postuserssignindatasubscription.md + - docs/models/postuserssignindataauthenticationfeatures.md + - docs/models/postuserssignindataauthenticationresponsestatus.md + - docs/models/postuserssignindataauthenticationsubscription.md + - docs/models/postuserssignindatastate.md + - docs/models/internalpaymentmethod.md + - docs/models/billing.md + - docs/models/pastsubscription.md + - docs/models/trials.md + - docs/models/postuserssignindatauserplexaccount.md + - docs/models/postuserssignindataresponse.md - docs/models/getstatisticsrequest.md - docs/models/getstatisticserrors.md - docs/models/getstatisticsstatisticsresponsebody.md @@ -673,7 +752,7 @@ generatedFiles: - docs/models/getsessionsmediacontainer.md - docs/models/getsessionsresponsebody.md - docs/models/getsessionsresponse.md - - docs/models/filter.md + - docs/models/queryparamfilter.md - docs/models/getsessionhistoryrequest.md - docs/models/getsessionhistoryerrors.md - docs/models/getsessionhistorysessionsresponsebody.md @@ -708,39 +787,6 @@ generatedFiles: - docs/models/applyupdateserrors.md - docs/models/applyupdatesresponsebody.md - docs/models/applyupdatesresponse.md - - docs/models/postuserssignindataglobals.md - - docs/models/postuserssignindatarequestbody.md - - docs/models/postuserssignindatarequest.md - - docs/models/postuserssignindataerrors.md - - docs/models/postuserssignindataresponsebody.md - - docs/models/postuserssignindatamailingliststatus.md - - docs/models/postuserssignindatauserprofile.md - - docs/models/postuserssignindatastatus.md - - docs/models/postuserssignindataservices.md - - docs/models/postuserssignindatafeatures.md - - docs/models/postuserssignindatauserstatus.md - - docs/models/postuserssignindatasubscription.md - - docs/models/postuserssignindatauserfeatures.md - - docs/models/postuserssignindatauserresponsestatus.md - - docs/models/postuserssignindatausersubscription.md - - docs/models/postuserssignindatastate.md - - docs/models/internalpaymentmethod.md - - docs/models/billing.md - - docs/models/pastsubscription.md - - docs/models/trials.md - - docs/models/postuserssignindatauserplexaccount.md - - docs/models/postuserssignindataresponse.md - - docs/models/pathparamfilter.md - - docs/models/libtype.md - - docs/models/includecollections.md - - docs/models/includeexternalmedia.md - - docs/models/getwatchlistrequest.md - - docs/models/getwatchlisterrors.md - - docs/models/getwatchlistwatchlistresponsebody.md - - docs/models/image.md - - docs/models/metadata.md - - docs/models/getwatchlistresponsebody.md - - docs/models/getwatchlistresponse.md - docs/models/security.md - docs/sdks/plexapi/README.md - docs/lib/utils/retryconfig.md @@ -753,14 +799,13 @@ generatedFiles: - docs/sdks/hubs/README.md - docs/sdks/search/README.md - docs/sdks/library/README.md + - docs/sdks/watchlist/README.md - docs/sdks/log/README.md - docs/sdks/playlists/README.md - docs/sdks/authentication/README.md - docs/sdks/statistics/README.md - docs/sdks/sessions/README.md - docs/sdks/updater/README.md - - docs/sdks/user/README.md - - docs/sdks/watchlist/README.md - USAGE.md - .gitattributes - src/hooks/hooks.ts diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index c24abf48..78c334dd 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true typescript: - version: 0.19.0 + version: 0.20.0 additionalDependencies: dependencies: {} devDependencies: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 7f99ce36..fb032bbd 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.377.1 +speakeasyVersion: 1.390.7 sources: my-source: sourceNamespace: my-source - sourceRevisionDigest: sha256:4e103669d4bcf7c698608fa37524f3d644510de45959c5437c21b60b2fb2dd9f - sourceBlobDigest: sha256:3cb937b6d66508640fa6080fa4c16ebef73a438fbb21a1f8833d6dd2e8fcd5ee + sourceRevisionDigest: sha256:fff67c8d70fdb1711caf3e9c61cdc91a4c88ac98b3419c1d287db6ca95c7278b + sourceBlobDigest: sha256:235067aeeeba40f6a4b062d9b9e6816a6e1282023f9664b46cbc1af6495b4c53 tags: - latest - main @@ -11,10 +11,10 @@ targets: plexjs: source: my-source sourceNamespace: my-source - sourceRevisionDigest: sha256:4e103669d4bcf7c698608fa37524f3d644510de45959c5437c21b60b2fb2dd9f - sourceBlobDigest: sha256:3cb937b6d66508640fa6080fa4c16ebef73a438fbb21a1f8833d6dd2e8fcd5ee + sourceRevisionDigest: sha256:fff67c8d70fdb1711caf3e9c61cdc91a4c88ac98b3419c1d287db6ca95c7278b + sourceBlobDigest: sha256:235067aeeeba40f6a4b062d9b9e6816a6e1282023f9664b46cbc1af6495b4c53 codeSamplesNamespace: code-samples-typescript-plexjs - codeSamplesRevisionDigest: sha256:439dcb28ca6dc855201641d70fc56ac3a6685187d824eb3077145b6a5be15b8b + codeSamplesRevisionDigest: sha256:18919b4d52e4482e8771f2e3657d74cae7f332e481471d177e5b248a9ffc99bd outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/FUNCTIONS.md b/FUNCTIONS.md index d3ded6dd..a9456bf5 100644 --- a/FUNCTIONS.md +++ b/FUNCTIONS.md @@ -27,7 +27,7 @@ import { SDKValidationError } from "@lukehagar/plexjs/models/sdkvalidationerror. // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { diff --git a/README.md b/README.md index 92256b7e..cc5358e7 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,34 @@ + +## Summary + +Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server + + + +## Table of Contents + +* [SDK Installation](#sdk-installation) +* [Requirements](#requirements) +* [SDK Example Usage](#sdk-example-usage) +* [Available Resources and Operations](#available-resources-and-operations) +* [Standalone functions](#standalone-functions) +* [Global Parameters](#global-parameters) +* [Retries](#retries) +* [Error Handling](#error-handling) +* [Server Selection](#server-selection) +* [Custom HTTP Client](#custom-http-client) +* [Authentication](#authentication) +* [Debugging](#debugging) + + ## SDK Installation +The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers. + ### NPM ```bash @@ -48,7 +73,7 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -75,6 +100,7 @@ run(); * [getServerIdentity](docs/sdks/server/README.md#getserveridentity) - Get Server Identity * [getMyPlexAccount](docs/sdks/server/README.md#getmyplexaccount) - Get MyPlex Account * [getResizedPhoto](docs/sdks/server/README.md#getresizedphoto) - Get a Resized Photo +* [getMediaProviders](docs/sdks/server/README.md#getmediaproviders) - Get Media Providers * [getServerList](docs/sdks/server/README.md#getserverlist) - Get Server List ### [media](docs/sdks/media/README.md) @@ -82,6 +108,8 @@ run(); * [markPlayed](docs/sdks/media/README.md#markplayed) - Mark Media Played * [markUnplayed](docs/sdks/media/README.md#markunplayed) - Mark Media Unplayed * [updatePlayProgress](docs/sdks/media/README.md#updateplayprogress) - Update Media Play Progress +* [getBannerImage](docs/sdks/media/README.md#getbannerimage) - Get Banner Image +* [getThumbImage](docs/sdks/media/README.md#getthumbimage) - Get Thumb Image ### [video](docs/sdks/video/README.md) @@ -107,10 +135,9 @@ run(); * [getUserFriends](docs/sdks/plex/README.md#getuserfriends) - Get list of friends of the user logged in * [getGeoData](docs/sdks/plex/README.md#getgeodata) - Get Geo Data * [getHomeData](docs/sdks/plex/README.md#gethomedata) - Get Plex Home Data -* [getResources](docs/sdks/plex/README.md#getresources) - Get Resources +* [getServerResources](docs/sdks/plex/README.md#getserverresources) - Get Server Resources * [getPin](docs/sdks/plex/README.md#getpin) - Get a Pin * [getTokenByPinId](docs/sdks/plex/README.md#gettokenbypinid) - Get Access Token by PinId -* [getUserDetails](docs/sdks/plex/README.md#getuserdetails) - Get UserData By Token ### [hubs](docs/sdks/hubs/README.md) @@ -127,17 +154,21 @@ run(); * [getFileHash](docs/sdks/library/README.md#getfilehash) - Get Hash Value * [getRecentlyAdded](docs/sdks/library/README.md#getrecentlyadded) - Get Recently Added -* [getLibraries](docs/sdks/library/README.md#getlibraries) - Get All Libraries -* [getLibrary](docs/sdks/library/README.md#getlibrary) - Get Library Details +* [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 * [getLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items -* [refreshLibrary](docs/sdks/library/README.md#refreshlibrary) - Refresh Library -* [searchLibrary](docs/sdks/library/README.md#searchlibrary) - Search Library -* [getMetadata](docs/sdks/library/README.md#getmetadata) - Get Items Metadata +* [getRefreshLibraryMetadata](docs/sdks/library/README.md#getrefreshlibrarymetadata) - Refresh Metadata Of The Library +* [getSearchLibrary](docs/sdks/library/README.md#getsearchlibrary) - Search Library +* [getMetaDataByRatingKey](docs/sdks/library/README.md#getmetadatabyratingkey) - Get Metadata by RatingKey * [getMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children * [getTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content * [getOnDeck](docs/sdks/library/README.md#getondeck) - Get On Deck +### [watchlist](docs/sdks/watchlist/README.md) + +* [getWatchList](docs/sdks/watchlist/README.md#getwatchlist) - Get User Watchlist + ### [log](docs/sdks/log/README.md) * [logLine](docs/sdks/log/README.md#logline) - Logging a single line message. @@ -160,6 +191,8 @@ run(); * [getTransientToken](docs/sdks/authentication/README.md#gettransienttoken) - Get a Transient Token. * [getSourceConnectionInformation](docs/sdks/authentication/README.md#getsourceconnectioninformation) - Get Source Connection Information +* [getUserDetails](docs/sdks/authentication/README.md#getuserdetails) - Get User Data By Token +* [postUsersSignInData](docs/sdks/authentication/README.md#postuserssignindata) - Get User SignIn Data ### [statistics](docs/sdks/statistics/README.md) @@ -179,14 +212,6 @@ run(); * [getUpdateStatus](docs/sdks/updater/README.md#getupdatestatus) - Querying status of updates * [checkForUpdates](docs/sdks/updater/README.md#checkforupdates) - Checking for updates * [applyUpdates](docs/sdks/updater/README.md#applyupdates) - Apply Updates - -### [user](docs/sdks/user/README.md) - -* [postUsersSigninData](docs/sdks/user/README.md#postuserssignindata) - Get User SignIn Data - -### [watchlist](docs/sdks/watchlist/README.md) - -* [getWatchlist](docs/sdks/watchlist/README.md#getwatchlist) - Get User Watchlist @@ -203,18 +228,21 @@ Validation errors can also occur when either method arguments or data returned f ```typescript -import { PlexAPI } from "@lukehagar/plexjs"; +import { GetServerCapabilitiesServerResponseBody, PlexAPI } from "@lukehagar/plexjs"; import { SDKValidationError } from "@lukehagar/plexjs/models"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { let result; try { result = await plexAPI.server.getServerCapabilities(); + + // Handle the result + console.log(result); } catch (err) { switch (true) { case err instanceof SDKValidationError: { @@ -224,8 +252,9 @@ async function run() { console.error(err.rawValue); return; } - case err instanceof models.GetServerCapabilitiesServerResponseBody: { - console.error(err); // handle exception + case err instanceof GetServerCapabilitiesServerResponseBody: { + // Handle err.data$: GetServerCapabilitiesServerResponseBodyData + console.error(err); return; } default: { @@ -233,9 +262,6 @@ async function run() { } } } - - // Handle the result - console.log(result); } run(); @@ -252,7 +278,7 @@ You can override the default server globally by passing a server index to the `s | # | Server | Variables | | - | ------ | --------- | -| 0 | `{protocol}://{ip}:{port}` | `protocol` (default is `http`), `ip` (default is `10.10.10.47`), `port` (default is `32400`) | +| 0 | `{protocol}://{ip}:{port}` | `protocol` (default is `https`), `ip` (default is `10.10.10.47`), `port` (default is `32400`) | ```typescript import { PlexAPI } from "@lukehagar/plexjs"; @@ -260,7 +286,7 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ serverIdx: 0, accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -291,7 +317,7 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ serverURL: "{protocol}://{ip}:{port}", accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -313,7 +339,7 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -396,7 +422,7 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -436,6 +462,8 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [activitiesGetServerActivities](docs/sdks/activities/README.md#getserveractivities) - [authenticationGetSourceConnectionInformation](docs/sdks/authentication/README.md#getsourceconnectioninformation) - [authenticationGetTransientToken](docs/sdks/authentication/README.md#gettransienttoken) +- [authenticationGetUserDetails](docs/sdks/authentication/README.md#getuserdetails) +- [authenticationPostUsersSignInData](docs/sdks/authentication/README.md#postuserssignindata) - [butlerGetButlerTasks](docs/sdks/butler/README.md#getbutlertasks) - [butlerStartAllTasks](docs/sdks/butler/README.md#startalltasks) - [butlerStartTask](docs/sdks/butler/README.md#starttask) @@ -444,20 +472,22 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [hubsGetGlobalHubs](docs/sdks/hubs/README.md#getglobalhubs) - [hubsGetLibraryHubs](docs/sdks/hubs/README.md#getlibraryhubs) - [libraryDeleteLibrary](docs/sdks/library/README.md#deletelibrary) +- [libraryGetAllLibraries](docs/sdks/library/README.md#getalllibraries) - [libraryGetFileHash](docs/sdks/library/README.md#getfilehash) -- [libraryGetLibraries](docs/sdks/library/README.md#getlibraries) +- [libraryGetLibraryDetails](docs/sdks/library/README.md#getlibrarydetails) - [libraryGetLibraryItems](docs/sdks/library/README.md#getlibraryitems) -- [libraryGetLibrary](docs/sdks/library/README.md#getlibrary) +- [libraryGetMetaDataByRatingKey](docs/sdks/library/README.md#getmetadatabyratingkey) - [libraryGetMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) -- [libraryGetMetadata](docs/sdks/library/README.md#getmetadata) - [libraryGetOnDeck](docs/sdks/library/README.md#getondeck) - [libraryGetRecentlyAdded](docs/sdks/library/README.md#getrecentlyadded) +- [libraryGetRefreshLibraryMetadata](docs/sdks/library/README.md#getrefreshlibrarymetadata) +- [libraryGetSearchLibrary](docs/sdks/library/README.md#getsearchlibrary) - [libraryGetTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) -- [libraryRefreshLibrary](docs/sdks/library/README.md#refreshlibrary) -- [librarySearchLibrary](docs/sdks/library/README.md#searchlibrary) - [logEnablePaperTrail](docs/sdks/log/README.md#enablepapertrail) - [logLogLine](docs/sdks/log/README.md#logline) - [logLogMultiLine](docs/sdks/log/README.md#logmultiline) +- [mediaGetBannerImage](docs/sdks/media/README.md#getbannerimage) +- [mediaGetThumbImage](docs/sdks/media/README.md#getthumbimage) - [mediaMarkPlayed](docs/sdks/media/README.md#markplayed) - [mediaMarkUnplayed](docs/sdks/media/README.md#markunplayed) - [mediaUpdatePlayProgress](docs/sdks/media/README.md#updateplayprogress) @@ -474,15 +504,15 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [plexGetGeoData](docs/sdks/plex/README.md#getgeodata) - [plexGetHomeData](docs/sdks/plex/README.md#gethomedata) - [plexGetPin](docs/sdks/plex/README.md#getpin) -- [plexGetResources](docs/sdks/plex/README.md#getresources) +- [plexGetServerResources](docs/sdks/plex/README.md#getserverresources) - [plexGetTokenByPinId](docs/sdks/plex/README.md#gettokenbypinid) -- [plexGetUserDetails](docs/sdks/plex/README.md#getuserdetails) - [plexGetUserFriends](docs/sdks/plex/README.md#getuserfriends) - [searchGetSearchResults](docs/sdks/search/README.md#getsearchresults) - [searchPerformSearch](docs/sdks/search/README.md#performsearch) - [searchPerformVoiceSearch](docs/sdks/search/README.md#performvoicesearch) - [serverGetAvailableClients](docs/sdks/server/README.md#getavailableclients) - [serverGetDevices](docs/sdks/server/README.md#getdevices) +- [serverGetMediaProviders](docs/sdks/server/README.md#getmediaproviders) - [serverGetMyPlexAccount](docs/sdks/server/README.md#getmyplexaccount) - [serverGetResizedPhoto](docs/sdks/server/README.md#getresizedphoto) - [serverGetServerCapabilities](docs/sdks/server/README.md#getservercapabilities) @@ -499,15 +529,61 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [updaterApplyUpdates](docs/sdks/updater/README.md#applyupdates) - [updaterCheckForUpdates](docs/sdks/updater/README.md#checkforupdates) - [updaterGetUpdateStatus](docs/sdks/updater/README.md#getupdatestatus) -- [userPostUsersSigninData](docs/sdks/user/README.md#postuserssignindata) - [videoGetTimeline](docs/sdks/video/README.md#gettimeline) - [videoStartUniversalTranscode](docs/sdks/video/README.md#startuniversaltranscode) -- [watchlistGetWatchlist](docs/sdks/watchlist/README.md#getwatchlist) +- [watchlistGetWatchList](docs/sdks/watchlist/README.md#getwatchlist) + +## 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. + +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. + + +### Available Globals + +The following global parameter is 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) + | + + +### Example + +```typescript +import { IncludeHttps, IncludeIPv6, IncludeRelay, PlexAPI } from "@lukehagar/plexjs"; + +const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", +}); + +async function run() { + const result = await plexAPI.plex.getServerResources({ + xPlexToken: "CV5xoxjTpFKUzBTShsaf", + includeHttps: IncludeHttps.One, + includeRelay: IncludeRelay.One, + includeIPv6: IncludeIPv6.One, + }); + + // Handle the result + console.log(result); +} + +run(); + +``` + + ## Retries @@ -519,7 +595,7 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -560,7 +636,7 @@ const plexAPI = new PlexAPI({ retryConnectionErrors: false, }, accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { diff --git a/RELEASES.md b/RELEASES.md index 401b56e1..d5907c01 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -938,4 +938,14 @@ Based on: ### Generated - [typescript v0.19.0] . ### Releases -- [NPM v0.19.0] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.19.0 - . \ No newline at end of file +- [NPM v0.19.0] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.19.0 - . + +## 2024-09-06 00:01:07 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.390.7 (2.409.8) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.20.0] . +### Releases +- [NPM v0.20.0] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.20.0 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index df3ecee9..34b6046a 100644 --- a/USAGE.md +++ b/USAGE.md @@ -4,7 +4,7 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { diff --git a/codeSamples.yaml b/codeSamples.yaml index 976eb419..5970049d 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,1538 +3,447 @@ info: title: CodeSamples overlay for typescript target version: 0.0.0 actions: - - target: $["paths"]["/library/sections/{sectionId}/search"]["get"] - update: - x-codeSamples: - - lang: typescript - label: searchLibrary - source: |- - import { PlexAPI, Type } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.searchLibrary(933505, Type.Four); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/playlists/{playlistID}"]["delete"] - update: - x-codeSamples: - - lang: typescript - label: deletePlaylist - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.deletePlaylist(216.22); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/transcode/sessions"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getTranscodeSessions - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.sessions.getTranscodeSessions(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/updater/apply"]["put"] - update: - x-codeSamples: - - lang: typescript - label: applyUpdates - source: |- - import { PlexAPI, Skip, Tonight } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.updater.applyUpdates(Tonight.One, Skip.One); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getServerCapabilities - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getServerCapabilities(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/butler"]["delete"] - update: - x-codeSamples: - - lang: typescript - label: stopAllTasks - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.butler.stopAllTasks(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/hubs"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getGlobalHubs - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.hubs.getGlobalHubs(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/library/sections/{sectionId}"]["delete"] - update: - x-codeSamples: - - lang: typescript - label: deleteLibrary - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.deleteLibrary(1000); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/user"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getUserDetails - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.plex.getUserDetails(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/library/recentlyAdded"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getRecentlyAdded - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getRecentlyAdded(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/playlists/{playlistID}"]["put"] - update: - x-codeSamples: - - lang: typescript - label: updatePlaylist - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.updatePlaylist(3915); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/security/token"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getTransientToken - source: |- - import { GetTransientTokenQueryParamType, PlexAPI, Scope } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.authentication.getTransientToken(GetTransientTokenQueryParamType.Delegation, Scope.All); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/clients"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getAvailableClients - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getAvailableClients(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/photo/:/transcode"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getResizedPhoto - source: |- - import { MinSize, PlexAPI, Upscale } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getResizedPhoto({ - width: 110, - height: 165, - opacity: 100, - blur: 20, - minSize: MinSize.One, - upscale: Upscale.Zero, - url: "/library/metadata/49564/thumb/1654258204", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/:/timeline"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getTimeline - source: |- - import { PlexAPI, State } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.video.getTimeline({ - ratingKey: 23409, - key: "/library/metadata/23409", - state: State.Playing, - hasMDE: 1, - time: 2000, - duration: 10000, - context: "home:hub.continueWatching", - playQueueItemID: 1, - playBackTime: 2000, - row: 1, - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/friends"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getUserFriends - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.plex.getUserFriends(); - - // 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"; - - const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.user.postUsersSigninData("Postman", { - login: "username@email.com", - password: "password123", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/home"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getHomeData - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.plex.getHomeData(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/library/hashes"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getFileHash - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getFileHash("file://C:\Image.png&type=13"); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/log"]["get"] - update: - x-codeSamples: - - lang: typescript - label: logLine - source: |- - import { Level, PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.log.logLine(Level.Three, "Test log message", "Postman"); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/:/prefs"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getServerPreferences - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getServerPreferences(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/servers"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getServerList - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getServerList(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/butler"]["post"] - update: - x-codeSamples: - - lang: typescript - label: startAllTasks - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.butler.startAllTasks(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/identity"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getServerIdentity - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getServerIdentity(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/:/scrobble"]["get"] - update: - x-codeSamples: - - lang: typescript - label: markPlayed - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.media.markPlayed(59398); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/library/sections/{sectionId}"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getLibrary - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getLibrary(1000); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/hubs/search"]["get"] - update: - x-codeSamples: - - lang: typescript - label: performSearch - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.search.performSearch("dylan", 5); - - // Handle the result - console.log(result) - } - - run(); - target: $["paths"]["/security/resources"]["get"] update: x-codeSamples: - lang: typescript label: getSourceConnectionInformation - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.authentication.getSourceConnectionInformation("server://client-identifier"); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/devices"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getDevices - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getDevices(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/myplex/account"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getMyPlexAccount - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getMyPlexAccount(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/butler/{taskName}"]["delete"] - update: - x-codeSamples: - - lang: typescript - label: stopTask - source: |- - import { PathParamTaskName, PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.butler.stopTask(PathParamTaskName.BackupDatabase); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/playlists/{playlistID}"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getPlaylist - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.getPlaylist(4109.48); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/search"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getSearchResults - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.search.getSearchResults("110"); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/playlists/{playlistID}/items"]["put"] - update: - x-codeSamples: - - lang: typescript - label: addPlaylistContents - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.addPlaylistContents(8502.01, "server://12345/com.plexapp.plugins.library/library/metadata/1", 123); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/playlists/upload"]["post"] - update: - x-codeSamples: - - lang: typescript - label: uploadPlaylist - source: |- - import { Force, PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.uploadPlaylist("/home/barkley/playlist.m3u", Force.Zero); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/:/unscrobble"]["get"] - update: - x-codeSamples: - - lang: typescript - label: markUnplayed - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.media.markUnplayed(59398); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/pins/{pinID}"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getTokenByPinId - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.plex.getTokenByPinId(408895, "Postman"); - - // 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"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.hubs.getLibraryHubs(6728.76); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/library/sections/{sectionId}/refresh"]["get"] - update: - x-codeSamples: - - lang: typescript - label: refreshLibrary - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.refreshLibrary(934.16); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/playlists"]["post"] - update: - x-codeSamples: - - lang: typescript - label: createPlaylist - source: |- - import { PlexAPI, QueryParamType, Smart } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.createPlaylist({ - title: "", - type: QueryParamType.Photo, - smart: Smart.One, - uri: "https://inborn-brochure.biz", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/statistics/media"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getStatistics - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.statistics.getStatistics(4); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/activities/{activityUUID}"]["delete"] - update: - x-codeSamples: - - lang: typescript - label: cancelServerActivities - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.activities.cancelServerActivities("25b71ed5-0f9d-461c-baa7-d404e9e10d3e"); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/hubs/search/voice"]["get"] - update: - x-codeSamples: - - lang: typescript - label: performVoiceSearch - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.search.performVoiceSearch("dead+poop", 5); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/library/sections"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getLibraries - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getLibraries(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/library/sections/{sectionId}/{tag}"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getLibraryItems - source: |- - import { PlexAPI, Tag } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getLibraryItems("", Tag.Genre, 1); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/library/onDeck"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getOnDeck - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getOnDeck(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/playlists/{playlistID}/items"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getPlaylistContents - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.getPlaylistContents(5004.46, 9403.59); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/log"]["post"] - update: - x-codeSamples: - - lang: typescript - label: logMultiLine - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.log.logMultiLine("level=4&message=Test%20message%201&source=postman - level=3&message=Test%20message%202&source=postman - level=1&message=Test%20message%203&source=postman"); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/playlists"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getPlaylists - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.getPlaylists(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/updater/check"]["put"] - update: - x-codeSamples: - - lang: typescript - label: checkForUpdates - source: |- - import { Download, PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.updater.checkForUpdates(Download.One); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/:/progress"]["post"] - update: - x-codeSamples: - - lang: typescript - label: updatePlayProgress - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.media.updatePlayProgress("", 90000, "played"); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/companions"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getCompanionsData - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.plex.getCompanionsData(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/geoip"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getGeoData - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.plex.getGeoData(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/library/metadata/{ratingKey}"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getMetadata - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getMetadata(17); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/library/sections/watchlist/{filter}"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getWatchlist - source: |- - import { PathParamFilter, PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.watchlist.getWatchlist({ - filter: PathParamFilter.Released, - xPlexToken: "", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/resources"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getResources - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.plex.getResources("Postman"); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/pins"]["post"] - update: - x-codeSamples: - - lang: typescript - label: getPin - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.plex.getPin("Postman", "Postman"); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/playlists/{playlistID}/items"]["delete"] - update: - x-codeSamples: - - lang: typescript - label: clearPlaylistContents - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.clearPlaylistContents(1893.18); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/transcode/sessions/{sessionKey}"]["delete"] - update: - x-codeSamples: - - lang: typescript - label: stopTranscodeSession - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.sessions.stopTranscodeSession("zz7llzqlx8w9vnrsbnwhbmep"); - - // Handle the result - console.log(result) - } - - run(); + 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();" - target: $["paths"]["/status/sessions"]["get"] update: x-codeSamples: - lang: typescript label: getSessions - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.sessions.getSessions(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/updater/status"]["get"] + 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();" + - target: $["paths"]["/servers"]["get"] update: x-codeSamples: - lang: typescript - label: getUpdateStatus - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.updater.getUpdateStatus(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/video/:/transcode/universal/start.mpd"]["get"] + 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();" + - target: $["paths"]["/butler"]["delete"] update: x-codeSamples: - lang: typescript - label: startUniversalTranscode - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.video.startUniversalTranscode({ - hasMDE: 1, - path: "/library/metadata/23409", - mediaIndex: 0, - partIndex: 0, - protocol: "hls", - fastSeek: 0, - directPlay: 0, - directStream: 0, - subtitleSize: 100, - subtites: "burn", - audioBoost: 100, - location: "lan", - mediaBufferSize: 102400, - session: "zvcage8b7rkioqcm8f4uns4c", - addDebugOverlay: 0, - autoAdjustQuality: 0, - }); - - // Handle the result - console.log(result) - } - - run(); + 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();" - target: $["paths"]["/butler/{taskName}"]["post"] update: x-codeSamples: - lang: typescript label: startTask - source: |- - import { PlexAPI, TaskName } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.butler.startTask(TaskName.CleanOldBundles); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/log/networked"]["get"] + source: "import { PlexAPI, TaskName } from \"@lukehagar/plexjs\";\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();" + - target: $["paths"]["/home"]["get"] update: x-codeSamples: - lang: typescript - label: enablePaperTrail - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.log.enablePaperTrail(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/statistics/resources"]["get"] + 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();" + - target: $["paths"]["/playlists/{playlistID}"]["put"] update: x-codeSamples: - lang: typescript - label: getResourcesStatistics - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.statistics.getResourcesStatistics(4); - - // Handle the result - console.log(result) - } - - run(); + 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();" - target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"] update: x-codeSamples: - lang: typescript label: getMetadataChildren - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getMetadataChildren(1539.14, "Stream"); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/status/sessions/history/all"]["get"] + 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();" + - target: $["paths"]["/users/signin"]["post"] update: x-codeSamples: - lang: typescript - label: getSessionHistory - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.sessions.getSessionHistory("viewedAt:desc", 1, {}, 12); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/activities"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getServerActivities - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.activities.getServerActivities(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/butler"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getButlerTasks - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.butler.getButlerTasks(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/library/all/top"]["get"] - update: - x-codeSamples: - - lang: typescript - label: getTopWatchedContent - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getTopWatchedContent(1, 1); - - // Handle the result - console.log(result) - } - - run(); + 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 });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" - target: $["paths"]["/statistics/bandwidth"]["get"] update: x-codeSamples: - lang: typescript label: getBandwidthStatistics - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.statistics.getBandwidthStatistics(4); - - // Handle the result - console.log(result) - } - - run(); + 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();" + - target: $["paths"]["/user"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getUserDetails + 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.getUserDetails(\"CV5xoxjTpFKUzBTShsaf\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + - 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();" + - target: $["paths"]["/library/sections/{sectionKey}/{tag}"]["get"] + update: + x-codeSamples: + - lang: typescript + label: items + source: "import { IncludeGuids, IncludeMeta, PlexAPI, Tag, Type } from \"@lukehagar/plexjs\";\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();" + - target: $["paths"]["/library/all/top"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getTopWatchedContent + source: "import { GetTopWatchedContentQueryParamType, 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.getTopWatchedContent(GetTopWatchedContentQueryParamType.Two, 1);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/playlists"]["post"] + update: + x-codeSamples: + - lang: typescript + label: createPlaylist + source: "import { CreatePlaylistQueryParamType, PlexAPI, Smart } from \"@lukehagar/plexjs\";\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();" + - 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();" + - 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();" + - 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();" + - 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();" + - 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();" + - target: $["paths"]["/library/sections/watchlist/{filter}"]["get"] + update: + x-codeSamples: + - lang: typescript + label: list + source: "import { Filter, PlexAPI } from \"@lukehagar/plexjs\";\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();" + - target: $["paths"]["/"]["get"] + update: + 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();" + - 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();" + - 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();" + - 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();" + - target: $["paths"]["/log"]["get"] + update: + x-codeSamples: + - lang: typescript + label: logLine + source: "import { Level, 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.logLine(Level.Three, \"Test log message\", \"Postman\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + - 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();" + - 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();" + - target: $["paths"]["/photo/:/transcode"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getResizedPhoto + source: "import { MinSize, PlexAPI, Upscale } from \"@lukehagar/plexjs\";\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.Zero,\n url: \"/library/metadata/49564/thumb/1654258204\",\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + - 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();" + - 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();" + - target: $["paths"]["/playlists/{playlistID}/items"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getPlaylistContents + source: "import { GetPlaylistContentsQueryParamType, 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.getPlaylistContents(5004.46, GetPlaylistContentsQueryParamType.Two);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + - 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();" + - 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();" + - 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();" + - target: $["paths"]["/updater/apply"]["put"] + update: + x-codeSamples: + - lang: typescript + label: applyUpdates + source: "import { PlexAPI, Skip, Tonight } from \"@lukehagar/plexjs\";\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();" + - 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();" + - 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();" + - 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();" + - 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();" + - target: $["paths"]["/butler/{taskName}"]["delete"] + update: + x-codeSamples: + - lang: typescript + label: stopTask + source: "import { PathParamTaskName, 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.stopTask(PathParamTaskName.BackupDatabase);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + - 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();" + - 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(\"arnold\", 5);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + - 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();" + - target: $["paths"]["/updater/check"]["put"] + update: + x-codeSamples: + - lang: typescript + label: checkForUpdates + source: "import { Download, 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.checkForUpdates(Download.One);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + - 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();" + - 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();" + - target: $["paths"]["/resources"]["get"] + update: + x-codeSamples: + - lang: typescript + label: resources + source: "import { IncludeHttps, IncludeIPv6, IncludeRelay, 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.getServerResources({\n xPlexToken: \"CV5xoxjTpFKUzBTShsaf\",\n includeHttps: IncludeHttps.One,\n includeRelay: IncludeRelay.One,\n includeIPv6: IncludeIPv6.One,\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/library/sections/{sectionKey}/refresh"]["get"] + update: + x-codeSamples: + - lang: typescript + label: metadata + source: "import { Force, 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.getRefreshLibraryMetadata(9518, Force.One);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/security/token"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getTransientToken + source: "import { GetTransientTokenQueryParamType, PlexAPI, Scope } from \"@lukehagar/plexjs\";\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();" + - 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();" + - 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();" + - 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();" + - target: $["paths"]["/library/sections/{sectionKey}/search"]["get"] + update: + x-codeSamples: + - lang: typescript + label: library + source: "import { PlexAPI, QueryParamType } from \"@lukehagar/plexjs\";\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();" + - 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();" + - 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();" + - 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();" + - 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();" + - 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();" + - 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();" + - 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();" + - 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();" + - 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();" + - 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();" + - 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();" + - 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();" + - 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();" + - 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();" + - 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();" + - target: $["paths"]["/playlists/upload"]["post"] + update: + x-codeSamples: + - lang: typescript + label: uploadPlaylist + source: "import { PlexAPI, QueryParamForce } from \"@lukehagar/plexjs\";\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();" + - target: $["paths"]["/:/timeline"]["get"] + update: + x-codeSamples: + - lang: typescript + label: getTimeline + source: "import { PlexAPI, State } from \"@lukehagar/plexjs\";\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();" + - 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();" + - 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();" + - 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();" diff --git a/docs/models/addplaylistcontentsrequest.md b/docs/models/addplaylistcontentsrequest.md index 34f3d8fd..0703f7cb 100644 --- a/docs/models/addplaylistcontentsrequest.md +++ b/docs/models/addplaylistcontentsrequest.md @@ -6,7 +6,7 @@ import { AddPlaylistContentsRequest } from "@lukehagar/plexjs"; let value: AddPlaylistContentsRequest = { - playlistID: 6350.59, + playlistID: 6625.27, uri: "server://12345/com.plexapp.plugins.library/library/metadata/1", playQueueID: 123, }; diff --git a/docs/models/addplaylistcontentsresponse.md b/docs/models/addplaylistcontentsresponse.md index 6de86176..530b3b41 100644 --- a/docs/models/addplaylistcontentsresponse.md +++ b/docs/models/addplaylistcontentsresponse.md @@ -7,7 +7,7 @@ import { AddPlaylistContentsResponse } from "@lukehagar/plexjs"; let value: AddPlaylistContentsResponse = { contentType: "", - statusCode: 161309, + statusCode: 820994, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/applyupdatesrequest.md b/docs/models/applyupdatesrequest.md index 8142dd9e..2269ba85 100644 --- a/docs/models/applyupdatesrequest.md +++ b/docs/models/applyupdatesrequest.md @@ -16,4 +16,4 @@ let value: ApplyUpdatesRequest = { | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | `tonight` | [models.Tonight](../models/tonight.md) | :heavy_minus_sign: | Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install | 1 | -| `skip` | [models.Skip](../models/skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. | 1 | \ No newline at end of file +| `skip` | [models.Skip](../models/skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The [Release] entry for this version will have the `state` set to `skipped`. | 1 | \ No newline at end of file diff --git a/docs/models/applyupdatesresponse.md b/docs/models/applyupdatesresponse.md index a9a108f1..90e594a8 100644 --- a/docs/models/applyupdatesresponse.md +++ b/docs/models/applyupdatesresponse.md @@ -7,7 +7,7 @@ import { ApplyUpdatesResponse } from "@lukehagar/plexjs"; let value: ApplyUpdatesResponse = { contentType: "", - statusCode: 138183, + statusCode: 318569, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/autoselectsubtitle.md b/docs/models/autoselectsubtitle.md new file mode 100644 index 00000000..56d83cc7 --- /dev/null +++ b/docs/models/autoselectsubtitle.md @@ -0,0 +1,18 @@ +# AutoSelectSubtitle + +The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) + +## Example Usage + +```typescript +import { AutoSelectSubtitle } from "@lukehagar/plexjs"; + +let value: AutoSelectSubtitle = AutoSelectSubtitle.One; +``` + +## Values + +| Name | Value | +| ------ | ------ | +| `Zero` | 0 | +| `One` | 1 | \ No newline at end of file diff --git a/docs/models/billing.md b/docs/models/billing.md index 8511239d..32f5f58a 100644 --- a/docs/models/billing.md +++ b/docs/models/billing.md @@ -7,7 +7,7 @@ import { Billing } from "@lukehagar/plexjs"; let value: Billing = { internalPaymentMethod: {}, - paymentMethodId: 368725, + paymentMethodId: 317983, }; ``` diff --git a/docs/models/cancelserveractivitiesresponse.md b/docs/models/cancelserveractivitiesresponse.md index d50e3c4f..d961fd2d 100644 --- a/docs/models/cancelserveractivitiesresponse.md +++ b/docs/models/cancelserveractivitiesresponse.md @@ -7,7 +7,7 @@ import { CancelServerActivitiesResponse } from "@lukehagar/plexjs"; let value: CancelServerActivitiesResponse = { contentType: "", - statusCode: 477665, + statusCode: 791725, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/checkforupdatesresponse.md b/docs/models/checkforupdatesresponse.md index 9cd21e0f..6486d5eb 100644 --- a/docs/models/checkforupdatesresponse.md +++ b/docs/models/checkforupdatesresponse.md @@ -7,7 +7,7 @@ import { CheckForUpdatesResponse } from "@lukehagar/plexjs"; let value: CheckForUpdatesResponse = { contentType: "", - statusCode: 317202, + statusCode: 277718, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/clearplaylistcontentsrequest.md b/docs/models/clearplaylistcontentsrequest.md index bd9b8b2d..d3284efc 100644 --- a/docs/models/clearplaylistcontentsrequest.md +++ b/docs/models/clearplaylistcontentsrequest.md @@ -6,7 +6,7 @@ import { ClearPlaylistContentsRequest } from "@lukehagar/plexjs"; let value: ClearPlaylistContentsRequest = { - playlistID: 6527.9, + playlistID: 9495.72, }; ``` diff --git a/docs/models/clearplaylistcontentsresponse.md b/docs/models/clearplaylistcontentsresponse.md index 806ab215..e2e07cda 100644 --- a/docs/models/clearplaylistcontentsresponse.md +++ b/docs/models/clearplaylistcontentsresponse.md @@ -7,7 +7,7 @@ import { ClearPlaylistContentsResponse } from "@lukehagar/plexjs"; let value: ClearPlaylistContentsResponse = { contentType: "", - statusCode: 208876, + statusCode: 368725, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/connections.md b/docs/models/connections.md index 1e54630f..83e6d5e1 100644 --- a/docs/models/connections.md +++ b/docs/models/connections.md @@ -5,17 +5,25 @@ ```typescript import { Connections } from "@lukehagar/plexjs"; -let value: Connections = {}; +let value: Connections = { + protocol: "", + address: "971 Strosin Wall", + port: 4736.08, + uri: "https://starry-initialise.name", + local: false, + relay: false, + iPv6: false, +}; ``` ## Fields | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `protocol` | *string* | :heavy_minus_sign: | N/A | -| `address` | *string* | :heavy_minus_sign: | N/A | -| `port` | *number* | :heavy_minus_sign: | N/A | -| `uri` | *string* | :heavy_minus_sign: | N/A | -| `local` | *boolean* | :heavy_minus_sign: | N/A | -| `relay` | *boolean* | :heavy_minus_sign: | N/A | -| `iPv6` | *boolean* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `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 diff --git a/docs/models/createplaylistqueryparamtype.md b/docs/models/createplaylistqueryparamtype.md new file mode 100644 index 00000000..3b32124d --- /dev/null +++ b/docs/models/createplaylistqueryparamtype.md @@ -0,0 +1,19 @@ +# CreatePlaylistQueryParamType + +type of playlist to create + +## Example Usage + +```typescript +import { CreatePlaylistQueryParamType } from "@lukehagar/plexjs"; + +let value: CreatePlaylistQueryParamType = CreatePlaylistQueryParamType.Video; +``` + +## Values + +| Name | Value | +| ------- | ------- | +| `Audio` | audio | +| `Video` | video | +| `Photo` | photo | \ No newline at end of file diff --git a/docs/models/createplaylistrequest.md b/docs/models/createplaylistrequest.md index e2c05bd3..5f908699 100644 --- a/docs/models/createplaylistrequest.md +++ b/docs/models/createplaylistrequest.md @@ -3,22 +3,22 @@ ## Example Usage ```typescript -import { CreatePlaylistRequest, QueryParamType, Smart } from "@lukehagar/plexjs"; +import { CreatePlaylistQueryParamType, CreatePlaylistRequest, Smart } from "@lukehagar/plexjs"; let value: CreatePlaylistRequest = { title: "", - type: QueryParamType.Photo, + type: CreatePlaylistQueryParamType.Photo, smart: Smart.One, - uri: "https://deadly-corsage.info", + uri: "https://exotic-harm.info", }; ``` ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `title` | *string* | :heavy_check_mark: | name of the playlist | -| `type` | [models.QueryParamType](../models/queryparamtype.md) | :heavy_check_mark: | type of playlist to create | -| `smart` | [models.Smart](../models/smart.md) | :heavy_check_mark: | whether the playlist is smart or not | -| `uri` | *string* | :heavy_check_mark: | the content URI for the playlist | -| `playQueueID` | *number* | :heavy_minus_sign: | the play queue to copy to a playlist | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `title` | *string* | :heavy_check_mark: | name of the playlist | +| `type` | [models.CreatePlaylistQueryParamType](../models/createplaylistqueryparamtype.md) | :heavy_check_mark: | type of playlist to create | +| `smart` | [models.Smart](../models/smart.md) | :heavy_check_mark: | whether the playlist is smart or not | +| `uri` | *string* | :heavy_check_mark: | the content URI for the playlist | +| `playQueueID` | *number* | :heavy_minus_sign: | the play queue to copy to a playlist | \ No newline at end of file diff --git a/docs/models/createplaylistresponse.md b/docs/models/createplaylistresponse.md index 19cbb887..edad96a6 100644 --- a/docs/models/createplaylistresponse.md +++ b/docs/models/createplaylistresponse.md @@ -7,7 +7,7 @@ import { CreatePlaylistResponse } from "@lukehagar/plexjs"; let value: CreatePlaylistResponse = { contentType: "", - statusCode: 128926, + statusCode: 474697, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/defaultsubtitleaccessibility.md b/docs/models/defaultsubtitleaccessibility.md new file mode 100644 index 00000000..c76796db --- /dev/null +++ b/docs/models/defaultsubtitleaccessibility.md @@ -0,0 +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) + +## Example Usage + +```typescript +import { DefaultSubtitleAccessibility } from "@lukehagar/plexjs"; + +let value: DefaultSubtitleAccessibility = DefaultSubtitleAccessibility.One; +``` + +## Values + +| Name | Value | +| ------ | ------ | +| `Zero` | 0 | +| `One` | 1 | \ No newline at end of file diff --git a/docs/models/defaultsubtitleforced.md b/docs/models/defaultsubtitleforced.md new file mode 100644 index 00000000..02e48507 --- /dev/null +++ b/docs/models/defaultsubtitleforced.md @@ -0,0 +1,18 @@ +# DefaultSubtitleForced + +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) + +## Example Usage + +```typescript +import { DefaultSubtitleForced } from "@lukehagar/plexjs"; + +let value: DefaultSubtitleForced = DefaultSubtitleForced.One; +``` + +## Values + +| Name | Value | +| ------ | ------ | +| `Zero` | 0 | +| `One` | 1 | \ No newline at end of file diff --git a/docs/models/deletelibraryrequest.md b/docs/models/deletelibraryrequest.md index 1689a752..0f0d1be3 100644 --- a/docs/models/deletelibraryrequest.md +++ b/docs/models/deletelibraryrequest.md @@ -6,12 +6,12 @@ import { DeleteLibraryRequest } from "@lukehagar/plexjs"; let value: DeleteLibraryRequest = { - sectionId: 1000, + sectionKey: 9518, }; ``` ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | -| `sectionId` | *number* | :heavy_check_mark: | the Id of the library to query | 1000 | \ No newline at end of file +| 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 | \ No newline at end of file diff --git a/docs/models/deletelibraryresponse.md b/docs/models/deletelibraryresponse.md index 45015704..59cd5257 100644 --- a/docs/models/deletelibraryresponse.md +++ b/docs/models/deletelibraryresponse.md @@ -7,7 +7,7 @@ import { DeleteLibraryResponse } from "@lukehagar/plexjs"; let value: DeleteLibraryResponse = { contentType: "", - statusCode: 736918, + statusCode: 697631, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/deleteplaylistrequest.md b/docs/models/deleteplaylistrequest.md index 246328b0..0e5586a6 100644 --- a/docs/models/deleteplaylistrequest.md +++ b/docs/models/deleteplaylistrequest.md @@ -6,7 +6,7 @@ import { DeletePlaylistRequest } from "@lukehagar/plexjs"; let value: DeletePlaylistRequest = { - playlistID: 5701.97, + playlistID: 6747.52, }; ``` diff --git a/docs/models/deleteplaylistresponse.md b/docs/models/deleteplaylistresponse.md index 968b6fc0..365d7ddd 100644 --- a/docs/models/deleteplaylistresponse.md +++ b/docs/models/deleteplaylistresponse.md @@ -7,7 +7,7 @@ import { DeletePlaylistResponse } from "@lukehagar/plexjs"; let value: DeletePlaylistResponse = { contentType: "", - statusCode: 38425, + statusCode: 656330, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/enablepapertrailresponse.md b/docs/models/enablepapertrailresponse.md index cda73ff7..76666368 100644 --- a/docs/models/enablepapertrailresponse.md +++ b/docs/models/enablepapertrailresponse.md @@ -7,7 +7,7 @@ import { EnablePaperTrailResponse } from "@lukehagar/plexjs"; let value: EnablePaperTrailResponse = { contentType: "", - statusCode: 99280, + statusCode: 208876, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/feature.md b/docs/models/feature.md new file mode 100644 index 00000000..1d473df7 --- /dev/null +++ b/docs/models/feature.md @@ -0,0 +1,17 @@ +# Feature + +## Example Usage + +```typescript +import { Feature } from "@lukehagar/plexjs"; + +let value: Feature = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `key` | *string* | :heavy_minus_sign: | N/A | +| `type` | *string* | :heavy_minus_sign: | N/A | +| `directory` | [models.GetMediaProvidersDirectory](../models/getmediaprovidersdirectory.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/features.md b/docs/models/features.md index bc93cc20..49e8f6d7 100644 --- a/docs/models/features.md +++ b/docs/models/features.md @@ -5,7 +5,7 @@ ```typescript import { Features } from "@lukehagar/plexjs"; -let value: Features = Features.SharedServerNotification; +let value: Features = Features.WatchTogetherInvite; ``` ## Values diff --git a/docs/models/filter.md b/docs/models/filter.md index d11fde16..08978a75 100644 --- a/docs/models/filter.md +++ b/docs/models/filter.md @@ -1,18 +1,19 @@ # Filter -Filters content by field and direction/equality -(Unknown if viewedAt is the only supported column) - +Filter ## Example Usage ```typescript import { Filter } from "@lukehagar/plexjs"; -let value: Filter = {}; +let value: Filter = Filter.Available; ``` -## Fields +## Values -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file +| Name | Value | +| ----------- | ----------- | +| `All` | all | +| `Available` | available | +| `Released` | released | \ No newline at end of file diff --git a/docs/models/force.md b/docs/models/force.md index 244e229b..08651572 100644 --- a/docs/models/force.md +++ b/docs/models/force.md @@ -1,10 +1,6 @@ # Force -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. - +Force the refresh even if the library is already being refreshed. ## Example Usage diff --git a/docs/models/getlibrariesdirectory.md b/docs/models/getalllibrariesdirectory.md similarity index 93% rename from docs/models/getlibrariesdirectory.md rename to docs/models/getalllibrariesdirectory.md index 9bd3c925..f97b86a4 100644 --- a/docs/models/getlibrariesdirectory.md +++ b/docs/models/getalllibrariesdirectory.md @@ -1,11 +1,11 @@ -# GetLibrariesDirectory +# GetAllLibrariesDirectory ## Example Usage ```typescript -import { GetLibrariesDirectory } from "@lukehagar/plexjs"; +import { GetAllLibrariesDirectory } from "@lukehagar/plexjs"; -let value: GetLibrariesDirectory = { +let value: GetAllLibrariesDirectory = { allowSync: true, art: "/:/resources/movie-fanart.jpg", composite: "/library/sections/1/composite/1705615584", @@ -19,9 +19,9 @@ let value: GetLibrariesDirectory = { scanner: "Plex Movie", language: "en-US", uuid: "322a231a-b7f7-49f5-920f-14c61199cd30", - updatedAt: 1705615634, - createdAt: 1654131312, - scannedAt: 1705615584, + updatedAt: 1556281940, + createdAt: 1556281940, + scannedAt: 1556281940, content: true, directory: true, contentChangedAt: 3192854, @@ -52,9 +52,9 @@ let value: GetLibrariesDirectory = { | `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: | N/A | 1705615634 | -| `createdAt` | *number* | :heavy_minus_sign: | N/A | 1654131312 | -| `scannedAt` | *number* | :heavy_minus_sign: | N/A | 1705615584 | +| `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 | diff --git a/docs/models/getresourceserrors.md b/docs/models/getalllibrarieserrors.md similarity index 89% rename from docs/models/getresourceserrors.md rename to docs/models/getalllibrarieserrors.md index 700f7315..85c89db1 100644 --- a/docs/models/getresourceserrors.md +++ b/docs/models/getalllibrarieserrors.md @@ -1,11 +1,11 @@ -# GetResourcesErrors +# GetAllLibrariesErrors ## Example Usage ```typescript -import { GetResourcesErrors } from "@lukehagar/plexjs"; +import { GetAllLibrariesErrors } from "@lukehagar/plexjs"; -let value: GetResourcesErrors = { +let value: GetAllLibrariesErrors = { code: 1001, message: "User could not be authenticated", status: 401, diff --git a/docs/models/getmetadatalibraryresponsebody.md b/docs/models/getalllibrarieslibraryresponsebody.md similarity index 83% rename from docs/models/getmetadatalibraryresponsebody.md rename to docs/models/getalllibrarieslibraryresponsebody.md index a566e547..f3282ae5 100644 --- a/docs/models/getmetadatalibraryresponsebody.md +++ b/docs/models/getalllibrarieslibraryresponsebody.md @@ -1,11 +1,11 @@ -# GetMetadataLibraryResponseBody +# GetAllLibrariesLibraryResponseBody Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Example Usage ```typescript -import { GetMetadataLibraryResponseBody } from "@lukehagar/plexjs"; +import { GetAllLibrariesLibraryResponseBody } from "@lukehagar/plexjs"; // No examples available for this model ``` @@ -14,5 +14,5 @@ import { GetMetadataLibraryResponseBody } from "@lukehagar/plexjs"; | Field | Type | Required | Description | | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `errors` | [models.GetMetadataErrors](../models/getmetadataerrors.md)[] | :heavy_minus_sign: | N/A | +| `errors` | [models.GetAllLibrariesErrors](../models/getalllibrarieserrors.md)[] | :heavy_minus_sign: | N/A | | `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/getalllibrariesmediacontainer.md b/docs/models/getalllibrariesmediacontainer.md new file mode 100644 index 00000000..45881c76 --- /dev/null +++ b/docs/models/getalllibrariesmediacontainer.md @@ -0,0 +1,52 @@ +# GetAllLibrariesMediaContainer + +## Example Usage + +```typescript +import { GetAllLibrariesMediaContainer } from "@lukehagar/plexjs"; + +let value: GetAllLibrariesMediaContainer = { + size: 5, + allowSync: false, + title1: "Plex Library", + directory: [ + { + allowSync: true, + art: "/:/resources/movie-fanart.jpg", + composite: "/library/sections/1/composite/1705615584", + filters: true, + refreshing: false, + thumb: "/:/resources/movie.png", + key: "1", + type: "movie", + title: "Movies", + agent: "tv.plex.agents.movie", + scanner: "Plex Movie", + language: "en-US", + uuid: "322a231a-b7f7-49f5-920f-14c61199cd30", + updatedAt: 1556281940, + createdAt: 1556281940, + scannedAt: 1556281940, + content: true, + directory: true, + contentChangedAt: 3192854, + hidden: 0, + location: [ + { + id: 1, + path: "/movies", + }, + ], + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `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` | [models.GetAllLibrariesDirectory](../models/getalllibrariesdirectory.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/getalllibrariesresponse.md b/docs/models/getalllibrariesresponse.md new file mode 100644 index 00000000..f70539dc --- /dev/null +++ b/docs/models/getalllibrariesresponse.md @@ -0,0 +1,61 @@ +# GetAllLibrariesResponse + +## Example Usage + +```typescript +import { GetAllLibrariesResponse } from "@lukehagar/plexjs"; + +let value: GetAllLibrariesResponse = { + contentType: "", + statusCode: 613064, + rawResponse: new Response('{"message": "hello world"}', { + headers: { "Content-Type": "application/json" }, + }), + object: { + mediaContainer: { + size: 5, + allowSync: false, + title1: "Plex Library", + directory: [ + { + allowSync: true, + art: "/:/resources/movie-fanart.jpg", + composite: "/library/sections/1/composite/1705615584", + filters: true, + refreshing: false, + thumb: "/:/resources/movie.png", + key: "1", + type: "movie", + title: "Movies", + agent: "tv.plex.agents.movie", + scanner: "Plex Movie", + language: "en-US", + uuid: "322a231a-b7f7-49f5-920f-14c61199cd30", + updatedAt: 1556281940, + createdAt: 1556281940, + scannedAt: 1556281940, + content: true, + directory: true, + contentChangedAt: 3192854, + hidden: 0, + location: [ + { + id: 1, + path: "/movies", + }, + ], + }, + ], + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [models.GetAllLibrariesResponseBody](../models/getalllibrariesresponsebody.md) | :heavy_minus_sign: | The libraries available on the Server | \ No newline at end of file diff --git a/docs/models/getlibrariesresponsebody.md b/docs/models/getalllibrariesresponsebody.md similarity index 54% rename from docs/models/getlibrariesresponsebody.md rename to docs/models/getalllibrariesresponsebody.md index 4aa660f6..70e5e07c 100644 --- a/docs/models/getlibrariesresponsebody.md +++ b/docs/models/getalllibrariesresponsebody.md @@ -1,13 +1,13 @@ -# GetLibrariesResponseBody +# GetAllLibrariesResponseBody The libraries available on the Server ## Example Usage ```typescript -import { GetLibrariesResponseBody } from "@lukehagar/plexjs"; +import { GetAllLibrariesResponseBody } from "@lukehagar/plexjs"; -let value: GetLibrariesResponseBody = { +let value: GetAllLibrariesResponseBody = { mediaContainer: { size: 5, allowSync: false, @@ -27,9 +27,9 @@ let value: GetLibrariesResponseBody = { scanner: "Plex Movie", language: "en-US", uuid: "322a231a-b7f7-49f5-920f-14c61199cd30", - updatedAt: 1705615634, - createdAt: 1654131312, - scannedAt: 1705615584, + updatedAt: 1556281940, + createdAt: 1556281940, + scannedAt: 1556281940, content: true, directory: true, contentChangedAt: 3192854, @@ -48,6 +48,6 @@ let value: GetLibrariesResponseBody = { ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `mediaContainer` | [models.GetLibrariesMediaContainer](../models/getlibrariesmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `mediaContainer` | [models.GetAllLibrariesMediaContainer](../models/getalllibrariesmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/getbandwidthstatisticsmediacontainer.md b/docs/models/getbandwidthstatisticsmediacontainer.md index 62a03d4d..cdcc659d 100644 --- a/docs/models/getbandwidthstatisticsmediacontainer.md +++ b/docs/models/getbandwidthstatisticsmediacontainer.md @@ -31,6 +31,7 @@ let value: GetBandwidthStatisticsMediaContainer = { statisticsBandwidth: [ { accountID: 238960586, + deviceID: 208, timespan: 6, at: 1718387650, lan: true, diff --git a/docs/models/getbandwidthstatisticsresponse.md b/docs/models/getbandwidthstatisticsresponse.md index b42a7b69..8703707d 100644 --- a/docs/models/getbandwidthstatisticsresponse.md +++ b/docs/models/getbandwidthstatisticsresponse.md @@ -7,7 +7,7 @@ import { GetBandwidthStatisticsResponse } from "@lukehagar/plexjs"; let value: GetBandwidthStatisticsResponse = { contentType: "", - statusCode: 623510, + statusCode: 916723, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), @@ -38,6 +38,7 @@ let value: GetBandwidthStatisticsResponse = { statisticsBandwidth: [ { accountID: 238960586, + deviceID: 208, timespan: 6, at: 1718387650, lan: true, diff --git a/docs/models/getbandwidthstatisticsresponsebody.md b/docs/models/getbandwidthstatisticsresponsebody.md index 463e67f6..28f8de38 100644 --- a/docs/models/getbandwidthstatisticsresponsebody.md +++ b/docs/models/getbandwidthstatisticsresponsebody.md @@ -34,6 +34,7 @@ let value: GetBandwidthStatisticsResponseBody = { statisticsBandwidth: [ { accountID: 238960586, + deviceID: 208, timespan: 6, at: 1718387650, lan: true, diff --git a/docs/models/getlibrarieserrors.md b/docs/models/getbannerimageerrors.md similarity index 89% rename from docs/models/getlibrarieserrors.md rename to docs/models/getbannerimageerrors.md index 0602ba1d..f6bd9d5a 100644 --- a/docs/models/getlibrarieserrors.md +++ b/docs/models/getbannerimageerrors.md @@ -1,11 +1,11 @@ -# GetLibrariesErrors +# GetBannerImageErrors ## Example Usage ```typescript -import { GetLibrariesErrors } from "@lukehagar/plexjs"; +import { GetBannerImageErrors } from "@lukehagar/plexjs"; -let value: GetLibrariesErrors = { +let value: GetBannerImageErrors = { code: 1001, message: "User could not be authenticated", status: 401, diff --git a/docs/models/getbannerimagerequest.md b/docs/models/getbannerimagerequest.md new file mode 100644 index 00000000..c5b8b807 --- /dev/null +++ b/docs/models/getbannerimagerequest.md @@ -0,0 +1,27 @@ +# GetBannerImageRequest + +## Example Usage + +```typescript +import { GetBannerImageRequest } from "@lukehagar/plexjs"; + +let value: GetBannerImageRequest = { + ratingKey: 9518, + width: 396, + height: 396, + minSize: 1, + upscale: 1, + xPlexToken: "CV5xoxjTpFKUzBTShsaf", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ratingKey` | *number* | :heavy_check_mark: | the id of the library item to return the children of. | 9518 | +| `width` | *number* | :heavy_check_mark: | N/A | 396 | +| `height` | *number* | :heavy_check_mark: | N/A | 396 | +| `minSize` | *number* | :heavy_check_mark: | N/A | 1 | +| `upscale` | *number* | :heavy_check_mark: | N/A | 1 | +| `xPlexToken` | *string* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf | \ No newline at end of file diff --git a/docs/models/getbannerimageresponse.md b/docs/models/getbannerimageresponse.md new file mode 100644 index 00000000..1649dcd2 --- /dev/null +++ b/docs/models/getbannerimageresponse.md @@ -0,0 +1,19 @@ +# GetBannerImageResponse + +## Example Usage + +```typescript +import { GetBannerImageResponse } from "@lukehagar/plexjs"; + +// No examples available for this model +``` + +## 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 | +| `responseStream` | *ReadableStream* | :heavy_minus_sign: | Successful response returning an image | +| `headers` | Record | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/refreshlibraryresponsebody.md b/docs/models/getbannerimageresponsebody.md similarity index 88% rename from docs/models/refreshlibraryresponsebody.md rename to docs/models/getbannerimageresponsebody.md index 280e5ae0..fa594274 100644 --- a/docs/models/refreshlibraryresponsebody.md +++ b/docs/models/getbannerimageresponsebody.md @@ -1,11 +1,11 @@ -# RefreshLibraryResponseBody +# GetBannerImageResponseBody Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Example Usage ```typescript -import { RefreshLibraryResponseBody } from "@lukehagar/plexjs"; +import { GetBannerImageResponseBody } from "@lukehagar/plexjs"; // No examples available for this model ``` @@ -14,5 +14,5 @@ import { RefreshLibraryResponseBody } from "@lukehagar/plexjs"; | Field | Type | Required | Description | | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `errors` | [models.RefreshLibraryErrors](../models/refreshlibraryerrors.md)[] | :heavy_minus_sign: | N/A | +| `errors` | [models.GetBannerImageErrors](../models/getbannerimageerrors.md)[] | :heavy_minus_sign: | N/A | | `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/getbutlertasksresponse.md b/docs/models/getbutlertasksresponse.md index 0de7fe8c..e83a4650 100644 --- a/docs/models/getbutlertasksresponse.md +++ b/docs/models/getbutlertasksresponse.md @@ -7,7 +7,7 @@ import { GetButlerTasksResponse } from "@lukehagar/plexjs"; let value: GetButlerTasksResponse = { contentType: "", - statusCode: 791725, + statusCode: 812169, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getcompanionsdataresponse.md b/docs/models/getcompanionsdataresponse.md index 996cc128..e1d413bc 100644 --- a/docs/models/getcompanionsdataresponse.md +++ b/docs/models/getcompanionsdataresponse.md @@ -7,7 +7,7 @@ import { GetCompanionsDataResponse } from "@lukehagar/plexjs"; let value: GetCompanionsDataResponse = { contentType: "", - statusCode: 337396, + statusCode: 87129, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getfilehashresponse.md b/docs/models/getfilehashresponse.md index eacc574d..7be5445e 100644 --- a/docs/models/getfilehashresponse.md +++ b/docs/models/getfilehashresponse.md @@ -7,7 +7,7 @@ import { GetFileHashResponse } from "@lukehagar/plexjs"; let value: GetFileHashResponse = { contentType: "", - statusCode: 414662, + statusCode: 449950, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getgeodataresponse.md b/docs/models/getgeodataresponse.md index 8693817c..67ae426b 100644 --- a/docs/models/getgeodataresponse.md +++ b/docs/models/getgeodataresponse.md @@ -7,7 +7,7 @@ import { GetGeoDataResponse } from "@lukehagar/plexjs"; let value: GetGeoDataResponse = { contentType: "", - statusCode: 648172, + statusCode: 20218, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getglobalhubsresponse.md b/docs/models/getglobalhubsresponse.md index 0f4b005b..7694a0ec 100644 --- a/docs/models/getglobalhubsresponse.md +++ b/docs/models/getglobalhubsresponse.md @@ -7,7 +7,7 @@ import { GetGlobalHubsResponse } from "@lukehagar/plexjs"; let value: GetGlobalHubsResponse = { contentType: "", - statusCode: 639921, + statusCode: 149675, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/gethomedataresponse.md b/docs/models/gethomedataresponse.md index dc75c2a7..60126ba6 100644 --- a/docs/models/gethomedataresponse.md +++ b/docs/models/gethomedataresponse.md @@ -7,7 +7,7 @@ import { GetHomeDataResponse } from "@lukehagar/plexjs"; let value: GetHomeDataResponse = { contentType: "", - statusCode: 20218, + statusCode: 368241, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getlibrarieslibraryresponsebody.md b/docs/models/getlibrarieslibraryresponsebody.md deleted file mode 100644 index f616551f..00000000 --- a/docs/models/getlibrarieslibraryresponsebody.md +++ /dev/null @@ -1,18 +0,0 @@ -# GetLibrariesLibraryResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - -## Example Usage - -```typescript -import { GetLibrariesLibraryResponseBody } from "@lukehagar/plexjs"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `errors` | [models.GetLibrariesErrors](../models/getlibrarieserrors.md)[] | :heavy_minus_sign: | N/A | -| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/getlibrariesmediacontainer.md b/docs/models/getlibrariesmediacontainer.md deleted file mode 100644 index 6cdadf11..00000000 --- a/docs/models/getlibrariesmediacontainer.md +++ /dev/null @@ -1,52 +0,0 @@ -# GetLibrariesMediaContainer - -## Example Usage - -```typescript -import { GetLibrariesMediaContainer } from "@lukehagar/plexjs"; - -let value: GetLibrariesMediaContainer = { - size: 5, - allowSync: false, - title1: "Plex Library", - directory: [ - { - allowSync: true, - art: "/:/resources/movie-fanart.jpg", - composite: "/library/sections/1/composite/1705615584", - filters: true, - refreshing: false, - thumb: "/:/resources/movie.png", - key: "1", - type: "movie", - title: "Movies", - agent: "tv.plex.agents.movie", - scanner: "Plex Movie", - language: "en-US", - uuid: "322a231a-b7f7-49f5-920f-14c61199cd30", - updatedAt: 1705615634, - createdAt: 1654131312, - scannedAt: 1705615584, - content: true, - directory: true, - contentChangedAt: 3192854, - hidden: 0, - location: [ - { - id: 1, - path: "/movies", - }, - ], - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `size` | *number* | :heavy_minus_sign: | N/A | 5 | -| `allowSync` | *boolean* | :heavy_minus_sign: | N/A | false | -| `title1` | *string* | :heavy_minus_sign: | N/A | Plex Library | -| `directory` | [models.GetLibrariesDirectory](../models/getlibrariesdirectory.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/getlibrariesresponse.md b/docs/models/getlibrariesresponse.md deleted file mode 100644 index 0a1d8963..00000000 --- a/docs/models/getlibrariesresponse.md +++ /dev/null @@ -1,61 +0,0 @@ -# GetLibrariesResponse - -## Example Usage - -```typescript -import { GetLibrariesResponse } from "@lukehagar/plexjs"; - -let value: GetLibrariesResponse = { - contentType: "", - statusCode: 264555, - rawResponse: new Response('{"message": "hello world"}', { - headers: { "Content-Type": "application/json" }, - }), - object: { - mediaContainer: { - size: 5, - allowSync: false, - title1: "Plex Library", - directory: [ - { - allowSync: true, - art: "/:/resources/movie-fanart.jpg", - composite: "/library/sections/1/composite/1705615584", - filters: true, - refreshing: false, - thumb: "/:/resources/movie.png", - key: "1", - type: "movie", - title: "Movies", - agent: "tv.plex.agents.movie", - scanner: "Plex Movie", - language: "en-US", - uuid: "322a231a-b7f7-49f5-920f-14c61199cd30", - updatedAt: 1705615634, - createdAt: 1654131312, - scannedAt: 1705615584, - content: true, - directory: true, - contentChangedAt: 3192854, - hidden: 0, - location: [ - { - id: 1, - path: "/movies", - }, - ], - }, - ], - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [models.GetLibrariesResponseBody](../models/getlibrariesresponsebody.md) | :heavy_minus_sign: | The libraries available on the Server | \ No newline at end of file diff --git a/docs/models/getlibrarydirectory.md b/docs/models/getlibrarydetailsdirectory.md similarity index 87% rename from docs/models/getlibrarydirectory.md rename to docs/models/getlibrarydetailsdirectory.md index b55c06a3..fc990273 100644 --- a/docs/models/getlibrarydirectory.md +++ b/docs/models/getlibrarydetailsdirectory.md @@ -1,11 +1,11 @@ -# GetLibraryDirectory +# GetLibraryDetailsDirectory ## Example Usage ```typescript -import { GetLibraryDirectory } from "@lukehagar/plexjs"; +import { GetLibraryDetailsDirectory } from "@lukehagar/plexjs"; -let value: GetLibraryDirectory = { +let value: GetLibraryDetailsDirectory = { key: "search?type=1", title: "Search...", secondary: true, diff --git a/docs/models/getlibrarydetailserrors.md b/docs/models/getlibrarydetailserrors.md new file mode 100644 index 00000000..2285a0fe --- /dev/null +++ b/docs/models/getlibrarydetailserrors.md @@ -0,0 +1,21 @@ +# GetLibraryDetailsErrors + +## Example Usage + +```typescript +import { GetLibraryDetailsErrors } from "@lukehagar/plexjs"; + +let value: GetLibraryDetailsErrors = { + 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/models/getlibraryfilter.md b/docs/models/getlibrarydetailsfilter.md similarity index 90% rename from docs/models/getlibraryfilter.md rename to docs/models/getlibrarydetailsfilter.md index c6268d41..43ea6e4f 100644 --- a/docs/models/getlibraryfilter.md +++ b/docs/models/getlibrarydetailsfilter.md @@ -1,11 +1,11 @@ -# GetLibraryFilter +# GetLibraryDetailsFilter ## Example Usage ```typescript -import { GetLibraryFilter } from "@lukehagar/plexjs"; +import { GetLibraryDetailsFilter } from "@lukehagar/plexjs"; -let value: GetLibraryFilter = { +let value: GetLibraryDetailsFilter = { filter: "label", filterType: "string", key: "/library/sections/1/label", diff --git a/docs/models/getlibrarydetailslibraryresponsebody.md b/docs/models/getlibrarydetailslibraryresponsebody.md new file mode 100644 index 00000000..4f68dbe6 --- /dev/null +++ b/docs/models/getlibrarydetailslibraryresponsebody.md @@ -0,0 +1,18 @@ +# GetLibraryDetailsLibraryResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + +## Example Usage + +```typescript +import { GetLibraryDetailsLibraryResponseBody } from "@lukehagar/plexjs"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `errors` | [models.GetLibraryDetailsErrors](../models/getlibrarydetailserrors.md)[] | :heavy_minus_sign: | N/A | +| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/getlibrarydetailsmediacontainer.md b/docs/models/getlibrarydetailsmediacontainer.md new file mode 100644 index 00000000..2de5a9ec --- /dev/null +++ b/docs/models/getlibrarydetailsmediacontainer.md @@ -0,0 +1,97 @@ +# GetLibraryDetailsMediaContainer + +## Example Usage + +```typescript +import { GetLibraryDetailsMediaContainer } from "@lukehagar/plexjs"; + +let value: GetLibraryDetailsMediaContainer = { + size: 29, + allowSync: false, + art: "/:/resources/movie-fanart.jpg", + content: "secondary", + identifier: "com.plexapp.plugins.library", + librarySectionID: 1, + mediaTagPrefix: "/system/bundle/media/flags/", + mediaTagVersion: 1701731894, + thumb: "/:/resources/movie.png", + title1: "Movies", + viewGroup: "secondary", + viewMode: 65592, + directory: [ + { + key: "search?type=1", + title: "Search...", + secondary: true, + prompt: "Search Movies", + search: true, + }, + ], + type: [ + { + key: "/library/sections/1/all?type=1", + type: "movie", + title: "Movies", + active: false, + filter: [ + { + filter: "label", + filterType: "string", + key: "/library/sections/1/label", + title: "Labels", + type: "filter", + }, + ], + sort: [ + { + default: "asc", + defaultDirection: "desc", + descKey: "random:desc", + firstCharacterKey: "/library/sections/1/firstCharacter", + key: "random", + title: "Randomly", + }, + ], + field: [ + { + key: "label", + title: "Label", + type: "tag", + subType: "bitrate", + }, + ], + }, + ], + fieldType: [ + { + type: "resolution", + operator: [ + { + key: "=", + title: "is", + }, + ], + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `size` | *number* | :heavy_minus_sign: | N/A | 29 | +| `allowSync` | *boolean* | :heavy_minus_sign: | N/A | false | +| `art` | *string* | :heavy_minus_sign: | N/A | /:/resources/movie-fanart.jpg | +| `content` | *string* | :heavy_minus_sign: | N/A | secondary | +| `identifier` | *string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | +| `librarySectionID` | *number* | :heavy_minus_sign: | N/A | 1 | +| `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 | +| `viewGroup` | *string* | :heavy_minus_sign: | N/A | secondary | +| `viewMode` | *number* | :heavy_minus_sign: | N/A | 65592 | +| `directory` | [models.GetLibraryDetailsDirectory](../models/getlibrarydetailsdirectory.md)[] | :heavy_minus_sign: | N/A | | +| `type` | [models.GetLibraryDetailsType](../models/getlibrarydetailstype.md)[] | :heavy_minus_sign: | N/A | | +| `fieldType` | [models.FieldType](../models/fieldtype.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/getlibraryrequest.md b/docs/models/getlibrarydetailsrequest.md similarity index 88% rename from docs/models/getlibraryrequest.md rename to docs/models/getlibrarydetailsrequest.md index c1b52504..84397010 100644 --- a/docs/models/getlibraryrequest.md +++ b/docs/models/getlibrarydetailsrequest.md @@ -1,12 +1,12 @@ -# GetLibraryRequest +# GetLibraryDetailsRequest ## Example Usage ```typescript -import { GetLibraryRequest } from "@lukehagar/plexjs"; +import { GetLibraryDetailsRequest } from "@lukehagar/plexjs"; -let value: GetLibraryRequest = { - sectionId: 1000, +let value: GetLibraryDetailsRequest = { + sectionKey: 9518, }; ``` @@ -14,5 +14,5 @@ let value: GetLibraryRequest = { | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `sectionId` | *number* | :heavy_check_mark: | the Id of the library to query | 1000 | +| `sectionKey` | *number* | :heavy_check_mark: | The unique key of the Plex library.
Note: This is unique in the context of the Plex server.
| 9518 | | `includeDetails` | [models.IncludeDetails](../models/includedetails.md) | :heavy_minus_sign: | Whether or not to include details for a section (types, filters, and sorts).
Only exists for backwards compatibility, media providers other than the server libraries have it on always.
| | \ No newline at end of file diff --git a/docs/models/getlibraryresponse.md b/docs/models/getlibrarydetailsresponse.md similarity index 62% rename from docs/models/getlibraryresponse.md rename to docs/models/getlibrarydetailsresponse.md index b338354c..82fd685b 100644 --- a/docs/models/getlibraryresponse.md +++ b/docs/models/getlibrarydetailsresponse.md @@ -1,13 +1,13 @@ -# GetLibraryResponse +# GetLibraryDetailsResponse ## Example Usage ```typescript -import { GetLibraryResponse } from "@lukehagar/plexjs"; +import { GetLibraryDetailsResponse } from "@lukehagar/plexjs"; -let value: GetLibraryResponse = { +let value: GetLibraryDetailsResponse = { contentType: "", - statusCode: 774234, + statusCode: 902349, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), @@ -87,9 +87,9 @@ let value: GetLibraryResponse = { ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [models.GetLibraryResponseBody](../models/getlibraryresponsebody.md) | :heavy_minus_sign: | The details of the library | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [models.GetLibraryDetailsResponseBody](../models/getlibrarydetailsresponsebody.md) | :heavy_minus_sign: | The details of the library | \ No newline at end of file diff --git a/docs/models/getlibraryresponsebody.md b/docs/models/getlibrarydetailsresponsebody.md similarity index 71% rename from docs/models/getlibraryresponsebody.md rename to docs/models/getlibrarydetailsresponsebody.md index b973a71c..1ed74b72 100644 --- a/docs/models/getlibraryresponsebody.md +++ b/docs/models/getlibrarydetailsresponsebody.md @@ -1,13 +1,13 @@ -# GetLibraryResponseBody +# GetLibraryDetailsResponseBody The details of the library ## Example Usage ```typescript -import { GetLibraryResponseBody } from "@lukehagar/plexjs"; +import { GetLibraryDetailsResponseBody } from "@lukehagar/plexjs"; -let value: GetLibraryResponseBody = { +let value: GetLibraryDetailsResponseBody = { mediaContainer: { size: 29, allowSync: false, @@ -82,6 +82,6 @@ let value: GetLibraryResponseBody = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `mediaContainer` | [models.GetLibraryMediaContainer](../models/getlibrarymediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `mediaContainer` | [models.GetLibraryDetailsMediaContainer](../models/getlibrarydetailsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/getlibrarydetailstype.md b/docs/models/getlibrarydetailstype.md new file mode 100644 index 00000000..6ab748a0 --- /dev/null +++ b/docs/models/getlibrarydetailstype.md @@ -0,0 +1,53 @@ +# GetLibraryDetailsType + +## Example Usage + +```typescript +import { GetLibraryDetailsType } from "@lukehagar/plexjs"; + +let value: GetLibraryDetailsType = { + key: "/library/sections/1/all?type=1", + type: "movie", + title: "Movies", + active: false, + filter: [ + { + filter: "label", + filterType: "string", + key: "/library/sections/1/label", + title: "Labels", + type: "filter", + }, + ], + sort: [ + { + default: "asc", + defaultDirection: "desc", + descKey: "random:desc", + firstCharacterKey: "/library/sections/1/firstCharacter", + key: "random", + title: "Randomly", + }, + ], + field: [ + { + key: "label", + title: "Label", + type: "tag", + subType: "bitrate", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `key` | *string* | :heavy_minus_sign: | N/A | /library/sections/1/all?type=1 | +| `type` | *string* | :heavy_minus_sign: | N/A | movie | +| `title` | *string* | :heavy_minus_sign: | N/A | Movies | +| `active` | *boolean* | :heavy_minus_sign: | N/A | false | +| `filter` | [models.GetLibraryDetailsFilter](../models/getlibrarydetailsfilter.md)[] | :heavy_minus_sign: | N/A | | +| `sort` | [models.Sort](../models/sort.md)[] | :heavy_minus_sign: | N/A | | +| `field` | [models.Field](../models/field.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/getlibraryhubsrequest.md b/docs/models/getlibraryhubsrequest.md index 95b3471d..1a70baae 100644 --- a/docs/models/getlibraryhubsrequest.md +++ b/docs/models/getlibraryhubsrequest.md @@ -6,7 +6,7 @@ import { GetLibraryHubsRequest } from "@lukehagar/plexjs"; let value: GetLibraryHubsRequest = { - sectionId: 1433.53, + sectionId: 2223.21, }; ``` diff --git a/docs/models/getlibraryhubsresponse.md b/docs/models/getlibraryhubsresponse.md index 9a9502f2..519c00f2 100644 --- a/docs/models/getlibraryhubsresponse.md +++ b/docs/models/getlibraryhubsresponse.md @@ -8,7 +8,7 @@ import { RFCDate } from "@lukehagar/plexjs/types"; let value: GetLibraryHubsResponse = { contentType: "", - statusCode: 537373, + statusCode: 616934, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getlibraryitemsrequest.md b/docs/models/getlibraryitemsrequest.md index 6dc0f586..4c792abd 100644 --- a/docs/models/getlibraryitemsrequest.md +++ b/docs/models/getlibraryitemsrequest.md @@ -3,19 +3,27 @@ ## Example Usage ```typescript -import { GetLibraryItemsRequest, Tag } from "@lukehagar/plexjs"; +import { GetLibraryItemsRequest, IncludeGuids, IncludeMeta, Tag, Type } from "@lukehagar/plexjs"; let value: GetLibraryItemsRequest = { - sectionId: "", - tag: Tag.RecentlyViewed, - includeGuids: 1, + sectionKey: 9518, + tag: Tag.Unwatched, + includeGuids: IncludeGuids.One, + includeMeta: IncludeMeta.One, + type: Type.Two, + xPlexContainerStart: 0, + xPlexContainerSize: 50, }; ``` ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `sectionId` | *any* | :heavy_check_mark: | the Id of the library to query | | -| `tag` | [models.Tag](../models/tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. | | -| `includeGuids` | *number* | :heavy_minus_sign: | Adds the Guids object to the response
| 1 | \ No newline at end of file +| 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 | +| `tag` | [models.Tag](../models/tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. | | +| `includeGuids` | [models.IncludeGuids](../models/includeguids.md) | :heavy_minus_sign: | Adds the Guids object to the response
| 1 | +| `includeMeta` | [models.IncludeMeta](../models/includemeta.md) | :heavy_minus_sign: | Adds the Meta object to the response
| 1 | +| `type` | [models.Type](../models/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 | +| `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/models/getlibraryitemsresponse.md b/docs/models/getlibraryitemsresponse.md index b72ad5d0..d1431883 100644 --- a/docs/models/getlibraryitemsresponse.md +++ b/docs/models/getlibraryitemsresponse.md @@ -8,7 +8,7 @@ import { RFCDate } from "@lukehagar/plexjs/types"; let value: GetLibraryItemsResponse = { contentType: "", - statusCode: 135218, + statusCode: 666767, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getlibrarylibraryresponsebody.md b/docs/models/getlibrarylibraryresponsebody.md deleted file mode 100644 index d4bbea89..00000000 --- a/docs/models/getlibrarylibraryresponsebody.md +++ /dev/null @@ -1,18 +0,0 @@ -# GetLibraryLibraryResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - -## Example Usage - -```typescript -import { GetLibraryLibraryResponseBody } from "@lukehagar/plexjs"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `errors` | [models.GetLibraryErrors](../models/getlibraryerrors.md)[] | :heavy_minus_sign: | N/A | -| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/getlibrarymediacontainer.md b/docs/models/getlibrarymediacontainer.md deleted file mode 100644 index bfb8c8bb..00000000 --- a/docs/models/getlibrarymediacontainer.md +++ /dev/null @@ -1,97 +0,0 @@ -# GetLibraryMediaContainer - -## Example Usage - -```typescript -import { GetLibraryMediaContainer } from "@lukehagar/plexjs"; - -let value: GetLibraryMediaContainer = { - size: 29, - allowSync: false, - art: "/:/resources/movie-fanart.jpg", - content: "secondary", - identifier: "com.plexapp.plugins.library", - librarySectionID: 1, - mediaTagPrefix: "/system/bundle/media/flags/", - mediaTagVersion: 1701731894, - thumb: "/:/resources/movie.png", - title1: "Movies", - viewGroup: "secondary", - viewMode: 65592, - directory: [ - { - key: "search?type=1", - title: "Search...", - secondary: true, - prompt: "Search Movies", - search: true, - }, - ], - type: [ - { - key: "/library/sections/1/all?type=1", - type: "movie", - title: "Movies", - active: false, - filter: [ - { - filter: "label", - filterType: "string", - key: "/library/sections/1/label", - title: "Labels", - type: "filter", - }, - ], - sort: [ - { - default: "asc", - defaultDirection: "desc", - descKey: "random:desc", - firstCharacterKey: "/library/sections/1/firstCharacter", - key: "random", - title: "Randomly", - }, - ], - field: [ - { - key: "label", - title: "Label", - type: "tag", - subType: "bitrate", - }, - ], - }, - ], - fieldType: [ - { - type: "resolution", - operator: [ - { - key: "=", - title: "is", - }, - ], - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `size` | *number* | :heavy_minus_sign: | N/A | 29 | -| `allowSync` | *boolean* | :heavy_minus_sign: | N/A | false | -| `art` | *string* | :heavy_minus_sign: | N/A | /:/resources/movie-fanart.jpg | -| `content` | *string* | :heavy_minus_sign: | N/A | secondary | -| `identifier` | *string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | -| `librarySectionID` | *number* | :heavy_minus_sign: | N/A | 1 | -| `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 | -| `viewGroup` | *string* | :heavy_minus_sign: | N/A | secondary | -| `viewMode` | *number* | :heavy_minus_sign: | N/A | 65592 | -| `directory` | [models.GetLibraryDirectory](../models/getlibrarydirectory.md)[] | :heavy_minus_sign: | N/A | | -| `type` | [models.GetLibraryType](../models/getlibrarytype.md)[] | :heavy_minus_sign: | N/A | | -| `fieldType` | [models.FieldType](../models/fieldtype.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/getlibrarytype.md b/docs/models/getlibrarytype.md deleted file mode 100644 index c7bd2f03..00000000 --- a/docs/models/getlibrarytype.md +++ /dev/null @@ -1,53 +0,0 @@ -# GetLibraryType - -## Example Usage - -```typescript -import { GetLibraryType } from "@lukehagar/plexjs"; - -let value: GetLibraryType = { - key: "/library/sections/1/all?type=1", - type: "movie", - title: "Movies", - active: false, - filter: [ - { - filter: "label", - filterType: "string", - key: "/library/sections/1/label", - title: "Labels", - type: "filter", - }, - ], - sort: [ - { - default: "asc", - defaultDirection: "desc", - descKey: "random:desc", - firstCharacterKey: "/library/sections/1/firstCharacter", - key: "random", - title: "Randomly", - }, - ], - field: [ - { - key: "label", - title: "Label", - type: "tag", - subType: "bitrate", - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `key` | *string* | :heavy_minus_sign: | N/A | /library/sections/1/all?type=1 | -| `type` | *string* | :heavy_minus_sign: | N/A | movie | -| `title` | *string* | :heavy_minus_sign: | N/A | Movies | -| `active` | *boolean* | :heavy_minus_sign: | N/A | false | -| `filter` | [models.GetLibraryFilter](../models/getlibraryfilter.md)[] | :heavy_minus_sign: | N/A | | -| `sort` | [models.Sort](../models/sort.md)[] | :heavy_minus_sign: | N/A | | -| `field` | [models.Field](../models/field.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/getmediaprovidersdirectory.md b/docs/models/getmediaprovidersdirectory.md new file mode 100644 index 00000000..c6de26b2 --- /dev/null +++ b/docs/models/getmediaprovidersdirectory.md @@ -0,0 +1,28 @@ +# GetMediaProvidersDirectory + +## Example Usage + +```typescript +import { GetMediaProvidersDirectory } from "@lukehagar/plexjs"; + +let value: GetMediaProvidersDirectory = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `hubKey` | *string* | :heavy_minus_sign: | N/A | +| `title` | *string* | :heavy_minus_sign: | N/A | +| `agent` | *string* | :heavy_minus_sign: | N/A | +| `language` | *string* | :heavy_minus_sign: | N/A | +| `refreshing` | *boolean* | :heavy_minus_sign: | N/A | +| `scanner` | *string* | :heavy_minus_sign: | N/A | +| `uuid` | *string* | :heavy_minus_sign: | N/A | +| `id` | *string* | :heavy_minus_sign: | N/A | +| `key` | *string* | :heavy_minus_sign: | N/A | +| `type` | *string* | :heavy_minus_sign: | N/A | +| `subtype` | *string* | :heavy_minus_sign: | N/A | +| `updatedAt` | *number* | :heavy_minus_sign: | N/A | +| `scannedAt` | *number* | :heavy_minus_sign: | N/A | +| `pivot` | [models.Pivot](../models/pivot.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/getmediaproviderserrors.md b/docs/models/getmediaproviderserrors.md new file mode 100644 index 00000000..83fd3ee8 --- /dev/null +++ b/docs/models/getmediaproviderserrors.md @@ -0,0 +1,21 @@ +# GetMediaProvidersErrors + +## Example Usage + +```typescript +import { GetMediaProvidersErrors } from "@lukehagar/plexjs"; + +let value: GetMediaProvidersErrors = { + 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/models/getmediaprovidersmediacontainer.md b/docs/models/getmediaprovidersmediacontainer.md new file mode 100644 index 00000000..2591b9cf --- /dev/null +++ b/docs/models/getmediaprovidersmediacontainer.md @@ -0,0 +1,58 @@ +# GetMediaProvidersMediaContainer + +## Example Usage + +```typescript +import { GetMediaProvidersMediaContainer } from "@lukehagar/plexjs"; + +let value: GetMediaProvidersMediaContainer = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `size` | *number* | :heavy_minus_sign: | N/A | +| `allowCameraUpload` | *boolean* | :heavy_minus_sign: | N/A | +| `allowChannelAccess` | *boolean* | :heavy_minus_sign: | N/A | +| `allowSharing` | *boolean* | :heavy_minus_sign: | N/A | +| `allowSync` | *boolean* | :heavy_minus_sign: | N/A | +| `allowTuners` | *boolean* | :heavy_minus_sign: | N/A | +| `backgroundProcessing` | *boolean* | :heavy_minus_sign: | N/A | +| `certificate` | *boolean* | :heavy_minus_sign: | N/A | +| `companionProxy` | *boolean* | :heavy_minus_sign: | N/A | +| `countryCode` | *string* | :heavy_minus_sign: | N/A | +| `diagnostics` | *string* | :heavy_minus_sign: | N/A | +| `eventStream` | *boolean* | :heavy_minus_sign: | N/A | +| `friendlyName` | *string* | :heavy_minus_sign: | N/A | +| `livetv` | *number* | :heavy_minus_sign: | N/A | +| `machineIdentifier` | *string* | :heavy_minus_sign: | N/A | +| `musicAnalysis` | *number* | :heavy_minus_sign: | N/A | +| `myPlex` | *boolean* | :heavy_minus_sign: | N/A | +| `myPlexMappingState` | *string* | :heavy_minus_sign: | N/A | +| `myPlexSigninState` | *string* | :heavy_minus_sign: | N/A | +| `myPlexSubscription` | *boolean* | :heavy_minus_sign: | N/A | +| `myPlexUsername` | *string* | :heavy_minus_sign: | N/A | +| `offlineTranscode` | *number* | :heavy_minus_sign: | N/A | +| `ownerFeatures` | *string* | :heavy_minus_sign: | N/A | +| `platform` | *string* | :heavy_minus_sign: | N/A | +| `platformVersion` | *string* | :heavy_minus_sign: | N/A | +| `pluginHost` | *boolean* | :heavy_minus_sign: | N/A | +| `pushNotifications` | *boolean* | :heavy_minus_sign: | N/A | +| `readOnlyLibraries` | *boolean* | :heavy_minus_sign: | N/A | +| `streamingBrainABRVersion` | *number* | :heavy_minus_sign: | N/A | +| `streamingBrainVersion` | *number* | :heavy_minus_sign: | N/A | +| `sync` | *boolean* | :heavy_minus_sign: | N/A | +| `transcoderActiveVideoSessions` | *number* | :heavy_minus_sign: | N/A | +| `transcoderAudio` | *boolean* | :heavy_minus_sign: | N/A | +| `transcoderLyrics` | *boolean* | :heavy_minus_sign: | N/A | +| `transcoderSubtitles` | *boolean* | :heavy_minus_sign: | N/A | +| `transcoderVideo` | *boolean* | :heavy_minus_sign: | N/A | +| `transcoderVideoBitrates` | *string* | :heavy_minus_sign: | N/A | +| `transcoderVideoQualities` | *string* | :heavy_minus_sign: | N/A | +| `transcoderVideoResolutions` | *string* | :heavy_minus_sign: | N/A | +| `updatedAt` | *number* | :heavy_minus_sign: | N/A | +| `updater` | *boolean* | :heavy_minus_sign: | N/A | +| `version` | *string* | :heavy_minus_sign: | N/A | +| `voiceSearch` | *boolean* | :heavy_minus_sign: | N/A | +| `mediaProvider` | [models.MediaProvider](../models/mediaprovider.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/getmediaprovidersrequest.md b/docs/models/getmediaprovidersrequest.md new file mode 100644 index 00000000..7c942c71 --- /dev/null +++ b/docs/models/getmediaprovidersrequest.md @@ -0,0 +1,17 @@ +# GetMediaProvidersRequest + +## Example Usage + +```typescript +import { GetMediaProvidersRequest } from "@lukehagar/plexjs"; + +let value: GetMediaProvidersRequest = { + xPlexToken: "CV5xoxjTpFKUzBTShsaf", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `xPlexToken` | *string* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf | \ No newline at end of file diff --git a/docs/models/getmediaprovidersresponse.md b/docs/models/getmediaprovidersresponse.md new file mode 100644 index 00000000..d48b3918 --- /dev/null +++ b/docs/models/getmediaprovidersresponse.md @@ -0,0 +1,24 @@ +# GetMediaProvidersResponse + +## Example Usage + +```typescript +import { GetMediaProvidersResponse } from "@lukehagar/plexjs"; + +let value: GetMediaProvidersResponse = { + contentType: "", + statusCode: 437587, + rawResponse: new Response('{"message": "hello world"}', { + headers: { "Content-Type": "application/json" }, + }), +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [models.GetMediaProvidersResponseBody](../models/getmediaprovidersresponsebody.md) | :heavy_minus_sign: | Media providers and their features | \ No newline at end of file diff --git a/docs/models/getmediaprovidersresponsebody.md b/docs/models/getmediaprovidersresponsebody.md new file mode 100644 index 00000000..c961229e --- /dev/null +++ b/docs/models/getmediaprovidersresponsebody.md @@ -0,0 +1,17 @@ +# GetMediaProvidersResponseBody + +Media providers and their features + +## Example Usage + +```typescript +import { GetMediaProvidersResponseBody } from "@lukehagar/plexjs"; + +let value: GetMediaProvidersResponseBody = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `mediaContainer` | [models.GetMediaProvidersMediaContainer](../models/getmediaprovidersmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/getmediaprovidersserverresponsebody.md b/docs/models/getmediaprovidersserverresponsebody.md new file mode 100644 index 00000000..2cd9498a --- /dev/null +++ b/docs/models/getmediaprovidersserverresponsebody.md @@ -0,0 +1,18 @@ +# GetMediaProvidersServerResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + +## Example Usage + +```typescript +import { GetMediaProvidersServerResponseBody } from "@lukehagar/plexjs"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `errors` | [models.GetMediaProvidersErrors](../models/getmediaproviderserrors.md)[] | :heavy_minus_sign: | N/A | +| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/getmetadatacountry.md b/docs/models/getmetadatabyratingkeycountry.md similarity index 84% rename from docs/models/getmetadatacountry.md rename to docs/models/getmetadatabyratingkeycountry.md index 8981acde..a76ad183 100644 --- a/docs/models/getmetadatacountry.md +++ b/docs/models/getmetadatabyratingkeycountry.md @@ -1,11 +1,11 @@ -# GetMetadataCountry +# GetMetaDataByRatingKeyCountry ## Example Usage ```typescript -import { GetMetadataCountry } from "@lukehagar/plexjs"; +import { GetMetaDataByRatingKeyCountry } from "@lukehagar/plexjs"; -let value: GetMetadataCountry = { +let value: GetMetaDataByRatingKeyCountry = { id: 116, filter: "country=116", tag: "United States of America", diff --git a/docs/models/getmetadatadirector.md b/docs/models/getmetadatabyratingkeydirector.md similarity index 94% rename from docs/models/getmetadatadirector.md rename to docs/models/getmetadatabyratingkeydirector.md index 06ae3048..c122ab65 100644 --- a/docs/models/getmetadatadirector.md +++ b/docs/models/getmetadatabyratingkeydirector.md @@ -1,11 +1,11 @@ -# GetMetadataDirector +# GetMetaDataByRatingKeyDirector ## Example Usage ```typescript -import { GetMetadataDirector } from "@lukehagar/plexjs"; +import { GetMetaDataByRatingKeyDirector } from "@lukehagar/plexjs"; -let value: GetMetadataDirector = { +let value: GetMetaDataByRatingKeyDirector = { id: 130, filter: "director=130", tag: "Joss Whedon", diff --git a/docs/models/getmetadatabyratingkeyerrors.md b/docs/models/getmetadatabyratingkeyerrors.md new file mode 100644 index 00000000..71ad62bd --- /dev/null +++ b/docs/models/getmetadatabyratingkeyerrors.md @@ -0,0 +1,21 @@ +# GetMetaDataByRatingKeyErrors + +## Example Usage + +```typescript +import { GetMetaDataByRatingKeyErrors } from "@lukehagar/plexjs"; + +let value: GetMetaDataByRatingKeyErrors = { + 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/models/getmetadatagenre.md b/docs/models/getmetadatabyratingkeygenre.md similarity index 82% rename from docs/models/getmetadatagenre.md rename to docs/models/getmetadatabyratingkeygenre.md index 47775608..021d9cdc 100644 --- a/docs/models/getmetadatagenre.md +++ b/docs/models/getmetadatabyratingkeygenre.md @@ -1,11 +1,11 @@ -# GetMetadataGenre +# GetMetaDataByRatingKeyGenre ## Example Usage ```typescript -import { GetMetadataGenre } from "@lukehagar/plexjs"; +import { GetMetaDataByRatingKeyGenre } from "@lukehagar/plexjs"; -let value: GetMetadataGenre = { +let value: GetMetaDataByRatingKeyGenre = { id: 184, filter: "genre=184", tag: "Thriller", diff --git a/docs/models/getmetadatabyratingkeylibraryresponsebody.md b/docs/models/getmetadatabyratingkeylibraryresponsebody.md new file mode 100644 index 00000000..3494f71a --- /dev/null +++ b/docs/models/getmetadatabyratingkeylibraryresponsebody.md @@ -0,0 +1,18 @@ +# GetMetaDataByRatingKeyLibraryResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + +## Example Usage + +```typescript +import { GetMetaDataByRatingKeyLibraryResponseBody } from "@lukehagar/plexjs"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `errors` | [models.GetMetaDataByRatingKeyErrors](../models/getmetadatabyratingkeyerrors.md)[] | :heavy_minus_sign: | N/A | +| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/getmetadatabyratingkeymedia.md b/docs/models/getmetadatabyratingkeymedia.md new file mode 100644 index 00000000..256e88aa --- /dev/null +++ b/docs/models/getmetadatabyratingkeymedia.md @@ -0,0 +1,98 @@ +# GetMetaDataByRatingKeyMedia + +## Example Usage + +```typescript +import { GetMetaDataByRatingKeyMedia } from "@lukehagar/plexjs"; + +let value: GetMetaDataByRatingKeyMedia = { + id: 15, + duration: 141417, + bitrate: 2278, + width: 1920, + height: 814, + aspectRatio: 2.35, + audioChannels: 2, + audioCodec: "aac", + videoCodec: "h264", + videoResolution: "1080", + container: "mp4", + videoFrameRate: "24p", + optimizedForStreaming: 0, + audioProfile: "lc", + has64bitOffsets: false, + videoProfile: "high", + part: [ + { + id: 15, + key: "/library/parts/15/1705637151/file.mp4", + duration: 141417, + file: "/movies/Serenity (2005)/Serenity (2005).mp4", + size: 40271948, + audioProfile: "lc", + container: "mp4", + has64bitOffsets: false, + optimizedForStreaming: false, + videoProfile: "high", + stream: [ + { + 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 | 15 | +| `duration` | *number* | :heavy_minus_sign: | N/A | 141417 | +| `bitrate` | *number* | :heavy_minus_sign: | N/A | 2278 | +| `width` | *number* | :heavy_minus_sign: | N/A | 1920 | +| `height` | *number* | :heavy_minus_sign: | N/A | 814 | +| `aspectRatio` | *number* | :heavy_minus_sign: | N/A | 2.35 | +| `audioChannels` | *number* | :heavy_minus_sign: | N/A | 2 | +| `audioCodec` | *string* | :heavy_minus_sign: | N/A | aac | +| `videoCodec` | *string* | :heavy_minus_sign: | N/A | h264 | +| `videoResolution` | *string* | :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 | +| `audioProfile` | *string* | :heavy_minus_sign: | N/A | lc | +| `has64bitOffsets` | *boolean* | :heavy_minus_sign: | N/A | false | +| `videoProfile` | *string* | :heavy_minus_sign: | N/A | high | +| `part` | [models.GetMetaDataByRatingKeyPart](../models/getmetadatabyratingkeypart.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/getmetadatamediacontainer.md b/docs/models/getmetadatabyratingkeymediacontainer.md similarity index 64% rename from docs/models/getmetadatamediacontainer.md rename to docs/models/getmetadatabyratingkeymediacontainer.md index 11922193..02165886 100644 --- a/docs/models/getmetadatamediacontainer.md +++ b/docs/models/getmetadatabyratingkeymediacontainer.md @@ -1,12 +1,12 @@ -# GetMetadataMediaContainer +# GetMetaDataByRatingKeyMediaContainer ## Example Usage ```typescript -import { GetMetadataMediaContainer } from "@lukehagar/plexjs"; +import { GetMetaDataByRatingKeyMediaContainer } from "@lukehagar/plexjs"; import { RFCDate } from "@lukehagar/plexjs/types"; -let value: GetMetadataMediaContainer = { +let value: GetMetaDataByRatingKeyMediaContainer = { size: 1, allowSync: true, identifier: "com.plexapp.plugins.library", @@ -182,14 +182,14 @@ let value: GetMetadataMediaContainer = { ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `size` | *number* | :heavy_minus_sign: | N/A | 1 | -| `allowSync` | *boolean* | :heavy_minus_sign: | N/A | true | -| `identifier` | *string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | -| `librarySectionID` | *number* | :heavy_minus_sign: | N/A | 1 | -| `librarySectionTitle` | *string* | :heavy_minus_sign: | N/A | Movies | -| `librarySectionUUID` | *string* | :heavy_minus_sign: | N/A | cfc899d7-3000-46f6-8489-b9592714ada5 | -| `mediaTagPrefix` | *string* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | -| `mediaTagVersion` | *number* | :heavy_minus_sign: | N/A | 1698860922 | -| `metadata` | [models.GetMetadataMetadata](../models/getmetadatametadata.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `size` | *number* | :heavy_minus_sign: | N/A | 1 | +| `allowSync` | *boolean* | :heavy_minus_sign: | N/A | true | +| `identifier` | *string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | +| `librarySectionID` | *number* | :heavy_minus_sign: | N/A | 1 | +| `librarySectionTitle` | *string* | :heavy_minus_sign: | N/A | Movies | +| `librarySectionUUID` | *string* | :heavy_minus_sign: | N/A | cfc899d7-3000-46f6-8489-b9592714ada5 | +| `mediaTagPrefix` | *string* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | +| `mediaTagVersion` | *number* | :heavy_minus_sign: | N/A | 1698860922 | +| `metadata` | [models.GetMetaDataByRatingKeyMetadata](../models/getmetadatabyratingkeymetadata.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/getmetadatametadata.md b/docs/models/getmetadatabyratingkeymetadata.md similarity index 98% rename from docs/models/getmetadatametadata.md rename to docs/models/getmetadatabyratingkeymetadata.md index 18616a5c..95773d8e 100644 --- a/docs/models/getmetadatametadata.md +++ b/docs/models/getmetadatabyratingkeymetadata.md @@ -1,12 +1,12 @@ -# GetMetadataMetadata +# GetMetaDataByRatingKeyMetadata ## Example Usage ```typescript -import { GetMetadataMetadata } from "@lukehagar/plexjs"; +import { GetMetaDataByRatingKeyMetadata } from "@lukehagar/plexjs"; import { RFCDate } from "@lukehagar/plexjs/types"; -let value: GetMetadataMetadata = { +let value: GetMetaDataByRatingKeyMetadata = { ratingKey: "17", key: "/library/metadata/17", guid: "plex://movie/5d77683f6f4521001ea9dc53", @@ -196,12 +196,12 @@ let value: GetMetadataMetadata = { | `audienceRatingImage` | *string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | | `hasPremiumPrimaryExtra` | *string* | :heavy_minus_sign: | N/A | 1 | | `ratingImage` | *string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.ripe | -| `media` | [models.GetMetadataMedia](../models/getmetadatamedia.md)[] | :heavy_minus_sign: | N/A | | -| `genre` | [models.GetMetadataGenre](../models/getmetadatagenre.md)[] | :heavy_minus_sign: | N/A | | -| `country` | [models.GetMetadataCountry](../models/getmetadatacountry.md)[] | :heavy_minus_sign: | N/A | | +| `media` | [models.GetMetaDataByRatingKeyMedia](../models/getmetadatabyratingkeymedia.md)[] | :heavy_minus_sign: | N/A | | +| `genre` | [models.GetMetaDataByRatingKeyGenre](../models/getmetadatabyratingkeygenre.md)[] | :heavy_minus_sign: | N/A | | +| `country` | [models.GetMetaDataByRatingKeyCountry](../models/getmetadatabyratingkeycountry.md)[] | :heavy_minus_sign: | N/A | | | `guids` | [models.Guids](../models/guids.md)[] | :heavy_minus_sign: | N/A | | | `ratings` | [models.Ratings](../models/ratings.md)[] | :heavy_minus_sign: | N/A | | -| `director` | [models.GetMetadataDirector](../models/getmetadatadirector.md)[] | :heavy_minus_sign: | N/A | | -| `writer` | [models.GetMetadataWriter](../models/getmetadatawriter.md)[] | :heavy_minus_sign: | N/A | | -| `role` | [models.GetMetadataRole](../models/getmetadatarole.md)[] | :heavy_minus_sign: | N/A | | +| `director` | [models.GetMetaDataByRatingKeyDirector](../models/getmetadatabyratingkeydirector.md)[] | :heavy_minus_sign: | N/A | | +| `writer` | [models.GetMetaDataByRatingKeyWriter](../models/getmetadatabyratingkeywriter.md)[] | :heavy_minus_sign: | N/A | | +| `role` | [models.GetMetaDataByRatingKeyRole](../models/getmetadatabyratingkeyrole.md)[] | :heavy_minus_sign: | N/A | | | `producer` | [models.Producer](../models/producer.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/getmetadatapart.md b/docs/models/getmetadatabyratingkeypart.md similarity index 97% rename from docs/models/getmetadatapart.md rename to docs/models/getmetadatabyratingkeypart.md index f72760c3..c83a17df 100644 --- a/docs/models/getmetadatapart.md +++ b/docs/models/getmetadatabyratingkeypart.md @@ -1,11 +1,11 @@ -# GetMetadataPart +# GetMetaDataByRatingKeyPart ## Example Usage ```typescript -import { GetMetadataPart } from "@lukehagar/plexjs"; +import { GetMetaDataByRatingKeyPart } from "@lukehagar/plexjs"; -let value: GetMetadataPart = { +let value: GetMetaDataByRatingKeyPart = { id: 15, key: "/library/parts/15/1705637151/file.mp4", duration: 141417, diff --git a/docs/models/getmetadatarequest.md b/docs/models/getmetadatabyratingkeyrequest.md similarity index 59% rename from docs/models/getmetadatarequest.md rename to docs/models/getmetadatabyratingkeyrequest.md index 7fea4cf4..46c9c723 100644 --- a/docs/models/getmetadatarequest.md +++ b/docs/models/getmetadatabyratingkeyrequest.md @@ -1,17 +1,17 @@ -# GetMetadataRequest +# GetMetaDataByRatingKeyRequest ## Example Usage ```typescript -import { GetMetadataRequest } from "@lukehagar/plexjs"; +import { GetMetaDataByRatingKeyRequest } from "@lukehagar/plexjs"; -let value: GetMetadataRequest = { - ratingKey: 6169.34, +let value: GetMetaDataByRatingKeyRequest = { + ratingKey: 9518, }; ``` ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `ratingKey` | *number* | :heavy_check_mark: | the id of the library item to return the children of. | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ratingKey` | *number* | :heavy_check_mark: | the id of the library item to return the children of. | 9518 | \ No newline at end of file diff --git a/docs/models/getmetadataresponse.md b/docs/models/getmetadatabyratingkeyresponse.md similarity index 81% rename from docs/models/getmetadataresponse.md rename to docs/models/getmetadatabyratingkeyresponse.md index 3ef9b4d9..eb3cac03 100644 --- a/docs/models/getmetadataresponse.md +++ b/docs/models/getmetadatabyratingkeyresponse.md @@ -1,14 +1,14 @@ -# GetMetadataResponse +# GetMetaDataByRatingKeyResponse ## Example Usage ```typescript -import { GetMetadataResponse } from "@lukehagar/plexjs"; +import { GetMetaDataByRatingKeyResponse } from "@lukehagar/plexjs"; import { RFCDate } from "@lukehagar/plexjs/types"; -let value: GetMetadataResponse = { +let value: GetMetaDataByRatingKeyResponse = { contentType: "", - statusCode: 386489, + statusCode: 358152, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), @@ -191,9 +191,9 @@ let value: GetMetadataResponse = { ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [models.GetMetadataResponseBody](../models/getmetadataresponsebody.md) | :heavy_minus_sign: | The metadata of the library item. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [models.GetMetaDataByRatingKeyResponseBody](../models/getmetadatabyratingkeyresponsebody.md) | :heavy_minus_sign: | The metadata of the library item. | \ No newline at end of file diff --git a/docs/models/getmetadataresponsebody.md b/docs/models/getmetadatabyratingkeyresponsebody.md similarity index 87% rename from docs/models/getmetadataresponsebody.md rename to docs/models/getmetadatabyratingkeyresponsebody.md index 0c9877e1..4e850b8a 100644 --- a/docs/models/getmetadataresponsebody.md +++ b/docs/models/getmetadatabyratingkeyresponsebody.md @@ -1,14 +1,14 @@ -# GetMetadataResponseBody +# GetMetaDataByRatingKeyResponseBody The metadata of the library item. ## Example Usage ```typescript -import { GetMetadataResponseBody } from "@lukehagar/plexjs"; +import { GetMetaDataByRatingKeyResponseBody } from "@lukehagar/plexjs"; import { RFCDate } from "@lukehagar/plexjs/types"; -let value: GetMetadataResponseBody = { +let value: GetMetaDataByRatingKeyResponseBody = { mediaContainer: { size: 1, allowSync: true, @@ -186,6 +186,6 @@ let value: GetMetadataResponseBody = { ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `mediaContainer` | [models.GetMetadataMediaContainer](../models/getmetadatamediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `mediaContainer` | [models.GetMetaDataByRatingKeyMediaContainer](../models/getmetadatabyratingkeymediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/getmetadatarole.md b/docs/models/getmetadatabyratingkeyrole.md similarity index 96% rename from docs/models/getmetadatarole.md rename to docs/models/getmetadatabyratingkeyrole.md index 16052562..54c9dbcf 100644 --- a/docs/models/getmetadatarole.md +++ b/docs/models/getmetadatabyratingkeyrole.md @@ -1,11 +1,11 @@ -# GetMetadataRole +# GetMetaDataByRatingKeyRole ## Example Usage ```typescript -import { GetMetadataRole } from "@lukehagar/plexjs"; +import { GetMetaDataByRatingKeyRole } from "@lukehagar/plexjs"; -let value: GetMetadataRole = { +let value: GetMetaDataByRatingKeyRole = { id: 220, filter: "actor=220", tag: "Dennis Keiffer", diff --git a/docs/models/getmetadatawriter.md b/docs/models/getmetadatabyratingkeywriter.md similarity index 95% rename from docs/models/getmetadatawriter.md rename to docs/models/getmetadatabyratingkeywriter.md index d77ed800..0cd9655b 100644 --- a/docs/models/getmetadatawriter.md +++ b/docs/models/getmetadatabyratingkeywriter.md @@ -1,11 +1,11 @@ -# GetMetadataWriter +# GetMetaDataByRatingKeyWriter ## Example Usage ```typescript -import { GetMetadataWriter } from "@lukehagar/plexjs"; +import { GetMetaDataByRatingKeyWriter } from "@lukehagar/plexjs"; -let value: GetMetadataWriter = { +let value: GetMetaDataByRatingKeyWriter = { id: 132, filter: "writer=132", tag: "Joss Whedon", diff --git a/docs/models/getmetadatachildrenrequest.md b/docs/models/getmetadatachildrenrequest.md index 3f463c7e..49e841e6 100644 --- a/docs/models/getmetadatachildrenrequest.md +++ b/docs/models/getmetadatachildrenrequest.md @@ -6,7 +6,7 @@ import { GetMetadataChildrenRequest } from "@lukehagar/plexjs"; let value: GetMetadataChildrenRequest = { - ratingKey: 9437.49, + ratingKey: 1289.26, }; ``` diff --git a/docs/models/getmetadatachildrenresponse.md b/docs/models/getmetadatachildrenresponse.md index d78af34f..0533182b 100644 --- a/docs/models/getmetadatachildrenresponse.md +++ b/docs/models/getmetadatachildrenresponse.md @@ -7,7 +7,7 @@ import { GetMetadataChildrenResponse } from "@lukehagar/plexjs"; let value: GetMetadataChildrenResponse = { contentType: "", - statusCode: 902599, + statusCode: 750686, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getmetadatamedia.md b/docs/models/getmetadatamedia.md deleted file mode 100644 index 7bd55a9b..00000000 --- a/docs/models/getmetadatamedia.md +++ /dev/null @@ -1,98 +0,0 @@ -# GetMetadataMedia - -## Example Usage - -```typescript -import { GetMetadataMedia } from "@lukehagar/plexjs"; - -let value: GetMetadataMedia = { - id: 15, - duration: 141417, - bitrate: 2278, - width: 1920, - height: 814, - aspectRatio: 2.35, - audioChannels: 2, - audioCodec: "aac", - videoCodec: "h264", - videoResolution: "1080", - container: "mp4", - videoFrameRate: "24p", - optimizedForStreaming: 0, - audioProfile: "lc", - has64bitOffsets: false, - videoProfile: "high", - part: [ - { - id: 15, - key: "/library/parts/15/1705637151/file.mp4", - duration: 141417, - file: "/movies/Serenity (2005)/Serenity (2005).mp4", - size: 40271948, - audioProfile: "lc", - container: "mp4", - has64bitOffsets: false, - optimizedForStreaming: false, - videoProfile: "high", - stream: [ - { - 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 | 15 | -| `duration` | *number* | :heavy_minus_sign: | N/A | 141417 | -| `bitrate` | *number* | :heavy_minus_sign: | N/A | 2278 | -| `width` | *number* | :heavy_minus_sign: | N/A | 1920 | -| `height` | *number* | :heavy_minus_sign: | N/A | 814 | -| `aspectRatio` | *number* | :heavy_minus_sign: | N/A | 2.35 | -| `audioChannels` | *number* | :heavy_minus_sign: | N/A | 2 | -| `audioCodec` | *string* | :heavy_minus_sign: | N/A | aac | -| `videoCodec` | *string* | :heavy_minus_sign: | N/A | h264 | -| `videoResolution` | *string* | :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 | -| `audioProfile` | *string* | :heavy_minus_sign: | N/A | lc | -| `has64bitOffsets` | *boolean* | :heavy_minus_sign: | N/A | false | -| `videoProfile` | *string* | :heavy_minus_sign: | N/A | high | -| `part` | [models.GetMetadataPart](../models/getmetadatapart.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/getondeckresponse.md b/docs/models/getondeckresponse.md index 8abf9446..7ad361cf 100644 --- a/docs/models/getondeckresponse.md +++ b/docs/models/getondeckresponse.md @@ -7,7 +7,7 @@ import { GetOnDeckResponse } from "@lukehagar/plexjs"; let value: GetOnDeckResponse = { contentType: "", - statusCode: 359508, + statusCode: 607831, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getpinglobals.md b/docs/models/getpinglobals.md index e7b7670e..63fb3880 100644 --- a/docs/models/getpinglobals.md +++ b/docs/models/getpinglobals.md @@ -12,4 +12,4 @@ let value: GetPinGlobals = {}; | 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)
| Postman | \ No newline at end of file +| `xPlexClientIdentifier` | *string* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| gcgzw5rz2xovp84b4vha3a40 | \ No newline at end of file diff --git a/docs/models/getpinrequest.md b/docs/models/getpinrequest.md index 8d83a8d7..2d75edfa 100644 --- a/docs/models/getpinrequest.md +++ b/docs/models/getpinrequest.md @@ -6,7 +6,7 @@ import { GetPinRequest } from "@lukehagar/plexjs"; let value: GetPinRequest = { - xPlexProduct: "Postman", + xPlexProduct: "Plex Web", }; ``` @@ -15,5 +15,5 @@ let value: GetPinRequest = { | 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)
| Postman | -| `xPlexProduct` | *string* | :heavy_check_mark: | Product name of the application shown in the list of devices
| Postman | \ No newline at end of file +| `xPlexClientIdentifier` | *string* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| gcgzw5rz2xovp84b4vha3a40 | +| `xPlexProduct` | *string* | :heavy_minus_sign: | N/A | Plex Web | \ No newline at end of file diff --git a/docs/models/getpinresponse.md b/docs/models/getpinresponse.md index 0a5b0e3f..08e70429 100644 --- a/docs/models/getpinresponse.md +++ b/docs/models/getpinresponse.md @@ -7,7 +7,7 @@ import { GetPinResponse } from "@lukehagar/plexjs"; let value: GetPinResponse = { contentType: "", - statusCode: 799159, + statusCode: 135218, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getplaylistcontentsqueryparamtype.md b/docs/models/getplaylistcontentsqueryparamtype.md new file mode 100644 index 00000000..25e3173a --- /dev/null +++ b/docs/models/getplaylistcontentsqueryparamtype.md @@ -0,0 +1,26 @@ +# GetPlaylistContentsQueryParamType + +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 { GetPlaylistContentsQueryParamType } from "@lukehagar/plexjs"; + +let value: GetPlaylistContentsQueryParamType = GetPlaylistContentsQueryParamType.Two; +``` + +## Values + +| Name | Value | +| ------- | ------- | +| `One` | 1 | +| `Two` | 2 | +| `Three` | 3 | +| `Four` | 4 | \ No newline at end of file diff --git a/docs/models/getplaylistcontentsrequest.md b/docs/models/getplaylistcontentsrequest.md index 4dd50e64..a86b4352 100644 --- a/docs/models/getplaylistcontentsrequest.md +++ b/docs/models/getplaylistcontentsrequest.md @@ -3,17 +3,17 @@ ## Example Usage ```typescript -import { GetPlaylistContentsRequest } from "@lukehagar/plexjs"; +import { GetPlaylistContentsQueryParamType, GetPlaylistContentsRequest } from "@lukehagar/plexjs"; let value: GetPlaylistContentsRequest = { - playlistID: 9883.74, - type: 9589.5, + playlistID: 7783.46, + type: GetPlaylistContentsQueryParamType.Two, }; ``` ## Fields -| Field | Type | Required | Description | -| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | -| `playlistID` | *number* | :heavy_check_mark: | the ID of the playlist | -| `type` | *number* | :heavy_check_mark: | the metadata type of the item to return | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `playlistID` | *number* | :heavy_check_mark: | the ID of the playlist | | +| `type` | [models.GetPlaylistContentsQueryParamType](../models/getplaylistcontentsqueryparamtype.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/models/getplaylistcontentsresponse.md b/docs/models/getplaylistcontentsresponse.md index 6a560fed..93b99c2b 100644 --- a/docs/models/getplaylistcontentsresponse.md +++ b/docs/models/getplaylistcontentsresponse.md @@ -8,7 +8,7 @@ import { RFCDate } from "@lukehagar/plexjs/types"; let value: GetPlaylistContentsResponse = { contentType: "", - statusCode: 102044, + statusCode: 196582, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getplaylistrequest.md b/docs/models/getplaylistrequest.md index 4e9db0e3..cebf6e66 100644 --- a/docs/models/getplaylistrequest.md +++ b/docs/models/getplaylistrequest.md @@ -6,7 +6,7 @@ import { GetPlaylistRequest } from "@lukehagar/plexjs"; let value: GetPlaylistRequest = { - playlistID: 3637.11, + playlistID: 3380.07, }; ``` diff --git a/docs/models/getplaylistresponse.md b/docs/models/getplaylistresponse.md index 73be07f7..de8c392e 100644 --- a/docs/models/getplaylistresponse.md +++ b/docs/models/getplaylistresponse.md @@ -7,7 +7,7 @@ import { GetPlaylistResponse } from "@lukehagar/plexjs"; let value: GetPlaylistResponse = { contentType: "", - statusCode: 325047, + statusCode: 110375, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getplaylistsresponse.md b/docs/models/getplaylistsresponse.md index ce84b830..86319ea1 100644 --- a/docs/models/getplaylistsresponse.md +++ b/docs/models/getplaylistsresponse.md @@ -7,7 +7,7 @@ import { GetPlaylistsResponse } from "@lukehagar/plexjs"; let value: GetPlaylistsResponse = { contentType: "", - statusCode: 607831, + statusCode: 158969, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getrecentlyaddedrequest.md b/docs/models/getrecentlyaddedrequest.md new file mode 100644 index 00000000..7a8e5715 --- /dev/null +++ b/docs/models/getrecentlyaddedrequest.md @@ -0,0 +1,19 @@ +# GetRecentlyAddedRequest + +## Example Usage + +```typescript +import { GetRecentlyAddedRequest } from "@lukehagar/plexjs"; + +let value: GetRecentlyAddedRequest = { + xPlexContainerStart: 0, + xPlexContainerSize: 50, +}; +``` + +## Fields + +| Field | 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
| 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/models/getrecentlyaddedresponse.md b/docs/models/getrecentlyaddedresponse.md index 3ab22db0..18e4bb71 100644 --- a/docs/models/getrecentlyaddedresponse.md +++ b/docs/models/getrecentlyaddedresponse.md @@ -7,7 +7,7 @@ import { GetRecentlyAddedResponse } from "@lukehagar/plexjs"; let value: GetRecentlyAddedResponse = { contentType: "", - statusCode: 473600, + statusCode: 359508, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getrefreshlibrarymetadataerrors.md b/docs/models/getrefreshlibrarymetadataerrors.md new file mode 100644 index 00000000..8bbbcdf6 --- /dev/null +++ b/docs/models/getrefreshlibrarymetadataerrors.md @@ -0,0 +1,21 @@ +# GetRefreshLibraryMetadataErrors + +## Example Usage + +```typescript +import { GetRefreshLibraryMetadataErrors } from "@lukehagar/plexjs"; + +let value: GetRefreshLibraryMetadataErrors = { + 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/models/getrefreshlibrarymetadatarequest.md b/docs/models/getrefreshlibrarymetadatarequest.md new file mode 100644 index 00000000..832f6288 --- /dev/null +++ b/docs/models/getrefreshlibrarymetadatarequest.md @@ -0,0 +1,19 @@ +# GetRefreshLibraryMetadataRequest + +## Example Usage + +```typescript +import { Force, GetRefreshLibraryMetadataRequest } from "@lukehagar/plexjs"; + +let value: GetRefreshLibraryMetadataRequest = { + sectionKey: 9518, + force: Force.One, +}; +``` + +## Fields + +| 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 | +| `force` | [models.Force](../models/force.md) | :heavy_minus_sign: | Force the refresh even if the library is already being refreshed. | 0 | \ No newline at end of file diff --git a/docs/models/refreshlibraryresponse.md b/docs/models/getrefreshlibrarymetadataresponse.md similarity index 90% rename from docs/models/refreshlibraryresponse.md rename to docs/models/getrefreshlibrarymetadataresponse.md index cddba6af..767584df 100644 --- a/docs/models/refreshlibraryresponse.md +++ b/docs/models/getrefreshlibrarymetadataresponse.md @@ -1,13 +1,13 @@ -# RefreshLibraryResponse +# GetRefreshLibraryMetadataResponse ## Example Usage ```typescript -import { RefreshLibraryResponse } from "@lukehagar/plexjs"; +import { GetRefreshLibraryMetadataResponse } from "@lukehagar/plexjs"; -let value: RefreshLibraryResponse = { +let value: GetRefreshLibraryMetadataResponse = { contentType: "", - statusCode: 324141, + statusCode: 170909, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getrefreshlibrarymetadataresponsebody.md b/docs/models/getrefreshlibrarymetadataresponsebody.md new file mode 100644 index 00000000..fd069039 --- /dev/null +++ b/docs/models/getrefreshlibrarymetadataresponsebody.md @@ -0,0 +1,18 @@ +# GetRefreshLibraryMetadataResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + +## Example Usage + +```typescript +import { GetRefreshLibraryMetadataResponseBody } from "@lukehagar/plexjs"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `errors` | [models.GetRefreshLibraryMetadataErrors](../models/getrefreshlibrarymetadataerrors.md)[] | :heavy_minus_sign: | N/A | +| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/getresourcesresponsebody.md b/docs/models/getresourcesresponsebody.md deleted file mode 100644 index 9461264e..00000000 --- a/docs/models/getresourcesresponsebody.md +++ /dev/null @@ -1,18 +0,0 @@ -# GetResourcesResponseBody - -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. - -## Example Usage - -```typescript -import { GetResourcesResponseBody } from "@lukehagar/plexjs"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `errors` | [models.GetResourcesErrors](../models/getresourceserrors.md)[] | :heavy_minus_sign: | N/A | -| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/getresourcesstatisticsresponse.md b/docs/models/getresourcesstatisticsresponse.md index d241f8a1..78c4bd11 100644 --- a/docs/models/getresourcesstatisticsresponse.md +++ b/docs/models/getresourcesstatisticsresponse.md @@ -7,7 +7,7 @@ import { GetResourcesStatisticsResponse } from "@lukehagar/plexjs"; let value: GetResourcesStatisticsResponse = { contentType: "", - statusCode: 244425, + statusCode: 523248, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getlibraryerrors.md b/docs/models/getsearchlibraryerrors.md similarity index 88% rename from docs/models/getlibraryerrors.md rename to docs/models/getsearchlibraryerrors.md index d357e9f7..f33986aa 100644 --- a/docs/models/getlibraryerrors.md +++ b/docs/models/getsearchlibraryerrors.md @@ -1,11 +1,11 @@ -# GetLibraryErrors +# GetSearchLibraryErrors ## Example Usage ```typescript -import { GetLibraryErrors } from "@lukehagar/plexjs"; +import { GetSearchLibraryErrors } from "@lukehagar/plexjs"; -let value: GetLibraryErrors = { +let value: GetSearchLibraryErrors = { code: 1001, message: "User could not be authenticated", status: 401, diff --git a/docs/models/getsearchlibrarylibraryresponsebody.md b/docs/models/getsearchlibrarylibraryresponsebody.md new file mode 100644 index 00000000..d8869244 --- /dev/null +++ b/docs/models/getsearchlibrarylibraryresponsebody.md @@ -0,0 +1,18 @@ +# GetSearchLibraryLibraryResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + +## Example Usage + +```typescript +import { GetSearchLibraryLibraryResponseBody } from "@lukehagar/plexjs"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `errors` | [models.GetSearchLibraryErrors](../models/getsearchlibraryerrors.md)[] | :heavy_minus_sign: | N/A | +| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/getsearchlibrarymediacontainer.md b/docs/models/getsearchlibrarymediacontainer.md new file mode 100644 index 00000000..3b11c3c3 --- /dev/null +++ b/docs/models/getsearchlibrarymediacontainer.md @@ -0,0 +1,65 @@ +# GetSearchLibraryMediaContainer + +## Example Usage + +```typescript +import { GetSearchLibraryMediaContainer } from "@lukehagar/plexjs"; + +let value: GetSearchLibraryMediaContainer = { + size: 2, + allowSync: false, + art: "/:/resources/show-fanart.jpg", + identifier: "com.plexapp.plugins.library", + mediaTagPrefix: "/system/bundle/media/flags/", + mediaTagVersion: 1698860922, + nocache: true, + thumb: "/:/resources/show.png", + title1: "TV Shows", + title2: "Search for ''", + viewGroup: "season", + viewMode: 65593, + metadata: [ + { + ratingKey: "2", + key: "/library/metadata/2/children", + parentRatingKey: "1", + guid: "plex://season/602e67e766dfdb002c0a1b5b", + parentGuid: "plex://show/5d9c086c7d06d9001ffd27aa", + parentStudio: "Mutant Enemy Productions", + type: "season", + title: "Season 1", + parentKey: "/library/metadata/1", + parentTitle: "Firefly", + summary: + "Captain Malcolm 'Mal' Reynolds is a former galactic war veteran who is the captain of the transport ship \"Serenity\". Mal and his crew, ensign Zoe Alleyne Washburne; Zoe's husband, pilot Hoban 'Wash' Washburne; muscular mercenary Jayne Cobb; young mechanic Kaylee Frye; former Alliance medical officer Simon Tam; his disturbed teenage sister River (both on the run from the interplanetary government \"The Alliance\"); the beautiful courtesan Inara Serra; and preacher Shepherd Book do any jobs, legal or illegal, they can find as the Serenity crew travels across the outskirts of outer space.", + index: 1, + parentIndex: 1, + parentYear: 2002, + thumb: "/library/metadata/2/thumb/1705636920", + art: "/library/metadata/1/art/1705636920", + parentThumb: "/library/metadata/1/thumb/1705636920", + parentTheme: "/library/metadata/1/theme/1705636920", + addedAt: 1705636916, + updatedAt: 1705636920, + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `size` | *number* | :heavy_minus_sign: | N/A | 2 | +| `allowSync` | *boolean* | :heavy_minus_sign: | N/A | false | +| `art` | *string* | :heavy_minus_sign: | N/A | /:/resources/show-fanart.jpg | +| `identifier` | *string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | +| `mediaTagPrefix` | *string* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | +| `mediaTagVersion` | *number* | :heavy_minus_sign: | N/A | 1698860922 | +| `nocache` | *boolean* | :heavy_minus_sign: | N/A | true | +| `thumb` | *string* | :heavy_minus_sign: | N/A | /:/resources/show.png | +| `title1` | *string* | :heavy_minus_sign: | N/A | TV Shows | +| `title2` | *string* | :heavy_minus_sign: | N/A | Search for '' | +| `viewGroup` | *string* | :heavy_minus_sign: | N/A | season | +| `viewMode` | *number* | :heavy_minus_sign: | N/A | 65593 | +| `metadata` | [models.GetSearchLibraryMetadata](../models/getsearchlibrarymetadata.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/searchlibrarymetadata.md b/docs/models/getsearchlibrarymetadata.md similarity index 99% rename from docs/models/searchlibrarymetadata.md rename to docs/models/getsearchlibrarymetadata.md index 3cda2137..bbc2facf 100644 --- a/docs/models/searchlibrarymetadata.md +++ b/docs/models/getsearchlibrarymetadata.md @@ -1,11 +1,11 @@ -# SearchLibraryMetadata +# GetSearchLibraryMetadata ## Example Usage ```typescript -import { SearchLibraryMetadata } from "@lukehagar/plexjs"; +import { GetSearchLibraryMetadata } from "@lukehagar/plexjs"; -let value: SearchLibraryMetadata = { +let value: GetSearchLibraryMetadata = { ratingKey: "2", key: "/library/metadata/2/children", parentRatingKey: "1", diff --git a/docs/models/getsearchlibraryrequest.md b/docs/models/getsearchlibraryrequest.md new file mode 100644 index 00000000..97b4141f --- /dev/null +++ b/docs/models/getsearchlibraryrequest.md @@ -0,0 +1,19 @@ +# GetSearchLibraryRequest + +## Example Usage + +```typescript +import { GetSearchLibraryRequest, QueryParamType } from "@lukehagar/plexjs"; + +let value: GetSearchLibraryRequest = { + sectionKey: 9518, + type: QueryParamType.Two, +}; +``` + +## Fields + +| 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` | [models.QueryParamType](../models/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 diff --git a/docs/models/searchlibraryresponse.md b/docs/models/getsearchlibraryresponse.md similarity index 61% rename from docs/models/searchlibraryresponse.md rename to docs/models/getsearchlibraryresponse.md index f95e7462..e65a7e80 100644 --- a/docs/models/searchlibraryresponse.md +++ b/docs/models/getsearchlibraryresponse.md @@ -1,13 +1,13 @@ -# SearchLibraryResponse +# GetSearchLibraryResponse ## Example Usage ```typescript -import { SearchLibraryResponse } from "@lukehagar/plexjs"; +import { GetSearchLibraryResponse } from "@lukehagar/plexjs"; -let value: SearchLibraryResponse = { +let value: GetSearchLibraryResponse = { contentType: "", - statusCode: 222321, + statusCode: 210382, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), @@ -57,9 +57,9 @@ let value: SearchLibraryResponse = { ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [models.SearchLibraryResponseBody](../models/searchlibraryresponsebody.md) | :heavy_minus_sign: | The contents of the library by section and type | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [models.GetSearchLibraryResponseBody](../models/getsearchlibraryresponsebody.md) | :heavy_minus_sign: | The contents of the library by section and type | \ No newline at end of file diff --git a/docs/models/searchlibraryresponsebody.md b/docs/models/getsearchlibraryresponsebody.md similarity index 73% rename from docs/models/searchlibraryresponsebody.md rename to docs/models/getsearchlibraryresponsebody.md index 31232e79..1ae9bbdc 100644 --- a/docs/models/searchlibraryresponsebody.md +++ b/docs/models/getsearchlibraryresponsebody.md @@ -1,13 +1,13 @@ -# SearchLibraryResponseBody +# GetSearchLibraryResponseBody The contents of the library by section and type ## Example Usage ```typescript -import { SearchLibraryResponseBody } from "@lukehagar/plexjs"; +import { GetSearchLibraryResponseBody } from "@lukehagar/plexjs"; -let value: SearchLibraryResponseBody = { +let value: GetSearchLibraryResponseBody = { mediaContainer: { size: 2, allowSync: false, @@ -52,6 +52,6 @@ let value: SearchLibraryResponseBody = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `mediaContainer` | [models.SearchLibraryMediaContainer](../models/searchlibrarymediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `mediaContainer` | [models.GetSearchLibraryMediaContainer](../models/getsearchlibrarymediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/getsearchresultsresponse.md b/docs/models/getsearchresultsresponse.md index c244e8d8..da62f9d0 100644 --- a/docs/models/getsearchresultsresponse.md +++ b/docs/models/getsearchresultsresponse.md @@ -7,7 +7,7 @@ import { GetSearchResultsResponse } from "@lukehagar/plexjs"; let value: GetSearchResultsResponse = { contentType: "", - statusCode: 105907, + statusCode: 681820, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getserveractivitiesresponse.md b/docs/models/getserveractivitiesresponse.md index 49e12798..5932053a 100644 --- a/docs/models/getserveractivitiesresponse.md +++ b/docs/models/getserveractivitiesresponse.md @@ -7,7 +7,7 @@ import { GetServerActivitiesResponse } from "@lukehagar/plexjs"; let value: GetServerActivitiesResponse = { contentType: "", - statusCode: 383441, + statusCode: 477665, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getserveridentityerrors.md b/docs/models/getserveridentityerrors.md deleted file mode 100644 index 4bc147fb..00000000 --- a/docs/models/getserveridentityerrors.md +++ /dev/null @@ -1,21 +0,0 @@ -# GetServerIdentityErrors - -## Example Usage - -```typescript -import { GetServerIdentityErrors } from "@lukehagar/plexjs"; - -let value: GetServerIdentityErrors = { - 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/models/getserveridentityserverresponsebody.md b/docs/models/getserveridentityserverresponsebody.md index d4fddf7b..888d2b91 100644 --- a/docs/models/getserveridentityserverresponsebody.md +++ b/docs/models/getserveridentityserverresponsebody.md @@ -1,6 +1,6 @@ # GetServerIdentityServerResponseBody -Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +Request Timeout ## Example Usage @@ -12,7 +12,8 @@ import { GetServerIdentityServerResponseBody } from "@lukehagar/plexjs"; ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `errors` | [models.GetServerIdentityErrors](../models/getserveridentityerrors.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 +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `code` | *number* | :heavy_minus_sign: | N/A | 408 | +| `message` | *string* | :heavy_minus_sign: | N/A | The server timed out waiting for the request. | +| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/docs/models/getserverlistresponse.md b/docs/models/getserverlistresponse.md index 49e32b96..63722223 100644 --- a/docs/models/getserverlistresponse.md +++ b/docs/models/getserverlistresponse.md @@ -7,7 +7,7 @@ import { GetServerListResponse } from "@lukehagar/plexjs"; let value: GetServerListResponse = { contentType: "", - statusCode: 437587, + statusCode: 297534, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getserverresourceserrors.md b/docs/models/getserverresourceserrors.md new file mode 100644 index 00000000..210fa821 --- /dev/null +++ b/docs/models/getserverresourceserrors.md @@ -0,0 +1,21 @@ +# GetServerResourcesErrors + +## Example Usage + +```typescript +import { GetServerResourcesErrors } from "@lukehagar/plexjs"; + +let value: GetServerResourcesErrors = { + 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/models/getresourcesglobals.md b/docs/models/getserverresourcesglobals.md similarity index 90% rename from docs/models/getresourcesglobals.md rename to docs/models/getserverresourcesglobals.md index dd306e74..3daa48da 100644 --- a/docs/models/getresourcesglobals.md +++ b/docs/models/getserverresourcesglobals.md @@ -1,15 +1,15 @@ -# GetResourcesGlobals +# GetServerResourcesGlobals ## Example Usage ```typescript -import { GetResourcesGlobals } from "@lukehagar/plexjs"; +import { GetServerResourcesGlobals } from "@lukehagar/plexjs"; -let value: GetResourcesGlobals = {}; +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)
| Postman | \ No newline at end of file +| `xPlexClientIdentifier` | *string* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| gcgzw5rz2xovp84b4vha3a40 | \ No newline at end of file diff --git a/docs/models/getresourcesrequest.md b/docs/models/getserverresourcesrequest.md similarity index 76% rename from docs/models/getresourcesrequest.md rename to docs/models/getserverresourcesrequest.md index 99ea84bf..1222101c 100644 --- a/docs/models/getresourcesrequest.md +++ b/docs/models/getserverresourcesrequest.md @@ -1,18 +1,24 @@ -# GetResourcesRequest +# GetServerResourcesRequest ## Example Usage ```typescript -import { GetResourcesRequest } from "@lukehagar/plexjs"; +import { GetServerResourcesRequest, IncludeHttps, IncludeIPv6, IncludeRelay } from "@lukehagar/plexjs"; -let value: GetResourcesRequest = {}; +let value: GetServerResourcesRequest = { + xPlexToken: "CV5xoxjTpFKUzBTShsaf", + includeHttps: IncludeHttps.One, + includeRelay: IncludeRelay.One, + includeIPv6: IncludeIPv6.One, +}; ``` ## 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)
| Postman | -| `includeHttps` | [models.IncludeHttps](../models/includehttps.md) | :heavy_minus_sign: | Include Https entries in the results | | -| `includeRelay` | [models.IncludeRelay](../models/includerelay.md) | :heavy_minus_sign: | Include Relay addresses in the results | | -| `includeIPv6` | [models.IncludeIPv6](../models/includeipv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | | \ No newline at end of file +| `xPlexClientIdentifier` | *string* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| gcgzw5rz2xovp84b4vha3a40 | +| `xPlexToken` | *string* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf | +| `includeHttps` | [models.IncludeHttps](../models/includehttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 | +| `includeRelay` | [models.IncludeRelay](../models/includerelay.md) | :heavy_minus_sign: | Include Relay addresses in the results
E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400
| 1 | +| `includeIPv6` | [models.IncludeIPv6](../models/includeipv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 | \ No newline at end of file diff --git a/docs/models/getresourcesresponse.md b/docs/models/getserverresourcesresponse.md similarity index 92% rename from docs/models/getresourcesresponse.md rename to docs/models/getserverresourcesresponse.md index cf9299bc..357b7d91 100644 --- a/docs/models/getresourcesresponse.md +++ b/docs/models/getserverresourcesresponse.md @@ -1,13 +1,13 @@ -# GetResourcesResponse +# GetServerResourcesResponse ## Example Usage ```typescript -import { GetResourcesResponse } from "@lukehagar/plexjs"; +import { GetServerResourcesResponse } from "@lukehagar/plexjs"; -let value: GetResourcesResponse = { +let value: GetServerResourcesResponse = { contentType: "", - statusCode: 473608, + statusCode: 568434, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getserverresourcesresponsebody.md b/docs/models/getserverresourcesresponsebody.md new file mode 100644 index 00000000..77c172b9 --- /dev/null +++ b/docs/models/getserverresourcesresponsebody.md @@ -0,0 +1,18 @@ +# GetServerResourcesResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + +## Example Usage + +```typescript +import { GetServerResourcesResponseBody } from "@lukehagar/plexjs"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `errors` | [models.GetServerResourcesErrors](../models/getserverresourceserrors.md)[] | :heavy_minus_sign: | N/A | +| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/getsessionhistoryrequest.md b/docs/models/getsessionhistoryrequest.md index 8fde4581..0eca08a5 100644 --- a/docs/models/getsessionhistoryrequest.md +++ b/docs/models/getsessionhistoryrequest.md @@ -18,5 +18,5 @@ let value: GetSessionHistoryRequest = { | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `sort` | *string* | :heavy_minus_sign: | Sorts the results by the specified field followed by the direction (asc, desc)
| | | `accountId` | *number* | :heavy_minus_sign: | Filter results by those that are related to a specific users id
| 1 | -| `filter` | [models.Filter](../models/filter.md) | :heavy_minus_sign: | Filters content by field and direction/equality
(Unknown if viewedAt is the only supported column)
| {
"viewed-at-greater-than": {
"value": "viewedAt\u003e"
},
"viewed-at-greater-than-or-equal-to": {
"value": "viewedAt\u003e=\u003e"
},
"viewed-at-less-than": {
"value": "viewedAt\u003c"
}
} | +| `filter` | [models.QueryParamFilter](../models/queryparamfilter.md) | :heavy_minus_sign: | Filters content by field and direction/equality
(Unknown if viewedAt is the only supported column)
| {
"viewed-at-greater-than": {
"value": "viewedAt\u003e"
},
"viewed-at-greater-than-or-equal-to": {
"value": "viewedAt\u003e=\u003e"
},
"viewed-at-less-than": {
"value": "viewedAt\u003c"
}
} | | `librarySectionID` | *number* | :heavy_minus_sign: | Filters the results based on the id of a valid library section
| 12 | \ No newline at end of file diff --git a/docs/models/getsessionhistoryresponse.md b/docs/models/getsessionhistoryresponse.md index 47047a85..610e2ab0 100644 --- a/docs/models/getsessionhistoryresponse.md +++ b/docs/models/getsessionhistoryresponse.md @@ -8,7 +8,7 @@ import { RFCDate } from "@lukehagar/plexjs/types"; let value: GetSessionHistoryResponse = { contentType: "", - statusCode: 338007, + statusCode: 921158, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getsessionsresponse.md b/docs/models/getsessionsresponse.md index 86a2e512..8f15292f 100644 --- a/docs/models/getsessionsresponse.md +++ b/docs/models/getsessionsresponse.md @@ -7,7 +7,7 @@ import { GetSessionsResponse } from "@lukehagar/plexjs"; let value: GetSessionsResponse = { contentType: "", - statusCode: 158969, + statusCode: 93940, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getsourceconnectioninformationrequest.md b/docs/models/getsourceconnectioninformationrequest.md index 30b2603b..acea216e 100644 --- a/docs/models/getsourceconnectioninformationrequest.md +++ b/docs/models/getsourceconnectioninformationrequest.md @@ -6,7 +6,7 @@ import { GetSourceConnectionInformationRequest } from "@lukehagar/plexjs"; let value: GetSourceConnectionInformationRequest = { - source: "server://client-identifier", + source: "provider://provider-identifier", }; ``` diff --git a/docs/models/getsourceconnectioninformationresponse.md b/docs/models/getsourceconnectioninformationresponse.md index 98fc1634..820a019c 100644 --- a/docs/models/getsourceconnectioninformationresponse.md +++ b/docs/models/getsourceconnectioninformationresponse.md @@ -7,7 +7,7 @@ import { GetSourceConnectionInformationResponse } from "@lukehagar/plexjs"; let value: GetSourceConnectionInformationResponse = { contentType: "", - statusCode: 466311, + statusCode: 96098, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getstatisticsresponse.md b/docs/models/getstatisticsresponse.md index 114e02a8..367a2f77 100644 --- a/docs/models/getstatisticsresponse.md +++ b/docs/models/getstatisticsresponse.md @@ -7,7 +7,7 @@ import { GetStatisticsResponse } from "@lukehagar/plexjs"; let value: GetStatisticsResponse = { contentType: "", - statusCode: 474697, + statusCode: 508969, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getmetadataerrors.md b/docs/models/getthumbimageerrors.md similarity index 89% rename from docs/models/getmetadataerrors.md rename to docs/models/getthumbimageerrors.md index 8318d333..4d704750 100644 --- a/docs/models/getmetadataerrors.md +++ b/docs/models/getthumbimageerrors.md @@ -1,11 +1,11 @@ -# GetMetadataErrors +# GetThumbImageErrors ## Example Usage ```typescript -import { GetMetadataErrors } from "@lukehagar/plexjs"; +import { GetThumbImageErrors } from "@lukehagar/plexjs"; -let value: GetMetadataErrors = { +let value: GetThumbImageErrors = { code: 1001, message: "User could not be authenticated", status: 401, diff --git a/docs/models/getthumbimagerequest.md b/docs/models/getthumbimagerequest.md new file mode 100644 index 00000000..95759339 --- /dev/null +++ b/docs/models/getthumbimagerequest.md @@ -0,0 +1,27 @@ +# GetThumbImageRequest + +## Example Usage + +```typescript +import { GetThumbImageRequest } from "@lukehagar/plexjs"; + +let value: GetThumbImageRequest = { + ratingKey: 9518, + width: 396, + height: 396, + minSize: 1, + upscale: 1, + xPlexToken: "CV5xoxjTpFKUzBTShsaf", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ratingKey` | *number* | :heavy_check_mark: | the id of the library item to return the children of. | 9518 | +| `width` | *number* | :heavy_check_mark: | N/A | 396 | +| `height` | *number* | :heavy_check_mark: | N/A | 396 | +| `minSize` | *number* | :heavy_check_mark: | N/A | 1 | +| `upscale` | *number* | :heavy_check_mark: | N/A | 1 | +| `xPlexToken` | *string* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf | \ No newline at end of file diff --git a/docs/models/getthumbimageresponse.md b/docs/models/getthumbimageresponse.md new file mode 100644 index 00000000..2d529da8 --- /dev/null +++ b/docs/models/getthumbimageresponse.md @@ -0,0 +1,19 @@ +# GetThumbImageResponse + +## Example Usage + +```typescript +import { GetThumbImageResponse } from "@lukehagar/plexjs"; + +// No examples available for this model +``` + +## 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 | +| `responseStream` | *ReadableStream* | :heavy_minus_sign: | Successful response returning an image | +| `headers` | Record | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/searchlibrarylibraryresponsebody.md b/docs/models/getthumbimageresponsebody.md similarity index 88% rename from docs/models/searchlibrarylibraryresponsebody.md rename to docs/models/getthumbimageresponsebody.md index fd4b2a40..dbd1e1ab 100644 --- a/docs/models/searchlibrarylibraryresponsebody.md +++ b/docs/models/getthumbimageresponsebody.md @@ -1,11 +1,11 @@ -# SearchLibraryLibraryResponseBody +# GetThumbImageResponseBody Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Example Usage ```typescript -import { SearchLibraryLibraryResponseBody } from "@lukehagar/plexjs"; +import { GetThumbImageResponseBody } from "@lukehagar/plexjs"; // No examples available for this model ``` @@ -14,5 +14,5 @@ import { SearchLibraryLibraryResponseBody } from "@lukehagar/plexjs"; | Field | Type | Required | Description | | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `errors` | [models.SearchLibraryErrors](../models/searchlibraryerrors.md)[] | :heavy_minus_sign: | N/A | +| `errors` | [models.GetThumbImageErrors](../models/getthumbimageerrors.md)[] | :heavy_minus_sign: | N/A | | `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/gettimelineresponse.md b/docs/models/gettimelineresponse.md index 015d0fc4..2ee7facc 100644 --- a/docs/models/gettimelineresponse.md +++ b/docs/models/gettimelineresponse.md @@ -7,7 +7,7 @@ import { GetTimelineResponse } from "@lukehagar/plexjs"; let value: GetTimelineResponse = { contentType: "", - statusCode: 963663, + statusCode: 272656, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/gettokenbypiniderrors.md b/docs/models/gettokenbypiniderrors.md index 146966ee..011f8c26 100644 --- a/docs/models/gettokenbypiniderrors.md +++ b/docs/models/gettokenbypiniderrors.md @@ -6,14 +6,16 @@ import { GetTokenByPinIdErrors } from "@lukehagar/plexjs"; let value: GetTokenByPinIdErrors = { - code: 1020, - message: "Code not found or expired", + code: 1000, + message: "X-Plex-Client-Identifier is missing", + status: 400, }; ``` ## Fields -| Field | Type | Required | Description | Example | -| ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | -| `code` | *number* | :heavy_minus_sign: | N/A | 1020 | -| `message` | *string* | :heavy_minus_sign: | N/A | Code not found or expired | \ 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/models/gettokenbypinidglobals.md b/docs/models/gettokenbypinidglobals.md index 8246fc6b..edcad1a8 100644 --- a/docs/models/gettokenbypinidglobals.md +++ b/docs/models/gettokenbypinidglobals.md @@ -12,4 +12,4 @@ let value: GetTokenByPinIdGlobals = {}; | 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)
| Postman | \ No newline at end of file +| `xPlexClientIdentifier` | *string* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| gcgzw5rz2xovp84b4vha3a40 | \ No newline at end of file diff --git a/docs/models/gettokenbypinidplexerrors.md b/docs/models/gettokenbypinidplexerrors.md new file mode 100644 index 00000000..10e10c20 --- /dev/null +++ b/docs/models/gettokenbypinidplexerrors.md @@ -0,0 +1,19 @@ +# GetTokenByPinIdPlexErrors + +## Example Usage + +```typescript +import { GetTokenByPinIdPlexErrors } from "@lukehagar/plexjs"; + +let value: GetTokenByPinIdPlexErrors = { + code: 1020, + message: "Code not found or expired", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `code` | *number* | :heavy_minus_sign: | N/A | 1020 | +| `message` | *string* | :heavy_minus_sign: | N/A | Code not found or expired | \ No newline at end of file diff --git a/docs/models/gettokenbypinidplexresponsebody.md b/docs/models/gettokenbypinidplexresponsebody.md new file mode 100644 index 00000000..dcc97fc4 --- /dev/null +++ b/docs/models/gettokenbypinidplexresponsebody.md @@ -0,0 +1,18 @@ +# GetTokenByPinIdPlexResponseBody + +Not Found or Expired + +## Example Usage + +```typescript +import { GetTokenByPinIdPlexResponseBody } from "@lukehagar/plexjs"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `errors` | [models.GetTokenByPinIdPlexErrors](../models/gettokenbypinidplexerrors.md)[] | :heavy_minus_sign: | N/A | +| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/gettokenbypinidrequest.md b/docs/models/gettokenbypinidrequest.md index 2fd42701..21f9663a 100644 --- a/docs/models/gettokenbypinidrequest.md +++ b/docs/models/gettokenbypinidrequest.md @@ -6,7 +6,7 @@ import { GetTokenByPinIdRequest } from "@lukehagar/plexjs"; let value: GetTokenByPinIdRequest = { - pinID: 800911, + pinID: 18789, }; ``` @@ -14,5 +14,5 @@ let value: GetTokenByPinIdRequest = { | 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)
| Postman | +| `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 diff --git a/docs/models/gettokenbypinidresponse.md b/docs/models/gettokenbypinidresponse.md index 5bead11f..756e33c9 100644 --- a/docs/models/gettokenbypinidresponse.md +++ b/docs/models/gettokenbypinidresponse.md @@ -7,7 +7,7 @@ import { GetTokenByPinIdResponse } from "@lukehagar/plexjs"; let value: GetTokenByPinIdResponse = { contentType: "", - statusCode: 461479, + statusCode: 324141, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/gettokenbypinidresponsebody.md b/docs/models/gettokenbypinidresponsebody.md index 03c95c58..c8027cb9 100644 --- a/docs/models/gettokenbypinidresponsebody.md +++ b/docs/models/gettokenbypinidresponsebody.md @@ -1,6 +1,6 @@ # GetTokenByPinIdResponseBody -Not Found or Expired +Bad Request response when the X-Plex-Client-Identifier is missing ## Example Usage diff --git a/docs/models/gettopwatchedcontenterrors.md b/docs/models/gettopwatchedcontenterrors.md new file mode 100644 index 00000000..b5706182 --- /dev/null +++ b/docs/models/gettopwatchedcontenterrors.md @@ -0,0 +1,21 @@ +# GetTopWatchedContentErrors + +## Example Usage + +```typescript +import { GetTopWatchedContentErrors } from "@lukehagar/plexjs"; + +let value: GetTopWatchedContentErrors = { + 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/models/gettopwatchedcontentlibraryresponsebody.md b/docs/models/gettopwatchedcontentlibraryresponsebody.md new file mode 100644 index 00000000..6c018135 --- /dev/null +++ b/docs/models/gettopwatchedcontentlibraryresponsebody.md @@ -0,0 +1,18 @@ +# GetTopWatchedContentLibraryResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + +## Example Usage + +```typescript +import { GetTopWatchedContentLibraryResponseBody } from "@lukehagar/plexjs"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `errors` | [models.GetTopWatchedContentErrors](../models/gettopwatchedcontenterrors.md)[] | :heavy_minus_sign: | N/A | +| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/gettopwatchedcontentmetadata.md b/docs/models/gettopwatchedcontentmetadata.md index c4288e70..3c88f9d2 100644 --- a/docs/models/gettopwatchedcontentmetadata.md +++ b/docs/models/gettopwatchedcontentmetadata.md @@ -107,4 +107,4 @@ let value: GetTopWatchedContentMetadata = { | `country` | [models.GetTopWatchedContentCountry](../models/gettopwatchedcontentcountry.md)[] | :heavy_minus_sign: | N/A | | | `guids` | [models.GetTopWatchedContentGuids](../models/gettopwatchedcontentguids.md)[] | :heavy_minus_sign: | N/A | | | `role` | [models.GetTopWatchedContentRole](../models/gettopwatchedcontentrole.md)[] | :heavy_minus_sign: | N/A | | -| `user` | [models.GetTopWatchedContentUser](../models/gettopwatchedcontentuser.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `user` | [models.User](../models/user.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/gettopwatchedcontentqueryparamtype.md b/docs/models/gettopwatchedcontentqueryparamtype.md new file mode 100644 index 00000000..50e2bfbe --- /dev/null +++ b/docs/models/gettopwatchedcontentqueryparamtype.md @@ -0,0 +1,26 @@ +# GetTopWatchedContentQueryParamType + +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 { GetTopWatchedContentQueryParamType } from "@lukehagar/plexjs"; + +let value: GetTopWatchedContentQueryParamType = GetTopWatchedContentQueryParamType.Two; +``` + +## Values + +| Name | Value | +| ------- | ------- | +| `One` | 1 | +| `Two` | 2 | +| `Three` | 3 | +| `Four` | 4 | \ No newline at end of file diff --git a/docs/models/gettopwatchedcontentrequest.md b/docs/models/gettopwatchedcontentrequest.md index d1457dca..881541fa 100644 --- a/docs/models/gettopwatchedcontentrequest.md +++ b/docs/models/gettopwatchedcontentrequest.md @@ -3,17 +3,17 @@ ## Example Usage ```typescript -import { GetTopWatchedContentRequest } from "@lukehagar/plexjs"; +import { GetTopWatchedContentQueryParamType, GetTopWatchedContentRequest } from "@lukehagar/plexjs"; let value: GetTopWatchedContentRequest = { - type: 681820, + type: GetTopWatchedContentQueryParamType.Two, includeGuids: 1, }; ``` ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | -| `type` | *number* | :heavy_check_mark: | the library type (1 - movies, 2 - shows, 3 - music) | | -| `includeGuids` | *number* | :heavy_minus_sign: | Adds the Guids object to the response
| 1 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [models.GetTopWatchedContentQueryParamType](../models/gettopwatchedcontentqueryparamtype.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 | +| `includeGuids` | *number* | :heavy_minus_sign: | Adds the Guids object to the response
| 1 | \ No newline at end of file diff --git a/docs/models/gettopwatchedcontentresponse.md b/docs/models/gettopwatchedcontentresponse.md index 650904f0..253798d2 100644 --- a/docs/models/gettopwatchedcontentresponse.md +++ b/docs/models/gettopwatchedcontentresponse.md @@ -8,7 +8,7 @@ import { RFCDate } from "@lukehagar/plexjs/types"; let value: GetTopWatchedContentResponse = { contentType: "", - statusCode: 449950, + statusCode: 315428, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/gettranscodesessionsresponse.md b/docs/models/gettranscodesessionsresponse.md index d64d1956..c717052f 100644 --- a/docs/models/gettranscodesessionsresponse.md +++ b/docs/models/gettranscodesessionsresponse.md @@ -7,7 +7,7 @@ import { GetTranscodeSessionsResponse } from "@lukehagar/plexjs"; let value: GetTranscodeSessionsResponse = { contentType: "", - statusCode: 110375, + statusCode: 575947, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/gettransienttokenresponse.md b/docs/models/gettransienttokenresponse.md index c8cbb92b..59268fa1 100644 --- a/docs/models/gettransienttokenresponse.md +++ b/docs/models/gettransienttokenresponse.md @@ -7,7 +7,7 @@ import { GetTransientTokenResponse } from "@lukehagar/plexjs"; let value: GetTransientTokenResponse = { contentType: "", - statusCode: 253291, + statusCode: 837945, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getupdatestatusmediacontainer.md b/docs/models/getupdatestatusmediacontainer.md index 1b041927..ea17b625 100644 --- a/docs/models/getupdatestatusmediacontainer.md +++ b/docs/models/getupdatestatusmediacontainer.md @@ -6,36 +6,40 @@ import { GetUpdateStatusMediaContainer } from "@lukehagar/plexjs"; let value: GetUpdateStatusMediaContainer = { - size: 1, - canInstall: false, - checkedAt: 1705801232, - downloadURL: "https://plex.tv/downloads/latest/5?channel=8&build=linux-x86_64&distro=redhat&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx", - status: 0, - release: [ - { - key: "https://plex.tv/updater/releases/5136", - version: "1.40.0.7775-456fbaf97", - added: "(PLEASE NOTE) This version makes changes to the database which will make it compatible only with server versions 1.31.2 or higher (released March 14). You will not be able to use your database on Plex Media Server versions lower than this after this update. Please also be patient when updating to this version if you have a very large database and allow the upgrade process to finish. - (Collections) Items added to a collection from the item context menu will now lock the collection field on the items (#12793) - (Music) Store track genres and add filtering options (#14653) - (Music) Support ID3v2.4 null-separated tags for genres and release type (#14653) - (View History) No longer create a view history entry for items marked as played (#10888) - (Web) Updated to 4.118.0", - fixed: "(Agents) Changing a 'Other Videos' type library to the modern movie agent would fail (#14483) - (Agents) It is possible that agents are not initialised during startup on rare occasions (#14654) - (Agents) Remove the legacy OpenSubtitles agent which is no longer supported upstream (#14667) - (Collection) Server could become unresponsive when collection membership changes (#14612) - (DVR) Previously watched recordings could be deleted without being watched again (#13779) - (Libraries) When performing fix match on items from certain music libraries the language would default to Arabic (#14501) - (Library) The Content Rating not equal to None filter does not work (#14620) - (Search) Album search results could contain all the album's tracks too (#14486) - (Subtitles) In some circumstances, sidecar subtitles can show up for media when they're no longer available (#14674) - (Transcoder) HW encoding would fail on devices with no rate control (#14222) - (Transcoder) Software transcoding on Ubuntu could cause unexpected behavior (#14605)", - downloadURL: "https://plex.tv/downloads/latest/5?channel=8&build=linux-x86_64&distro=redhat&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx", - state: "notify", - }, - ], + size: 1, + canInstall: false, + checkedAt: 1705801232, + downloadURL: + "https://plex.tv/downloads/latest/5?channel=8&build=linux-x86_64&distro=redhat&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx", + status: 0, + release: [ + { + key: "https://plex.tv/updater/releases/5136", + version: "1.40.0.7775-456fbaf97", + added: + "(PLEASE NOTE) This version makes changes to the database which will make it compatible only with server versions 1.31.2 or higher (released March 14). You will not be able to use your database on Plex Media Server versions lower than this after this update. Please also be patient when updating to this version if you have a very large database and allow the upgrade process to finish.\n" + + "(Collections) Items added to a collection from the item context menu will now lock the collection field on the items (#12793)\n" + + "(Music) Store track genres and add filtering options (#14653)\n" + + "(Music) Support ID3v2.4 null-separated tags for genres and release type (#14653)\n" + + "(View History) No longer create a view history entry for items marked as played (#10888)\n" + + "(Web) Updated to 4.118.0", + fixed: + "(Agents) Changing a 'Other Videos' type library to the modern movie agent would fail (#14483)\n" + + "(Agents) It is possible that agents are not initialised during startup on rare occasions (#14654)\n" + + "(Agents) Remove the legacy OpenSubtitles agent which is no longer supported upstream (#14667)\n" + + "(Collection) Server could become unresponsive when collection membership changes (#14612)\n" + + "(DVR) Previously watched recordings could be deleted without being watched again (#13779)\n" + + "(Libraries) When performing fix match on items from certain music libraries the language would default to Arabic (#14501)\n" + + "(Library) The Content Rating not equal to None filter does not work (#14620)\n" + + "(Search) Album search results could contain all the album's tracks too (#14486)\n" + + "(Subtitles) In some circumstances, sidecar subtitles can show up for media when they're no longer available (#14674)\n" + + "(Transcoder) HW encoding would fail on devices with no rate control (#14222)\n" + + "(Transcoder) Software transcoding on Ubuntu could cause unexpected behavior (#14605)", + downloadURL: + "https://plex.tv/downloads/latest/5?channel=8&build=linux-x86_64&distro=redhat&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx", + state: "notify", + }, + ], }; ``` diff --git a/docs/models/getupdatestatusresponse.md b/docs/models/getupdatestatusresponse.md index 254b6b61..395b3fd0 100644 --- a/docs/models/getupdatestatusresponse.md +++ b/docs/models/getupdatestatusresponse.md @@ -6,43 +6,49 @@ import { GetUpdateStatusResponse } from "@lukehagar/plexjs"; let value: GetUpdateStatusResponse = { - contentType: "", - statusCode: 656330, - rawResponse: new Response('{"message": "hello world"}', {headers: {"Content-Type": "application/json"}}), - object: { - mediaContainer: { - size: 1, - canInstall: false, - checkedAt: 1705801232, - downloadURL: "https://plex.tv/downloads/latest/5?channel=8&build=linux-x86_64&distro=redhat&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx", - status: 0, - release: [ - { - key: "https://plex.tv/updater/releases/5136", - version: "1.40.0.7775-456fbaf97", - added: "(PLEASE NOTE) This version makes changes to the database which will make it compatible only with server versions 1.31.2 or higher (released March 14). You will not be able to use your database on Plex Media Server versions lower than this after this update. Please also be patient when updating to this version if you have a very large database and allow the upgrade process to finish. - (Collections) Items added to a collection from the item context menu will now lock the collection field on the items (#12793) - (Music) Store track genres and add filtering options (#14653) - (Music) Support ID3v2.4 null-separated tags for genres and release type (#14653) - (View History) No longer create a view history entry for items marked as played (#10888) - (Web) Updated to 4.118.0", - fixed: "(Agents) Changing a 'Other Videos' type library to the modern movie agent would fail (#14483) - (Agents) It is possible that agents are not initialised during startup on rare occasions (#14654) - (Agents) Remove the legacy OpenSubtitles agent which is no longer supported upstream (#14667) - (Collection) Server could become unresponsive when collection membership changes (#14612) - (DVR) Previously watched recordings could be deleted without being watched again (#13779) - (Libraries) When performing fix match on items from certain music libraries the language would default to Arabic (#14501) - (Library) The Content Rating not equal to None filter does not work (#14620) - (Search) Album search results could contain all the album's tracks too (#14486) - (Subtitles) In some circumstances, sidecar subtitles can show up for media when they're no longer available (#14674) - (Transcoder) HW encoding would fail on devices with no rate control (#14222) - (Transcoder) Software transcoding on Ubuntu could cause unexpected behavior (#14605)", - downloadURL: "https://plex.tv/downloads/latest/5?channel=8&build=linux-x86_64&distro=redhat&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx", - state: "notify", + contentType: "", + statusCode: 929297, + rawResponse: new Response('{"message": "hello world"}', { + headers: { "Content-Type": "application/json" }, + }), + object: { + mediaContainer: { + size: 1, + canInstall: false, + checkedAt: 1705801232, + downloadURL: + "https://plex.tv/downloads/latest/5?channel=8&build=linux-x86_64&distro=redhat&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx", + status: 0, + release: [ + { + key: "https://plex.tv/updater/releases/5136", + version: "1.40.0.7775-456fbaf97", + added: + "(PLEASE NOTE) This version makes changes to the database which will make it compatible only with server versions 1.31.2 or higher (released March 14). You will not be able to use your database on Plex Media Server versions lower than this after this update. Please also be patient when updating to this version if you have a very large database and allow the upgrade process to finish.\n" + + "(Collections) Items added to a collection from the item context menu will now lock the collection field on the items (#12793)\n" + + "(Music) Store track genres and add filtering options (#14653)\n" + + "(Music) Support ID3v2.4 null-separated tags for genres and release type (#14653)\n" + + "(View History) No longer create a view history entry for items marked as played (#10888)\n" + + "(Web) Updated to 4.118.0", + fixed: + "(Agents) Changing a 'Other Videos' type library to the modern movie agent would fail (#14483)\n" + + "(Agents) It is possible that agents are not initialised during startup on rare occasions (#14654)\n" + + "(Agents) Remove the legacy OpenSubtitles agent which is no longer supported upstream (#14667)\n" + + "(Collection) Server could become unresponsive when collection membership changes (#14612)\n" + + "(DVR) Previously watched recordings could be deleted without being watched again (#13779)\n" + + "(Libraries) When performing fix match on items from certain music libraries the language would default to Arabic (#14501)\n" + + "(Library) The Content Rating not equal to None filter does not work (#14620)\n" + + "(Search) Album search results could contain all the album's tracks too (#14486)\n" + + "(Subtitles) In some circumstances, sidecar subtitles can show up for media when they're no longer available (#14674)\n" + + "(Transcoder) HW encoding would fail on devices with no rate control (#14222)\n" + + "(Transcoder) Software transcoding on Ubuntu could cause unexpected behavior (#14605)", + downloadURL: + "https://plex.tv/downloads/latest/5?channel=8&build=linux-x86_64&distro=redhat&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx", + state: "notify", + }, + ], }, - ], }, - }, }; ``` diff --git a/docs/models/getupdatestatusresponsebody.md b/docs/models/getupdatestatusresponsebody.md index 533691c7..2995e20c 100644 --- a/docs/models/getupdatestatusresponsebody.md +++ b/docs/models/getupdatestatusresponsebody.md @@ -8,38 +8,42 @@ The Server Updates import { GetUpdateStatusResponseBody } from "@lukehagar/plexjs"; let value: GetUpdateStatusResponseBody = { - mediaContainer: { - size: 1, - canInstall: false, - checkedAt: 1705801232, - downloadURL: "https://plex.tv/downloads/latest/5?channel=8&build=linux-x86_64&distro=redhat&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx", - status: 0, - release: [ - { - key: "https://plex.tv/updater/releases/5136", - version: "1.40.0.7775-456fbaf97", - added: "(PLEASE NOTE) This version makes changes to the database which will make it compatible only with server versions 1.31.2 or higher (released March 14). You will not be able to use your database on Plex Media Server versions lower than this after this update. Please also be patient when updating to this version if you have a very large database and allow the upgrade process to finish. - (Collections) Items added to a collection from the item context menu will now lock the collection field on the items (#12793) - (Music) Store track genres and add filtering options (#14653) - (Music) Support ID3v2.4 null-separated tags for genres and release type (#14653) - (View History) No longer create a view history entry for items marked as played (#10888) - (Web) Updated to 4.118.0", - fixed: "(Agents) Changing a 'Other Videos' type library to the modern movie agent would fail (#14483) - (Agents) It is possible that agents are not initialised during startup on rare occasions (#14654) - (Agents) Remove the legacy OpenSubtitles agent which is no longer supported upstream (#14667) - (Collection) Server could become unresponsive when collection membership changes (#14612) - (DVR) Previously watched recordings could be deleted without being watched again (#13779) - (Libraries) When performing fix match on items from certain music libraries the language would default to Arabic (#14501) - (Library) The Content Rating not equal to None filter does not work (#14620) - (Search) Album search results could contain all the album's tracks too (#14486) - (Subtitles) In some circumstances, sidecar subtitles can show up for media when they're no longer available (#14674) - (Transcoder) HW encoding would fail on devices with no rate control (#14222) - (Transcoder) Software transcoding on Ubuntu could cause unexpected behavior (#14605)", - downloadURL: "https://plex.tv/downloads/latest/5?channel=8&build=linux-x86_64&distro=redhat&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx", - state: "notify", - }, - ], - }, + mediaContainer: { + size: 1, + canInstall: false, + checkedAt: 1705801232, + downloadURL: + "https://plex.tv/downloads/latest/5?channel=8&build=linux-x86_64&distro=redhat&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx", + status: 0, + release: [ + { + key: "https://plex.tv/updater/releases/5136", + version: "1.40.0.7775-456fbaf97", + added: + "(PLEASE NOTE) This version makes changes to the database which will make it compatible only with server versions 1.31.2 or higher (released March 14). You will not be able to use your database on Plex Media Server versions lower than this after this update. Please also be patient when updating to this version if you have a very large database and allow the upgrade process to finish.\n" + + "(Collections) Items added to a collection from the item context menu will now lock the collection field on the items (#12793)\n" + + "(Music) Store track genres and add filtering options (#14653)\n" + + "(Music) Support ID3v2.4 null-separated tags for genres and release type (#14653)\n" + + "(View History) No longer create a view history entry for items marked as played (#10888)\n" + + "(Web) Updated to 4.118.0", + fixed: + "(Agents) Changing a 'Other Videos' type library to the modern movie agent would fail (#14483)\n" + + "(Agents) It is possible that agents are not initialised during startup on rare occasions (#14654)\n" + + "(Agents) Remove the legacy OpenSubtitles agent which is no longer supported upstream (#14667)\n" + + "(Collection) Server could become unresponsive when collection membership changes (#14612)\n" + + "(DVR) Previously watched recordings could be deleted without being watched again (#13779)\n" + + "(Libraries) When performing fix match on items from certain music libraries the language would default to Arabic (#14501)\n" + + "(Library) The Content Rating not equal to None filter does not work (#14620)\n" + + "(Search) Album search results could contain all the album's tracks too (#14486)\n" + + "(Subtitles) In some circumstances, sidecar subtitles can show up for media when they're no longer available (#14674)\n" + + "(Transcoder) HW encoding would fail on devices with no rate control (#14222)\n" + + "(Transcoder) Software transcoding on Ubuntu could cause unexpected behavior (#14605)", + downloadURL: + "https://plex.tv/downloads/latest/5?channel=8&build=linux-x86_64&distro=redhat&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx", + state: "notify", + }, + ], + }, }; ``` diff --git a/docs/models/getuserdetailsauthenticationresponsestatus.md b/docs/models/getuserdetailsauthenticationresponsestatus.md new file mode 100644 index 00000000..5ddaba7d --- /dev/null +++ b/docs/models/getuserdetailsauthenticationresponsestatus.md @@ -0,0 +1,19 @@ +# GetUserDetailsAuthenticationResponseStatus + +String representation of subscriptionActive + +## Example Usage + +```typescript +import { GetUserDetailsAuthenticationResponseStatus } from "@lukehagar/plexjs"; + +let value: GetUserDetailsAuthenticationResponseStatus = + GetUserDetailsAuthenticationResponseStatus.Inactive; +``` + +## Values + +| Name | Value | +| ---------- | ---------- | +| `Inactive` | Inactive | +| `Active` | Active | \ No newline at end of file diff --git a/docs/models/postuserssignindatauserstatus.md b/docs/models/getuserdetailsauthenticationstatus.md similarity index 50% rename from docs/models/postuserssignindatauserstatus.md rename to docs/models/getuserdetailsauthenticationstatus.md index 71a5b130..b945f06f 100644 --- a/docs/models/postuserssignindatauserstatus.md +++ b/docs/models/getuserdetailsauthenticationstatus.md @@ -1,13 +1,13 @@ -# PostUsersSigninDataUserStatus +# GetUserDetailsAuthenticationStatus String representation of subscriptionActive ## Example Usage ```typescript -import { PostUsersSigninDataUserStatus } from "@lukehagar/plexjs"; +import { GetUserDetailsAuthenticationStatus } from "@lukehagar/plexjs"; -let value: PostUsersSigninDataUserStatus = PostUsersSigninDataUserStatus.Inactive; +let value: GetUserDetailsAuthenticationStatus = GetUserDetailsAuthenticationStatus.Inactive; ``` ## Values diff --git a/docs/models/getuserdetailsfeatures.md b/docs/models/getuserdetailsfeatures.md index b934db1f..58452b60 100644 --- a/docs/models/getuserdetailsfeatures.md +++ b/docs/models/getuserdetailsfeatures.md @@ -5,7 +5,7 @@ ```typescript import { GetUserDetailsFeatures } from "@lukehagar/plexjs"; -let value: GetUserDetailsFeatures = GetUserDetailsFeatures.PhotosFavorites; +let value: GetUserDetailsFeatures = GetUserDetailsFeatures.HRKEnableEUR; ``` ## Values diff --git a/docs/models/getuserdetailsplexresponsestatus.md b/docs/models/getuserdetailsplexresponsestatus.md deleted file mode 100644 index ca0b3fdd..00000000 --- a/docs/models/getuserdetailsplexresponsestatus.md +++ /dev/null @@ -1,18 +0,0 @@ -# GetUserDetailsPlexResponseStatus - -String representation of subscriptionActive - -## Example Usage - -```typescript -import { GetUserDetailsPlexResponseStatus } from "@lukehagar/plexjs"; - -let value: GetUserDetailsPlexResponseStatus = GetUserDetailsPlexResponseStatus.Inactive; -``` - -## Values - -| Name | Value | -| ---------- | ---------- | -| `Inactive` | Inactive | -| `Active` | Active | \ No newline at end of file diff --git a/docs/models/getuserdetailsplexstatus.md b/docs/models/getuserdetailsplexstatus.md deleted file mode 100644 index 34b9c35a..00000000 --- a/docs/models/getuserdetailsplexstatus.md +++ /dev/null @@ -1,18 +0,0 @@ -# GetUserDetailsPlexStatus - -String representation of subscriptionActive - -## Example Usage - -```typescript -import { GetUserDetailsPlexStatus } from "@lukehagar/plexjs"; - -let value: GetUserDetailsPlexStatus = GetUserDetailsPlexStatus.Inactive; -``` - -## Values - -| Name | Value | -| ---------- | ---------- | -| `Inactive` | Inactive | -| `Active` | Active | \ No newline at end of file diff --git a/docs/models/getuserdetailsrequest.md b/docs/models/getuserdetailsrequest.md new file mode 100644 index 00000000..207007d6 --- /dev/null +++ b/docs/models/getuserdetailsrequest.md @@ -0,0 +1,17 @@ +# GetUserDetailsRequest + +## Example Usage + +```typescript +import { GetUserDetailsRequest } from "@lukehagar/plexjs"; + +let value: GetUserDetailsRequest = { + xPlexToken: "CV5xoxjTpFKUzBTShsaf", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `xPlexToken` | *string* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf | \ No newline at end of file diff --git a/docs/models/getuserdetailsresponse.md b/docs/models/getuserdetailsresponse.md index 8c7b25f5..76c091ba 100644 --- a/docs/models/getuserdetailsresponse.md +++ b/docs/models/getuserdetailsresponse.md @@ -4,18 +4,23 @@ ```typescript import { + AutoSelectSubtitle, + DefaultSubtitleAccessibility, + DefaultSubtitleForced, Features, + GetUserDetailsAuthenticationResponseStatus, + GetUserDetailsAuthenticationStatus, GetUserDetailsFeatures, - GetUserDetailsPlexResponseStatus, - GetUserDetailsPlexStatus, GetUserDetailsResponse, GetUserDetailsStatus, MailingListStatus, + MediaReviewsVisibility, + WatchedIndicator, } from "@lukehagar/plexjs"; let value: GetUserDetailsResponse = { contentType: "", - statusCode: 118274, + statusCode: 19987, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), @@ -42,21 +47,19 @@ let value: GetUserDetailsResponse = { joinedAt: 1721154902, locale: null, mailingListActive: false, - mailingListStatus: MailingListStatus.Subscribed, + mailingListStatus: MailingListStatus.Active, maxHomeSize: 15, pin: "string", - profile: [ - { - autoSelectAudio: true, - defaultAudioLanguage: "ja", - defaultSubtitleLanguage: "en", - autoSelectSubtitle: 1, - defaultSubtitleAccessibility: 1, - defaultSubtitleForced: 0, - watchedIndicator: 1, - mediaReviewsVisibility: 0, - }, - ], + profile: { + autoSelectAudio: true, + defaultAudioLanguage: "ja", + defaultSubtitleLanguage: "en", + autoSelectSubtitle: AutoSelectSubtitle.One, + defaultSubtitleAccessibility: DefaultSubtitleAccessibility.One, + defaultSubtitleForced: DefaultSubtitleForced.Zero, + watchedIndicator: WatchedIndicator.One, + mediaReviewsVisibility: MediaReviewsVisibility.Zero, + }, protected: false, rememberExpiresAt: 1722364046, restricted: false, @@ -74,8 +77,8 @@ let value: GetUserDetailsResponse = { subscription: { features: [Features.AndroidDolbyVision], active: true, - subscribedAt: new Date("2021-04-12T18:21:12Z"), - status: GetUserDetailsPlexStatus.Inactive, + subscribedAt: "2021-04-12T18:21:12Z", + status: GetUserDetailsAuthenticationStatus.Inactive, paymentService: "string", plan: "string", }, @@ -84,8 +87,8 @@ let value: GetUserDetailsResponse = { { features: [GetUserDetailsFeatures.AndroidDolbyVision], active: true, - subscribedAt: new Date("2021-04-12T18:21:12Z"), - status: GetUserDetailsPlexResponseStatus.Inactive, + subscribedAt: "2021-04-12T18:21:12Z", + status: GetUserDetailsAuthenticationResponseStatus.Inactive, paymentService: "string", plan: "string", }, diff --git a/docs/models/getuserdetailssubscription.md b/docs/models/getuserdetailssubscription.md index 3fe058a2..019823bf 100644 --- a/docs/models/getuserdetailssubscription.md +++ b/docs/models/getuserdetailssubscription.md @@ -3,22 +3,22 @@ ## Example Usage ```typescript -import { GetUserDetailsPlexResponseStatus, GetUserDetailsSubscription } from "@lukehagar/plexjs"; +import { GetUserDetailsAuthenticationResponseStatus, GetUserDetailsSubscription } from "@lukehagar/plexjs"; let value: GetUserDetailsSubscription = { active: true, - subscribedAt: new Date("2021-04-12T18:21:12Z"), - status: GetUserDetailsPlexResponseStatus.Inactive, + subscribedAt: "2021-04-12T18:21:12Z", + status: GetUserDetailsAuthenticationResponseStatus.Inactive, }; ``` ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `features` | [models.GetUserDetailsFeatures](../models/getuserdetailsfeatures.md)[] | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | | -| `active` | *boolean* | :heavy_minus_sign: | If the account's Plex Pass subscription is active | true | -| `subscribedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Date the account subscribed to Plex Pass | 2021-04-12T18:21:12Z | -| `status` | [models.GetUserDetailsPlexResponseStatus](../models/getuserdetailsplexresponsestatus.md) | :heavy_minus_sign: | String representation of subscriptionActive | Inactive | -| `paymentService` | *string* | :heavy_minus_sign: | Payment service used for your Plex Pass subscription | | -| `plan` | *string* | :heavy_minus_sign: | Name of Plex Pass subscription plan | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `features` | [models.GetUserDetailsFeatures](../models/getuserdetailsfeatures.md)[] | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | | +| `active` | *boolean* | :heavy_minus_sign: | If the account's Plex Pass subscription is active | true | +| `subscribedAt` | *string* | :heavy_minus_sign: | Date the account subscribed to Plex Pass | 2021-04-12T18:21:12Z | +| `status` | [models.GetUserDetailsAuthenticationResponseStatus](../models/getuserdetailsauthenticationresponsestatus.md) | :heavy_minus_sign: | String representation of subscriptionActive | Inactive | +| `paymentService` | *string* | :heavy_minus_sign: | Payment service used for your Plex Pass subscription | | +| `plan` | *string* | :heavy_minus_sign: | Name of Plex Pass subscription plan | | \ No newline at end of file diff --git a/docs/models/getuserdetailsuserplexaccount.md b/docs/models/getuserdetailsuserplexaccount.md index cb589331..adcdc32c 100644 --- a/docs/models/getuserdetailsuserplexaccount.md +++ b/docs/models/getuserdetailsuserplexaccount.md @@ -6,13 +6,18 @@ Logged in user details ```typescript import { + AutoSelectSubtitle, + DefaultSubtitleAccessibility, + DefaultSubtitleForced, Features, + GetUserDetailsAuthenticationResponseStatus, + GetUserDetailsAuthenticationStatus, GetUserDetailsFeatures, - GetUserDetailsPlexResponseStatus, - GetUserDetailsPlexStatus, GetUserDetailsStatus, GetUserDetailsUserPlexAccount, MailingListStatus, + MediaReviewsVisibility, + WatchedIndicator, } from "@lukehagar/plexjs"; let value: GetUserDetailsUserPlexAccount = { @@ -38,21 +43,19 @@ let value: GetUserDetailsUserPlexAccount = { joinedAt: 1721154902, locale: null, mailingListActive: false, - mailingListStatus: MailingListStatus.Subscribed, + mailingListStatus: MailingListStatus.Unsubscribed, maxHomeSize: 15, pin: "string", - profile: [ - { - autoSelectAudio: true, - defaultAudioLanguage: "ja", - defaultSubtitleLanguage: "en", - autoSelectSubtitle: 1, - defaultSubtitleAccessibility: 1, - defaultSubtitleForced: 0, - watchedIndicator: 1, - mediaReviewsVisibility: 0, - }, - ], + profile: { + autoSelectAudio: true, + defaultAudioLanguage: "ja", + defaultSubtitleLanguage: "en", + autoSelectSubtitle: AutoSelectSubtitle.One, + defaultSubtitleAccessibility: DefaultSubtitleAccessibility.One, + defaultSubtitleForced: DefaultSubtitleForced.Zero, + watchedIndicator: WatchedIndicator.One, + mediaReviewsVisibility: MediaReviewsVisibility.One, + }, protected: false, rememberExpiresAt: 1722364046, restricted: false, @@ -70,8 +73,8 @@ let value: GetUserDetailsUserPlexAccount = { subscription: { features: [Features.AndroidDolbyVision], active: true, - subscribedAt: new Date("2021-04-12T18:21:12Z"), - status: GetUserDetailsPlexStatus.Inactive, + subscribedAt: "2021-04-12T18:21:12Z", + status: GetUserDetailsAuthenticationStatus.Inactive, paymentService: "string", plan: "string", }, @@ -80,8 +83,8 @@ let value: GetUserDetailsUserPlexAccount = { { features: [GetUserDetailsFeatures.AndroidDolbyVision], active: true, - subscribedAt: new Date("2021-04-12T18:21:12Z"), - status: GetUserDetailsPlexResponseStatus.Inactive, + subscribedAt: "2021-04-12T18:21:12Z", + status: GetUserDetailsAuthenticationResponseStatus.Inactive, paymentService: "string", plan: "string", }, @@ -123,7 +126,7 @@ let value: GetUserDetailsUserPlexAccount = { | `mailingListStatus` | [models.MailingListStatus](../models/mailingliststatus.md) | :heavy_check_mark: | Your current mailing list status | | | `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` | [models.UserProfile](../models/userprofile.md)[] | :heavy_check_mark: | N/A | | +| `profile` | [models.UserProfile](../models/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 the authtoken expires | 1722364046 | | `restricted` | *boolean* | :heavy_minus_sign: | If the account is a Plex Home managed user | | diff --git a/docs/models/getuserfriendsresponse.md b/docs/models/getuserfriendsresponse.md index 44f4b76e..533449f8 100644 --- a/docs/models/getuserfriendsresponse.md +++ b/docs/models/getuserfriendsresponse.md @@ -7,7 +7,7 @@ import { GetUserFriendsResponse, Status } from "@lukehagar/plexjs"; let value: GetUserFriendsResponse = { contentType: "", - statusCode: 87129, + statusCode: 648172, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/getwatchlisterrors.md b/docs/models/getwatchlisterrors.md index 9b76e781..6fe33a7f 100644 --- a/docs/models/getwatchlisterrors.md +++ b/docs/models/getwatchlisterrors.md @@ -1,11 +1,11 @@ -# GetWatchlistErrors +# GetWatchListErrors ## Example Usage ```typescript -import { GetWatchlistErrors } from "@lukehagar/plexjs"; +import { GetWatchListErrors } from "@lukehagar/plexjs"; -let value: GetWatchlistErrors = { +let value: GetWatchListErrors = { code: 1001, message: "User could not be authenticated", status: 401, diff --git a/docs/models/getwatchlistrequest.md b/docs/models/getwatchlistrequest.md index 75eac0ab..bac10f59 100644 --- a/docs/models/getwatchlistrequest.md +++ b/docs/models/getwatchlistrequest.md @@ -1,26 +1,28 @@ -# GetWatchlistRequest +# GetWatchListRequest ## Example Usage ```typescript -import { GetWatchlistRequest, PathParamFilter } from "@lukehagar/plexjs"; +import { Filter, GetWatchListRequest } from "@lukehagar/plexjs"; -let value: GetWatchlistRequest = { - filter: PathParamFilter.All, - xPlexToken: "", +let value: GetWatchListRequest = { + filter: Filter.Available, + xPlexContainerStart: 0, + xPlexContainerSize: 50, + xPlexToken: "CV5xoxjTpFKUzBTShsaf", }; ``` ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `filter` | [models.PathParamFilter](../models/pathparamfilter.md) | :heavy_check_mark: | Filter | -| `sort` | *string* | :heavy_minus_sign: | In the format "field:dir". Available fields are "watchlistedAt" (Added At),
"titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating).
"dir" can be "asc" or "desc"
| -| `libtype` | [models.Libtype](../models/libtype.md) | :heavy_minus_sign: | The type of library to filter. Can be "movie" or "show", or all if not present.
| -| `maxresults` | *number* | :heavy_minus_sign: | The number of items to return. If not specified, all items will be returned.
If the number of items exceeds the limit, the response will be paginated.
| -| `includeCollections` | [models.IncludeCollections](../models/includecollections.md) | :heavy_minus_sign: | include collections in the results
| -| `includeExternalMedia` | [models.IncludeExternalMedia](../models/includeexternalmedia.md) | :heavy_minus_sign: | include external media in the results
| -| `xPlexToken` | *string* | :heavy_check_mark: | User Token | -| `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.
| -| `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.
| \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `filter` | [models.Filter](../models/filter.md) | :heavy_check_mark: | Filter | | +| `sort` | *string* | :heavy_minus_sign: | In the format "field:dir". Available fields are "watchlistedAt" (Added At),
"titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating).
"dir" can be "asc" or "desc"
| | +| `libtype` | [models.Libtype](../models/libtype.md) | :heavy_minus_sign: | The type of library to filter. Can be "movie" or "show", or all if not present.
| | +| `maxresults` | *number* | :heavy_minus_sign: | The number of items to return. If not specified, all items will be returned.
If the number of items exceeds the limit, the response will be paginated.
| | +| `includeCollections` | [models.IncludeCollections](../models/includecollections.md) | :heavy_minus_sign: | include collections in the results
| | +| `includeExternalMedia` | [models.IncludeExternalMedia](../models/includeexternalmedia.md) | :heavy_minus_sign: | include external media in the results
| | +| `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 | +| `xPlexToken` | *string* | :heavy_check_mark: | Plex Authentication Token | CV5xoxjTpFKUzBTShsaf | \ No newline at end of file diff --git a/docs/models/getwatchlistresponse.md b/docs/models/getwatchlistresponse.md index 5f1fc243..81dbfa1d 100644 --- a/docs/models/getwatchlistresponse.md +++ b/docs/models/getwatchlistresponse.md @@ -1,13 +1,13 @@ -# GetWatchlistResponse +# GetWatchListResponse ## Example Usage ```typescript -import { GetWatchlistResponse } from "@lukehagar/plexjs"; +import { GetWatchListResponse } from "@lukehagar/plexjs"; -let value: GetWatchlistResponse = { +let value: GetWatchListResponse = { contentType: "", - statusCode: 971945, + statusCode: 634274, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), @@ -21,4 +21,4 @@ let value: GetWatchlistResponse = { | `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | | `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [models.GetWatchlistResponseBody](../models/getwatchlistresponsebody.md) | :heavy_minus_sign: | Watchlist Data | \ No newline at end of file +| `object` | [models.GetWatchListResponseBody](../models/getwatchlistresponsebody.md) | :heavy_minus_sign: | Watchlist Data | \ No newline at end of file diff --git a/docs/models/getwatchlistresponsebody.md b/docs/models/getwatchlistresponsebody.md index c3e4a8a4..4cbc8b87 100644 --- a/docs/models/getwatchlistresponsebody.md +++ b/docs/models/getwatchlistresponsebody.md @@ -1,13 +1,13 @@ -# GetWatchlistResponseBody +# GetWatchListResponseBody Watchlist Data ## Example Usage ```typescript -import { GetWatchlistResponseBody } from "@lukehagar/plexjs"; +import { GetWatchListResponseBody } from "@lukehagar/plexjs"; -let value: GetWatchlistResponseBody = {}; +let value: GetWatchListResponseBody = {}; ``` ## Fields diff --git a/docs/models/getwatchlistwatchlistresponsebody.md b/docs/models/getwatchlistwatchlistresponsebody.md index 3250a844..5baf0e16 100644 --- a/docs/models/getwatchlistwatchlistresponsebody.md +++ b/docs/models/getwatchlistwatchlistresponsebody.md @@ -1,11 +1,11 @@ -# GetWatchlistWatchlistResponseBody +# GetWatchListWatchlistResponseBody Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Example Usage ```typescript -import { GetWatchlistWatchlistResponseBody } from "@lukehagar/plexjs"; +import { GetWatchListWatchlistResponseBody } from "@lukehagar/plexjs"; // No examples available for this model ``` @@ -14,5 +14,5 @@ import { GetWatchlistWatchlistResponseBody } from "@lukehagar/plexjs"; | Field | Type | Required | Description | | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `errors` | [models.GetWatchlistErrors](../models/getwatchlisterrors.md)[] | :heavy_minus_sign: | N/A | +| `errors` | [models.GetWatchListErrors](../models/getwatchlisterrors.md)[] | :heavy_minus_sign: | N/A | | `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/includeexternalmedia.md b/docs/models/includeexternalmedia.md index cce79799..92c83557 100644 --- a/docs/models/includeexternalmedia.md +++ b/docs/models/includeexternalmedia.md @@ -8,7 +8,7 @@ include external media in the results ```typescript import { IncludeExternalMedia } from "@lukehagar/plexjs"; -let value: IncludeExternalMedia = IncludeExternalMedia.Zero; +let value: IncludeExternalMedia = IncludeExternalMedia.One; ``` ## Values diff --git a/docs/models/includeguids.md b/docs/models/includeguids.md new file mode 100644 index 00000000..a3649f0b --- /dev/null +++ b/docs/models/includeguids.md @@ -0,0 +1,19 @@ +# IncludeGuids + +Adds the Guids object to the response + + +## Example Usage + +```typescript +import { IncludeGuids } from "@lukehagar/plexjs"; + +let value: IncludeGuids = IncludeGuids.One; +``` + +## Values + +| Name | Value | +| ------ | ------ | +| `Zero` | 0 | +| `One` | 1 | \ No newline at end of file diff --git a/docs/models/includehttps.md b/docs/models/includehttps.md index fac062e6..c2de1c4a 100644 --- a/docs/models/includehttps.md +++ b/docs/models/includehttps.md @@ -7,7 +7,7 @@ Include Https entries in the results ```typescript import { IncludeHttps } from "@lukehagar/plexjs"; -let value: IncludeHttps = IncludeHttps.Zero; +let value: IncludeHttps = IncludeHttps.One; ``` ## Values diff --git a/docs/models/includemeta.md b/docs/models/includemeta.md new file mode 100644 index 00000000..12d1d922 --- /dev/null +++ b/docs/models/includemeta.md @@ -0,0 +1,19 @@ +# IncludeMeta + +Adds the Meta object to the response + + +## Example Usage + +```typescript +import { IncludeMeta } from "@lukehagar/plexjs"; + +let value: IncludeMeta = IncludeMeta.One; +``` + +## Values + +| Name | Value | +| ------ | ------ | +| `Zero` | 0 | +| `One` | 1 | \ No newline at end of file diff --git a/docs/models/includerelay.md b/docs/models/includerelay.md index d65e1a46..49ca1196 100644 --- a/docs/models/includerelay.md +++ b/docs/models/includerelay.md @@ -1,6 +1,8 @@ # IncludeRelay -Include Relay addresses in the results +Include Relay addresses in the results +E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400 + ## Example Usage diff --git a/docs/models/level.md b/docs/models/level.md index b2f4b39c..dd32033b 100644 --- a/docs/models/level.md +++ b/docs/models/level.md @@ -13,7 +13,7 @@ An integer log level to write to the PMS log with. ```typescript import { Level } from "@lukehagar/plexjs"; -let value: Level = Level.Three; +let value: Level = Level.Four; ``` ## Values diff --git a/docs/models/libtype.md b/docs/models/libtype.md index f3fa0f1c..c57d30b2 100644 --- a/docs/models/libtype.md +++ b/docs/models/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"; -let value: Libtype = Libtype.Show; +let value: Libtype = Libtype.Movie; ``` ## Values diff --git a/docs/models/loglinerequest.md b/docs/models/loglinerequest.md index f38f7e7c..aa3a8952 100644 --- a/docs/models/loglinerequest.md +++ b/docs/models/loglinerequest.md @@ -6,7 +6,7 @@ import { Level, LogLineRequest } from "@lukehagar/plexjs"; let value: LogLineRequest = { - level: Level.Two, + level: Level.Four, message: "Test log message", source: "Postman", }; diff --git a/docs/models/loglineresponse.md b/docs/models/loglineresponse.md index a5679e8c..e660fcf3 100644 --- a/docs/models/loglineresponse.md +++ b/docs/models/loglineresponse.md @@ -7,7 +7,7 @@ import { LogLineResponse } from "@lukehagar/plexjs"; let value: LogLineResponse = { contentType: "", - statusCode: 902349, + statusCode: 102044, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/logmultilineresponse.md b/docs/models/logmultilineresponse.md index 6167f0e3..5e4de477 100644 --- a/docs/models/logmultilineresponse.md +++ b/docs/models/logmultilineresponse.md @@ -7,7 +7,7 @@ import { LogMultiLineResponse } from "@lukehagar/plexjs"; let value: LogMultiLineResponse = { contentType: "", - statusCode: 697631, + statusCode: 652790, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/mailingliststatus.md b/docs/models/mailingliststatus.md index ea311917..a6f0ad7c 100644 --- a/docs/models/mailingliststatus.md +++ b/docs/models/mailingliststatus.md @@ -14,5 +14,5 @@ let value: MailingListStatus = MailingListStatus.Unsubscribed; | Name | Value | | -------------- | -------------- | -| `Subscribed` | subscribed | +| `Active` | active | | `Unsubscribed` | unsubscribed | \ No newline at end of file diff --git a/docs/models/markplayedresponse.md b/docs/models/markplayedresponse.md index 08b066f1..7887c3d8 100644 --- a/docs/models/markplayedresponse.md +++ b/docs/models/markplayedresponse.md @@ -7,7 +7,7 @@ import { MarkPlayedResponse } from "@lukehagar/plexjs"; let value: MarkPlayedResponse = { contentType: "", - statusCode: 297534, + statusCode: 891773, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/markunplayedresponse.md b/docs/models/markunplayedresponse.md index 54f895d2..2d42066a 100644 --- a/docs/models/markunplayedresponse.md +++ b/docs/models/markunplayedresponse.md @@ -7,7 +7,7 @@ import { MarkUnplayedResponse } from "@lukehagar/plexjs"; let value: MarkUnplayedResponse = { contentType: "", - statusCode: 891773, + statusCode: 56713, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/mediaprovider.md b/docs/models/mediaprovider.md new file mode 100644 index 00000000..b3b1088e --- /dev/null +++ b/docs/models/mediaprovider.md @@ -0,0 +1,19 @@ +# MediaProvider + +## Example Usage + +```typescript +import { MediaProvider } from "@lukehagar/plexjs"; + +let value: MediaProvider = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `identifier` | *string* | :heavy_minus_sign: | N/A | +| `title` | *string* | :heavy_minus_sign: | N/A | +| `types` | *string* | :heavy_minus_sign: | N/A | +| `protocols` | *string* | :heavy_minus_sign: | N/A | +| `feature` | [models.Feature](../models/feature.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/mediareviewsvisibility.md b/docs/models/mediareviewsvisibility.md new file mode 100644 index 00000000..23b142c7 --- /dev/null +++ b/docs/models/mediareviewsvisibility.md @@ -0,0 +1,16 @@ +# MediaReviewsVisibility + +## Example Usage + +```typescript +import { MediaReviewsVisibility } from "@lukehagar/plexjs"; + +let value: MediaReviewsVisibility = MediaReviewsVisibility.One; +``` + +## Values + +| Name | Value | +| ------ | ------ | +| `Zero` | 0 | +| `One` | 1 | \ No newline at end of file diff --git a/docs/models/pastsubscription.md b/docs/models/pastsubscription.md index 47bfdea1..65a164f4 100644 --- a/docs/models/pastsubscription.md +++ b/docs/models/pastsubscription.md @@ -3,12 +3,12 @@ ## Example Usage ```typescript -import { PastSubscription, PostUsersSigninDataState } from "@lukehagar/plexjs"; +import { PastSubscription, PostUsersSignInDataState } from "@lukehagar/plexjs"; let value: PastSubscription = { id: "", mode: "", - renewsAt: 662527, + renewsAt: 1556281940, endsAt: 1556281940, canceled: false, gracePeriod: false, @@ -19,13 +19,11 @@ let value: PastSubscription = { canConvert: false, type: "plexpass", transfer: "", - state: PostUsersSigninDataState.Ended, - billing: [ - { - internalPaymentMethod: {}, - paymentMethodId: 820994, - }, - ], + state: PostUsersSignInDataState.Ended, + billing: { + internalPaymentMethod: {}, + paymentMethodId: 880476, + }, }; ``` @@ -35,8 +33,8 @@ let value: PastSubscription = { | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | | `id` | *string* | :heavy_check_mark: | N/A | | | `mode` | *string* | :heavy_check_mark: | N/A | | -| `renewsAt` | *number* | :heavy_check_mark: | Unix epoch datetime | | -| `endsAt` | *number* | :heavy_check_mark: | Unix epoch datetime | 1556281940 | +| `renewsAt` | *number* | :heavy_check_mark: | N/A | 1556281940 | +| `endsAt` | *number* | :heavy_check_mark: | N/A | 1556281940 | | `canceled` | *boolean* | :heavy_minus_sign: | N/A | false | | `gracePeriod` | *boolean* | :heavy_minus_sign: | N/A | false | | `onHold` | *boolean* | :heavy_minus_sign: | N/A | false | @@ -46,5 +44,5 @@ let value: PastSubscription = { | `canConvert` | *boolean* | :heavy_minus_sign: | N/A | false | | `type` | *string* | :heavy_check_mark: | N/A | plexpass | | `transfer` | *string* | :heavy_check_mark: | N/A | | -| `state` | [models.PostUsersSigninDataState](../models/postuserssignindatastate.md) | :heavy_check_mark: | N/A | ended | -| `billing` | [models.Billing](../models/billing.md)[] | :heavy_check_mark: | N/A | | \ No newline at end of file +| `state` | [models.PostUsersSignInDataState](../models/postuserssignindatastate.md) | :heavy_check_mark: | N/A | ended | +| `billing` | [models.Billing](../models/billing.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/pathparamfilter.md b/docs/models/pathparamfilter.md deleted file mode 100644 index 99983e20..00000000 --- a/docs/models/pathparamfilter.md +++ /dev/null @@ -1,19 +0,0 @@ -# PathParamFilter - -Filter - -## Example Usage - -```typescript -import { PathParamFilter } from "@lukehagar/plexjs"; - -let value: PathParamFilter = PathParamFilter.All; -``` - -## Values - -| Name | Value | -| ----------- | ----------- | -| `All` | all | -| `Available` | available | -| `Released` | released | \ No newline at end of file diff --git a/docs/models/pathparamtaskname.md b/docs/models/pathparamtaskname.md index c9693160..62dd848b 100644 --- a/docs/models/pathparamtaskname.md +++ b/docs/models/pathparamtaskname.md @@ -7,7 +7,7 @@ The name of the task to be started. ```typescript import { PathParamTaskName } from "@lukehagar/plexjs"; -let value: PathParamTaskName = PathParamTaskName.RefreshPeriodicMetadata; +let value: PathParamTaskName = PathParamTaskName.RefreshLocalMedia; ``` ## Values diff --git a/docs/models/performsearchrequest.md b/docs/models/performsearchrequest.md index d811a67f..4bbbb093 100644 --- a/docs/models/performsearchrequest.md +++ b/docs/models/performsearchrequest.md @@ -6,7 +6,7 @@ import { PerformSearchRequest } from "@lukehagar/plexjs"; let value: PerformSearchRequest = { - query: "dylan", + query: "arnold", limit: 5, }; ``` diff --git a/docs/models/performsearchresponse.md b/docs/models/performsearchresponse.md index eeceae3a..f198d629 100644 --- a/docs/models/performsearchresponse.md +++ b/docs/models/performsearchresponse.md @@ -7,7 +7,7 @@ import { PerformSearchResponse } from "@lukehagar/plexjs"; let value: PerformSearchResponse = { contentType: "", - statusCode: 758616, + statusCode: 943749, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/performvoicesearchresponse.md b/docs/models/performvoicesearchresponse.md index 1d0da9cc..597e8051 100644 --- a/docs/models/performvoicesearchresponse.md +++ b/docs/models/performvoicesearchresponse.md @@ -7,7 +7,7 @@ import { PerformVoiceSearchResponse } from "@lukehagar/plexjs"; let value: PerformVoiceSearchResponse = { contentType: "", - statusCode: 521848, + statusCode: 902599, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/pivot.md b/docs/models/pivot.md new file mode 100644 index 00000000..90bb3526 --- /dev/null +++ b/docs/models/pivot.md @@ -0,0 +1,20 @@ +# Pivot + +## Example Usage + +```typescript +import { Pivot } from "@lukehagar/plexjs"; + +let value: Pivot = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *string* | :heavy_minus_sign: | N/A | +| `key` | *string* | :heavy_minus_sign: | N/A | +| `type` | *string* | :heavy_minus_sign: | N/A | +| `title` | *string* | :heavy_minus_sign: | N/A | +| `context` | *string* | :heavy_minus_sign: | N/A | +| `symbol` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/playlisttype.md b/docs/models/playlisttype.md index ea8a64d4..c27d5c4e 100644 --- a/docs/models/playlisttype.md +++ b/docs/models/playlisttype.md @@ -7,7 +7,7 @@ limit to a type of playlist. ```typescript import { PlaylistType } from "@lukehagar/plexjs"; -let value: PlaylistType = PlaylistType.Photo; +let value: PlaylistType = PlaylistType.Audio; ``` ## Values diff --git a/docs/models/plexdevice.md b/docs/models/plexdevice.md index 3bf8f2b6..e3dc2c66 100644 --- a/docs/models/plexdevice.md +++ b/docs/models/plexdevice.md @@ -7,15 +7,39 @@ import { PlexDevice } from "@lukehagar/plexjs"; let value: PlexDevice = { name: "", - product: "Oriental Bronze Pizza", + product: "Oriental Metal Computer", productVersion: "", platform: "", platformVersion: "", device: "", clientIdentifier: "", - createdAt: new Date("2024-08-11T14:46:30.188Z"), - lastSeenAt: new Date("2024-12-08T13:34:36.810Z"), + createdAt: new Date("2024-02-29T19:31:16.563Z"), + lastSeenAt: new Date("2023-12-03T08:28:56.752Z"), provides: "", + ownerId: 582020, + sourceTitle: "", + publicAddress: "", + accessToken: "", + owned: false, + home: false, + synced: false, + relay: false, + presence: false, + httpsRequired: false, + publicAddressMatches: false, + dnsRebindingProtection: false, + natLoopbackSupported: false, + connections: [ + { + protocol: "", + address: "59751 Jaren Ford", + port: 1863.32, + uri: "https://several-increase.biz", + local: false, + relay: false, + iPv6: false, + }, + ], }; ``` @@ -33,17 +57,17 @@ let value: PlexDevice = { | `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` | *string* | :heavy_minus_sign: | N/A | -| `sourceTitle` | *string* | :heavy_minus_sign: | N/A | -| `publicAddress` | *string* | :heavy_minus_sign: | N/A | -| `accessToken` | *string* | :heavy_minus_sign: | N/A | -| `owned` | *boolean* | :heavy_minus_sign: | N/A | -| `home` | *boolean* | :heavy_minus_sign: | N/A | -| `synced` | *boolean* | :heavy_minus_sign: | N/A | -| `relay` | *boolean* | :heavy_minus_sign: | N/A | -| `presence` | *boolean* | :heavy_minus_sign: | N/A | -| `httpsRequired` | *boolean* | :heavy_minus_sign: | N/A | -| `publicAddressMatches` | *boolean* | :heavy_minus_sign: | N/A | -| `dnsRebindingProtection` | *boolean* | :heavy_minus_sign: | N/A | -| `natLoopbackSupported` | *boolean* | :heavy_minus_sign: | N/A | -| `connections` | [models.Connections](../models/connections.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file +| `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` | [models.Connections](../models/connections.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/postuserssignindatauserfeatures.md b/docs/models/postuserssignindataauthenticationfeatures.md similarity index 95% rename from docs/models/postuserssignindatauserfeatures.md rename to docs/models/postuserssignindataauthenticationfeatures.md index bf31bb3f..d57648d2 100644 --- a/docs/models/postuserssignindatauserfeatures.md +++ b/docs/models/postuserssignindataauthenticationfeatures.md @@ -1,11 +1,12 @@ -# PostUsersSigninDataUserFeatures +# PostUsersSignInDataAuthenticationFeatures ## Example Usage ```typescript -import { PostUsersSigninDataUserFeatures } from "@lukehagar/plexjs"; +import { PostUsersSignInDataAuthenticationFeatures } from "@lukehagar/plexjs"; -let value: PostUsersSigninDataUserFeatures = PostUsersSigninDataUserFeatures.VodCloudflare; +let value: PostUsersSignInDataAuthenticationFeatures = + PostUsersSignInDataAuthenticationFeatures.PhotosFavorites; ``` ## Values diff --git a/docs/models/postuserssignindataauthenticationresponsestatus.md b/docs/models/postuserssignindataauthenticationresponsestatus.md new file mode 100644 index 00000000..658b9ba3 --- /dev/null +++ b/docs/models/postuserssignindataauthenticationresponsestatus.md @@ -0,0 +1,19 @@ +# PostUsersSignInDataAuthenticationResponseStatus + +String representation of subscriptionActive + +## Example Usage + +```typescript +import { PostUsersSignInDataAuthenticationResponseStatus } from "@lukehagar/plexjs"; + +let value: PostUsersSignInDataAuthenticationResponseStatus = + PostUsersSignInDataAuthenticationResponseStatus.Inactive; +``` + +## Values + +| Name | Value | +| ---------- | ---------- | +| `Inactive` | Inactive | +| `Active` | Active | \ No newline at end of file diff --git a/docs/models/postuserssignindataauthenticationstatus.md b/docs/models/postuserssignindataauthenticationstatus.md new file mode 100644 index 00000000..d75ee071 --- /dev/null +++ b/docs/models/postuserssignindataauthenticationstatus.md @@ -0,0 +1,19 @@ +# PostUsersSignInDataAuthenticationStatus + +String representation of subscriptionActive + +## Example Usage + +```typescript +import { PostUsersSignInDataAuthenticationStatus } from "@lukehagar/plexjs"; + +let value: PostUsersSignInDataAuthenticationStatus = + PostUsersSignInDataAuthenticationStatus.Inactive; +``` + +## Values + +| Name | Value | +| ---------- | ---------- | +| `Inactive` | Inactive | +| `Active` | Active | \ No newline at end of file diff --git a/docs/models/postuserssignindataauthenticationsubscription.md b/docs/models/postuserssignindataauthenticationsubscription.md new file mode 100644 index 00000000..4cf897c1 --- /dev/null +++ b/docs/models/postuserssignindataauthenticationsubscription.md @@ -0,0 +1,27 @@ +# PostUsersSignInDataAuthenticationSubscription + +## Example Usage + +```typescript +import { + PostUsersSignInDataAuthenticationResponseStatus, + PostUsersSignInDataAuthenticationSubscription, +} from "@lukehagar/plexjs"; + +let value: PostUsersSignInDataAuthenticationSubscription = { + active: true, + subscribedAt: "2021-04-12T18:21:12Z", + status: PostUsersSignInDataAuthenticationResponseStatus.Inactive, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `features` | [models.PostUsersSignInDataAuthenticationFeatures](../models/postuserssignindataauthenticationfeatures.md)[] | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | | +| `active` | *boolean* | :heavy_minus_sign: | If the account's Plex Pass subscription is active | true | +| `subscribedAt` | *string* | :heavy_minus_sign: | Date the account subscribed to Plex Pass | 2021-04-12T18:21:12Z | +| `status` | [models.PostUsersSignInDataAuthenticationResponseStatus](../models/postuserssignindataauthenticationresponsestatus.md) | :heavy_minus_sign: | String representation of subscriptionActive | Inactive | +| `paymentService` | *string* | :heavy_minus_sign: | Payment service used for your Plex Pass subscription | | +| `plan` | *string* | :heavy_minus_sign: | Name of Plex Pass subscription plan | | \ No newline at end of file diff --git a/docs/models/postuserssignindataautoselectsubtitle.md b/docs/models/postuserssignindataautoselectsubtitle.md new file mode 100644 index 00000000..003a3f02 --- /dev/null +++ b/docs/models/postuserssignindataautoselectsubtitle.md @@ -0,0 +1,18 @@ +# PostUsersSignInDataAutoSelectSubtitle + +The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) + +## Example Usage + +```typescript +import { PostUsersSignInDataAutoSelectSubtitle } from "@lukehagar/plexjs"; + +let value: PostUsersSignInDataAutoSelectSubtitle = PostUsersSignInDataAutoSelectSubtitle.One; +``` + +## Values + +| Name | Value | +| ------ | ------ | +| `Zero` | 0 | +| `One` | 1 | \ No newline at end of file diff --git a/docs/models/postuserssignindatadefaultsubtitleaccessibility.md b/docs/models/postuserssignindatadefaultsubtitleaccessibility.md new file mode 100644 index 00000000..9a660f05 --- /dev/null +++ b/docs/models/postuserssignindatadefaultsubtitleaccessibility.md @@ -0,0 +1,19 @@ +# 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) + +## Example Usage + +```typescript +import { PostUsersSignInDataDefaultSubtitleAccessibility } from "@lukehagar/plexjs"; + +let value: PostUsersSignInDataDefaultSubtitleAccessibility = + PostUsersSignInDataDefaultSubtitleAccessibility.One; +``` + +## Values + +| Name | Value | +| ------ | ------ | +| `Zero` | 0 | +| `One` | 1 | \ No newline at end of file diff --git a/docs/models/postuserssignindatadefaultsubtitleforced.md b/docs/models/postuserssignindatadefaultsubtitleforced.md new file mode 100644 index 00000000..6a768c09 --- /dev/null +++ b/docs/models/postuserssignindatadefaultsubtitleforced.md @@ -0,0 +1,18 @@ +# PostUsersSignInDataDefaultSubtitleForced + +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) + +## Example Usage + +```typescript +import { PostUsersSignInDataDefaultSubtitleForced } from "@lukehagar/plexjs"; + +let value: PostUsersSignInDataDefaultSubtitleForced = PostUsersSignInDataDefaultSubtitleForced.Zero; +``` + +## Values + +| Name | Value | +| ------ | ------ | +| `Zero` | 0 | +| `One` | 1 | \ No newline at end of file diff --git a/docs/models/postuserssignindataerrors.md b/docs/models/postuserssignindataerrors.md index 69d2e589..d21445f4 100644 --- a/docs/models/postuserssignindataerrors.md +++ b/docs/models/postuserssignindataerrors.md @@ -1,11 +1,11 @@ -# PostUsersSigninDataErrors +# PostUsersSignInDataErrors ## Example Usage ```typescript -import { PostUsersSigninDataErrors } from "@lukehagar/plexjs"; +import { PostUsersSignInDataErrors } from "@lukehagar/plexjs"; -let value: PostUsersSigninDataErrors = { +let value: PostUsersSignInDataErrors = { code: 1001, message: "User could not be authenticated", status: 401, diff --git a/docs/models/postuserssignindatafeatures.md b/docs/models/postuserssignindatafeatures.md index 6ffd274b..618b9c56 100644 --- a/docs/models/postuserssignindatafeatures.md +++ b/docs/models/postuserssignindatafeatures.md @@ -1,11 +1,11 @@ -# PostUsersSigninDataFeatures +# PostUsersSignInDataFeatures ## Example Usage ```typescript -import { PostUsersSigninDataFeatures } from "@lukehagar/plexjs"; +import { PostUsersSignInDataFeatures } from "@lukehagar/plexjs"; -let value: PostUsersSigninDataFeatures = PostUsersSigninDataFeatures.ClientRadioStations; +let value: PostUsersSignInDataFeatures = PostUsersSignInDataFeatures.AmazonLoopDebug; ``` ## Values diff --git a/docs/models/postuserssignindataglobals.md b/docs/models/postuserssignindataglobals.md index 912da2a7..5de331a6 100644 --- a/docs/models/postuserssignindataglobals.md +++ b/docs/models/postuserssignindataglobals.md @@ -1,15 +1,15 @@ -# PostUsersSigninDataGlobals +# PostUsersSignInDataGlobals ## Example Usage ```typescript -import { PostUsersSigninDataGlobals } from "@lukehagar/plexjs"; +import { PostUsersSignInDataGlobals } from "@lukehagar/plexjs"; -let value: PostUsersSigninDataGlobals = {}; +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)
| Postman | \ No newline at end of file +| `xPlexClientIdentifier` | *string* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| gcgzw5rz2xovp84b4vha3a40 | \ No newline at end of file diff --git a/docs/models/postuserssignindatamailingliststatus.md b/docs/models/postuserssignindatamailingliststatus.md index 1f4fb999..0f45ba2b 100644 --- a/docs/models/postuserssignindatamailingliststatus.md +++ b/docs/models/postuserssignindatamailingliststatus.md @@ -1,18 +1,18 @@ -# PostUsersSigninDataMailingListStatus +# PostUsersSignInDataMailingListStatus Your current mailing list status ## Example Usage ```typescript -import { PostUsersSigninDataMailingListStatus } from "@lukehagar/plexjs"; +import { PostUsersSignInDataMailingListStatus } from "@lukehagar/plexjs"; -let value: PostUsersSigninDataMailingListStatus = PostUsersSigninDataMailingListStatus.Unsubscribed; +let value: PostUsersSignInDataMailingListStatus = PostUsersSignInDataMailingListStatus.Unsubscribed; ``` ## Values | Name | Value | | -------------- | -------------- | -| `Subscribed` | subscribed | +| `Active` | active | | `Unsubscribed` | unsubscribed | \ No newline at end of file diff --git a/docs/models/postuserssignindatamediareviewsvisibility.md b/docs/models/postuserssignindatamediareviewsvisibility.md new file mode 100644 index 00000000..80f068e5 --- /dev/null +++ b/docs/models/postuserssignindatamediareviewsvisibility.md @@ -0,0 +1,17 @@ +# PostUsersSignInDataMediaReviewsVisibility + +## Example Usage + +```typescript +import { PostUsersSignInDataMediaReviewsVisibility } from "@lukehagar/plexjs"; + +let value: PostUsersSignInDataMediaReviewsVisibility = + PostUsersSignInDataMediaReviewsVisibility.Zero; +``` + +## Values + +| Name | Value | +| ------ | ------ | +| `Zero` | 0 | +| `One` | 1 | \ No newline at end of file diff --git a/docs/models/postuserssignindatarequest.md b/docs/models/postuserssignindatarequest.md index dcd156c3..126313e1 100644 --- a/docs/models/postuserssignindatarequest.md +++ b/docs/models/postuserssignindatarequest.md @@ -1,11 +1,11 @@ -# PostUsersSigninDataRequest +# PostUsersSignInDataRequest ## Example Usage ```typescript -import { PostUsersSigninDataRequest } from "@lukehagar/plexjs"; +import { PostUsersSignInDataRequest } from "@lukehagar/plexjs"; -let value: PostUsersSigninDataRequest = { +let value: PostUsersSignInDataRequest = { requestBody: { login: "username@email.com", password: "password123", @@ -17,5 +17,5 @@ let value: PostUsersSigninDataRequest = { | 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)
| Postman | -| `requestBody` | [models.PostUsersSigninDataRequestBody](../models/postuserssignindatarequestbody.md) | :heavy_minus_sign: | Login credentials | | \ No newline at end of file +| `xPlexClientIdentifier` | *string* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| gcgzw5rz2xovp84b4vha3a40 | +| `requestBody` | [models.PostUsersSignInDataRequestBody](../models/postuserssignindatarequestbody.md) | :heavy_minus_sign: | Login credentials | | \ No newline at end of file diff --git a/docs/models/postuserssignindatarequestbody.md b/docs/models/postuserssignindatarequestbody.md index 7871d335..4f557139 100644 --- a/docs/models/postuserssignindatarequestbody.md +++ b/docs/models/postuserssignindatarequestbody.md @@ -1,13 +1,13 @@ -# PostUsersSigninDataRequestBody +# PostUsersSignInDataRequestBody Login credentials ## Example Usage ```typescript -import { PostUsersSigninDataRequestBody } from "@lukehagar/plexjs"; +import { PostUsersSignInDataRequestBody } from "@lukehagar/plexjs"; -let value: PostUsersSigninDataRequestBody = { +let value: PostUsersSignInDataRequestBody = { login: "username@email.com", password: "password123", }; diff --git a/docs/models/postuserssignindataresponse.md b/docs/models/postuserssignindataresponse.md index c4cbb2f9..85f3e6ae 100644 --- a/docs/models/postuserssignindataresponse.md +++ b/docs/models/postuserssignindataresponse.md @@ -1,22 +1,27 @@ -# PostUsersSigninDataResponse +# PostUsersSignInDataResponse ## Example Usage ```typescript import { - PostUsersSigninDataFeatures, - PostUsersSigninDataMailingListStatus, - PostUsersSigninDataResponse, - PostUsersSigninDataState, - PostUsersSigninDataStatus, - PostUsersSigninDataUserFeatures, - PostUsersSigninDataUserResponseStatus, - PostUsersSigninDataUserStatus, + PostUsersSignInDataAuthenticationFeatures, + PostUsersSignInDataAuthenticationResponseStatus, + PostUsersSignInDataAuthenticationStatus, + PostUsersSignInDataAutoSelectSubtitle, + PostUsersSignInDataDefaultSubtitleAccessibility, + PostUsersSignInDataDefaultSubtitleForced, + PostUsersSignInDataFeatures, + PostUsersSignInDataMailingListStatus, + PostUsersSignInDataMediaReviewsVisibility, + PostUsersSignInDataResponse, + PostUsersSignInDataState, + PostUsersSignInDataStatus, + PostUsersSignInDataWatchedIndicator, } from "@lukehagar/plexjs"; -let value: PostUsersSigninDataResponse = { +let value: PostUsersSignInDataResponse = { contentType: "", - statusCode: 13571, + statusCode: 692472, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), @@ -43,21 +48,19 @@ let value: PostUsersSigninDataResponse = { joinedAt: 1721154902, locale: null, mailingListActive: false, - mailingListStatus: PostUsersSigninDataMailingListStatus.Subscribed, + mailingListStatus: PostUsersSignInDataMailingListStatus.Unsubscribed, maxHomeSize: 15, pin: "string", - profile: [ - { - autoSelectAudio: true, - defaultAudioLanguage: "ja", - defaultSubtitleLanguage: "en", - autoSelectSubtitle: 1, - defaultSubtitleAccessibility: 1, - defaultSubtitleForced: 0, - watchedIndicator: 1, - mediaReviewsVisibility: 0, - }, - ], + profile: { + autoSelectAudio: true, + defaultAudioLanguage: "ja", + defaultSubtitleLanguage: "en", + autoSelectSubtitle: PostUsersSignInDataAutoSelectSubtitle.One, + defaultSubtitleAccessibility: PostUsersSignInDataDefaultSubtitleAccessibility.One, + defaultSubtitleForced: PostUsersSignInDataDefaultSubtitleForced.One, + watchedIndicator: PostUsersSignInDataWatchedIndicator.One, + mediaReviewsVisibility: PostUsersSignInDataMediaReviewsVisibility.One, + }, protected: false, rememberExpiresAt: 1722364046, restricted: false, @@ -69,24 +72,24 @@ let value: PostUsersSigninDataResponse = { endpoint: "https://epg.provider.plex.tv", token: "DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv", secret: "string", - status: PostUsersSigninDataStatus.Online, + status: PostUsersSignInDataStatus.Online, }, ], subscription: { - features: [PostUsersSigninDataFeatures.AndroidDolbyVision], + features: [PostUsersSignInDataFeatures.AndroidDolbyVision], active: true, - subscribedAt: new Date("2021-04-12T18:21:12Z"), - status: PostUsersSigninDataUserStatus.Inactive, + subscribedAt: "2021-04-12T18:21:12Z", + status: PostUsersSignInDataAuthenticationStatus.Inactive, paymentService: "string", plan: "string", }, subscriptionDescription: "string", subscriptions: [ { - features: [PostUsersSigninDataUserFeatures.AndroidDolbyVision], + features: [PostUsersSignInDataAuthenticationFeatures.AndroidDolbyVision], active: true, - subscribedAt: new Date("2021-04-12T18:21:12Z"), - status: PostUsersSigninDataUserResponseStatus.Inactive, + subscribedAt: "2021-04-12T18:21:12Z", + status: PostUsersSignInDataAuthenticationResponseStatus.Inactive, paymentService: "string", plan: "string", }, @@ -111,13 +114,11 @@ let value: PostUsersSigninDataResponse = { canConvert: true, type: "plexpass", transfer: "string", - state: PostUsersSigninDataState.Ended, - billing: [ - { - internalPaymentMethod: {}, - paymentMethodId: string, - }, - ], + state: PostUsersSignInDataState.Ended, + billing: { + internalPaymentMethod: {}, + paymentMethodId: 265389, + }, }, ], trials: [{}], @@ -132,4 +133,4 @@ let value: PostUsersSigninDataResponse = { | `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 | | -| `userPlexAccount` | [models.PostUsersSigninDataUserPlexAccount](../models/postuserssignindatauserplexaccount.md) | :heavy_minus_sign: | Returns the user account data with a valid auth token | {
"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": "subscribed",
"maxHomeSize": 15,
"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": [
{
"internalPaymentMethod": "string",
"paymentMethodId": "string"
}
]
}
],
"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",
"trials": [
{}
],
"twoFactorEnabled": false,
"username": "Username",
"uuid": "dae343c1f45beb4f"
} | \ No newline at end of file +| `userPlexAccount` | [models.PostUsersSignInDataUserPlexAccount](../models/postuserssignindatauserplexaccount.md) | :heavy_minus_sign: | Returns the user account data with a valid auth token | {
"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": "subscribed",
"maxHomeSize": 15,
"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": [
{
"internalPaymentMethod": "string",
"paymentMethodId": "string"
}
]
}
],
"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",
"trials": [
{}
],
"twoFactorEnabled": false,
"username": "Username",
"uuid": "dae343c1f45beb4f"
} | \ No newline at end of file diff --git a/docs/models/postuserssignindataresponsebody.md b/docs/models/postuserssignindataresponsebody.md index 225546cc..4ab02529 100644 --- a/docs/models/postuserssignindataresponsebody.md +++ b/docs/models/postuserssignindataresponsebody.md @@ -1,11 +1,11 @@ -# PostUsersSigninDataResponseBody +# PostUsersSignInDataResponseBody Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Example Usage ```typescript -import { PostUsersSigninDataResponseBody } from "@lukehagar/plexjs"; +import { PostUsersSignInDataResponseBody } from "@lukehagar/plexjs"; // No examples available for this model ``` @@ -14,5 +14,5 @@ import { PostUsersSigninDataResponseBody } from "@lukehagar/plexjs"; | Field | Type | Required | Description | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `errors` | [models.PostUsersSigninDataErrors](../models/postuserssignindataerrors.md)[] | :heavy_minus_sign: | N/A | +| `errors` | [models.PostUsersSignInDataErrors](../models/postuserssignindataerrors.md)[] | :heavy_minus_sign: | N/A | | `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/postuserssignindataservices.md b/docs/models/postuserssignindataservices.md index 1989ca5e..74a822bb 100644 --- a/docs/models/postuserssignindataservices.md +++ b/docs/models/postuserssignindataservices.md @@ -1,16 +1,16 @@ -# PostUsersSigninDataServices +# PostUsersSignInDataServices ## Example Usage ```typescript -import { PostUsersSigninDataServices, PostUsersSigninDataStatus } from "@lukehagar/plexjs"; +import { PostUsersSignInDataServices, PostUsersSignInDataStatus } from "@lukehagar/plexjs"; -let value: PostUsersSigninDataServices = { +let value: PostUsersSignInDataServices = { identifier: "metadata-dev", endpoint: "https://epg.provider.plex.tv", token: "DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv", secret: "", - status: PostUsersSigninDataStatus.Online, + status: PostUsersSignInDataStatus.Online, }; ``` @@ -22,4 +22,4 @@ let value: PostUsersSigninDataServices = { | `endpoint` | *string* | :heavy_check_mark: | N/A | https://epg.provider.plex.tv | | `token` | *string* | :heavy_check_mark: | N/A | DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv | | `secret` | *string* | :heavy_check_mark: | N/A | | -| `status` | [models.PostUsersSigninDataStatus](../models/postuserssignindatastatus.md) | :heavy_check_mark: | N/A | online | \ No newline at end of file +| `status` | [models.PostUsersSignInDataStatus](../models/postuserssignindatastatus.md) | :heavy_check_mark: | N/A | online | \ No newline at end of file diff --git a/docs/models/postuserssignindatastate.md b/docs/models/postuserssignindatastate.md index 0ade6cfc..1f1c0a64 100644 --- a/docs/models/postuserssignindatastate.md +++ b/docs/models/postuserssignindatastate.md @@ -1,11 +1,11 @@ -# PostUsersSigninDataState +# PostUsersSignInDataState ## Example Usage ```typescript -import { PostUsersSigninDataState } from "@lukehagar/plexjs"; +import { PostUsersSignInDataState } from "@lukehagar/plexjs"; -let value: PostUsersSigninDataState = PostUsersSigninDataState.Ended; +let value: PostUsersSignInDataState = PostUsersSignInDataState.Ended; ``` ## Values diff --git a/docs/models/postuserssignindatastatus.md b/docs/models/postuserssignindatastatus.md index 2b9f0d92..b21353cb 100644 --- a/docs/models/postuserssignindatastatus.md +++ b/docs/models/postuserssignindatastatus.md @@ -1,11 +1,11 @@ -# PostUsersSigninDataStatus +# PostUsersSignInDataStatus ## Example Usage ```typescript -import { PostUsersSigninDataStatus } from "@lukehagar/plexjs"; +import { PostUsersSignInDataStatus } from "@lukehagar/plexjs"; -let value: PostUsersSigninDataStatus = PostUsersSigninDataStatus.Online; +let value: PostUsersSignInDataStatus = PostUsersSignInDataStatus.Online; ``` ## Values diff --git a/docs/models/postuserssignindatasubscription.md b/docs/models/postuserssignindatasubscription.md index 0dcf74fa..08a2306d 100644 --- a/docs/models/postuserssignindatasubscription.md +++ b/docs/models/postuserssignindatasubscription.md @@ -1,26 +1,26 @@ -# PostUsersSigninDataSubscription +# PostUsersSignInDataSubscription If the account’s Plex Pass subscription is active ## Example Usage ```typescript -import { PostUsersSigninDataSubscription, PostUsersSigninDataUserStatus } from "@lukehagar/plexjs"; +import { PostUsersSignInDataAuthenticationStatus, PostUsersSignInDataSubscription } from "@lukehagar/plexjs"; -let value: PostUsersSigninDataSubscription = { +let value: PostUsersSignInDataSubscription = { active: true, - subscribedAt: new Date("2021-04-12T18:21:12Z"), - status: PostUsersSigninDataUserStatus.Inactive, + subscribedAt: "2021-04-12T18:21:12Z", + status: PostUsersSignInDataAuthenticationStatus.Inactive, }; ``` ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `features` | [models.PostUsersSigninDataFeatures](../models/postuserssignindatafeatures.md)[] | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | | -| `active` | *boolean* | :heavy_minus_sign: | If the account's Plex Pass subscription is active | true | -| `subscribedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Date the account subscribed to Plex Pass | 2021-04-12T18:21:12Z | -| `status` | [models.PostUsersSigninDataUserStatus](../models/postuserssignindatauserstatus.md) | :heavy_minus_sign: | String representation of subscriptionActive | Inactive | -| `paymentService` | *string* | :heavy_minus_sign: | Payment service used for your Plex Pass subscription | | -| `plan` | *string* | :heavy_minus_sign: | Name of Plex Pass subscription plan | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `features` | [models.PostUsersSignInDataFeatures](../models/postuserssignindatafeatures.md)[] | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | | +| `active` | *boolean* | :heavy_minus_sign: | If the account's Plex Pass subscription is active | true | +| `subscribedAt` | *string* | :heavy_minus_sign: | Date the account subscribed to Plex Pass | 2021-04-12T18:21:12Z | +| `status` | [models.PostUsersSignInDataAuthenticationStatus](../models/postuserssignindataauthenticationstatus.md) | :heavy_minus_sign: | String representation of subscriptionActive | Inactive | +| `paymentService` | *string* | :heavy_minus_sign: | Payment service used for your Plex Pass subscription | | +| `plan` | *string* | :heavy_minus_sign: | Name of Plex Pass subscription plan | | \ No newline at end of file diff --git a/docs/models/postuserssignindatauserplexaccount.md b/docs/models/postuserssignindatauserplexaccount.md index fa33ae81..9c3d30d5 100644 --- a/docs/models/postuserssignindatauserplexaccount.md +++ b/docs/models/postuserssignindatauserplexaccount.md @@ -1,4 +1,4 @@ -# PostUsersSigninDataUserPlexAccount +# PostUsersSignInDataUserPlexAccount Returns the user account data with a valid auth token @@ -6,17 +6,22 @@ Returns the user account data with a valid auth token ```typescript import { - PostUsersSigninDataFeatures, - PostUsersSigninDataMailingListStatus, - PostUsersSigninDataState, - PostUsersSigninDataStatus, - PostUsersSigninDataUserFeatures, - PostUsersSigninDataUserPlexAccount, - PostUsersSigninDataUserResponseStatus, - PostUsersSigninDataUserStatus, + PostUsersSignInDataAuthenticationFeatures, + PostUsersSignInDataAuthenticationResponseStatus, + PostUsersSignInDataAuthenticationStatus, + PostUsersSignInDataAutoSelectSubtitle, + PostUsersSignInDataDefaultSubtitleAccessibility, + PostUsersSignInDataDefaultSubtitleForced, + PostUsersSignInDataFeatures, + PostUsersSignInDataMailingListStatus, + PostUsersSignInDataMediaReviewsVisibility, + PostUsersSignInDataState, + PostUsersSignInDataStatus, + PostUsersSignInDataUserPlexAccount, + PostUsersSignInDataWatchedIndicator, } from "@lukehagar/plexjs"; -let value: PostUsersSigninDataUserPlexAccount = { +let value: PostUsersSignInDataUserPlexAccount = { adsConsent: true, adsConsentReminderAt: new Date("2019-08-24T14:15:22Z"), adsConsentSetAt: new Date("2019-08-24T14:15:22Z"), @@ -39,21 +44,19 @@ let value: PostUsersSigninDataUserPlexAccount = { joinedAt: 1721154902, locale: null, mailingListActive: false, - mailingListStatus: PostUsersSigninDataMailingListStatus.Subscribed, + mailingListStatus: PostUsersSignInDataMailingListStatus.Active, maxHomeSize: 15, pin: "string", - profile: [ - { - autoSelectAudio: true, - defaultAudioLanguage: "ja", - defaultSubtitleLanguage: "en", - autoSelectSubtitle: 1, - defaultSubtitleAccessibility: 1, - defaultSubtitleForced: 0, - watchedIndicator: 1, - mediaReviewsVisibility: 0, - }, - ], + profile: { + autoSelectAudio: true, + defaultAudioLanguage: "ja", + defaultSubtitleLanguage: "en", + autoSelectSubtitle: PostUsersSignInDataAutoSelectSubtitle.One, + defaultSubtitleAccessibility: PostUsersSignInDataDefaultSubtitleAccessibility.One, + defaultSubtitleForced: PostUsersSignInDataDefaultSubtitleForced.One, + watchedIndicator: PostUsersSignInDataWatchedIndicator.One, + mediaReviewsVisibility: PostUsersSignInDataMediaReviewsVisibility.Zero, + }, protected: false, rememberExpiresAt: 1722364046, restricted: false, @@ -65,24 +68,24 @@ let value: PostUsersSigninDataUserPlexAccount = { endpoint: "https://epg.provider.plex.tv", token: "DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv", secret: "string", - status: PostUsersSigninDataStatus.Online, + status: PostUsersSignInDataStatus.Online, }, ], subscription: { - features: [PostUsersSigninDataFeatures.AndroidDolbyVision], + features: [PostUsersSignInDataFeatures.AndroidDolbyVision], active: true, - subscribedAt: new Date("2021-04-12T18:21:12Z"), - status: PostUsersSigninDataUserStatus.Inactive, + subscribedAt: "2021-04-12T18:21:12Z", + status: PostUsersSignInDataAuthenticationStatus.Inactive, paymentService: "string", plan: "string", }, subscriptionDescription: "string", subscriptions: [ { - features: [PostUsersSigninDataUserFeatures.AndroidDolbyVision], + features: [PostUsersSignInDataAuthenticationFeatures.AndroidDolbyVision], active: true, - subscribedAt: new Date("2021-04-12T18:21:12Z"), - status: PostUsersSigninDataUserResponseStatus.Inactive, + subscribedAt: "2021-04-12T18:21:12Z", + status: PostUsersSignInDataAuthenticationResponseStatus.Inactive, paymentService: "string", plan: "string", }, @@ -107,13 +110,11 @@ let value: PostUsersSigninDataUserPlexAccount = { canConvert: true, type: "plexpass", transfer: "string", - state: PostUsersSigninDataState.Ended, - billing: [ - { - internalPaymentMethod: {}, - paymentMethodId: string, - }, - ], + state: PostUsersSignInDataState.Ended, + billing: { + internalPaymentMethod: {}, + paymentMethodId: 216822, + }, }, ], trials: [{}], @@ -146,19 +147,19 @@ let value: PostUsersSigninDataUserPlexAccount = { | `joinedAt` | *number* | :heavy_check_mark: | Unix epoch datetime the account joined Plex | 1721154902 | | `locale` | *string* | :heavy_check_mark: | The account locale | | | `mailingListActive` | *boolean* | :heavy_minus_sign: | If you are subscribed to the Plex newsletter | | -| `mailingListStatus` | [models.PostUsersSigninDataMailingListStatus](../models/postuserssignindatamailingliststatus.md) | :heavy_check_mark: | Your current mailing list status | | +| `mailingListStatus` | [models.PostUsersSignInDataMailingListStatus](../models/postuserssignindatamailingliststatus.md) | :heavy_check_mark: | Your current mailing list status | | | `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` | [models.PostUsersSigninDataUserProfile](../models/postuserssignindatauserprofile.md)[] | :heavy_check_mark: | N/A | | +| `profile` | [models.PostUsersSignInDataUserProfile](../models/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 the authtoken expires | 1722364046 | | `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 | | -| `services` | [models.PostUsersSigninDataServices](../models/postuserssignindataservices.md)[] | :heavy_check_mark: | N/A | | -| `subscription` | [models.PostUsersSigninDataSubscription](../models/postuserssignindatasubscription.md) | :heavy_check_mark: | If the account’s Plex Pass subscription is active | | +| `services` | [models.PostUsersSignInDataServices](../models/postuserssignindataservices.md)[] | :heavy_check_mark: | N/A | | +| `subscription` | [models.PostUsersSignInDataSubscription](../models/postuserssignindatasubscription.md) | :heavy_check_mark: | If the account’s Plex Pass subscription is active | | | `subscriptionDescription` | *string* | :heavy_check_mark: | Description of the Plex Pass subscription | | -| `subscriptions` | [models.PostUsersSigninDataUserSubscription](../models/postuserssignindatausersubscription.md)[] | :heavy_check_mark: | N/A | | +| `subscriptions` | [models.PostUsersSignInDataAuthenticationSubscription](../models/postuserssignindataauthenticationsubscription.md)[] | :heavy_check_mark: | N/A | | | `thumb` | *string* | :heavy_check_mark: | URL of the account thumbnail | https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101 | | `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 | | diff --git a/docs/models/postuserssignindatauserprofile.md b/docs/models/postuserssignindatauserprofile.md index 43f2e212..94486f2d 100644 --- a/docs/models/postuserssignindatauserprofile.md +++ b/docs/models/postuserssignindatauserprofile.md @@ -1,19 +1,26 @@ -# PostUsersSigninDataUserProfile +# PostUsersSignInDataUserProfile ## Example Usage ```typescript -import { PostUsersSigninDataUserProfile } from "@lukehagar/plexjs"; +import { + PostUsersSignInDataAutoSelectSubtitle, + PostUsersSignInDataDefaultSubtitleAccessibility, + PostUsersSignInDataDefaultSubtitleForced, + PostUsersSignInDataMediaReviewsVisibility, + PostUsersSignInDataUserProfile, + PostUsersSignInDataWatchedIndicator, +} from "@lukehagar/plexjs"; -let value: PostUsersSigninDataUserProfile = { +let value: PostUsersSignInDataUserProfile = { autoSelectAudio: true, defaultAudioLanguage: "ja", defaultSubtitleLanguage: "en", - autoSelectSubtitle: 1, - defaultSubtitleAccessibility: 1, - defaultSubtitleForced: 0, - watchedIndicator: 1, - mediaReviewsVisibility: 0, + autoSelectSubtitle: PostUsersSignInDataAutoSelectSubtitle.One, + defaultSubtitleAccessibility: PostUsersSignInDataDefaultSubtitleAccessibility.One, + defaultSubtitleForced: PostUsersSignInDataDefaultSubtitleForced.Zero, + watchedIndicator: PostUsersSignInDataWatchedIndicator.One, + mediaReviewsVisibility: PostUsersSignInDataMediaReviewsVisibility.Zero, }; ``` @@ -22,10 +29,10 @@ let value: PostUsersSigninDataUserProfile = { | 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_minus_sign: | The preferred audio language for the account | ja | -| `defaultSubtitleLanguage` | *string* | :heavy_minus_sign: | The preferred subtitle language for the account | en | -| `autoSelectSubtitle` | *number* | :heavy_minus_sign: | The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) | 1 | -| `defaultSubtitleAccessibility` | *number* | :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` | *number* | :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` | *number* | :heavy_minus_sign: | N/A | 1 | -| `mediaReviewsVisibility` | *number* | :heavy_minus_sign: | N/A | 0 | \ No newline at end of file +| `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` | [models.PostUsersSignInDataAutoSelectSubtitle](../models/postuserssignindataautoselectsubtitle.md) | :heavy_minus_sign: | The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) | 1 | +| `defaultSubtitleAccessibility` | [models.PostUsersSignInDataDefaultSubtitleAccessibility](../models/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` | [models.PostUsersSignInDataDefaultSubtitleForced](../models/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` | [models.PostUsersSignInDataWatchedIndicator](../models/postuserssignindatawatchedindicator.md) | :heavy_minus_sign: | N/A | 1 | +| `mediaReviewsVisibility` | [models.PostUsersSignInDataMediaReviewsVisibility](../models/postuserssignindatamediareviewsvisibility.md) | :heavy_minus_sign: | N/A | 0 | \ No newline at end of file diff --git a/docs/models/postuserssignindatauserresponsestatus.md b/docs/models/postuserssignindatauserresponsestatus.md deleted file mode 100644 index 3a75e381..00000000 --- a/docs/models/postuserssignindatauserresponsestatus.md +++ /dev/null @@ -1,18 +0,0 @@ -# PostUsersSigninDataUserResponseStatus - -String representation of subscriptionActive - -## Example Usage - -```typescript -import { PostUsersSigninDataUserResponseStatus } from "@lukehagar/plexjs"; - -let value: PostUsersSigninDataUserResponseStatus = PostUsersSigninDataUserResponseStatus.Inactive; -``` - -## Values - -| Name | Value | -| ---------- | ---------- | -| `Inactive` | Inactive | -| `Active` | Active | \ No newline at end of file diff --git a/docs/models/postuserssignindatausersubscription.md b/docs/models/postuserssignindatausersubscription.md deleted file mode 100644 index dcc3cc00..00000000 --- a/docs/models/postuserssignindatausersubscription.md +++ /dev/null @@ -1,24 +0,0 @@ -# PostUsersSigninDataUserSubscription - -## Example Usage - -```typescript -import { PostUsersSigninDataUserResponseStatus, PostUsersSigninDataUserSubscription } from "@lukehagar/plexjs"; - -let value: PostUsersSigninDataUserSubscription = { - active: true, - subscribedAt: new Date("2021-04-12T18:21:12Z"), - status: PostUsersSigninDataUserResponseStatus.Inactive, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `features` | [models.PostUsersSigninDataUserFeatures](../models/postuserssignindatauserfeatures.md)[] | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | | -| `active` | *boolean* | :heavy_minus_sign: | If the account's Plex Pass subscription is active | true | -| `subscribedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Date the account subscribed to Plex Pass | 2021-04-12T18:21:12Z | -| `status` | [models.PostUsersSigninDataUserResponseStatus](../models/postuserssignindatauserresponsestatus.md) | :heavy_minus_sign: | String representation of subscriptionActive | Inactive | -| `paymentService` | *string* | :heavy_minus_sign: | Payment service used for your Plex Pass subscription | | -| `plan` | *string* | :heavy_minus_sign: | Name of Plex Pass subscription plan | | \ No newline at end of file diff --git a/docs/models/postuserssignindatawatchedindicator.md b/docs/models/postuserssignindatawatchedindicator.md new file mode 100644 index 00000000..2950234a --- /dev/null +++ b/docs/models/postuserssignindatawatchedindicator.md @@ -0,0 +1,16 @@ +# PostUsersSignInDataWatchedIndicator + +## Example Usage + +```typescript +import { PostUsersSignInDataWatchedIndicator } from "@lukehagar/plexjs"; + +let value: PostUsersSignInDataWatchedIndicator = PostUsersSignInDataWatchedIndicator.One; +``` + +## Values + +| Name | Value | +| ------ | ------ | +| `Zero` | 0 | +| `One` | 1 | \ No newline at end of file diff --git a/docs/models/queryparamfilter.md b/docs/models/queryparamfilter.md new file mode 100644 index 00000000..8a0dad6c --- /dev/null +++ b/docs/models/queryparamfilter.md @@ -0,0 +1,18 @@ +# QueryParamFilter + +Filters content by field and direction/equality +(Unknown if viewedAt is the only supported column) + + +## Example Usage + +```typescript +import { QueryParamFilter } from "@lukehagar/plexjs"; + +let value: QueryParamFilter = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/queryparamforce.md b/docs/models/queryparamforce.md new file mode 100644 index 00000000..c3e17813 --- /dev/null +++ b/docs/models/queryparamforce.md @@ -0,0 +1,22 @@ +# QueryParamForce + +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. + + +## Example Usage + +```typescript +import { QueryParamForce } from "@lukehagar/plexjs"; + +let value: QueryParamForce = QueryParamForce.Zero; +``` + +## Values + +| Name | Value | +| ------ | ------ | +| `Zero` | 0 | +| `One` | 1 | \ No newline at end of file diff --git a/docs/models/queryparamsmart.md b/docs/models/queryparamsmart.md index dacbf57e..7f59c8d9 100644 --- a/docs/models/queryparamsmart.md +++ b/docs/models/queryparamsmart.md @@ -7,7 +7,7 @@ type of playlists to return (default is all). ```typescript import { QueryParamSmart } from "@lukehagar/plexjs"; -let value: QueryParamSmart = QueryParamSmart.Zero; +let value: QueryParamSmart = QueryParamSmart.One; ``` ## Values diff --git a/docs/models/queryparamtype.md b/docs/models/queryparamtype.md index 2ab8320d..9d3bce4b 100644 --- a/docs/models/queryparamtype.md +++ b/docs/models/queryparamtype.md @@ -1,19 +1,26 @@ # QueryParamType -type of playlist to create +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 { QueryParamType } from "@lukehagar/plexjs"; -let value: QueryParamType = QueryParamType.Audio; +let value: QueryParamType = QueryParamType.Two; ``` ## Values | Name | Value | | ------- | ------- | -| `Audio` | audio | -| `Video` | video | -| `Photo` | photo | \ No newline at end of file +| `One` | 1 | +| `Two` | 2 | +| `Three` | 3 | +| `Four` | 4 | \ No newline at end of file diff --git a/docs/models/refreshlibraryerrors.md b/docs/models/refreshlibraryerrors.md deleted file mode 100644 index f1b9f83e..00000000 --- a/docs/models/refreshlibraryerrors.md +++ /dev/null @@ -1,21 +0,0 @@ -# RefreshLibraryErrors - -## Example Usage - -```typescript -import { RefreshLibraryErrors } from "@lukehagar/plexjs"; - -let value: RefreshLibraryErrors = { - 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/models/refreshlibraryrequest.md b/docs/models/refreshlibraryrequest.md deleted file mode 100644 index 20750fa7..00000000 --- a/docs/models/refreshlibraryrequest.md +++ /dev/null @@ -1,17 +0,0 @@ -# RefreshLibraryRequest - -## Example Usage - -```typescript -import { RefreshLibraryRequest } from "@lukehagar/plexjs"; - -let value: RefreshLibraryRequest = { - sectionId: 187.89, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -| `sectionId` | *number* | :heavy_check_mark: | the Id of the library to refresh | \ No newline at end of file diff --git a/docs/models/release.md b/docs/models/release.md index ace1dcdf..739c7369 100644 --- a/docs/models/release.md +++ b/docs/models/release.md @@ -6,27 +6,30 @@ import { Release } from "@lukehagar/plexjs"; let value: Release = { - key: "https://plex.tv/updater/releases/5136", - version: "1.40.0.7775-456fbaf97", - added: "(PLEASE NOTE) This version makes changes to the database which will make it compatible only with server versions 1.31.2 or higher (released March 14). You will not be able to use your database on Plex Media Server versions lower than this after this update. Please also be patient when updating to this version if you have a very large database and allow the upgrade process to finish. -(Collections) Items added to a collection from the item context menu will now lock the collection field on the items (#12793) -(Music) Store track genres and add filtering options (#14653) -(Music) Support ID3v2.4 null-separated tags for genres and release type (#14653) -(View History) No longer create a view history entry for items marked as played (#10888) -(Web) Updated to 4.118.0", - fixed: "(Agents) Changing a 'Other Videos' type library to the modern movie agent would fail (#14483) -(Agents) It is possible that agents are not initialised during startup on rare occasions (#14654) -(Agents) Remove the legacy OpenSubtitles agent which is no longer supported upstream (#14667) -(Collection) Server could become unresponsive when collection membership changes (#14612) -(DVR) Previously watched recordings could be deleted without being watched again (#13779) -(Libraries) When performing fix match on items from certain music libraries the language would default to Arabic (#14501) -(Library) The Content Rating not equal to None filter does not work (#14620) -(Search) Album search results could contain all the album's tracks too (#14486) -(Subtitles) In some circumstances, sidecar subtitles can show up for media when they're no longer available (#14674) -(Transcoder) HW encoding would fail on devices with no rate control (#14222) -(Transcoder) Software transcoding on Ubuntu could cause unexpected behavior (#14605)", - downloadURL: "https://plex.tv/downloads/latest/5?channel=8&build=linux-x86_64&distro=redhat&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx", - state: "notify", + key: "https://plex.tv/updater/releases/5136", + version: "1.40.0.7775-456fbaf97", + added: + "(PLEASE NOTE) This version makes changes to the database which will make it compatible only with server versions 1.31.2 or higher (released March 14). You will not be able to use your database on Plex Media Server versions lower than this after this update. Please also be patient when updating to this version if you have a very large database and allow the upgrade process to finish.\n" + + "(Collections) Items added to a collection from the item context menu will now lock the collection field on the items (#12793)\n" + + "(Music) Store track genres and add filtering options (#14653)\n" + + "(Music) Support ID3v2.4 null-separated tags for genres and release type (#14653)\n" + + "(View History) No longer create a view history entry for items marked as played (#10888)\n" + + "(Web) Updated to 4.118.0", + fixed: + "(Agents) Changing a 'Other Videos' type library to the modern movie agent would fail (#14483)\n" + + "(Agents) It is possible that agents are not initialised during startup on rare occasions (#14654)\n" + + "(Agents) Remove the legacy OpenSubtitles agent which is no longer supported upstream (#14667)\n" + + "(Collection) Server could become unresponsive when collection membership changes (#14612)\n" + + "(DVR) Previously watched recordings could be deleted without being watched again (#13779)\n" + + "(Libraries) When performing fix match on items from certain music libraries the language would default to Arabic (#14501)\n" + + "(Library) The Content Rating not equal to None filter does not work (#14620)\n" + + "(Search) Album search results could contain all the album's tracks too (#14486)\n" + + "(Subtitles) In some circumstances, sidecar subtitles can show up for media when they're no longer available (#14674)\n" + + "(Transcoder) HW encoding would fail on devices with no rate control (#14222)\n" + + "(Transcoder) Software transcoding on Ubuntu could cause unexpected behavior (#14605)", + downloadURL: + "https://plex.tv/downloads/latest/5?channel=8&build=linux-x86_64&distro=redhat&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx", + state: "notify", }; ``` diff --git a/docs/models/searchlibraryerrors.md b/docs/models/searchlibraryerrors.md deleted file mode 100644 index d32c3c75..00000000 --- a/docs/models/searchlibraryerrors.md +++ /dev/null @@ -1,21 +0,0 @@ -# SearchLibraryErrors - -## Example Usage - -```typescript -import { SearchLibraryErrors } from "@lukehagar/plexjs"; - -let value: SearchLibraryErrors = { - 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/models/searchlibrarymediacontainer.md b/docs/models/searchlibrarymediacontainer.md deleted file mode 100644 index a65c8eaf..00000000 --- a/docs/models/searchlibrarymediacontainer.md +++ /dev/null @@ -1,65 +0,0 @@ -# SearchLibraryMediaContainer - -## Example Usage - -```typescript -import { SearchLibraryMediaContainer } from "@lukehagar/plexjs"; - -let value: SearchLibraryMediaContainer = { - size: 2, - allowSync: false, - art: "/:/resources/show-fanart.jpg", - identifier: "com.plexapp.plugins.library", - mediaTagPrefix: "/system/bundle/media/flags/", - mediaTagVersion: 1698860922, - nocache: true, - thumb: "/:/resources/show.png", - title1: "TV Shows", - title2: "Search for ''", - viewGroup: "season", - viewMode: 65593, - metadata: [ - { - ratingKey: "2", - key: "/library/metadata/2/children", - parentRatingKey: "1", - guid: "plex://season/602e67e766dfdb002c0a1b5b", - parentGuid: "plex://show/5d9c086c7d06d9001ffd27aa", - parentStudio: "Mutant Enemy Productions", - type: "season", - title: "Season 1", - parentKey: "/library/metadata/1", - parentTitle: "Firefly", - summary: - "Captain Malcolm 'Mal' Reynolds is a former galactic war veteran who is the captain of the transport ship \"Serenity\". Mal and his crew, ensign Zoe Alleyne Washburne; Zoe's husband, pilot Hoban 'Wash' Washburne; muscular mercenary Jayne Cobb; young mechanic Kaylee Frye; former Alliance medical officer Simon Tam; his disturbed teenage sister River (both on the run from the interplanetary government \"The Alliance\"); the beautiful courtesan Inara Serra; and preacher Shepherd Book do any jobs, legal or illegal, they can find as the Serenity crew travels across the outskirts of outer space.", - index: 1, - parentIndex: 1, - parentYear: 2002, - thumb: "/library/metadata/2/thumb/1705636920", - art: "/library/metadata/1/art/1705636920", - parentThumb: "/library/metadata/1/thumb/1705636920", - parentTheme: "/library/metadata/1/theme/1705636920", - addedAt: 1705636916, - updatedAt: 1705636920, - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `size` | *number* | :heavy_minus_sign: | N/A | 2 | -| `allowSync` | *boolean* | :heavy_minus_sign: | N/A | false | -| `art` | *string* | :heavy_minus_sign: | N/A | /:/resources/show-fanart.jpg | -| `identifier` | *string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | -| `mediaTagPrefix` | *string* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | -| `mediaTagVersion` | *number* | :heavy_minus_sign: | N/A | 1698860922 | -| `nocache` | *boolean* | :heavy_minus_sign: | N/A | true | -| `thumb` | *string* | :heavy_minus_sign: | N/A | /:/resources/show.png | -| `title1` | *string* | :heavy_minus_sign: | N/A | TV Shows | -| `title2` | *string* | :heavy_minus_sign: | N/A | Search for '' | -| `viewGroup` | *string* | :heavy_minus_sign: | N/A | season | -| `viewMode` | *number* | :heavy_minus_sign: | N/A | 65593 | -| `metadata` | [models.SearchLibraryMetadata](../models/searchlibrarymetadata.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/searchlibraryrequest.md b/docs/models/searchlibraryrequest.md deleted file mode 100644 index 3cfe4d73..00000000 --- a/docs/models/searchlibraryrequest.md +++ /dev/null @@ -1,19 +0,0 @@ -# SearchLibraryRequest - -## Example Usage - -```typescript -import { SearchLibraryRequest, Type } from "@lukehagar/plexjs"; - -let value: SearchLibraryRequest = { - sectionId: 149675, - type: Type.Three, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -| `sectionId` | *number* | :heavy_check_mark: | the Id of the library to query | -| `type` | [models.Type](../models/type.md) | :heavy_check_mark: | Plex content type to search for | \ No newline at end of file diff --git a/docs/models/skip.md b/docs/models/skip.md index 619b8a2c..27d543af 100644 --- a/docs/models/skip.md +++ b/docs/models/skip.md @@ -1,6 +1,6 @@ # Skip -Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. +Indicate that the latest version should be marked as skipped. The [Release] entry for this version will have the `state` set to `skipped`. ## Example Usage diff --git a/docs/models/smart.md b/docs/models/smart.md index 6918a510..b527acdd 100644 --- a/docs/models/smart.md +++ b/docs/models/smart.md @@ -7,7 +7,7 @@ whether the playlist is smart or not ```typescript import { Smart } from "@lukehagar/plexjs"; -let value: Smart = Smart.One; +let value: Smart = Smart.Zero; ``` ## Values diff --git a/docs/models/startalltasksresponse.md b/docs/models/startalltasksresponse.md index d1defcaa..06ac4741 100644 --- a/docs/models/startalltasksresponse.md +++ b/docs/models/startalltasksresponse.md @@ -7,7 +7,7 @@ import { StartAllTasksResponse } from "@lukehagar/plexjs"; let value: StartAllTasksResponse = { contentType: "", - statusCode: 812169, + statusCode: 528895, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/starttaskrequest.md b/docs/models/starttaskrequest.md index b8942bec..eafb2d83 100644 --- a/docs/models/starttaskrequest.md +++ b/docs/models/starttaskrequest.md @@ -6,7 +6,7 @@ import { StartTaskRequest, TaskName } from "@lukehagar/plexjs"; let value: StartTaskRequest = { - taskName: TaskName.GenerateChapterThumbs, + taskName: TaskName.DeepMediaAnalysis, }; ``` diff --git a/docs/models/starttaskresponse.md b/docs/models/starttaskresponse.md index f0ad6cd8..00e8f246 100644 --- a/docs/models/starttaskresponse.md +++ b/docs/models/starttaskresponse.md @@ -7,7 +7,7 @@ import { StartTaskResponse } from "@lukehagar/plexjs"; let value: StartTaskResponse = { contentType: "", - statusCode: 392785, + statusCode: 925597, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/startuniversaltranscoderesponse.md b/docs/models/startuniversaltranscoderesponse.md index b79c987e..f400f913 100644 --- a/docs/models/startuniversaltranscoderesponse.md +++ b/docs/models/startuniversaltranscoderesponse.md @@ -7,7 +7,7 @@ import { StartUniversalTranscodeResponse } from "@lukehagar/plexjs"; let value: StartUniversalTranscodeResponse = { contentType: "", - statusCode: 272656, + statusCode: 383441, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/statisticsbandwidth.md b/docs/models/statisticsbandwidth.md index 698e6514..f30cba81 100644 --- a/docs/models/statisticsbandwidth.md +++ b/docs/models/statisticsbandwidth.md @@ -7,6 +7,7 @@ import { StatisticsBandwidth } from "@lukehagar/plexjs"; let value: StatisticsBandwidth = { accountID: 238960586, + deviceID: 208, timespan: 6, at: 1718387650, lan: true, @@ -19,7 +20,7 @@ let value: StatisticsBandwidth = { | Field | Type | Required | Description | Example | | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | | `accountID` | *number* | :heavy_minus_sign: | N/A | 238960586 | -| `deviceID` | *number* | :heavy_minus_sign: | N/A | | +| `deviceID` | *number* | :heavy_minus_sign: | N/A | 208 | | `timespan` | *number* | :heavy_minus_sign: | N/A | 6 | | `at` | *number* | :heavy_minus_sign: | N/A | 1718387650 | | `lan` | *boolean* | :heavy_minus_sign: | N/A | true | diff --git a/docs/models/stopalltasksresponse.md b/docs/models/stopalltasksresponse.md index 41ac0c51..4ab9c502 100644 --- a/docs/models/stopalltasksresponse.md +++ b/docs/models/stopalltasksresponse.md @@ -7,7 +7,7 @@ import { StopAllTasksResponse } from "@lukehagar/plexjs"; let value: StopAllTasksResponse = { contentType: "", - statusCode: 528895, + statusCode: 479977, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/stoptaskrequest.md b/docs/models/stoptaskrequest.md index b618f4eb..72c57890 100644 --- a/docs/models/stoptaskrequest.md +++ b/docs/models/stoptaskrequest.md @@ -6,7 +6,7 @@ import { PathParamTaskName, StopTaskRequest } from "@lukehagar/plexjs"; let value: StopTaskRequest = { - taskName: PathParamTaskName.RefreshLocalMedia, + taskName: PathParamTaskName.BackupDatabase, }; ``` diff --git a/docs/models/stoptaskresponse.md b/docs/models/stoptaskresponse.md index 505a80b1..ae17a24b 100644 --- a/docs/models/stoptaskresponse.md +++ b/docs/models/stoptaskresponse.md @@ -7,7 +7,7 @@ import { StopTaskResponse } from "@lukehagar/plexjs"; let value: StopTaskResponse = { contentType: "", - statusCode: 71036, + statusCode: 337396, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/stoptranscodesessionresponse.md b/docs/models/stoptranscodesessionresponse.md index 915c4832..7d3a5d87 100644 --- a/docs/models/stoptranscodesessionresponse.md +++ b/docs/models/stoptranscodesessionresponse.md @@ -7,7 +7,7 @@ import { StopTranscodeSessionResponse } from "@lukehagar/plexjs"; let value: StopTranscodeSessionResponse = { contentType: "", - statusCode: 674752, + statusCode: 83112, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/subscription.md b/docs/models/subscription.md index 7db04e32..573bd4c8 100644 --- a/docs/models/subscription.md +++ b/docs/models/subscription.md @@ -5,22 +5,22 @@ If the account’s Plex Pass subscription is active ## Example Usage ```typescript -import { GetUserDetailsPlexStatus, Subscription } from "@lukehagar/plexjs"; +import { GetUserDetailsAuthenticationStatus, Subscription } from "@lukehagar/plexjs"; let value: Subscription = { active: true, - subscribedAt: new Date("2021-04-12T18:21:12Z"), - status: GetUserDetailsPlexStatus.Inactive, + subscribedAt: "2021-04-12T18:21:12Z", + status: GetUserDetailsAuthenticationStatus.Inactive, }; ``` ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `features` | [models.Features](../models/features.md)[] | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | | -| `active` | *boolean* | :heavy_minus_sign: | If the account's Plex Pass subscription is active | true | -| `subscribedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Date the account subscribed to Plex Pass | 2021-04-12T18:21:12Z | -| `status` | [models.GetUserDetailsPlexStatus](../models/getuserdetailsplexstatus.md) | :heavy_minus_sign: | String representation of subscriptionActive | Inactive | -| `paymentService` | *string* | :heavy_minus_sign: | Payment service used for your Plex Pass subscription | | -| `plan` | *string* | :heavy_minus_sign: | Name of Plex Pass subscription plan | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `features` | [models.Features](../models/features.md)[] | :heavy_minus_sign: | List of features allowed on your Plex Pass subscription | | +| `active` | *boolean* | :heavy_minus_sign: | If the account's Plex Pass subscription is active | true | +| `subscribedAt` | *string* | :heavy_minus_sign: | Date the account subscribed to Plex Pass | 2021-04-12T18:21:12Z | +| `status` | [models.GetUserDetailsAuthenticationStatus](../models/getuserdetailsauthenticationstatus.md) | :heavy_minus_sign: | String representation of subscriptionActive | Inactive | +| `paymentService` | *string* | :heavy_minus_sign: | Payment service used for your Plex Pass subscription | | +| `plan` | *string* | :heavy_minus_sign: | Name of Plex Pass subscription plan | | \ No newline at end of file diff --git a/docs/models/tag.md b/docs/models/tag.md index 538da788..e73e4f6e 100644 --- a/docs/models/tag.md +++ b/docs/models/tag.md @@ -7,7 +7,7 @@ A key representing a specific tag within the section. ```typescript import { Tag } from "@lukehagar/plexjs"; -let value: Tag = Tag.Genre; +let value: Tag = Tag.Unwatched; ``` ## Values diff --git a/docs/models/taskname.md b/docs/models/taskname.md index dcc0b3d8..275640df 100644 --- a/docs/models/taskname.md +++ b/docs/models/taskname.md @@ -7,7 +7,7 @@ the name of the task to be started. ```typescript import { TaskName } from "@lukehagar/plexjs"; -let value: TaskName = TaskName.GenerateAutoTags; +let value: TaskName = TaskName.GenerateChapterThumbs; ``` ## Values diff --git a/docs/models/type.md b/docs/models/type.md index ce068868..d32384ed 100644 --- a/docs/models/type.md +++ b/docs/models/type.md @@ -1,13 +1,19 @@ # Type -Plex content type to search for +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 { Type } from "@lukehagar/plexjs"; -let value: Type = Type.Three; +let value: Type = Type.Two; ``` ## Values diff --git a/docs/models/updateplaylistrequest.md b/docs/models/updateplaylistrequest.md index d2632fe3..f1a982b9 100644 --- a/docs/models/updateplaylistrequest.md +++ b/docs/models/updateplaylistrequest.md @@ -6,7 +6,7 @@ import { UpdatePlaylistRequest } from "@lukehagar/plexjs"; let value: UpdatePlaylistRequest = { - playlistID: 4386.01, + playlistID: 3172.02, }; ``` diff --git a/docs/models/updateplaylistresponse.md b/docs/models/updateplaylistresponse.md index 776a9311..d7d72149 100644 --- a/docs/models/updateplaylistresponse.md +++ b/docs/models/updateplaylistresponse.md @@ -7,7 +7,7 @@ import { UpdatePlaylistResponse } from "@lukehagar/plexjs"; let value: UpdatePlaylistResponse = { contentType: "", - statusCode: 634274, + statusCode: 138183, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/updateplayprogressresponse.md b/docs/models/updateplayprogressresponse.md index a54fb344..3ca2f217 100644 --- a/docs/models/updateplayprogressresponse.md +++ b/docs/models/updateplayprogressresponse.md @@ -7,7 +7,7 @@ import { UpdatePlayProgressResponse } from "@lukehagar/plexjs"; let value: UpdatePlayProgressResponse = { contentType: "", - statusCode: 56713, + statusCode: 963663, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/uploadplaylistrequest.md b/docs/models/uploadplaylistrequest.md index 6b816eda..ce6370de 100644 --- a/docs/models/uploadplaylistrequest.md +++ b/docs/models/uploadplaylistrequest.md @@ -3,11 +3,11 @@ ## Example Usage ```typescript -import { Force, UploadPlaylistRequest } from "@lukehagar/plexjs"; +import { QueryParamForce, UploadPlaylistRequest } from "@lukehagar/plexjs"; let value: UploadPlaylistRequest = { path: "/home/barkley/playlist.m3u", - force: Force.One, + force: QueryParamForce.Zero, }; ``` @@ -16,4 +16,4 @@ 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` | [models.Force](../models/force.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` | [models.QueryParamForce](../models/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 diff --git a/docs/models/uploadplaylistresponse.md b/docs/models/uploadplaylistresponse.md index a0e0d08d..706f66b6 100644 --- a/docs/models/uploadplaylistresponse.md +++ b/docs/models/uploadplaylistresponse.md @@ -7,7 +7,7 @@ import { UploadPlaylistResponse } from "@lukehagar/plexjs"; let value: UploadPlaylistResponse = { contentType: "", - statusCode: 581850, + statusCode: 622846, rawResponse: new Response('{"message": "hello world"}', { headers: { "Content-Type": "application/json" }, }), diff --git a/docs/models/gettopwatchedcontentuser.md b/docs/models/user.md similarity index 74% rename from docs/models/gettopwatchedcontentuser.md rename to docs/models/user.md index 74f9aeed..0ed5a974 100644 --- a/docs/models/gettopwatchedcontentuser.md +++ b/docs/models/user.md @@ -1,11 +1,11 @@ -# GetTopWatchedContentUser +# User ## Example Usage ```typescript -import { GetTopWatchedContentUser } from "@lukehagar/plexjs"; +import { User } from "@lukehagar/plexjs"; -let value: GetTopWatchedContentUser = { +let value: User = { id: 220, }; ``` diff --git a/docs/models/userprofile.md b/docs/models/userprofile.md index baefaa77..ef373c98 100644 --- a/docs/models/userprofile.md +++ b/docs/models/userprofile.md @@ -3,17 +3,24 @@ ## Example Usage ```typescript -import { UserProfile } from "@lukehagar/plexjs"; +import { + AutoSelectSubtitle, + DefaultSubtitleAccessibility, + DefaultSubtitleForced, + MediaReviewsVisibility, + UserProfile, + WatchedIndicator, +} from "@lukehagar/plexjs"; let value: UserProfile = { autoSelectAudio: true, defaultAudioLanguage: "ja", defaultSubtitleLanguage: "en", - autoSelectSubtitle: 1, - defaultSubtitleAccessibility: 1, - defaultSubtitleForced: 0, - watchedIndicator: 1, - mediaReviewsVisibility: 0, + autoSelectSubtitle: AutoSelectSubtitle.One, + defaultSubtitleAccessibility: DefaultSubtitleAccessibility.One, + defaultSubtitleForced: DefaultSubtitleForced.Zero, + watchedIndicator: WatchedIndicator.One, + mediaReviewsVisibility: MediaReviewsVisibility.One, }; ``` @@ -22,10 +29,10 @@ let value: UserProfile = { | 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_minus_sign: | The preferred audio language for the account | ja | -| `defaultSubtitleLanguage` | *string* | :heavy_minus_sign: | The preferred subtitle language for the account | en | -| `autoSelectSubtitle` | *number* | :heavy_minus_sign: | The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) | 1 | -| `defaultSubtitleAccessibility` | *number* | :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` | *number* | :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` | *number* | :heavy_minus_sign: | N/A | 1 | -| `mediaReviewsVisibility` | *number* | :heavy_minus_sign: | N/A | 0 | \ No newline at end of file +| `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` | [models.AutoSelectSubtitle](../models/autoselectsubtitle.md) | :heavy_minus_sign: | The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) | 1 | +| `defaultSubtitleAccessibility` | [models.DefaultSubtitleAccessibility](../models/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` | [models.DefaultSubtitleForced](../models/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` | [models.WatchedIndicator](../models/watchedindicator.md) | :heavy_minus_sign: | N/A | 1 | +| `mediaReviewsVisibility` | [models.MediaReviewsVisibility](../models/mediareviewsvisibility.md) | :heavy_minus_sign: | N/A | 0 | \ No newline at end of file diff --git a/docs/models/watchedindicator.md b/docs/models/watchedindicator.md new file mode 100644 index 00000000..5f552906 --- /dev/null +++ b/docs/models/watchedindicator.md @@ -0,0 +1,16 @@ +# WatchedIndicator + +## Example Usage + +```typescript +import { WatchedIndicator } from "@lukehagar/plexjs"; + +let value: WatchedIndicator = WatchedIndicator.One; +``` + +## Values + +| Name | Value | +| ------ | ------ | +| `Zero` | 0 | +| `One` | 1 | \ No newline at end of file diff --git a/docs/sdks/activities/README.md b/docs/sdks/activities/README.md index 8b7666ee..0c0ca556 100644 --- a/docs/sdks/activities/README.md +++ b/docs/sdks/activities/README.md @@ -28,12 +28,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.activities.getServerActivities(); - + // Handle the result console.log(result) } @@ -53,7 +53,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -103,12 +103,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.activities.cancelServerActivities("25b71ed5-0f9d-461c-baa7-d404e9e10d3e"); - + // Handle the result console.log(result) } @@ -128,7 +128,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { diff --git a/docs/sdks/authentication/README.md b/docs/sdks/authentication/README.md index c0166bc1..a5acf098 100644 --- a/docs/sdks/authentication/README.md +++ b/docs/sdks/authentication/README.md @@ -10,6 +10,8 @@ API Calls regarding authentication for Plex Media Server * [getTransientToken](#gettransienttoken) - Get a Transient Token. * [getSourceConnectionInformation](#getsourceconnectioninformation) - Get Source Connection Information +* [getUserDetails](#getuserdetails) - Get User Data By Token +* [postUsersSignInData](#postuserssignindata) - Get User SignIn Data ## getTransientToken @@ -23,12 +25,12 @@ import { GetTransientTokenQueryParamType, PlexAPI, Scope } from "@lukehagar/plex const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.authentication.getTransientToken(GetTransientTokenQueryParamType.Delegation, Scope.All); - + // Handle the result console.log(result) } @@ -49,7 +51,7 @@ import { authenticationGetTransientToken } from "@lukehagar/plexjs/funcs/authent // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -103,12 +105,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.authentication.getSourceConnectionInformation("server://client-identifier"); - + // Handle the result console.log(result) } @@ -128,11 +130,11 @@ import { authenticationGetSourceConnectionInformation } from "@lukehagar/plexjs/ // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const res = await authenticationGetSourceConnectionInformation(plexAPI, "provider://provider-identifier"); + const res = await authenticationGetSourceConnectionInformation(plexAPI, "server://client-identifier"); if (!res.ok) { throw res.error; @@ -166,3 +168,162 @@ run(); | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | | models.GetSourceConnectionInformationResponseBody | 401 | application/json | | models.SDKError | 4xx-5xx | */* | + + +## getUserDetails + +Get the User data from the provided X-Plex-Token + +### Example Usage + +```typescript +import { PlexAPI } from "@lukehagar/plexjs"; + +const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", +}); + +async function run() { + const result = await plexAPI.authentication.getUserDetails("CV5xoxjTpFKUzBTShsaf"); + + // 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 { authenticationGetUserDetails } from "@lukehagar/plexjs/funcs/authenticationGetUserDetails.js"; + +// 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", +}); + +async function run() { + const res = await authenticationGetUserDetails(plexAPI, "CV5xoxjTpFKUzBTShsaf"); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `xPlexToken` | *string* | :heavy_check_mark: | Plex Authentication Token | [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 | + +### Response + +**Promise\<[models.GetUserDetailsResponse](../../models/getuserdetailsresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| models.GetUserDetailsResponseBody | 401 | application/json | +| models.SDKError | 4xx-5xx | */* | + + +## postUsersSignInData + +Sign in user with username and password and return user data with Plex authentication token + +### Example Usage + +```typescript +import { PlexAPI } from "@lukehagar/plexjs"; + +const plexAPI = new PlexAPI({ + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", +}); + +async function run() { + const result = await plexAPI.authentication.postUsersSignInData("gcgzw5rz2xovp84b4vha3a40", { + login: "username@email.com", + password: "password123", + }); + + // 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 { authenticationPostUsersSignInData } from "@lukehagar/plexjs/funcs/authenticationPostUsersSignInData.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", +}); + +async function run() { + const res = await authenticationPostUsersSignInData(plexAPI, "gcgzw5rz2xovp84b4vha3a40", { + login: "username@email.com", + password: "password123", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +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` | [models.PostUsersSignInDataRequestBody](../../models/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 | + +### Response + +**Promise\<[models.PostUsersSignInDataResponse](../../models/postuserssignindataresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| models.PostUsersSignInDataResponseBody | 401 | application/json | +| models.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/butler/README.md b/docs/sdks/butler/README.md index d741dbcb..fff5d4b8 100644 --- a/docs/sdks/butler/README.md +++ b/docs/sdks/butler/README.md @@ -25,12 +25,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.butler.getButlerTasks(); - + // Handle the result console.log(result) } @@ -50,7 +50,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -105,12 +105,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.butler.startAllTasks(); - + // Handle the result console.log(result) } @@ -130,7 +130,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -181,12 +181,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.butler.stopAllTasks(); - + // Handle the result console.log(result) } @@ -206,7 +206,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -261,12 +261,12 @@ import { PlexAPI, TaskName } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.butler.startTask(TaskName.CleanOldBundles); - + // Handle the result console.log(result) } @@ -287,7 +287,7 @@ import { butlerStartTask } from "@lukehagar/plexjs/funcs/butlerStartTask.js"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -339,12 +339,12 @@ import { PathParamTaskName, PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.butler.stopTask(PathParamTaskName.BackupDatabase); - + // Handle the result console.log(result) } @@ -365,7 +365,7 @@ import { butlerStopTask } from "@lukehagar/plexjs/funcs/butlerStopTask.js"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { diff --git a/docs/sdks/hubs/README.md b/docs/sdks/hubs/README.md index 2e36c2cc..2fe9ad68 100644 --- a/docs/sdks/hubs/README.md +++ b/docs/sdks/hubs/README.md @@ -22,12 +22,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.hubs.getGlobalHubs(); - + // Handle the result console.log(result) } @@ -47,7 +47,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -100,12 +100,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.hubs.getLibraryHubs(6728.76); - + // Handle the result console.log(result) } @@ -125,7 +125,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { diff --git a/docs/sdks/library/README.md b/docs/sdks/library/README.md index 43dfd25b..a3469a08 100644 --- a/docs/sdks/library/README.md +++ b/docs/sdks/library/README.md @@ -10,13 +10,13 @@ API Calls interacting with Plex Media Server Libraries * [getFileHash](#getfilehash) - Get Hash Value * [getRecentlyAdded](#getrecentlyadded) - Get Recently Added -* [getLibraries](#getlibraries) - Get All Libraries -* [getLibrary](#getlibrary) - Get Library Details +* [getAllLibraries](#getalllibraries) - Get All Libraries +* [getLibraryDetails](#getlibrarydetails) - Get Library Details * [deleteLibrary](#deletelibrary) - Delete Library Section * [getLibraryItems](#getlibraryitems) - Get Library Items -* [refreshLibrary](#refreshlibrary) - Refresh Library -* [searchLibrary](#searchlibrary) - Search Library -* [getMetadata](#getmetadata) - Get Items Metadata +* [getRefreshLibraryMetadata](#getrefreshlibrarymetadata) - Refresh Metadata Of The Library +* [getSearchLibrary](#getsearchlibrary) - Search Library +* [getMetaDataByRatingKey](#getmetadatabyratingkey) - Get Metadata by RatingKey * [getMetadataChildren](#getmetadatachildren) - Get Items Children * [getTopWatchedContent](#gettopwatchedcontent) - Get Top Watched Content * [getOnDeck](#getondeck) - Get On Deck @@ -32,12 +32,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.library.getFileHash("file://C:\Image.png&type=13"); - + // Handle the result console.log(result) } @@ -57,7 +57,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -110,12 +110,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const result = await plexAPI.library.getRecentlyAdded(); - + const result = await plexAPI.library.getRecentlyAdded(0, 50); + // Handle the result console.log(result) } @@ -135,11 +135,11 @@ import { libraryGetRecentlyAdded } from "@lukehagar/plexjs/funcs/libraryGetRecen // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const res = await libraryGetRecentlyAdded(plexAPI); + const res = await libraryGetRecentlyAdded(plexAPI, 0, 50); if (!res.ok) { throw res.error; @@ -156,11 +156,13 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| 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. | | ### Response @@ -174,7 +176,7 @@ run(); | models.SDKError | 4xx-5xx | */* | -## getLibraries +## getAllLibraries A library section (commonly referred to as just a library) is a collection of media. Libraries are typed, and depending on their type provide either a flat or a hierarchical view of the media. @@ -191,12 +193,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const result = await plexAPI.library.getLibraries(); - + const result = await plexAPI.library.getAllLibraries(); + // Handle the result console.log(result) } @@ -210,17 +212,17 @@ The standalone function version of this method: ```typescript import { PlexAPICore } from "@lukehagar/plexjs/core.js"; -import { libraryGetLibraries } from "@lukehagar/plexjs/funcs/libraryGetLibraries.js"; +import { libraryGetAllLibraries } from "@lukehagar/plexjs/funcs/libraryGetAllLibraries.js"; // 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const res = await libraryGetLibraries(plexAPI); + const res = await libraryGetAllLibraries(plexAPI); if (!res.ok) { throw res.error; @@ -245,17 +247,17 @@ run(); ### Response -**Promise\<[models.GetLibrariesResponse](../../models/getlibrariesresponse.md)\>** +**Promise\<[models.GetAllLibrariesResponse](../../models/getalllibrariesresponse.md)\>** ### Errors -| Error Object | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| models.GetLibrariesLibraryResponseBody | 401 | application/json | -| models.SDKError | 4xx-5xx | */* | +| Error Object | Status Code | Content Type | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| models.GetAllLibrariesLibraryResponseBody | 401 | application/json | +| models.SDKError | 4xx-5xx | */* | -## getLibrary +## getLibraryDetails ## Library Details Endpoint @@ -305,12 +307,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const result = await plexAPI.library.getLibrary(1000); - + const result = await plexAPI.library.getLibraryDetails(9518); + // Handle the result console.log(result) } @@ -324,17 +326,17 @@ The standalone function version of this method: ```typescript import { PlexAPICore } from "@lukehagar/plexjs/core.js"; -import { libraryGetLibrary } from "@lukehagar/plexjs/funcs/libraryGetLibrary.js"; +import { libraryGetLibraryDetails } from "@lukehagar/plexjs/funcs/libraryGetLibraryDetails.js"; // 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const res = await libraryGetLibrary(plexAPI, 1000); + const res = await libraryGetLibraryDetails(plexAPI, 9518); if (!res.ok) { throw res.error; @@ -353,7 +355,7 @@ run(); | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `sectionId` | *number* | :heavy_check_mark: | the Id of the library to query | [object Object] | +| `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] | | `includeDetails` | [models.IncludeDetails](../../models/includedetails.md) | :heavy_minus_sign: | Whether or not to include details for a section (types, filters, and sorts).
Only exists for backwards compatibility, media providers other than the server libraries have it on always.
| | | `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. | | @@ -361,19 +363,19 @@ run(); ### Response -**Promise\<[models.GetLibraryResponse](../../models/getlibraryresponse.md)\>** +**Promise\<[models.GetLibraryDetailsResponse](../../models/getlibrarydetailsresponse.md)\>** ### Errors -| Error Object | Status Code | Content Type | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | -| models.GetLibraryLibraryResponseBody | 401 | application/json | -| models.SDKError | 4xx-5xx | */* | +| Error Object | Status Code | Content Type | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| models.GetLibraryDetailsLibraryResponseBody | 401 | application/json | +| models.SDKError | 4xx-5xx | */* | ## deleteLibrary -Delate a library using a specific section +Delete a library using a specific section id ### Example Usage @@ -382,12 +384,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const result = await plexAPI.library.deleteLibrary(1000); - + const result = await plexAPI.library.deleteLibrary(9518); + // Handle the result console.log(result) } @@ -407,11 +409,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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const res = await libraryDeleteLibrary(plexAPI, 1000); + const res = await libraryDeleteLibrary(plexAPI, 9518); if (!res.ok) { throw res.error; @@ -430,7 +432,7 @@ run(); | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `sectionId` | *number* | :heavy_check_mark: | the Id of the library to query | [object Object] | +| `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] | | `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. | | @@ -474,16 +476,24 @@ Fetches details from a specific section of the library identified by a section k ### Example Usage ```typescript -import { PlexAPI, Tag } from "@lukehagar/plexjs"; +import { IncludeGuids, IncludeMeta, PlexAPI, Tag, Type } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const result = await plexAPI.library.getLibraryItems("", Tag.Genre, 1); - + const result = await plexAPI.library.getLibraryItems({ + sectionKey: 9518, + tag: Tag.Edition, + includeGuids: IncludeGuids.One, + includeMeta: IncludeMeta.One, + type: Type.Two, + xPlexContainerStart: 0, + xPlexContainerSize: 50, + }); + // Handle the result console.log(result) } @@ -496,7 +506,7 @@ run(); The standalone function version of this method: ```typescript -import { Tag } from "@lukehagar/plexjs"; +import { IncludeGuids, IncludeMeta, Tag, Type } from "@lukehagar/plexjs"; import { PlexAPICore } from "@lukehagar/plexjs/core.js"; import { libraryGetLibraryItems } from "@lukehagar/plexjs/funcs/libraryGetLibraryItems.js"; @@ -504,90 +514,19 @@ import { libraryGetLibraryItems } from "@lukehagar/plexjs/funcs/libraryGetLibrar // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const res = await libraryGetLibraryItems(plexAPI, "", Tag.FirstCharacter, 1); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result) -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `sectionId` | *any* | :heavy_check_mark: | the Id of the library to query | | -| `tag` | [models.Tag](../../models/tag.md) | :heavy_check_mark: | A key representing a specific tag within the section. | | -| `includeGuids` | *number* | :heavy_minus_sign: | Adds the Guids object to the response
| [object Object] | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | | - -### Response - -**Promise\<[models.GetLibraryItemsResponse](../../models/getlibraryitemsresponse.md)\>** - -### Errors - -| Error Object | Status Code | Content Type | -| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| models.GetLibraryItemsLibraryResponseBody | 401 | application/json | -| models.SDKError | 4xx-5xx | */* | - - -## refreshLibrary - -This endpoint Refreshes the library. - - -### Example Usage - -```typescript -import { PlexAPI } from "@lukehagar/plexjs"; - -const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", -}); - -async function run() { - const result = await plexAPI.library.refreshLibrary(934.16); - - // Handle the result - console.log(result) -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { PlexAPICore } from "@lukehagar/plexjs/core.js"; -import { libraryRefreshLibrary } from "@lukehagar/plexjs/funcs/libraryRefreshLibrary.js"; - -// 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: "Postman", -}); - -async function run() { - const res = await libraryRefreshLibrary(plexAPI, 3179.56); + const res = await libraryGetLibraryItems(plexAPI, { + sectionKey: 9518, + tag: Tag.Actor, + includeGuids: IncludeGuids.One, + includeMeta: IncludeMeta.One, + type: Type.Two, + xPlexContainerStart: 0, + xPlexContainerSize: 50, + }); if (!res.ok) { throw res.error; @@ -606,24 +545,103 @@ run(); | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `sectionId` | *number* | :heavy_check_mark: | the Id of the library to refresh | +| `request` | [models.GetLibraryItemsRequest](../../models/getlibraryitemsrequest.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\<[models.RefreshLibraryResponse](../../models/refreshlibraryresponse.md)\>** +**Promise\<[models.GetLibraryItemsResponse](../../models/getlibraryitemsresponse.md)\>** ### Errors -| Error Object | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| models.RefreshLibraryResponseBody | 401 | application/json | -| models.SDKError | 4xx-5xx | */* | +| Error Object | Status Code | Content Type | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| models.GetLibraryItemsLibraryResponseBody | 401 | application/json | +| models.SDKError | 4xx-5xx | */* | -## searchLibrary +## getRefreshLibraryMetadata + +This endpoint Refreshes all the Metadata of the library. + + +### Example Usage + +```typescript +import { Force, PlexAPI } from "@lukehagar/plexjs"; + +const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", +}); + +async function run() { + const result = await plexAPI.library.getRefreshLibraryMetadata(9518, Force.One); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { Force } from "@lukehagar/plexjs"; +import { PlexAPICore } from "@lukehagar/plexjs/core.js"; +import { libraryGetRefreshLibraryMetadata } from "@lukehagar/plexjs/funcs/libraryGetRefreshLibraryMetadata.js"; + +// 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", +}); + +async function run() { + const res = await libraryGetRefreshLibraryMetadata(plexAPI, 9518, Force.One); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| 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] | +| `force` | [models.Force](../../models/force.md) | :heavy_minus_sign: | Force the refresh even if the library is already being refreshed. | [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. | | + +### Response + +**Promise\<[models.GetRefreshLibraryMetadataResponse](../../models/getrefreshlibrarymetadataresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| models.GetRefreshLibraryMetadataResponseBody | 401 | application/json | +| models.SDKError | 4xx-5xx | */* | + + +## getSearchLibrary Search for content within a specific section of the library. @@ -648,16 +666,16 @@ Each type in the library comes with a set of filters and sorts, aiding in buildi ### Example Usage ```typescript -import { PlexAPI, Type } from "@lukehagar/plexjs"; +import { PlexAPI, QueryParamType } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const result = await plexAPI.library.searchLibrary(933505, Type.Four); - + const result = await plexAPI.library.getSearchLibrary(9518, QueryParamType.Two); + // Handle the result console.log(result) } @@ -670,19 +688,19 @@ run(); The standalone function version of this method: ```typescript -import { Type } from "@lukehagar/plexjs"; +import { QueryParamType } from "@lukehagar/plexjs"; import { PlexAPICore } from "@lukehagar/plexjs/core.js"; -import { librarySearchLibrary } from "@lukehagar/plexjs/funcs/librarySearchLibrary.js"; +import { libraryGetSearchLibrary } from "@lukehagar/plexjs/funcs/libraryGetSearchLibrary.js"; // 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const res = await librarySearchLibrary(plexAPI, 457197, Type.Four); + const res = await libraryGetSearchLibrary(plexAPI, 9518, QueryParamType.Two); if (!res.ok) { throw res.error; @@ -699,27 +717,27 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `sectionId` | *number* | :heavy_check_mark: | the Id of the library to query | -| `type` | [models.Type](../../models/type.md) | :heavy_check_mark: | Plex content type to search for | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| 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` | [models.QueryParamType](../../models/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] | +| `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\<[models.SearchLibraryResponse](../../models/searchlibraryresponse.md)\>** +**Promise\<[models.GetSearchLibraryResponse](../../models/getsearchlibraryresponse.md)\>** ### Errors -| Error Object | Status Code | Content Type | -| --------------------------------------- | --------------------------------------- | --------------------------------------- | -| models.SearchLibraryLibraryResponseBody | 401 | application/json | -| models.SDKError | 4xx-5xx | */* | +| Error Object | Status Code | Content Type | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| models.GetSearchLibraryLibraryResponseBody | 401 | application/json | +| models.SDKError | 4xx-5xx | */* | -## getMetadata +## getMetaDataByRatingKey This endpoint will return the metadata of a library item specified with the ratingKey. @@ -731,12 +749,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const result = await plexAPI.library.getMetadata(17); - + const result = await plexAPI.library.getMetaDataByRatingKey(9518); + // Handle the result console.log(result) } @@ -750,17 +768,17 @@ The standalone function version of this method: ```typescript import { PlexAPICore } from "@lukehagar/plexjs/core.js"; -import { libraryGetMetadata } from "@lukehagar/plexjs/funcs/libraryGetMetadata.js"; +import { libraryGetMetaDataByRatingKey } from "@lukehagar/plexjs/funcs/libraryGetMetaDataByRatingKey.js"; // 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const res = await libraryGetMetadata(plexAPI, 17); + const res = await libraryGetMetaDataByRatingKey(plexAPI, 9518); if (!res.ok) { throw res.error; @@ -777,23 +795,23 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `ratingKey` | *number* | :heavy_check_mark: | the id of the library item to return the children of. | -| `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 | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ratingKey` | *number* | :heavy_check_mark: | the id of the library item to return the children of. | [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. | | ### Response -**Promise\<[models.GetMetadataResponse](../../models/getmetadataresponse.md)\>** +**Promise\<[models.GetMetaDataByRatingKeyResponse](../../models/getmetadatabyratingkeyresponse.md)\>** ### Errors -| Error Object | Status Code | Content Type | -| ------------------------------------- | ------------------------------------- | ------------------------------------- | -| models.GetMetadataLibraryResponseBody | 401 | application/json | -| models.SDKError | 4xx-5xx | */* | +| Error Object | Status Code | Content Type | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| models.GetMetaDataByRatingKeyLibraryResponseBody | 401 | application/json | +| models.SDKError | 4xx-5xx | */* | ## getMetadataChildren @@ -808,12 +826,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.library.getMetadataChildren(1539.14, "Stream"); - + // Handle the result console.log(result) } @@ -833,7 +851,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -882,16 +900,16 @@ This endpoint will return the top watched content from libraries of a certain ty ### Example Usage ```typescript -import { PlexAPI } from "@lukehagar/plexjs"; +import { GetTopWatchedContentQueryParamType, PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const result = await plexAPI.library.getTopWatchedContent(1, 1); - + const result = await plexAPI.library.getTopWatchedContent(GetTopWatchedContentQueryParamType.Two, 1); + // Handle the result console.log(result) } @@ -904,6 +922,7 @@ run(); The standalone function version of this method: ```typescript +import { GetTopWatchedContentQueryParamType } from "@lukehagar/plexjs"; import { PlexAPICore } from "@lukehagar/plexjs/core.js"; import { libraryGetTopWatchedContent } from "@lukehagar/plexjs/funcs/libraryGetTopWatchedContent.js"; @@ -911,11 +930,11 @@ import { libraryGetTopWatchedContent } from "@lukehagar/plexjs/funcs/libraryGetT // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const res = await libraryGetTopWatchedContent(plexAPI, 1, 1); + const res = await libraryGetTopWatchedContent(plexAPI, GetTopWatchedContentQueryParamType.Two, 1); if (!res.ok) { throw res.error; @@ -932,13 +951,13 @@ run(); ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `type` | *number* | :heavy_check_mark: | the library type (1 - movies, 2 - shows, 3 - music) | | -| `includeGuids` | *number* | :heavy_minus_sign: | Adds the Guids object to the response
| [object Object] | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [models.GetTopWatchedContentQueryParamType](../../models/gettopwatchedcontentqueryparamtype.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] | +| `includeGuids` | *number* | :heavy_minus_sign: | Adds the Guids object to the response
| [object Object] | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | | ### Response @@ -946,9 +965,10 @@ run(); ### Errors -| Error Object | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| models.SDKError | 4xx-5xx | */* | +| Error Object | Status Code | Content Type | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| models.GetTopWatchedContentLibraryResponseBody | 401 | application/json | +| models.SDKError | 4xx-5xx | */* | ## getOnDeck @@ -963,12 +983,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.library.getOnDeck(); - + // Handle the result console.log(result) } @@ -988,7 +1008,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { diff --git a/docs/sdks/log/README.md b/docs/sdks/log/README.md index 0cfecde8..b8f394d8 100644 --- a/docs/sdks/log/README.md +++ b/docs/sdks/log/README.md @@ -24,12 +24,12 @@ import { Level, PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.log.logLine(Level.Three, "Test log message", "Postman"); - + // Handle the result console.log(result) } @@ -50,7 +50,7 @@ import { logLogLine } from "@lukehagar/plexjs/funcs/logLogLine.js"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -124,14 +124,14 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const result = await plexAPI.log.logMultiLine("level=4&message=Test%20message%201&source=postman - level=3&message=Test%20message%202&source=postman - level=1&message=Test%20message%203&source=postman"); - + 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) } @@ -151,13 +151,13 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const res = await logLogMultiLine(plexAPI, "level=4&message=Test%20message%201&source=postman - level=3&message=Test%20message%202&source=postman - level=1&message=Test%20message%203&source=postman"); + const res = await logLogMultiLine(plexAPI, "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"); if (!res.ok) { throw res.error; @@ -205,12 +205,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.log.enablePaperTrail(); - + // Handle the result console.log(result) } @@ -230,7 +230,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { diff --git a/docs/sdks/media/README.md b/docs/sdks/media/README.md index b007d82d..a565f679 100644 --- a/docs/sdks/media/README.md +++ b/docs/sdks/media/README.md @@ -11,6 +11,8 @@ API Calls interacting with Plex Media Server Media * [markPlayed](#markplayed) - Mark Media Played * [markUnplayed](#markunplayed) - Mark Media Unplayed * [updatePlayProgress](#updateplayprogress) - Update Media Play Progress +* [getBannerImage](#getbannerimage) - Get Banner Image +* [getThumbImage](#getthumbimage) - Get Thumb Image ## markPlayed @@ -23,12 +25,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.media.markPlayed(59398); - + // Handle the result console.log(result) } @@ -48,7 +50,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -99,12 +101,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.media.markUnplayed(59398); - + // Handle the result console.log(result) } @@ -124,7 +126,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -176,12 +178,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const result = await plexAPI.media.updatePlayProgress("", 90000, "played"); - + const result = await plexAPI.media.updatePlayProgress("", 90000, "played"); + // Handle the result console.log(result) } @@ -201,11 +203,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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const res = await mediaUpdatePlayProgress(plexAPI, "", 90000, "played"); + const res = await mediaUpdatePlayProgress(plexAPI, "", 90000, "played"); if (!res.ok) { throw res.error; @@ -241,3 +243,183 @@ run(); | ------------------------------------- | ------------------------------------- | ------------------------------------- | | models.UpdatePlayProgressResponseBody | 401 | application/json | | models.SDKError | 4xx-5xx | */* | + + +## getBannerImage + +Gets the banner image of the media item + +### Example Usage + +```typescript +import { PlexAPI } from "@lukehagar/plexjs"; + +const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", +}); + +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(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { PlexAPICore } from "@lukehagar/plexjs/core.js"; +import { mediaGetBannerImage } from "@lukehagar/plexjs/funcs/mediaGetBannerImage.js"; + +// 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", +}); + +async function run() { + const res = await mediaGetBannerImage(plexAPI, { + ratingKey: 9518, + width: 396, + height: 396, + minSize: 1, + upscale: 1, + xPlexToken: "CV5xoxjTpFKUzBTShsaf", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [models.GetBannerImageRequest](../../models/getbannerimagerequest.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\<[models.GetBannerImageResponse](../../models/getbannerimageresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| models.GetBannerImageResponseBody | 401 | application/json | +| models.SDKError | 4xx-5xx | */* | + + +## getThumbImage + +Gets the thumbnail image of the media item + +### Example Usage + +```typescript +import { PlexAPI } from "@lukehagar/plexjs"; + +const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", +}); + +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(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { PlexAPICore } from "@lukehagar/plexjs/core.js"; +import { mediaGetThumbImage } from "@lukehagar/plexjs/funcs/mediaGetThumbImage.js"; + +// 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", +}); + +async function run() { + const res = await mediaGetThumbImage(plexAPI, { + ratingKey: 9518, + width: 396, + height: 396, + minSize: 1, + upscale: 1, + xPlexToken: "CV5xoxjTpFKUzBTShsaf", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [models.GetThumbImageRequest](../../models/getthumbimagerequest.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\<[models.GetThumbImageResponse](../../models/getthumbimageresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| -------------------------------- | -------------------------------- | -------------------------------- | +| models.GetThumbImageResponseBody | 401 | application/json | +| models.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/playlists/README.md b/docs/sdks/playlists/README.md index 157efcef..d98b6aa5 100644 --- a/docs/sdks/playlists/README.md +++ b/docs/sdks/playlists/README.md @@ -31,21 +31,21 @@ Create a new playlist. By default the playlist is blank. To create a playlist al ### Example Usage ```typescript -import { PlexAPI, QueryParamType, Smart } from "@lukehagar/plexjs"; +import { CreatePlaylistQueryParamType, PlexAPI, Smart } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.playlists.createPlaylist({ title: "", - type: QueryParamType.Photo, + type: CreatePlaylistQueryParamType.Photo, smart: Smart.One, uri: "https://inborn-brochure.biz", }); - + // Handle the result console.log(result) } @@ -58,7 +58,7 @@ run(); The standalone function version of this method: ```typescript -import { QueryParamType, Smart } from "@lukehagar/plexjs"; +import { CreatePlaylistQueryParamType, Smart } from "@lukehagar/plexjs"; import { PlexAPICore } from "@lukehagar/plexjs/core.js"; import { playlistsCreatePlaylist } from "@lukehagar/plexjs/funcs/playlistsCreatePlaylist.js"; @@ -66,13 +66,13 @@ import { playlistsCreatePlaylist } from "@lukehagar/plexjs/funcs/playlistsCreate // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const res = await playlistsCreatePlaylist(plexAPI, { title: "", - type: QueryParamType.Video, + type: CreatePlaylistQueryParamType.Video, smart: Smart.Zero, uri: "http://doting-hake.biz", }); @@ -122,12 +122,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.playlists.getPlaylists(); - + // Handle the result console.log(result) } @@ -147,7 +147,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -201,12 +201,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.playlists.getPlaylist(4109.48); - + // Handle the result console.log(result) } @@ -226,7 +226,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -278,12 +278,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.playlists.deletePlaylist(216.22); - + // Handle the result console.log(result) } @@ -303,7 +303,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -355,12 +355,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.playlists.updatePlaylist(3915); - + // Handle the result console.log(result) } @@ -380,7 +380,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -433,16 +433,16 @@ Note that for dumb playlists, items have a `playlistItemID` attribute which is u ### Example Usage ```typescript -import { PlexAPI } from "@lukehagar/plexjs"; +import { GetPlaylistContentsQueryParamType, PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const result = await plexAPI.playlists.getPlaylistContents(5004.46, 9403.59); - + const result = await plexAPI.playlists.getPlaylistContents(5004.46, GetPlaylistContentsQueryParamType.Two); + // Handle the result console.log(result) } @@ -455,6 +455,7 @@ run(); The standalone function version of this method: ```typescript +import { GetPlaylistContentsQueryParamType } from "@lukehagar/plexjs"; import { PlexAPICore } from "@lukehagar/plexjs/core.js"; import { playlistsGetPlaylistContents } from "@lukehagar/plexjs/funcs/playlistsGetPlaylistContents.js"; @@ -462,11 +463,11 @@ import { playlistsGetPlaylistContents } from "@lukehagar/plexjs/funcs/playlistsG // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const res = await playlistsGetPlaylistContents(plexAPI, 6161.99, 9457); + const res = await playlistsGetPlaylistContents(plexAPI, 2778.32, GetPlaylistContentsQueryParamType.Two); if (!res.ok) { throw res.error; @@ -483,13 +484,13 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `playlistID` | *number* | :heavy_check_mark: | the ID of the playlist | -| `type` | *number* | :heavy_check_mark: | the metadata type of the item to return | -| `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 | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `playlistID` | *number* | :heavy_check_mark: | the ID of the playlist | | +| `type` | [models.GetPlaylistContentsQueryParamType](../../models/getplaylistcontentsqueryparamtype.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. | | ### Response @@ -515,12 +516,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.playlists.clearPlaylistContents(1893.18); - + // Handle the result console.log(result) } @@ -540,7 +541,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -593,12 +594,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); 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) } @@ -618,7 +619,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -668,16 +669,16 @@ Imports m3u playlists by passing a path on the server to scan for m3u-formatted ### Example Usage ```typescript -import { Force, PlexAPI } from "@lukehagar/plexjs"; +import { PlexAPI, QueryParamForce } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const result = await plexAPI.playlists.uploadPlaylist("/home/barkley/playlist.m3u", Force.Zero); - + const result = await plexAPI.playlists.uploadPlaylist("/home/barkley/playlist.m3u", QueryParamForce.Zero); + // Handle the result console.log(result) } @@ -690,7 +691,7 @@ run(); The standalone function version of this method: ```typescript -import { Force } from "@lukehagar/plexjs"; +import { QueryParamForce } from "@lukehagar/plexjs"; import { PlexAPICore } from "@lukehagar/plexjs/core.js"; import { playlistsUploadPlaylist } from "@lukehagar/plexjs/funcs/playlistsUploadPlaylist.js"; @@ -698,11 +699,11 @@ import { playlistsUploadPlaylist } from "@lukehagar/plexjs/funcs/playlistsUpload // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const res = await playlistsUploadPlaylist(plexAPI, "/home/barkley/playlist.m3u", Force.Zero); + const res = await playlistsUploadPlaylist(plexAPI, "/home/barkley/playlist.m3u", QueryParamForce.Zero); if (!res.ok) { throw res.error; @@ -722,7 +723,7 @@ run(); | Parameter | 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.
| [object Object] | -| `force` | [models.Force](../../models/force.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.
| | +| `force` | [models.QueryParamForce](../../models/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.
| | | `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. | | diff --git a/docs/sdks/plex/README.md b/docs/sdks/plex/README.md index 3c4ed476..cb5032d6 100644 --- a/docs/sdks/plex/README.md +++ b/docs/sdks/plex/README.md @@ -12,10 +12,9 @@ API Calls that perform operations directly against https://Plex.tv * [getUserFriends](#getuserfriends) - Get list of friends of the user logged in * [getGeoData](#getgeodata) - Get Geo Data * [getHomeData](#gethomedata) - Get Plex Home Data -* [getResources](#getresources) - Get Resources +* [getServerResources](#getserverresources) - Get Server Resources * [getPin](#getpin) - Get a Pin * [getTokenByPinId](#gettokenbypinid) - Get Access Token by PinId -* [getUserDetails](#getuserdetails) - Get UserData By Token ## getCompanionsData @@ -28,12 +27,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.plex.getCompanionsData(); - + // Handle the result console.log(result) } @@ -53,7 +52,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -104,12 +103,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.plex.getUserFriends(); - + // Handle the result console.log(result) } @@ -129,7 +128,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -179,12 +178,12 @@ Returns the geolocation and locale data of the caller import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.plex.getGeoData(); - + // Handle the result console.log(result) } @@ -203,7 +202,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -254,12 +253,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.plex.getHomeData(); - + // Handle the result console.log(result) } @@ -279,7 +278,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -318,22 +317,28 @@ run(); | models.SDKError | 4xx-5xx | */* | -## getResources +## getServerResources -Get Resources +Get Plex server access tokens and server connections ### Example Usage ```typescript -import { PlexAPI } from "@lukehagar/plexjs"; +import { IncludeHttps, IncludeIPv6, IncludeRelay, PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "Postman", + accessToken: "", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const result = await plexAPI.plex.getResources("Postman"); - + const result = await plexAPI.plex.getServerResources({ + xPlexToken: "CV5xoxjTpFKUzBTShsaf", + includeHttps: IncludeHttps.One, + includeRelay: IncludeRelay.One, + includeIPv6: IncludeIPv6.One, + }); + // Handle the result console.log(result) } @@ -346,17 +351,24 @@ run(); The standalone function version of this method: ```typescript +import { IncludeHttps, IncludeIPv6, IncludeRelay } from "@lukehagar/plexjs"; import { PlexAPICore } from "@lukehagar/plexjs/core.js"; -import { plexGetResources } from "@lukehagar/plexjs/funcs/plexGetResources.js"; +import { plexGetServerResources } from "@lukehagar/plexjs/funcs/plexGetServerResources.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: "Postman", + accessToken: "", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const res = await plexGetResources(plexAPI, "Postman"); + const res = await plexGetServerResources(plexAPI, { + xPlexToken: "CV5xoxjTpFKUzBTShsaf", + includeHttps: IncludeHttps.One, + includeRelay: IncludeRelay.One, + includeIPv6: IncludeIPv6.One, + }); if (!res.ok) { throw res.error; @@ -373,27 +385,24 @@ 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] | -| `includeHttps` | [models.IncludeHttps](../../models/includehttps.md) | :heavy_minus_sign: | Include Https entries in the results | | -| `includeRelay` | [models.IncludeRelay](../../models/includerelay.md) | :heavy_minus_sign: | Include Relay addresses in the results | | -| `includeIPv6` | [models.IncludeIPv6](../../models/includeipv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | | -| `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` | [models.GetServerResourcesRequest](../../models/getserverresourcesrequest.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 -**Promise\<[models.GetResourcesResponse](../../models/getresourcesresponse.md)\>** +**Promise\<[models.GetServerResourcesResponse](../../models/getserverresourcesresponse.md)\>** ### Errors -| Error Object | Status Code | Content Type | -| ------------------------------- | ------------------------------- | ------------------------------- | -| models.GetResourcesResponseBody | 401 | application/json | -| models.SDKError | 4xx-5xx | */* | +| Error Object | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models.GetServerResourcesResponseBody | 401 | application/json | +| models.SDKError | 4xx-5xx | */* | ## getPin @@ -406,12 +415,12 @@ Retrieve a Pin from Plex.tv for authentication flows import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const result = await plexAPI.plex.getPin("Postman", "Postman"); - + const result = await plexAPI.plex.getPin("gcgzw5rz2xovp84b4vha3a40", "Plex Web"); + // Handle the result console.log(result) } @@ -430,11 +439,11 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const res = await plexGetPin(plexAPI, "Postman", "Postman"); + const res = await plexGetPin(plexAPI, "gcgzw5rz2xovp84b4vha3a40", "Plex Web"); if (!res.ok) { throw res.error; @@ -453,9 +462,9 @@ run(); | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `xPlexProduct` | *string* | :heavy_check_mark: | Product name of the application shown in the list of devices
| [object Object] | | `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. | | @@ -483,12 +492,12 @@ Retrieve an Access Token from Plex.tv after the Pin has been authenticated import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const result = await plexAPI.plex.getTokenByPinId(408895, "Postman"); - + const result = await plexAPI.plex.getTokenByPinId(408895, "gcgzw5rz2xovp84b4vha3a40"); + // Handle the result console.log(result) } @@ -507,11 +516,11 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const res = await plexGetTokenByPinId(plexAPI, 537318, "Postman"); + const res = await plexGetTokenByPinId(plexAPI, 537318, "gcgzw5rz2xovp84b4vha3a40"); if (!res.ok) { throw res.error; @@ -543,83 +552,8 @@ run(); ### Errors -| Error Object | Status Code | Content Type | -| ---------------------------------- | ---------------------------------- | ---------------------------------- | -| models.GetTokenByPinIdResponseBody | 404 | application/json | -| models.SDKError | 4xx-5xx | */* | - - -## getUserDetails - -Get the User data from the provided X-Plex-Token - -### Example Usage - -```typescript -import { PlexAPI } from "@lukehagar/plexjs"; - -const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", -}); - -async function run() { - const result = await plexAPI.plex.getUserDetails(); - - // 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 { plexGetUserDetails } from "@lukehagar/plexjs/funcs/plexGetUserDetails.js"; - -// 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: "Postman", -}); - -async function run() { - const res = await plexGetUserDetails(plexAPI); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result) -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `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 - -**Promise\<[models.GetUserDetailsResponse](../../models/getuserdetailsresponse.md)\>** - -### Errors - -| Error Object | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| models.GetUserDetailsResponseBody | 401 | application/json | -| models.SDKError | 4xx-5xx | */* | +| Error Object | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| models.GetTokenByPinIdResponseBody | 400 | application/json | +| models.GetTokenByPinIdPlexResponseBody | 404 | application/json | +| models.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/plexapi/README.md b/docs/sdks/plexapi/README.md index 16ebfce5..2fd26ab8 100644 --- a/docs/sdks/plexapi/README.md +++ b/docs/sdks/plexapi/README.md @@ -2,4 +2,4 @@ ## Overview -Plex-API: An Open API Spec for interacting with Plex.tv \ No newline at end of file +Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server \ No newline at end of file diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md index b18491fe..5c907769 100644 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -35,12 +35,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const result = await plexAPI.search.performSearch("dylan", 5); - + const result = await plexAPI.search.performSearch("arnold", 5); + // Handle the result console.log(result) } @@ -60,7 +60,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -117,12 +117,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.search.performVoiceSearch("dead+poop", 5); - + // Handle the result console.log(result) } @@ -142,7 +142,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -195,12 +195,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.search.getSearchResults("110"); - + // Handle the result console.log(result) } @@ -220,7 +220,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { diff --git a/docs/sdks/server/README.md b/docs/sdks/server/README.md index 84344243..612e396d 100644 --- a/docs/sdks/server/README.md +++ b/docs/sdks/server/README.md @@ -15,6 +15,7 @@ Operations against the Plex Media Server System. * [getServerIdentity](#getserveridentity) - Get Server Identity * [getMyPlexAccount](#getmyplexaccount) - Get MyPlex Account * [getResizedPhoto](#getresizedphoto) - Get a Resized Photo +* [getMediaProviders](#getmediaproviders) - Get Media Providers * [getServerList](#getserverlist) - Get Server List ## getServerCapabilities @@ -28,12 +29,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.server.getServerCapabilities(); - + // Handle the result console.log(result) } @@ -53,7 +54,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -103,12 +104,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.server.getServerPreferences(); - + // Handle the result console.log(result) } @@ -128,7 +129,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -178,12 +179,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.server.getAvailableClients(); - + // Handle the result console.log(result) } @@ -203,7 +204,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -253,12 +254,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.server.getDevices(); - + // Handle the result console.log(result) } @@ -278,7 +279,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -319,7 +320,7 @@ run(); ## getServerIdentity -Get Server Identity +This request is useful to determine if the server is online or offline ### Example Usage @@ -327,13 +328,12 @@ Get Server Identity import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.server.getServerIdentity(); - + // Handle the result console.log(result) } @@ -352,8 +352,7 @@ 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({ - accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -388,7 +387,7 @@ run(); | Error Object | Status Code | Content Type | | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| models.GetServerIdentityServerResponseBody | 401 | application/json | +| models.GetServerIdentityServerResponseBody | 408 | application/json | | models.SDKError | 4xx-5xx | */* | @@ -403,12 +402,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.server.getMyPlexAccount(); - + // Handle the result console.log(result) } @@ -428,7 +427,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -479,7 +478,7 @@ import { MinSize, PlexAPI, Upscale } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -492,7 +491,7 @@ async function run() { upscale: Upscale.Zero, url: "/library/metadata/49564/thumb/1654258204", }); - + // Handle the result console.log(result) } @@ -513,7 +512,7 @@ import { serverGetResizedPhoto } from "@lukehagar/plexjs/funcs/serverGetResizedP // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -561,6 +560,82 @@ run(); | models.SDKError | 4xx-5xx | */* | +## getMediaProviders + +Retrieves media providers and their features from the Plex server. + +### Example Usage + +```typescript +import { PlexAPI } from "@lukehagar/plexjs"; + +const plexAPI = new PlexAPI({ + accessToken: "", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", +}); + +async function run() { + const result = await plexAPI.server.getMediaProviders("CV5xoxjTpFKUzBTShsaf"); + + // 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 { serverGetMediaProviders } from "@lukehagar/plexjs/funcs/serverGetMediaProviders.js"; + +// 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", +}); + +async function run() { + const res = await serverGetMediaProviders(plexAPI, "CV5xoxjTpFKUzBTShsaf"); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `xPlexToken` | *string* | :heavy_check_mark: | Plex Authentication Token | [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. | | + +### Response + +**Promise\<[models.GetMediaProvidersResponse](../../models/getmediaprovidersresponse.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| models.GetMediaProvidersServerResponseBody | 401 | application/json | +| models.SDKError | 4xx-5xx | */* | + + ## getServerList Get Server List @@ -572,12 +647,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.server.getServerList(); - + // Handle the result console.log(result) } @@ -597,7 +672,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { diff --git a/docs/sdks/sessions/README.md b/docs/sdks/sessions/README.md index baf7336a..30859cab 100644 --- a/docs/sdks/sessions/README.md +++ b/docs/sdks/sessions/README.md @@ -24,12 +24,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.sessions.getSessions(); - + // Handle the result console.log(result) } @@ -49,7 +49,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -99,12 +99,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.sessions.getSessionHistory("viewedAt:desc", 1, {}, 12); - + // Handle the result console.log(result) } @@ -124,7 +124,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -149,7 +149,7 @@ run(); | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `sort` | *string* | :heavy_minus_sign: | Sorts the results by the specified field followed by the direction (asc, desc)
| | | `accountId` | *number* | :heavy_minus_sign: | Filter results by those that are related to a specific users id
| [object Object] | -| `filter` | [models.Filter](../../models/filter.md) | :heavy_minus_sign: | Filters content by field and direction/equality
(Unknown if viewedAt is the only supported column)
| [object Object] | +| `filter` | [models.QueryParamFilter](../../models/queryparamfilter.md) | :heavy_minus_sign: | Filters content by field and direction/equality
(Unknown if viewedAt is the only supported column)
| [object Object] | | `librarySectionID` | *number* | :heavy_minus_sign: | Filters the results based on the id of a valid library section
| [object Object] | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | @@ -178,12 +178,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.sessions.getTranscodeSessions(); - + // Handle the result console.log(result) } @@ -203,7 +203,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -253,12 +253,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.sessions.stopTranscodeSession("zz7llzqlx8w9vnrsbnwhbmep"); - + // Handle the result console.log(result) } @@ -278,7 +278,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { diff --git a/docs/sdks/statistics/README.md b/docs/sdks/statistics/README.md index 7320a556..db3eac5b 100644 --- a/docs/sdks/statistics/README.md +++ b/docs/sdks/statistics/README.md @@ -23,12 +23,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.statistics.getStatistics(4); - + // Handle the result console.log(result) } @@ -48,7 +48,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -99,12 +99,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.statistics.getResourcesStatistics(4); - + // Handle the result console.log(result) } @@ -124,7 +124,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -175,12 +175,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.statistics.getBandwidthStatistics(4); - + // Handle the result console.log(result) } @@ -200,7 +200,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { diff --git a/docs/sdks/updater/README.md b/docs/sdks/updater/README.md index 08c10654..c47e34c4 100644 --- a/docs/sdks/updater/README.md +++ b/docs/sdks/updater/README.md @@ -24,12 +24,12 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.updater.getUpdateStatus(); - + // Handle the result console.log(result) } @@ -49,7 +49,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -99,12 +99,12 @@ import { Download, PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.updater.checkForUpdates(Download.One); - + // Handle the result console.log(result) } @@ -125,7 +125,7 @@ import { updaterCheckForUpdates } from "@lukehagar/plexjs/funcs/updaterCheckForU // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -177,12 +177,12 @@ import { PlexAPI, Skip, Tonight } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { const result = await plexAPI.updater.applyUpdates(Tonight.One, Skip.One); - + // Handle the result console.log(result) } @@ -203,7 +203,7 @@ import { updaterApplyUpdates } from "@lukehagar/plexjs/funcs/updaterApplyUpdates // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -227,7 +227,7 @@ run(); | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `tonight` | [models.Tonight](../../models/tonight.md) | :heavy_minus_sign: | Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install | [object Object] | -| `skip` | [models.Skip](../../models/skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. | [object Object] | +| `skip` | [models.Skip](../../models/skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The [Release] entry for this version will have the `state` set to `skipped`. | [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. | | diff --git a/docs/sdks/user/README.md b/docs/sdks/user/README.md deleted file mode 100644 index abd4d08f..00000000 --- a/docs/sdks/user/README.md +++ /dev/null @@ -1,92 +0,0 @@ -# User -(*user*) - -## Overview - -API Calls that perform operations with Plex Media Server Users - - -### Available Operations - -* [postUsersSigninData](#postuserssignindata) - Get User SignIn Data - -## postUsersSigninData - -Sign in user with username and password and return user data with Plex authentication token - -### Example Usage - -```typescript -import { PlexAPI } from "@lukehagar/plexjs"; - -const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "Postman", -}); - -async function run() { - const result = await plexAPI.user.postUsersSigninData("Postman", { - login: "username@email.com", - password: "password123", - }); - - // 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 { userPostUsersSigninData } from "@lukehagar/plexjs/funcs/userPostUsersSigninData.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: "Postman", -}); - -async function run() { - const res = await userPostUsersSigninData(plexAPI, "Postman", { - login: "username@email.com", - password: "password123", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result) -} - -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` | [models.PostUsersSigninDataRequestBody](../../models/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 | - -### Response - -**Promise\<[models.PostUsersSigninDataResponse](../../models/postuserssignindataresponse.md)\>** - -### Errors - -| Error Object | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| models.PostUsersSigninDataResponseBody | 401 | application/json | -| models.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/video/README.md b/docs/sdks/video/README.md index 98b56581..be7c6a3e 100644 --- a/docs/sdks/video/README.md +++ b/docs/sdks/video/README.md @@ -22,7 +22,7 @@ import { PlexAPI, State } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -38,7 +38,7 @@ async function run() { playBackTime: 2000, row: 1, }); - + // Handle the result console.log(result) } @@ -59,7 +59,7 @@ import { videoGetTimeline } from "@lukehagar/plexjs/funcs/videoGetTimeline.js"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -121,7 +121,7 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { @@ -143,7 +143,7 @@ async function run() { addDebugOverlay: 0, autoAdjustQuality: 0, }); - + // Handle the result console.log(result) } @@ -163,7 +163,7 @@ 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { diff --git a/docs/sdks/watchlist/README.md b/docs/sdks/watchlist/README.md index 738337c5..3e79db21 100644 --- a/docs/sdks/watchlist/README.md +++ b/docs/sdks/watchlist/README.md @@ -8,28 +8,30 @@ API Calls that perform operations with Plex Media Server Watchlists ### Available Operations -* [getWatchlist](#getwatchlist) - Get User Watchlist +* [getWatchList](#getwatchlist) - Get User Watchlist -## getWatchlist +## getWatchList Get User Watchlist ### Example Usage ```typescript -import { PathParamFilter, PlexAPI } from "@lukehagar/plexjs"; +import { Filter, PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - xPlexClientIdentifier: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const result = await plexAPI.watchlist.getWatchlist({ - filter: PathParamFilter.Released, - xPlexToken: "", + const result = await plexAPI.watchlist.getWatchList({ + filter: Filter.Available, + xPlexContainerStart: 0, + xPlexContainerSize: 50, + xPlexToken: "CV5xoxjTpFKUzBTShsaf", }); - + // Handle the result console.log(result) } @@ -42,21 +44,23 @@ run(); The standalone function version of this method: ```typescript -import { PathParamFilter } from "@lukehagar/plexjs"; +import { Filter } from "@lukehagar/plexjs"; import { PlexAPICore } from "@lukehagar/plexjs/core.js"; -import { watchlistGetWatchlist } from "@lukehagar/plexjs/funcs/watchlistGetWatchlist.js"; +import { watchlistGetWatchList } from "@lukehagar/plexjs/funcs/watchlistGetWatchList.js"; // 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: "Postman", + xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40", }); async function run() { - const res = await watchlistGetWatchlist(plexAPI, { - filter: PathParamFilter.All, - xPlexToken: "", + const res = await watchlistGetWatchList(plexAPI, { + filter: Filter.Released, + xPlexContainerStart: 0, + xPlexContainerSize: 50, + xPlexToken: "CV5xoxjTpFKUzBTShsaf", }); if (!res.ok) { @@ -76,7 +80,7 @@ run(); | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [models.GetWatchlistRequest](../../models/getwatchlistrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `request` | [models.GetWatchListRequest](../../models/getwatchlistrequest.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. | @@ -84,11 +88,11 @@ run(); ### Response -**Promise\<[models.GetWatchlistResponse](../../models/getwatchlistresponse.md)\>** +**Promise\<[models.GetWatchListResponse](../../models/getwatchlistresponse.md)\>** ### Errors | Error Object | Status Code | Content Type | | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | -| models.GetWatchlistWatchlistResponseBody | 401 | application/json | +| models.GetWatchListWatchlistResponseBody | 401 | application/json | | models.SDKError | 4xx-5xx | */* | diff --git a/jsr.json b/jsr.json index d73d83f0..e0b9a73b 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@lukehagar/plexjs", - "version": "0.19.0", + "version": "0.20.0", "exports": { ".": "./src/index.ts", "./models": "./src/models/index.ts", diff --git a/package-lock.json b/package-lock.json index 690a98a1..9205faad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,14 @@ { "name": "@lukehagar/plexjs", - "version": "0.19.0", + "version": "0.20.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@lukehagar/plexjs", - "version": "0.19.0", + "version": "0.20.0", "devDependencies": { + "@types/node": "^18.19.3", "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", "eslint": "^8.57.0", @@ -209,6 +210,16 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "node_modules/@types/node": { + "version": "18.19.50", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.50.tgz", + "integrity": "sha512-xonK+NRrMBRtkL1hVCc3G+uXtjh1Al4opBLjqVmipe5ZAaBYWW6cNAiBVZ1BvmkBhep698rP3UM3aRAdSALuhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~5.26.4" + } + }, "node_modules/@types/semver": { "version": "7.5.8", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", @@ -2940,6 +2951,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true, + "license": "MIT" + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -3181,6 +3199,15 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "@types/node": { + "version": "18.19.50", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.50.tgz", + "integrity": "sha512-xonK+NRrMBRtkL1hVCc3G+uXtjh1Al4opBLjqVmipe5ZAaBYWW6cNAiBVZ1BvmkBhep698rP3UM3aRAdSALuhg==", + "dev": true, + "requires": { + "undici-types": "~5.26.4" + } + }, "@types/semver": { "version": "7.5.8", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", @@ -5114,6 +5141,12 @@ "which-boxed-primitive": "^1.0.2" } }, + "undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", diff --git a/package.json b/package.json index 3b32c73a..1a50e582 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lukehagar/plexjs", - "version": "0.19.0", + "version": "0.20.0", "author": "LukeHagar", "main": "./index.js", "sideEffects": false, @@ -18,6 +18,7 @@ "zod": ">= 3" }, "devDependencies": { + "@types/node": "^18.19.3", "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", "eslint": "^8.57.0", diff --git a/src/funcs/plexGetUserDetails.ts b/src/funcs/authenticationGetUserDetails.ts similarity index 82% rename from src/funcs/plexGetUserDetails.ts rename to src/funcs/authenticationGetUserDetails.ts index 60974f13..bd5860d9 100644 --- a/src/funcs/plexGetUserDetails.ts +++ b/src/funcs/authenticationGetUserDetails.ts @@ -3,7 +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 { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -21,13 +23,14 @@ import { SDKValidationError } from "../models/sdkvalidationerror.js"; import { Result } from "../types/fp.js"; /** - * Get UserData By Token + * Get User Data By Token * * @remarks * Get the User data from the provided X-Plex-Token */ -export async function plexGetUserDetails( +export async function authenticationGetUserDetails( client$: PlexAPICore, + xPlexToken: string, options?: RequestOptions & { serverURL?: string } ): Promise< Result< @@ -42,12 +45,31 @@ export async function plexGetUserDetails( | ConnectionError > > { + const input$: models.GetUserDetailsRequest = { + xPlexToken: xPlexToken, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => models.GetUserDetailsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + const baseURL$ = options?.serverURL || pathToFunc(GetUserDetailsOpServerList[0], { charEncoding: "percent" })(); const path$ = pathToFunc("/user")(); + const query$ = encodeFormQuery$({ + "X-Plex-Token": payload$["X-Plex-Token"], + }); + const headers$ = new Headers({ Accept: "application/json", }); @@ -69,6 +91,8 @@ export async function plexGetUserDetails( baseURL: baseURL$, path: path$, headers: headers$, + query: query$, + body: body$, timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, }, options diff --git a/src/funcs/userPostUsersSigninData.ts b/src/funcs/authenticationPostUsersSignInData.ts similarity index 80% rename from src/funcs/userPostUsersSigninData.ts rename to src/funcs/authenticationPostUsersSignInData.ts index 88a97f49..7a090a8f 100644 --- a/src/funcs/userPostUsersSigninData.ts +++ b/src/funcs/authenticationPostUsersSignInData.ts @@ -5,7 +5,7 @@ import { PlexAPICore } from "../core.js"; import { encodeBodyForm as encodeBodyForm$, - encodeSimple as encodeSimple$, + encodeFormQuery as encodeFormQuery$, } from "../lib/encodings.js"; import * as m$ from "../lib/matchers.js"; import * as schemas$ from "../lib/schemas.js"; @@ -19,7 +19,7 @@ import { UnexpectedClientError, } from "../models/httpclienterrors.js"; import * as models from "../models/index.js"; -import { PostUsersSigninDataOpServerList } from "../models/postuserssignindataop.js"; +import { PostUsersSignInDataOpServerList } from "../models/postuserssignindataop.js"; import { SDKError } from "../models/sdkerror.js"; import { SDKValidationError } from "../models/sdkvalidationerror.js"; import { Result } from "../types/fp.js"; @@ -30,15 +30,15 @@ import { Result } from "../types/fp.js"; * @remarks * Sign in user with username and password and return user data with Plex authentication token */ -export async function userPostUsersSigninData( +export async function authenticationPostUsersSignInData( client$: PlexAPICore, xPlexClientIdentifier?: string | undefined, - requestBody?: models.PostUsersSigninDataRequestBody | undefined, + requestBody?: models.PostUsersSignInDataRequestBody | undefined, options?: RequestOptions & { serverURL?: string } ): Promise< Result< - models.PostUsersSigninDataResponse, - | models.PostUsersSigninDataResponseBody + models.PostUsersSignInDataResponse, + | models.PostUsersSignInDataResponseBody | SDKError | SDKValidationError | UnexpectedClientError @@ -48,14 +48,14 @@ export async function userPostUsersSigninData( | ConnectionError > > { - const input$: models.PostUsersSigninDataRequest = { + const input$: models.PostUsersSignInDataRequest = { xPlexClientIdentifier: xPlexClientIdentifier, requestBody: requestBody, }; const parsed$ = schemas$.safeParse( input$, - (value$) => models.PostUsersSigninDataRequest$outboundSchema.parse(value$), + (value$) => models.PostUsersSignInDataRequest$outboundSchema.parse(value$), "Input validation failed" ); if (!parsed$.ok) { @@ -70,22 +70,22 @@ export async function userPostUsersSigninData( const baseURL$ = options?.serverURL || - pathToFunc(PostUsersSigninDataOpServerList[0], { charEncoding: "percent" })(); + pathToFunc(PostUsersSignInDataOpServerList[0], { charEncoding: "percent" })(); const path$ = pathToFunc("/users/signin")(); + const query$ = encodeFormQuery$({ + "X-Plex-Client-Identifier": + payload$["X-Plex-Client-Identifier"] ?? client$.options$.xPlexClientIdentifier, + }); + const headers$ = new Headers({ "Content-Type": "application/x-www-form-urlencoded", Accept: "application/json", - "X-Plex-Client-Identifier": encodeSimple$( - "X-Plex-Client-Identifier", - payload$["X-Plex-Client-Identifier"] ?? client$.options$.xPlexClientIdentifier, - { explode: false, charEncoding: "none" } - ), }); const context = { - operationID: "post-users-signin-data", + operationID: "post-users-sign-in-data", oAuth2Scopes: [], securitySource: null, }; @@ -97,6 +97,7 @@ export async function userPostUsersSigninData( baseURL: baseURL$, path: path$, headers: headers$, + query: query$, body: body$, timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, }, @@ -126,8 +127,8 @@ export async function userPostUsersSigninData( }; const [result$] = await m$.match< - models.PostUsersSigninDataResponse, - | models.PostUsersSigninDataResponseBody + models.PostUsersSignInDataResponse, + | models.PostUsersSignInDataResponseBody | SDKError | SDKValidationError | UnexpectedClientError @@ -136,9 +137,9 @@ export async function userPostUsersSigninData( | RequestTimeoutError | ConnectionError >( - m$.json(201, models.PostUsersSigninDataResponse$inboundSchema, { key: "UserPlexAccount" }), + m$.json(201, models.PostUsersSignInDataResponse$inboundSchema, { key: "UserPlexAccount" }), m$.fail([400, "4XX", "5XX"]), - m$.jsonErr(401, models.PostUsersSigninDataResponseBody$inboundSchema) + m$.jsonErr(401, models.PostUsersSignInDataResponseBody$inboundSchema) )(response, { extraFields: responseFields$ }); if (!result$.ok) { return result$; diff --git a/src/funcs/libraryDeleteLibrary.ts b/src/funcs/libraryDeleteLibrary.ts index cfd0ea89..ddb88f27 100644 --- a/src/funcs/libraryDeleteLibrary.ts +++ b/src/funcs/libraryDeleteLibrary.ts @@ -25,11 +25,11 @@ import { Result } from "../types/fp.js"; * Delete Library Section * * @remarks - * Delate a library using a specific section + * Delete a library using a specific section id */ export async function libraryDeleteLibrary( client$: PlexAPICore, - sectionId: number, + sectionKey: number, options?: RequestOptions ): Promise< Result< @@ -45,7 +45,7 @@ export async function libraryDeleteLibrary( > > { const input$: models.DeleteLibraryRequest = { - sectionId: sectionId, + sectionKey: sectionKey, }; const parsed$ = schemas$.safeParse( @@ -60,13 +60,13 @@ export async function libraryDeleteLibrary( const body$ = null; const pathParams$ = { - sectionId: encodeSimple$("sectionId", payload$.sectionId, { + sectionKey: encodeSimple$("sectionKey", payload$.sectionKey, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/library/sections/{sectionId}")(pathParams$); + const path$ = pathToFunc("/library/sections/{sectionKey}")(pathParams$); const headers$ = new Headers({ Accept: "application/json", diff --git a/src/funcs/libraryGetLibraries.ts b/src/funcs/libraryGetAllLibraries.ts similarity index 88% rename from src/funcs/libraryGetLibraries.ts rename to src/funcs/libraryGetAllLibraries.ts index 8158125b..8312db32 100644 --- a/src/funcs/libraryGetLibraries.ts +++ b/src/funcs/libraryGetAllLibraries.ts @@ -31,13 +31,13 @@ import { Result } from "../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 libraryGetLibraries( +export async function libraryGetAllLibraries( client$: PlexAPICore, options?: RequestOptions ): Promise< Result< - models.GetLibrariesResponse, - | models.GetLibrariesLibraryResponseBody + models.GetAllLibrariesResponse, + | models.GetAllLibrariesLibraryResponseBody | SDKError | SDKValidationError | UnexpectedClientError @@ -56,7 +56,7 @@ export async function libraryGetLibraries( const accessToken$ = await extractSecurity(client$.options$.accessToken); const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; const context = { - operationID: "getLibraries", + operationID: "get-all-libraries", oAuth2Scopes: [], securitySource: client$.options$.accessToken, }; @@ -97,8 +97,8 @@ export async function libraryGetLibraries( }; const [result$] = await m$.match< - models.GetLibrariesResponse, - | models.GetLibrariesLibraryResponseBody + models.GetAllLibrariesResponse, + | models.GetAllLibrariesLibraryResponseBody | SDKError | SDKValidationError | UnexpectedClientError @@ -107,9 +107,9 @@ export async function libraryGetLibraries( | RequestTimeoutError | ConnectionError >( - m$.json(200, models.GetLibrariesResponse$inboundSchema, { key: "object" }), + m$.json(200, models.GetAllLibrariesResponse$inboundSchema, { key: "object" }), m$.fail([400, "4XX", "5XX"]), - m$.jsonErr(401, models.GetLibrariesLibraryResponseBody$inboundSchema) + m$.jsonErr(401, models.GetAllLibrariesLibraryResponseBody$inboundSchema) )(response, { extraFields: responseFields$ }); if (!result$.ok) { return result$; diff --git a/src/funcs/libraryGetLibrary.ts b/src/funcs/libraryGetLibraryDetails.ts similarity index 86% rename from src/funcs/libraryGetLibrary.ts rename to src/funcs/libraryGetLibraryDetails.ts index fdf261b0..6b2225c2 100644 --- a/src/funcs/libraryGetLibrary.ts +++ b/src/funcs/libraryGetLibraryDetails.ts @@ -69,15 +69,15 @@ import { Result } from "../types/fp.js"; * > **Note**: Filters and sorts are optional; without them, no filtering controls are rendered. * */ -export async function libraryGetLibrary( +export async function libraryGetLibraryDetails( client$: PlexAPICore, - sectionId: number, + sectionKey: number, includeDetails?: models.IncludeDetails | undefined, options?: RequestOptions ): Promise< Result< - models.GetLibraryResponse, - | models.GetLibraryLibraryResponseBody + models.GetLibraryDetailsResponse, + | models.GetLibraryDetailsLibraryResponseBody | SDKError | SDKValidationError | UnexpectedClientError @@ -87,14 +87,14 @@ export async function libraryGetLibrary( | ConnectionError > > { - const input$: models.GetLibraryRequest = { - sectionId: sectionId, + const input$: models.GetLibraryDetailsRequest = { + sectionKey: sectionKey, includeDetails: includeDetails, }; const parsed$ = schemas$.safeParse( input$, - (value$) => models.GetLibraryRequest$outboundSchema.parse(value$), + (value$) => models.GetLibraryDetailsRequest$outboundSchema.parse(value$), "Input validation failed" ); if (!parsed$.ok) { @@ -104,13 +104,13 @@ export async function libraryGetLibrary( const body$ = null; const pathParams$ = { - sectionId: encodeSimple$("sectionId", payload$.sectionId, { + sectionKey: encodeSimple$("sectionKey", payload$.sectionKey, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/library/sections/{sectionId}")(pathParams$); + const path$ = pathToFunc("/library/sections/{sectionKey}")(pathParams$); const query$ = encodeFormQuery$({ includeDetails: payload$.includeDetails, @@ -123,7 +123,7 @@ export async function libraryGetLibrary( const accessToken$ = await extractSecurity(client$.options$.accessToken); const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; const context = { - operationID: "getLibrary", + operationID: "get-library-details", oAuth2Scopes: [], securitySource: client$.options$.accessToken, }; @@ -166,8 +166,8 @@ export async function libraryGetLibrary( }; const [result$] = await m$.match< - models.GetLibraryResponse, - | models.GetLibraryLibraryResponseBody + models.GetLibraryDetailsResponse, + | models.GetLibraryDetailsLibraryResponseBody | SDKError | SDKValidationError | UnexpectedClientError @@ -176,9 +176,9 @@ export async function libraryGetLibrary( | RequestTimeoutError | ConnectionError >( - m$.json(200, models.GetLibraryResponse$inboundSchema, { key: "object" }), + m$.json(200, models.GetLibraryDetailsResponse$inboundSchema, { key: "object" }), m$.fail([400, "4XX", "5XX"]), - m$.jsonErr(401, models.GetLibraryLibraryResponseBody$inboundSchema) + m$.jsonErr(401, models.GetLibraryDetailsLibraryResponseBody$inboundSchema) )(response, { extraFields: responseFields$ }); if (!result$.ok) { return result$; diff --git a/src/funcs/libraryGetLibraryItems.ts b/src/funcs/libraryGetLibraryItems.ts index e4601625..7ba5eeef 100644 --- a/src/funcs/libraryGetLibraryItems.ts +++ b/src/funcs/libraryGetLibraryItems.ts @@ -52,9 +52,7 @@ import { Result } from "../types/fp.js"; */ export async function libraryGetLibraryItems( client$: PlexAPICore, - sectionId: any, - tag: models.Tag, - includeGuids?: number | undefined, + request: models.GetLibraryItemsRequest, options?: RequestOptions ): Promise< Result< @@ -69,11 +67,7 @@ export async function libraryGetLibraryItems( | ConnectionError > > { - const input$: models.GetLibraryItemsRequest = { - sectionId: sectionId, - tag: tag, - includeGuids: includeGuids, - }; + const input$ = request; const parsed$ = schemas$.safeParse( input$, @@ -87,17 +81,21 @@ export async function libraryGetLibraryItems( const body$ = null; const pathParams$ = { - sectionId: encodeSimple$("sectionId", payload$.sectionId, { + sectionKey: encodeSimple$("sectionKey", payload$.sectionKey, { explode: false, charEncoding: "percent", }), tag: encodeSimple$("tag", payload$.tag, { explode: false, charEncoding: "percent" }), }; - const path$ = pathToFunc("/library/sections/{sectionId}/{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 headers$ = new Headers({ @@ -107,7 +105,7 @@ export async function libraryGetLibraryItems( const accessToken$ = await extractSecurity(client$.options$.accessToken); const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; const context = { - operationID: "getLibraryItems", + operationID: "get-library-items", oAuth2Scopes: [], securitySource: client$.options$.accessToken, }; diff --git a/src/funcs/libraryGetMetadata.ts b/src/funcs/libraryGetMetaDataByRatingKey.ts similarity index 84% rename from src/funcs/libraryGetMetadata.ts rename to src/funcs/libraryGetMetaDataByRatingKey.ts index 5e03a646..93c509e6 100644 --- a/src/funcs/libraryGetMetadata.ts +++ b/src/funcs/libraryGetMetaDataByRatingKey.ts @@ -22,20 +22,20 @@ import { SDKValidationError } from "../models/sdkvalidationerror.js"; import { Result } from "../types/fp.js"; /** - * Get Items Metadata + * Get Metadata by RatingKey * * @remarks * This endpoint will return the metadata of a library item specified with the ratingKey. * */ -export async function libraryGetMetadata( +export async function libraryGetMetaDataByRatingKey( client$: PlexAPICore, ratingKey: number, options?: RequestOptions ): Promise< Result< - models.GetMetadataResponse, - | models.GetMetadataLibraryResponseBody + models.GetMetaDataByRatingKeyResponse, + | models.GetMetaDataByRatingKeyLibraryResponseBody | SDKError | SDKValidationError | UnexpectedClientError @@ -45,13 +45,13 @@ export async function libraryGetMetadata( | ConnectionError > > { - const input$: models.GetMetadataRequest = { + const input$: models.GetMetaDataByRatingKeyRequest = { ratingKey: ratingKey, }; const parsed$ = schemas$.safeParse( input$, - (value$) => models.GetMetadataRequest$outboundSchema.parse(value$), + (value$) => models.GetMetaDataByRatingKeyRequest$outboundSchema.parse(value$), "Input validation failed" ); if (!parsed$.ok) { @@ -76,7 +76,7 @@ export async function libraryGetMetadata( const accessToken$ = await extractSecurity(client$.options$.accessToken); const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; const context = { - operationID: "getMetadata", + operationID: "get-meta-data-by-rating-key", oAuth2Scopes: [], securitySource: client$.options$.accessToken, }; @@ -118,8 +118,8 @@ export async function libraryGetMetadata( }; const [result$] = await m$.match< - models.GetMetadataResponse, - | models.GetMetadataLibraryResponseBody + models.GetMetaDataByRatingKeyResponse, + | models.GetMetaDataByRatingKeyLibraryResponseBody | SDKError | SDKValidationError | UnexpectedClientError @@ -128,9 +128,9 @@ export async function libraryGetMetadata( | RequestTimeoutError | ConnectionError >( - m$.json(200, models.GetMetadataResponse$inboundSchema, { key: "object" }), + m$.json(200, models.GetMetaDataByRatingKeyResponse$inboundSchema, { key: "object" }), m$.fail([400, "4XX", "5XX"]), - m$.jsonErr(401, models.GetMetadataLibraryResponseBody$inboundSchema) + m$.jsonErr(401, models.GetMetaDataByRatingKeyLibraryResponseBody$inboundSchema) )(response, { extraFields: responseFields$ }); if (!result$.ok) { return result$; diff --git a/src/funcs/libraryGetRecentlyAdded.ts b/src/funcs/libraryGetRecentlyAdded.ts index ddf5aca8..141ad44b 100644 --- a/src/funcs/libraryGetRecentlyAdded.ts +++ b/src/funcs/libraryGetRecentlyAdded.ts @@ -3,7 +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 { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -28,6 +30,8 @@ import { Result } from "../types/fp.js"; */ export async function libraryGetRecentlyAdded( client$: PlexAPICore, + xPlexContainerStart?: number | undefined, + xPlexContainerSize?: number | undefined, options?: RequestOptions ): Promise< Result< @@ -42,8 +46,29 @@ export async function libraryGetRecentlyAdded( | ConnectionError > > { + const input$: models.GetRecentlyAddedRequest = { + xPlexContainerStart: xPlexContainerStart, + xPlexContainerSize: xPlexContainerSize, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => models.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", }); @@ -64,6 +89,8 @@ export async function libraryGetRecentlyAdded( method: "GET", path: path$, headers: headers$, + query: query$, + body: body$, timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, }, options diff --git a/src/funcs/libraryGetRefreshLibraryMetadata.ts b/src/funcs/libraryGetRefreshLibraryMetadata.ts new file mode 100644 index 00000000..0b723765 --- /dev/null +++ b/src/funcs/libraryGetRefreshLibraryMetadata.ts @@ -0,0 +1,150 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +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 { 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 "../models/httpclienterrors.js"; +import * as models from "../models/index.js"; +import { SDKError } from "../models/sdkerror.js"; +import { SDKValidationError } from "../models/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Refresh Metadata Of The Library + * + * @remarks + * This endpoint Refreshes all the Metadata of the library. + * + */ +export async function libraryGetRefreshLibraryMetadata( + client$: PlexAPICore, + sectionKey: number, + force?: models.Force | undefined, + options?: RequestOptions +): Promise< + Result< + models.GetRefreshLibraryMetadataResponse, + | models.GetRefreshLibraryMetadataResponseBody + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: models.GetRefreshLibraryMetadataRequest = { + sectionKey: sectionKey, + force: force, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => models.GetRefreshLibraryMetadataRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + sectionKey: encodeSimple$("sectionKey", payload$.sectionKey, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/library/sections/{sectionKey}/refresh")(pathParams$); + + const query$ = encodeFormQuery$({ + force: payload$.force, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const accessToken$ = await extractSecurity(client$.options$.accessToken); + const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const context = { + operationID: "get-refresh-library-metadata", + 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< + models.GetRefreshLibraryMetadataResponse, + | models.GetRefreshLibraryMetadataResponseBody + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.nil(200, models.GetRefreshLibraryMetadataResponse$inboundSchema), + m$.fail([400, "4XX", "5XX"]), + m$.jsonErr(401, models.GetRefreshLibraryMetadataResponseBody$inboundSchema) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/librarySearchLibrary.ts b/src/funcs/libraryGetSearchLibrary.ts similarity index 83% rename from src/funcs/librarySearchLibrary.ts rename to src/funcs/libraryGetSearchLibrary.ts index b1a8aff1..2b843147 100644 --- a/src/funcs/librarySearchLibrary.ts +++ b/src/funcs/libraryGetSearchLibrary.ts @@ -48,15 +48,15 @@ import { Result } from "../types/fp.js"; * > **Note**: Filters and sorts are optional; without them, no filtering controls are rendered. * */ -export async function librarySearchLibrary( +export async function libraryGetSearchLibrary( client$: PlexAPICore, - sectionId: number, - type: models.Type, + sectionKey: number, + type: models.QueryParamType, options?: RequestOptions ): Promise< Result< - models.SearchLibraryResponse, - | models.SearchLibraryLibraryResponseBody + models.GetSearchLibraryResponse, + | models.GetSearchLibraryLibraryResponseBody | SDKError | SDKValidationError | UnexpectedClientError @@ -66,14 +66,14 @@ export async function librarySearchLibrary( | ConnectionError > > { - const input$: models.SearchLibraryRequest = { - sectionId: sectionId, + const input$: models.GetSearchLibraryRequest = { + sectionKey: sectionKey, type: type, }; const parsed$ = schemas$.safeParse( input$, - (value$) => models.SearchLibraryRequest$outboundSchema.parse(value$), + (value$) => models.GetSearchLibraryRequest$outboundSchema.parse(value$), "Input validation failed" ); if (!parsed$.ok) { @@ -83,13 +83,13 @@ export async function librarySearchLibrary( const body$ = null; const pathParams$ = { - sectionId: encodeSimple$("sectionId", payload$.sectionId, { + sectionKey: encodeSimple$("sectionKey", payload$.sectionKey, { explode: false, charEncoding: "percent", }), }; - const path$ = pathToFunc("/library/sections/{sectionId}/search")(pathParams$); + const path$ = pathToFunc("/library/sections/{sectionKey}/search")(pathParams$); const query$ = encodeFormQuery$({ type: payload$.type, @@ -102,7 +102,7 @@ export async function librarySearchLibrary( const accessToken$ = await extractSecurity(client$.options$.accessToken); const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; const context = { - operationID: "searchLibrary", + operationID: "get-search-library", oAuth2Scopes: [], securitySource: client$.options$.accessToken, }; @@ -145,8 +145,8 @@ export async function librarySearchLibrary( }; const [result$] = await m$.match< - models.SearchLibraryResponse, - | models.SearchLibraryLibraryResponseBody + models.GetSearchLibraryResponse, + | models.GetSearchLibraryLibraryResponseBody | SDKError | SDKValidationError | UnexpectedClientError @@ -155,9 +155,9 @@ export async function librarySearchLibrary( | RequestTimeoutError | ConnectionError >( - m$.json(200, models.SearchLibraryResponse$inboundSchema, { key: "object" }), + m$.json(200, models.GetSearchLibraryResponse$inboundSchema, { key: "object" }), m$.fail([400, "4XX", "5XX"]), - m$.jsonErr(401, models.SearchLibraryLibraryResponseBody$inboundSchema) + m$.jsonErr(401, models.GetSearchLibraryLibraryResponseBody$inboundSchema) )(response, { extraFields: responseFields$ }); if (!result$.ok) { return result$; diff --git a/src/funcs/libraryGetTopWatchedContent.ts b/src/funcs/libraryGetTopWatchedContent.ts index 7ab1ae0c..e9c833e4 100644 --- a/src/funcs/libraryGetTopWatchedContent.ts +++ b/src/funcs/libraryGetTopWatchedContent.ts @@ -30,12 +30,13 @@ import { Result } from "../types/fp.js"; */ export async function libraryGetTopWatchedContent( client$: PlexAPICore, - type: number, + type: models.GetTopWatchedContentQueryParamType, includeGuids?: number | undefined, options?: RequestOptions ): Promise< Result< models.GetTopWatchedContentResponse, + | models.GetTopWatchedContentLibraryResponseBody | SDKError | SDKValidationError | UnexpectedClientError @@ -101,7 +102,7 @@ export async function libraryGetTopWatchedContent( const doResult = await client$.do$(request$, { context, - errorCodes: ["4XX", "5XX"], + errorCodes: ["400", "401", "4XX", "5XX"], retryConfig: options?.retries || client$.options$.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); @@ -119,6 +120,7 @@ export async function libraryGetTopWatchedContent( const [result$] = await m$.match< models.GetTopWatchedContentResponse, + | models.GetTopWatchedContentLibraryResponseBody | SDKError | SDKValidationError | UnexpectedClientError @@ -128,7 +130,8 @@ export async function libraryGetTopWatchedContent( | ConnectionError >( m$.json(200, models.GetTopWatchedContentResponse$inboundSchema, { key: "object" }), - m$.fail(["4XX", "5XX"]) + m$.fail([400, "4XX", "5XX"]), + m$.jsonErr(401, models.GetTopWatchedContentLibraryResponseBody$inboundSchema) )(response, { extraFields: responseFields$ }); if (!result$.ok) { return result$; diff --git a/src/funcs/mediaGetBannerImage.ts b/src/funcs/mediaGetBannerImage.ts new file mode 100644 index 00000000..f24f3825 --- /dev/null +++ b/src/funcs/mediaGetBannerImage.ts @@ -0,0 +1,153 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +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 { 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 "../models/httpclienterrors.js"; +import * as models from "../models/index.js"; +import { SDKError } from "../models/sdkerror.js"; +import { SDKValidationError } from "../models/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Get Banner Image + * + * @remarks + * Gets the banner image of the media item + */ +export async function mediaGetBannerImage( + client$: PlexAPICore, + request: models.GetBannerImageRequest, + options?: RequestOptions +): Promise< + Result< + models.GetBannerImageResponse, + | models.GetBannerImageResponseBody + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => models.GetBannerImageRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + ratingKey: encodeSimple$("ratingKey", payload$.ratingKey, { + explode: false, + charEncoding: "percent", + }), + }; + + 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 headers$ = new Headers({ + Accept: "image/jpeg", + }); + + const accessToken$ = await extractSecurity(client$.options$.accessToken); + const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const context = { + operationID: "get-banner-image", + 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< + models.GetBannerImageResponse, + | models.GetBannerImageResponseBody + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.stream(200, models.GetBannerImageResponse$inboundSchema, { + ctype: "image/jpeg", + hdrs: true, + key: "response-stream", + }), + m$.fail([400, "4XX", "5XX"]), + m$.jsonErr(401, models.GetBannerImageResponseBody$inboundSchema) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/mediaGetThumbImage.ts b/src/funcs/mediaGetThumbImage.ts new file mode 100644 index 00000000..08f7d241 --- /dev/null +++ b/src/funcs/mediaGetThumbImage.ts @@ -0,0 +1,153 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +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 { 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 "../models/httpclienterrors.js"; +import * as models from "../models/index.js"; +import { SDKError } from "../models/sdkerror.js"; +import { SDKValidationError } from "../models/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Get Thumb Image + * + * @remarks + * Gets the thumbnail image of the media item + */ +export async function mediaGetThumbImage( + client$: PlexAPICore, + request: models.GetThumbImageRequest, + options?: RequestOptions +): Promise< + Result< + models.GetThumbImageResponse, + | models.GetThumbImageResponseBody + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => models.GetThumbImageRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + ratingKey: encodeSimple$("ratingKey", payload$.ratingKey, { + explode: false, + charEncoding: "percent", + }), + }; + + 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 headers$ = new Headers({ + Accept: "image/jpeg", + }); + + const accessToken$ = await extractSecurity(client$.options$.accessToken); + const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const context = { + operationID: "get-thumb-image", + 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< + models.GetThumbImageResponse, + | models.GetThumbImageResponseBody + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.stream(200, models.GetThumbImageResponse$inboundSchema, { + ctype: "image/jpeg", + hdrs: true, + key: "response-stream", + }), + m$.fail([400, "4XX", "5XX"]), + m$.jsonErr(401, models.GetThumbImageResponseBody$inboundSchema) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/playlistsGetPlaylistContents.ts b/src/funcs/playlistsGetPlaylistContents.ts index 611a2528..c23588b9 100644 --- a/src/funcs/playlistsGetPlaylistContents.ts +++ b/src/funcs/playlistsGetPlaylistContents.ts @@ -37,7 +37,7 @@ import { Result } from "../types/fp.js"; export async function playlistsGetPlaylistContents( client$: PlexAPICore, playlistID: number, - type: number, + type: models.GetPlaylistContentsQueryParamType, options?: RequestOptions ): Promise< Result< diff --git a/src/funcs/playlistsUploadPlaylist.ts b/src/funcs/playlistsUploadPlaylist.ts index 79a1b1ad..38cbf455 100644 --- a/src/funcs/playlistsUploadPlaylist.ts +++ b/src/funcs/playlistsUploadPlaylist.ts @@ -31,7 +31,7 @@ import { Result } from "../types/fp.js"; export async function playlistsUploadPlaylist( client$: PlexAPICore, path: string, - force: models.Force, + force: models.QueryParamForce, options?: RequestOptions ): Promise< Result< diff --git a/src/funcs/plexGetPin.ts b/src/funcs/plexGetPin.ts index a0935e8c..57973f07 100644 --- a/src/funcs/plexGetPin.ts +++ b/src/funcs/plexGetPin.ts @@ -3,10 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.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"; @@ -32,9 +29,9 @@ import { Result } from "../types/fp.js"; */ export async function plexGetPin( client$: PlexAPICore, - xPlexProduct: string, strong?: boolean | undefined, xPlexClientIdentifier?: string | undefined, + xPlexProduct?: string | undefined, options?: RequestOptions & { serverURL?: string } ): Promise< Result< @@ -73,19 +70,13 @@ export async function plexGetPin( 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 headers$ = new Headers({ Accept: "application/json", - "X-Plex-Client-Identifier": encodeSimple$( - "X-Plex-Client-Identifier", - payload$["X-Plex-Client-Identifier"] ?? client$.options$.xPlexClientIdentifier, - { explode: false, charEncoding: "none" } - ), - "X-Plex-Product": encodeSimple$("X-Plex-Product", payload$["X-Plex-Product"], { - explode: false, - charEncoding: "none", - }), }); const context = { operationID: "getPin", oAuth2Scopes: [], securitySource: null }; diff --git a/src/funcs/plexGetResources.ts b/src/funcs/plexGetServerResources.ts similarity index 68% rename from src/funcs/plexGetResources.ts rename to src/funcs/plexGetServerResources.ts index e5b661cc..bf5f57c3 100644 --- a/src/funcs/plexGetResources.ts +++ b/src/funcs/plexGetServerResources.ts @@ -3,15 +3,13 @@ */ import { PlexAPICore } from "../core.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.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 { GetResourcesOpServerList } from "../models/getresourcesop.js"; +import { GetServerResourcesOpServerList } from "../models/getserverresourcesop.js"; import { ConnectionError, InvalidRequestError, @@ -25,22 +23,19 @@ import { SDKValidationError } from "../models/sdkvalidationerror.js"; import { Result } from "../types/fp.js"; /** - * Get Resources + * Get Server Resources * * @remarks - * Get Resources + * Get Plex server access tokens and server connections */ -export async function plexGetResources( +export async function plexGetServerResources( client$: PlexAPICore, - xPlexClientIdentifier?: string | undefined, - includeHttps?: models.IncludeHttps | undefined, - includeRelay?: models.IncludeRelay | undefined, - includeIPv6?: models.IncludeIPv6 | undefined, + request: models.GetServerResourcesRequest, options?: RequestOptions & { serverURL?: string } ): Promise< Result< - models.GetResourcesResponse, - | models.GetResourcesResponseBody + models.GetServerResourcesResponse, + | models.GetServerResourcesResponseBody | SDKError | SDKValidationError | UnexpectedClientError @@ -50,16 +45,11 @@ export async function plexGetResources( | ConnectionError > > { - const input$: models.GetResourcesRequest = { - xPlexClientIdentifier: xPlexClientIdentifier, - includeHttps: includeHttps, - includeRelay: includeRelay, - includeIPv6: includeIPv6, - }; + const input$ = request; const parsed$ = schemas$.safeParse( input$, - (value$) => models.GetResourcesRequest$outboundSchema.parse(value$), + (value$) => models.GetServerResourcesRequest$outboundSchema.parse(value$), "Input validation failed" ); if (!parsed$.ok) { @@ -70,7 +60,7 @@ export async function plexGetResources( const baseURL$ = options?.serverURL || - pathToFunc(GetResourcesOpServerList[0], { charEncoding: "percent" })(); + pathToFunc(GetServerResourcesOpServerList[0], { charEncoding: "percent" })(); const path$ = pathToFunc("/resources")(); @@ -78,22 +68,28 @@ export async function plexGetResources( includeHttps: payload$.includeHttps, includeIPv6: payload$.includeIPv6, includeRelay: payload$.includeRelay, + "X-Plex-Client-Identifier": + payload$["X-Plex-Client-Identifier"] ?? client$.options$.xPlexClientIdentifier, + "X-Plex-Token": payload$["X-Plex-Token"], }); const headers$ = new Headers({ Accept: "application/json", - "X-Plex-Client-Identifier": encodeSimple$( - "X-Plex-Client-Identifier", - payload$["X-Plex-Client-Identifier"] ?? client$.options$.xPlexClientIdentifier, - { explode: false, charEncoding: "none" } - ), }); - const context = { operationID: "getResources", oAuth2Scopes: [], securitySource: null }; + const accessToken$ = await extractSecurity(client$.options$.accessToken); + const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; + const context = { + operationID: "get-server-resources", + oAuth2Scopes: [], + securitySource: client$.options$.accessToken, + }; + const securitySettings$ = resolveGlobalSecurity(security$); const requestRes = client$.createRequest$( context, { + security: securitySettings$, method: "GET", baseURL: baseURL$, path: path$, @@ -128,8 +124,8 @@ export async function plexGetResources( }; const [result$] = await m$.match< - models.GetResourcesResponse, - | models.GetResourcesResponseBody + models.GetServerResourcesResponse, + | models.GetServerResourcesResponseBody | SDKError | SDKValidationError | UnexpectedClientError @@ -138,9 +134,9 @@ export async function plexGetResources( | RequestTimeoutError | ConnectionError >( - m$.json(200, models.GetResourcesResponse$inboundSchema, { key: "PlexDevices" }), + m$.json(200, models.GetServerResourcesResponse$inboundSchema, { key: "PlexDevices" }), m$.fail([400, "4XX", "5XX"]), - m$.jsonErr(401, models.GetResourcesResponseBody$inboundSchema) + m$.jsonErr(401, models.GetServerResourcesResponseBody$inboundSchema) )(response, { extraFields: responseFields$ }); if (!result$.ok) { return result$; diff --git a/src/funcs/plexGetTokenByPinId.ts b/src/funcs/plexGetTokenByPinId.ts index 7fad9d02..0ff10d7b 100644 --- a/src/funcs/plexGetTokenByPinId.ts +++ b/src/funcs/plexGetTokenByPinId.ts @@ -3,7 +3,10 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeSimple as encodeSimple$ } from "../lib/encodings.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 { RequestOptions } from "../lib/sdks.js"; @@ -36,6 +39,7 @@ export async function plexGetTokenByPinId( Result< models.GetTokenByPinIdResponse, | models.GetTokenByPinIdResponseBody + | models.GetTokenByPinIdPlexResponseBody | SDKError | SDKValidationError | UnexpectedClientError @@ -71,13 +75,13 @@ export async function plexGetTokenByPinId( const path$ = pathToFunc("/pins/{pinID}")(pathParams$); + const query$ = encodeFormQuery$({ + "X-Plex-Client-Identifier": + payload$["X-Plex-Client-Identifier"] ?? client$.options$.xPlexClientIdentifier, + }); + const headers$ = new Headers({ Accept: "application/json", - "X-Plex-Client-Identifier": encodeSimple$( - "X-Plex-Client-Identifier", - payload$["X-Plex-Client-Identifier"] ?? client$.options$.xPlexClientIdentifier, - { explode: false, charEncoding: "none" } - ), }); const context = { operationID: "getTokenByPinId", oAuth2Scopes: [], securitySource: null }; @@ -89,6 +93,7 @@ export async function plexGetTokenByPinId( baseURL: baseURL$, path: path$, headers: headers$, + query: query$, body: body$, timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, }, @@ -120,6 +125,7 @@ export async function plexGetTokenByPinId( const [result$] = await m$.match< models.GetTokenByPinIdResponse, | models.GetTokenByPinIdResponseBody + | models.GetTokenByPinIdPlexResponseBody | SDKError | SDKValidationError | UnexpectedClientError @@ -129,8 +135,9 @@ export async function plexGetTokenByPinId( | ConnectionError >( m$.json(200, models.GetTokenByPinIdResponse$inboundSchema, { key: "AuthPinContainer" }), - m$.fail([400, "4XX", "5XX"]), - m$.jsonErr(404, models.GetTokenByPinIdResponseBody$inboundSchema) + m$.jsonErr(400, models.GetTokenByPinIdResponseBody$inboundSchema), + m$.jsonErr(404, models.GetTokenByPinIdPlexResponseBody$inboundSchema), + m$.fail(["4XX", "5XX"]) )(response, { extraFields: responseFields$ }); if (!result$.ok) { return result$; diff --git a/src/funcs/libraryRefreshLibrary.ts b/src/funcs/serverGetMediaProviders.ts similarity index 76% rename from src/funcs/libraryRefreshLibrary.ts rename to src/funcs/serverGetMediaProviders.ts index a0b7dc3b..156f69b3 100644 --- a/src/funcs/libraryRefreshLibrary.ts +++ b/src/funcs/serverGetMediaProviders.ts @@ -3,7 +3,7 @@ */ import { PlexAPICore } from "../core.js"; -import { encodeSimple as encodeSimple$ } from "../lib/encodings.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"; @@ -22,20 +22,19 @@ import { SDKValidationError } from "../models/sdkvalidationerror.js"; import { Result } from "../types/fp.js"; /** - * Refresh Library + * Get Media Providers * * @remarks - * This endpoint Refreshes the library. - * + * Retrieves media providers and their features from the Plex server. */ -export async function libraryRefreshLibrary( +export async function serverGetMediaProviders( client$: PlexAPICore, - sectionId: number, + xPlexToken: string, options?: RequestOptions ): Promise< Result< - models.RefreshLibraryResponse, - | models.RefreshLibraryResponseBody + models.GetMediaProvidersResponse, + | models.GetMediaProvidersServerResponseBody | SDKError | SDKValidationError | UnexpectedClientError @@ -45,13 +44,13 @@ export async function libraryRefreshLibrary( | ConnectionError > > { - const input$: models.RefreshLibraryRequest = { - sectionId: sectionId, + const input$: models.GetMediaProvidersRequest = { + xPlexToken: xPlexToken, }; const parsed$ = schemas$.safeParse( input$, - (value$) => models.RefreshLibraryRequest$outboundSchema.parse(value$), + (value$) => models.GetMediaProvidersRequest$outboundSchema.parse(value$), "Input validation failed" ); if (!parsed$.ok) { @@ -60,14 +59,11 @@ export async function libraryRefreshLibrary( const payload$ = parsed$.value; const body$ = null; - const pathParams$ = { - sectionId: encodeSimple$("sectionId", payload$.sectionId, { - explode: false, - charEncoding: "percent", - }), - }; + const path$ = pathToFunc("/media/providers")(); - const path$ = pathToFunc("/library/sections/{sectionId}/refresh")(pathParams$); + const query$ = encodeFormQuery$({ + "X-Plex-Token": payload$["X-Plex-Token"], + }); const headers$ = new Headers({ Accept: "application/json", @@ -76,7 +72,7 @@ export async function libraryRefreshLibrary( const accessToken$ = await extractSecurity(client$.options$.accessToken); const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; const context = { - operationID: "refreshLibrary", + operationID: "get-media-providers", oAuth2Scopes: [], securitySource: client$.options$.accessToken, }; @@ -89,6 +85,7 @@ export async function libraryRefreshLibrary( method: "GET", path: path$, headers: headers$, + query: query$, body: body$, timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, }, @@ -118,8 +115,8 @@ export async function libraryRefreshLibrary( }; const [result$] = await m$.match< - models.RefreshLibraryResponse, - | models.RefreshLibraryResponseBody + models.GetMediaProvidersResponse, + | models.GetMediaProvidersServerResponseBody | SDKError | SDKValidationError | UnexpectedClientError @@ -128,9 +125,9 @@ export async function libraryRefreshLibrary( | RequestTimeoutError | ConnectionError >( - m$.nil(200, models.RefreshLibraryResponse$inboundSchema), + m$.json(200, models.GetMediaProvidersResponse$inboundSchema, { key: "object" }), m$.fail([400, "4XX", "5XX"]), - m$.jsonErr(401, models.RefreshLibraryResponseBody$inboundSchema) + m$.jsonErr(401, models.GetMediaProvidersServerResponseBody$inboundSchema) )(response, { extraFields: responseFields$ }); if (!result$.ok) { return result$; diff --git a/src/funcs/serverGetServerIdentity.ts b/src/funcs/serverGetServerIdentity.ts index 8a969592..c97a52e8 100644 --- a/src/funcs/serverGetServerIdentity.ts +++ b/src/funcs/serverGetServerIdentity.ts @@ -5,7 +5,6 @@ import { PlexAPICore } from "../core.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"; import { ConnectionError, @@ -23,7 +22,7 @@ import { Result } from "../types/fp.js"; * Get Server Identity * * @remarks - * Get Server Identity + * This request is useful to determine if the server is online or offline */ export async function serverGetServerIdentity( client$: PlexAPICore, @@ -47,19 +46,11 @@ export async function serverGetServerIdentity( Accept: "application/json", }); - const accessToken$ = await extractSecurity(client$.options$.accessToken); - const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; - const context = { - operationID: "getServerIdentity", - oAuth2Scopes: [], - securitySource: client$.options$.accessToken, - }; - const securitySettings$ = resolveGlobalSecurity(security$); + const context = { operationID: "get-server-identity", oAuth2Scopes: [], securitySource: null }; const requestRes = client$.createRequest$( context, { - security: securitySettings$, method: "GET", path: path$, headers: headers$, @@ -74,7 +65,7 @@ export async function serverGetServerIdentity( const doResult = await client$.do$(request$, { context, - errorCodes: ["400", "401", "4XX", "5XX"], + errorCodes: ["408", "4XX", "5XX"], retryConfig: options?.retries || client$.options$.retryConfig, retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }); @@ -102,8 +93,8 @@ export async function serverGetServerIdentity( | ConnectionError >( m$.json(200, models.GetServerIdentityResponse$inboundSchema, { key: "object" }), - m$.fail([400, "4XX", "5XX"]), - m$.jsonErr(401, models.GetServerIdentityServerResponseBody$inboundSchema) + m$.jsonErr(408, models.GetServerIdentityServerResponseBody$inboundSchema), + m$.fail(["4XX", "5XX"]) )(response, { extraFields: responseFields$ }); if (!result$.ok) { return result$; diff --git a/src/funcs/sessionsGetSessionHistory.ts b/src/funcs/sessionsGetSessionHistory.ts index 106a9486..1c9f89f9 100644 --- a/src/funcs/sessionsGetSessionHistory.ts +++ b/src/funcs/sessionsGetSessionHistory.ts @@ -31,7 +31,7 @@ export async function sessionsGetSessionHistory( client$: PlexAPICore, sort?: string | undefined, accountId?: number | undefined, - filter?: models.Filter | undefined, + filter?: models.QueryParamFilter | undefined, librarySectionID?: number | undefined, options?: RequestOptions ): Promise< diff --git a/src/funcs/watchlistGetWatchlist.ts b/src/funcs/watchlistGetWatchList.ts similarity index 87% rename from src/funcs/watchlistGetWatchlist.ts rename to src/funcs/watchlistGetWatchList.ts index 2425a1af..b74cfb68 100644 --- a/src/funcs/watchlistGetWatchlist.ts +++ b/src/funcs/watchlistGetWatchList.ts @@ -12,7 +12,7 @@ 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 { GetWatchlistOpServerList } from "../models/getwatchlistop.js"; +import { GetWatchListOpServerList } from "../models/getwatchlistop.js"; import { ConnectionError, InvalidRequestError, @@ -31,14 +31,14 @@ import { Result } from "../types/fp.js"; * @remarks * Get User Watchlist */ -export async function watchlistGetWatchlist( +export async function watchlistGetWatchList( client$: PlexAPICore, - request: models.GetWatchlistRequest, + request: models.GetWatchListRequest, options?: RequestOptions & { serverURL?: string } ): Promise< Result< - models.GetWatchlistResponse, - | models.GetWatchlistWatchlistResponseBody + models.GetWatchListResponse, + | models.GetWatchListWatchlistResponseBody | SDKError | SDKValidationError | UnexpectedClientError @@ -52,7 +52,7 @@ export async function watchlistGetWatchlist( const parsed$ = schemas$.safeParse( input$, - (value$) => models.GetWatchlistRequest$outboundSchema.parse(value$), + (value$) => models.GetWatchListRequest$outboundSchema.parse(value$), "Input validation failed" ); if (!parsed$.ok) { @@ -63,7 +63,7 @@ export async function watchlistGetWatchlist( const baseURL$ = options?.serverURL || - pathToFunc(GetWatchlistOpServerList[0], { charEncoding: "percent" })(); + pathToFunc(GetWatchListOpServerList[0], { charEncoding: "percent" })(); const pathParams$ = { filter: encodeSimple$("filter", payload$.filter, { @@ -92,7 +92,7 @@ export async function watchlistGetWatchlist( const accessToken$ = await extractSecurity(client$.options$.accessToken); const security$ = accessToken$ == null ? {} : { accessToken: accessToken$ }; const context = { - operationID: "getWatchlist", + operationID: "get-watch-list", oAuth2Scopes: [], securitySource: client$.options$.accessToken, }; @@ -136,8 +136,8 @@ export async function watchlistGetWatchlist( }; const [result$] = await m$.match< - models.GetWatchlistResponse, - | models.GetWatchlistWatchlistResponseBody + models.GetWatchListResponse, + | models.GetWatchListWatchlistResponseBody | SDKError | SDKValidationError | UnexpectedClientError @@ -146,9 +146,9 @@ export async function watchlistGetWatchlist( | RequestTimeoutError | ConnectionError >( - m$.json(200, models.GetWatchlistResponse$inboundSchema, { key: "object" }), + m$.json(200, models.GetWatchListResponse$inboundSchema, { key: "object" }), m$.fail([400, "4XX", "5XX"]), - m$.jsonErr(401, models.GetWatchlistWatchlistResponseBody$inboundSchema) + m$.jsonErr(401, models.GetWatchListWatchlistResponseBody$inboundSchema) )(response, { extraFields: responseFields$ }); if (!result$.ok) { return result$; diff --git a/src/index.ts b/src/index.ts index 5c956a8a..e81fbd36 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,6 +4,7 @@ export * from "./sdk/sdk.js"; export * from "./lib/config.js"; +export * as files from "./lib/files.js"; export * from "./models/index.js"; export * as types from "./types/index.js"; diff --git a/src/lib/config.ts b/src/lib/config.ts index 2fcd36df..759052ae 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -66,7 +66,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { const serverParams: Params[] = [ { - protocol: options.protocol ?? "http", + protocol: options.protocol ?? "https", ip: options.ip ?? "10.10.10.47", port: options.port ?? "32400", }, @@ -89,7 +89,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "0.0.3", - sdkVersion: "0.19.0", - genVersion: "2.404.1", - userAgent: "speakeasy-sdk/typescript 0.19.0 2.404.1 0.0.3 @lukehagar/plexjs", + sdkVersion: "0.20.0", + genVersion: "2.409.8", + userAgent: "speakeasy-sdk/typescript 0.20.0 2.409.8 0.0.3 @lukehagar/plexjs", } as const; diff --git a/src/lib/files.ts b/src/lib/files.ts new file mode 100644 index 00000000..19e08041 --- /dev/null +++ b/src/lib/files.ts @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +/** + * Consumes a stream and returns a concatenated array buffer. Useful in + * situations where we need to read the whole file because it forms part of a + * larger payload containing other fields, and we can't modify the underlying + * request structure. + */ +export async function readableStreamToArrayBuffer( + readable: ReadableStream, +): Promise { + const reader = readable.getReader(); + const chunks: Uint8Array[] = []; + + let totalLength = 0; + let done = false; + + while (!done) { + const { value, done: doneReading } = await reader.read(); + + if (doneReading) { + done = true; + } else { + chunks.push(value); + totalLength += value.length; + } + } + + const concatenatedChunks = new Uint8Array(totalLength); + let offset = 0; + + for (const chunk of chunks) { + concatenatedChunks.set(chunk, offset); + offset += chunk.length; + } + + return concatenatedChunks.buffer; +} diff --git a/src/lib/sdks.ts b/src/lib/sdks.ts index bfdd54ba..7c039c1f 100644 --- a/src/lib/sdks.ts +++ b/src/lib/sdks.ts @@ -181,6 +181,18 @@ export class ClientSDK { } } + if (conf.body instanceof ReadableStream) { + if (!fetchOptions) { + fetchOptions = { + // @ts-expect-error see https://github.com/node-fetch/node-fetch/issues/1769 + duplex: "half", + }; + } else { + // @ts-expect-error see https://github.com/node-fetch/node-fetch/issues/1769 + fetchOptions.duplex = "half"; + } + } + let input; try { input = this.hooks$.beforeCreateRequest(context, { diff --git a/src/lib/security.ts b/src/lib/security.ts index f7c0b434..aed85a75 100644 --- a/src/lib/security.ts +++ b/src/lib/security.ts @@ -71,13 +71,20 @@ type SecurityInputOAuth2ClientCredentials = { fieldName: string; }; +type SecurityInputCustom = { + type: "http:custom"; + value: any | null | undefined; + fieldName: string; +}; + export type SecurityInput = | SecurityInputBasic | SecurityInputBearer | SecurityInputAPIKey | SecurityInputOAuth2 | SecurityInputOAuth2ClientCredentials - | SecurityInputOIDC; + | SecurityInputOIDC + | SecurityInputCustom; export function resolveSecurity(...options: SecurityInput[][]): SecurityState | null { const state: SecurityState = { @@ -93,6 +100,8 @@ export function resolveSecurity(...options: SecurityInput[][]): SecurityState | return false; } else if (o.type === "http:basic") { return o.value.username != null || o.value.password != null; + } else if (o.type === "http:custom") { + return null; } else if (typeof o.value === "string") { return !!o.value; } else { @@ -126,6 +135,8 @@ export function resolveSecurity(...options: SecurityInput[][]): SecurityState | case "http:basic": applyBasic(state, spec); break; + case "http:custom": + break; case "http:bearer": applyBearer(state, spec); break; @@ -175,7 +186,7 @@ export function resolveGlobalSecurity( return resolveSecurity([ { fieldName: "X-Plex-Token", - type: "apiKey:header", + type: "apiKey:query", value: security?.accessToken, }, ]); diff --git a/src/models/applyupdatesop.ts b/src/models/applyupdatesop.ts index 7a9d3fec..7755d22f 100644 --- a/src/models/applyupdatesop.ts +++ b/src/models/applyupdatesop.ts @@ -14,7 +14,7 @@ export enum Tonight { } /** - * Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. + * Indicate that the latest version should be marked as skipped. The [Release] entry for this version will have the `state` set to `skipped`. */ export enum Skip { Zero = 0, @@ -27,7 +27,7 @@ export type ApplyUpdatesRequest = { */ tonight?: Tonight | undefined; /** - * Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. + * Indicate that the latest version should be marked as skipped. The [Release] entry for this version will have the `state` set to `skipped`. */ skip?: Skip | undefined; }; diff --git a/src/models/createplaylistop.ts b/src/models/createplaylistop.ts index 0243e8b2..c7e61f52 100644 --- a/src/models/createplaylistop.ts +++ b/src/models/createplaylistop.ts @@ -8,7 +8,7 @@ import * as z from "zod"; /** * type of playlist to create */ -export enum QueryParamType { +export enum CreatePlaylistQueryParamType { Audio = "audio", Video = "video", Photo = "photo", @@ -30,7 +30,7 @@ export type CreatePlaylistRequest = { /** * type of playlist to create */ - type: QueryParamType; + type: CreatePlaylistQueryParamType; /** * whether the playlist is smart or not */ @@ -145,22 +145,24 @@ export type CreatePlaylistResponse = { }; /** @internal */ -export const QueryParamType$inboundSchema: z.ZodNativeEnum = - z.nativeEnum(QueryParamType); +export const CreatePlaylistQueryParamType$inboundSchema: z.ZodNativeEnum< + typeof CreatePlaylistQueryParamType +> = z.nativeEnum(CreatePlaylistQueryParamType); /** @internal */ -export const QueryParamType$outboundSchema: z.ZodNativeEnum = - QueryParamType$inboundSchema; +export const CreatePlaylistQueryParamType$outboundSchema: z.ZodNativeEnum< + typeof CreatePlaylistQueryParamType +> = CreatePlaylistQueryParamType$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 CreatePlaylistQueryParamType$ { + /** @deprecated use `CreatePlaylistQueryParamType$inboundSchema` instead. */ + export const inboundSchema = CreatePlaylistQueryParamType$inboundSchema; + /** @deprecated use `CreatePlaylistQueryParamType$outboundSchema` instead. */ + export const outboundSchema = CreatePlaylistQueryParamType$outboundSchema; } /** @internal */ @@ -187,7 +189,7 @@ export const CreatePlaylistRequest$inboundSchema: z.ZodType< unknown > = z.object({ title: z.string(), - type: QueryParamType$inboundSchema, + type: CreatePlaylistQueryParamType$inboundSchema, smart: Smart$inboundSchema, uri: z.string(), playQueueID: z.number().optional(), @@ -209,7 +211,7 @@ export const CreatePlaylistRequest$outboundSchema: z.ZodType< CreatePlaylistRequest > = z.object({ title: z.string(), - type: QueryParamType$outboundSchema, + type: CreatePlaylistQueryParamType$outboundSchema, smart: Smart$outboundSchema, uri: z.string(), playQueueID: z.number().optional(), diff --git a/src/models/deletelibraryop.ts b/src/models/deletelibraryop.ts index a42e6bd1..39ed80e2 100644 --- a/src/models/deletelibraryop.ts +++ b/src/models/deletelibraryop.ts @@ -7,9 +7,13 @@ import * as z from "zod"; export type DeleteLibraryRequest = { /** - * the Id of the library to query + * The unique key of the Plex library. + * + * @remarks + * Note: This is unique in the context of the Plex server. + * */ - sectionId: number; + sectionKey: number; }; export type DeleteLibraryErrors = { @@ -82,12 +86,12 @@ export const DeleteLibraryRequest$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - sectionId: z.number(), + sectionKey: z.number().int(), }); /** @internal */ export type DeleteLibraryRequest$Outbound = { - sectionId: number; + sectionKey: number; }; /** @internal */ @@ -96,7 +100,7 @@ export const DeleteLibraryRequest$outboundSchema: z.ZodType< z.ZodTypeDef, DeleteLibraryRequest > = z.object({ - sectionId: z.number(), + sectionKey: z.number().int(), }); /** diff --git a/src/models/getlibrariesop.ts b/src/models/getalllibrariesop.ts similarity index 60% rename from src/models/getlibrariesop.ts rename to src/models/getalllibrariesop.ts index 1e94a576..4b164507 100644 --- a/src/models/getlibrariesop.ts +++ b/src/models/getalllibrariesop.ts @@ -5,7 +5,7 @@ import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; -export type GetLibrariesErrors = { +export type GetAllLibrariesErrors = { code?: number | undefined; message?: string | undefined; status?: number | undefined; @@ -14,8 +14,8 @@ export type GetLibrariesErrors = { /** * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ -export type GetLibrariesLibraryResponseBodyData = { - errors?: Array | undefined; +export type GetAllLibrariesLibraryResponseBodyData = { + errors?: Array | undefined; /** * Raw HTTP response; suitable for custom response parsing */ @@ -25,17 +25,17 @@ export type GetLibrariesLibraryResponseBodyData = { /** * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ -export class GetLibrariesLibraryResponseBody extends Error { - errors?: Array | undefined; +export class GetAllLibrariesLibraryResponseBody 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$: GetLibrariesLibraryResponseBodyData; + data$: GetAllLibrariesLibraryResponseBodyData; - constructor(err: GetLibrariesLibraryResponseBodyData) { + constructor(err: GetAllLibrariesLibraryResponseBodyData) { const message = "message" in err && typeof err.message === "string" ? err.message @@ -50,7 +50,7 @@ export class GetLibrariesLibraryResponseBody extends Error { this.rawResponse = err.rawResponse; } - this.name = "GetLibrariesLibraryResponseBody"; + this.name = "GetAllLibrariesLibraryResponseBody"; } } @@ -59,7 +59,7 @@ export type Location = { path?: string | undefined; }; -export type GetLibrariesDirectory = { +export type GetAllLibrariesDirectory = { allowSync?: boolean | undefined; art?: string | undefined; composite?: string | undefined; @@ -73,8 +73,17 @@ export type GetLibrariesDirectory = { scanner?: string | undefined; language?: string | undefined; uuid?: string | undefined; + /** + * Unix epoch datetime + */ updatedAt?: number | undefined; + /** + * Unix epoch datetime + */ createdAt?: number | undefined; + /** + * Unix epoch datetime + */ scannedAt?: number | undefined; content?: boolean | undefined; directory?: boolean | undefined; @@ -83,21 +92,21 @@ export type GetLibrariesDirectory = { location?: Array | undefined; }; -export type GetLibrariesMediaContainer = { - size?: number | undefined; - allowSync?: boolean | undefined; - title1?: string | undefined; - directory?: Array | undefined; +export type GetAllLibrariesMediaContainer = { + size: number; + allowSync: boolean; + title1: string; + directory?: Array | undefined; }; /** * The libraries available on the Server */ -export type GetLibrariesResponseBody = { - mediaContainer?: GetLibrariesMediaContainer | undefined; +export type GetAllLibrariesResponseBody = { + mediaContainer?: GetAllLibrariesMediaContainer | undefined; }; -export type GetLibrariesResponse = { +export type GetAllLibrariesResponse = { /** * HTTP response content type for this operation */ @@ -113,12 +122,12 @@ export type GetLibrariesResponse = { /** * The libraries available on the Server */ - object?: GetLibrariesResponseBody | undefined; + object?: GetAllLibrariesResponseBody | undefined; }; /** @internal */ -export const GetLibrariesErrors$inboundSchema: z.ZodType< - GetLibrariesErrors, +export const GetAllLibrariesErrors$inboundSchema: z.ZodType< + GetAllLibrariesErrors, z.ZodTypeDef, unknown > = z.object({ @@ -128,17 +137,17 @@ export const GetLibrariesErrors$inboundSchema: z.ZodType< }); /** @internal */ -export type GetLibrariesErrors$Outbound = { +export type GetAllLibrariesErrors$Outbound = { code?: number | undefined; message?: string | undefined; status?: number | undefined; }; /** @internal */ -export const GetLibrariesErrors$outboundSchema: z.ZodType< - GetLibrariesErrors$Outbound, +export const GetAllLibrariesErrors$outboundSchema: z.ZodType< + GetAllLibrariesErrors$Outbound, z.ZodTypeDef, - GetLibrariesErrors + GetAllLibrariesErrors > = z.object({ code: z.number().optional(), message: z.string().optional(), @@ -149,23 +158,23 @@ export const GetLibrariesErrors$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 GetLibrariesErrors$ { - /** @deprecated use `GetLibrariesErrors$inboundSchema` instead. */ - export const inboundSchema = GetLibrariesErrors$inboundSchema; - /** @deprecated use `GetLibrariesErrors$outboundSchema` instead. */ - export const outboundSchema = GetLibrariesErrors$outboundSchema; - /** @deprecated use `GetLibrariesErrors$Outbound` instead. */ - export type Outbound = GetLibrariesErrors$Outbound; +export namespace GetAllLibrariesErrors$ { + /** @deprecated use `GetAllLibrariesErrors$inboundSchema` instead. */ + export const inboundSchema = GetAllLibrariesErrors$inboundSchema; + /** @deprecated use `GetAllLibrariesErrors$outboundSchema` instead. */ + export const outboundSchema = GetAllLibrariesErrors$outboundSchema; + /** @deprecated use `GetAllLibrariesErrors$Outbound` instead. */ + export type Outbound = GetAllLibrariesErrors$Outbound; } /** @internal */ -export const GetLibrariesLibraryResponseBody$inboundSchema: z.ZodType< - GetLibrariesLibraryResponseBody, +export const GetAllLibrariesLibraryResponseBody$inboundSchema: z.ZodType< + GetAllLibrariesLibraryResponseBody, z.ZodTypeDef, unknown > = z .object({ - errors: z.array(z.lazy(() => GetLibrariesErrors$inboundSchema)).optional(), + errors: z.array(z.lazy(() => GetAllLibrariesErrors$inboundSchema)).optional(), RawResponse: z.instanceof(Response).optional(), }) .transform((v) => { @@ -173,27 +182,27 @@ export const GetLibrariesLibraryResponseBody$inboundSchema: z.ZodType< RawResponse: "rawResponse", }); - return new GetLibrariesLibraryResponseBody(remapped); + return new GetAllLibrariesLibraryResponseBody(remapped); }); /** @internal */ -export type GetLibrariesLibraryResponseBody$Outbound = { - errors?: Array | undefined; +export type GetAllLibrariesLibraryResponseBody$Outbound = { + errors?: Array | undefined; RawResponse?: never | undefined; }; /** @internal */ -export const GetLibrariesLibraryResponseBody$outboundSchema: z.ZodType< - GetLibrariesLibraryResponseBody$Outbound, +export const GetAllLibrariesLibraryResponseBody$outboundSchema: z.ZodType< + GetAllLibrariesLibraryResponseBody$Outbound, z.ZodTypeDef, - GetLibrariesLibraryResponseBody + GetAllLibrariesLibraryResponseBody > = z - .instanceof(GetLibrariesLibraryResponseBody) + .instanceof(GetAllLibrariesLibraryResponseBody) .transform((v) => v.data$) .pipe( z .object({ - errors: z.array(z.lazy(() => GetLibrariesErrors$outboundSchema)).optional(), + errors: z.array(z.lazy(() => GetAllLibrariesErrors$outboundSchema)).optional(), rawResponse: z .instanceof(Response) .transform(() => { @@ -212,13 +221,13 @@ export const GetLibrariesLibraryResponseBody$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 GetLibrariesLibraryResponseBody$ { - /** @deprecated use `GetLibrariesLibraryResponseBody$inboundSchema` instead. */ - export const inboundSchema = GetLibrariesLibraryResponseBody$inboundSchema; - /** @deprecated use `GetLibrariesLibraryResponseBody$outboundSchema` instead. */ - export const outboundSchema = GetLibrariesLibraryResponseBody$outboundSchema; - /** @deprecated use `GetLibrariesLibraryResponseBody$Outbound` instead. */ - export type Outbound = GetLibrariesLibraryResponseBody$Outbound; +export namespace GetAllLibrariesLibraryResponseBody$ { + /** @deprecated use `GetAllLibrariesLibraryResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetAllLibrariesLibraryResponseBody$inboundSchema; + /** @deprecated use `GetAllLibrariesLibraryResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetAllLibrariesLibraryResponseBody$outboundSchema; + /** @deprecated use `GetAllLibrariesLibraryResponseBody$Outbound` instead. */ + export type Outbound = GetAllLibrariesLibraryResponseBody$Outbound; } /** @internal */ @@ -254,8 +263,8 @@ export namespace Location$ { } /** @internal */ -export const GetLibrariesDirectory$inboundSchema: z.ZodType< - GetLibrariesDirectory, +export const GetAllLibrariesDirectory$inboundSchema: z.ZodType< + GetAllLibrariesDirectory, z.ZodTypeDef, unknown > = z @@ -289,7 +298,7 @@ export const GetLibrariesDirectory$inboundSchema: z.ZodType< }); /** @internal */ -export type GetLibrariesDirectory$Outbound = { +export type GetAllLibrariesDirectory$Outbound = { allowSync?: boolean | undefined; art?: string | undefined; composite?: string | undefined; @@ -314,10 +323,10 @@ export type GetLibrariesDirectory$Outbound = { }; /** @internal */ -export const GetLibrariesDirectory$outboundSchema: z.ZodType< - GetLibrariesDirectory$Outbound, +export const GetAllLibrariesDirectory$outboundSchema: z.ZodType< + GetAllLibrariesDirectory$Outbound, z.ZodTypeDef, - GetLibrariesDirectory + GetAllLibrariesDirectory > = z .object({ allowSync: z.boolean().optional(), @@ -352,26 +361,26 @@ export const GetLibrariesDirectory$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 GetLibrariesDirectory$ { - /** @deprecated use `GetLibrariesDirectory$inboundSchema` instead. */ - export const inboundSchema = GetLibrariesDirectory$inboundSchema; - /** @deprecated use `GetLibrariesDirectory$outboundSchema` instead. */ - export const outboundSchema = GetLibrariesDirectory$outboundSchema; - /** @deprecated use `GetLibrariesDirectory$Outbound` instead. */ - export type Outbound = GetLibrariesDirectory$Outbound; +export namespace GetAllLibrariesDirectory$ { + /** @deprecated use `GetAllLibrariesDirectory$inboundSchema` instead. */ + export const inboundSchema = GetAllLibrariesDirectory$inboundSchema; + /** @deprecated use `GetAllLibrariesDirectory$outboundSchema` instead. */ + export const outboundSchema = GetAllLibrariesDirectory$outboundSchema; + /** @deprecated use `GetAllLibrariesDirectory$Outbound` instead. */ + export type Outbound = GetAllLibrariesDirectory$Outbound; } /** @internal */ -export const GetLibrariesMediaContainer$inboundSchema: z.ZodType< - GetLibrariesMediaContainer, +export const GetAllLibrariesMediaContainer$inboundSchema: z.ZodType< + GetAllLibrariesMediaContainer, z.ZodTypeDef, unknown > = z .object({ - size: z.number().int().optional(), - allowSync: z.boolean().optional(), - title1: z.string().optional(), - Directory: z.array(z.lazy(() => GetLibrariesDirectory$inboundSchema)).optional(), + size: z.number().int(), + allowSync: z.boolean(), + title1: z.string(), + Directory: z.array(z.lazy(() => GetAllLibrariesDirectory$inboundSchema)).optional(), }) .transform((v) => { return remap$(v, { @@ -380,24 +389,24 @@ export const GetLibrariesMediaContainer$inboundSchema: z.ZodType< }); /** @internal */ -export type GetLibrariesMediaContainer$Outbound = { - size?: number | undefined; - allowSync?: boolean | undefined; - title1?: string | undefined; - Directory?: Array | undefined; +export type GetAllLibrariesMediaContainer$Outbound = { + size: number; + allowSync: boolean; + title1: string; + Directory?: Array | undefined; }; /** @internal */ -export const GetLibrariesMediaContainer$outboundSchema: z.ZodType< - GetLibrariesMediaContainer$Outbound, +export const GetAllLibrariesMediaContainer$outboundSchema: z.ZodType< + GetAllLibrariesMediaContainer$Outbound, z.ZodTypeDef, - GetLibrariesMediaContainer + GetAllLibrariesMediaContainer > = z .object({ - size: z.number().int().optional(), - allowSync: z.boolean().optional(), - title1: z.string().optional(), - directory: z.array(z.lazy(() => GetLibrariesDirectory$outboundSchema)).optional(), + size: z.number().int(), + allowSync: z.boolean(), + title1: z.string(), + directory: z.array(z.lazy(() => GetAllLibrariesDirectory$outboundSchema)).optional(), }) .transform((v) => { return remap$(v, { @@ -409,23 +418,23 @@ export const GetLibrariesMediaContainer$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 GetLibrariesMediaContainer$ { - /** @deprecated use `GetLibrariesMediaContainer$inboundSchema` instead. */ - export const inboundSchema = GetLibrariesMediaContainer$inboundSchema; - /** @deprecated use `GetLibrariesMediaContainer$outboundSchema` instead. */ - export const outboundSchema = GetLibrariesMediaContainer$outboundSchema; - /** @deprecated use `GetLibrariesMediaContainer$Outbound` instead. */ - export type Outbound = GetLibrariesMediaContainer$Outbound; +export namespace GetAllLibrariesMediaContainer$ { + /** @deprecated use `GetAllLibrariesMediaContainer$inboundSchema` instead. */ + export const inboundSchema = GetAllLibrariesMediaContainer$inboundSchema; + /** @deprecated use `GetAllLibrariesMediaContainer$outboundSchema` instead. */ + export const outboundSchema = GetAllLibrariesMediaContainer$outboundSchema; + /** @deprecated use `GetAllLibrariesMediaContainer$Outbound` instead. */ + export type Outbound = GetAllLibrariesMediaContainer$Outbound; } /** @internal */ -export const GetLibrariesResponseBody$inboundSchema: z.ZodType< - GetLibrariesResponseBody, +export const GetAllLibrariesResponseBody$inboundSchema: z.ZodType< + GetAllLibrariesResponseBody, z.ZodTypeDef, unknown > = z .object({ - MediaContainer: z.lazy(() => GetLibrariesMediaContainer$inboundSchema).optional(), + MediaContainer: z.lazy(() => GetAllLibrariesMediaContainer$inboundSchema).optional(), }) .transform((v) => { return remap$(v, { @@ -434,18 +443,18 @@ export const GetLibrariesResponseBody$inboundSchema: z.ZodType< }); /** @internal */ -export type GetLibrariesResponseBody$Outbound = { - MediaContainer?: GetLibrariesMediaContainer$Outbound | undefined; +export type GetAllLibrariesResponseBody$Outbound = { + MediaContainer?: GetAllLibrariesMediaContainer$Outbound | undefined; }; /** @internal */ -export const GetLibrariesResponseBody$outboundSchema: z.ZodType< - GetLibrariesResponseBody$Outbound, +export const GetAllLibrariesResponseBody$outboundSchema: z.ZodType< + GetAllLibrariesResponseBody$Outbound, z.ZodTypeDef, - GetLibrariesResponseBody + GetAllLibrariesResponseBody > = z .object({ - mediaContainer: z.lazy(() => GetLibrariesMediaContainer$outboundSchema).optional(), + mediaContainer: z.lazy(() => GetAllLibrariesMediaContainer$outboundSchema).optional(), }) .transform((v) => { return remap$(v, { @@ -457,18 +466,18 @@ export const GetLibrariesResponseBody$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 GetLibrariesResponseBody$ { - /** @deprecated use `GetLibrariesResponseBody$inboundSchema` instead. */ - export const inboundSchema = GetLibrariesResponseBody$inboundSchema; - /** @deprecated use `GetLibrariesResponseBody$outboundSchema` instead. */ - export const outboundSchema = GetLibrariesResponseBody$outboundSchema; - /** @deprecated use `GetLibrariesResponseBody$Outbound` instead. */ - export type Outbound = GetLibrariesResponseBody$Outbound; +export namespace GetAllLibrariesResponseBody$ { + /** @deprecated use `GetAllLibrariesResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetAllLibrariesResponseBody$inboundSchema; + /** @deprecated use `GetAllLibrariesResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetAllLibrariesResponseBody$outboundSchema; + /** @deprecated use `GetAllLibrariesResponseBody$Outbound` instead. */ + export type Outbound = GetAllLibrariesResponseBody$Outbound; } /** @internal */ -export const GetLibrariesResponse$inboundSchema: z.ZodType< - GetLibrariesResponse, +export const GetAllLibrariesResponse$inboundSchema: z.ZodType< + GetAllLibrariesResponse, z.ZodTypeDef, unknown > = z @@ -476,7 +485,7 @@ export const GetLibrariesResponse$inboundSchema: z.ZodType< ContentType: z.string(), StatusCode: z.number().int(), RawResponse: z.instanceof(Response), - object: z.lazy(() => GetLibrariesResponseBody$inboundSchema).optional(), + object: z.lazy(() => GetAllLibrariesResponseBody$inboundSchema).optional(), }) .transform((v) => { return remap$(v, { @@ -487,18 +496,18 @@ export const GetLibrariesResponse$inboundSchema: z.ZodType< }); /** @internal */ -export type GetLibrariesResponse$Outbound = { +export type GetAllLibrariesResponse$Outbound = { ContentType: string; StatusCode: number; RawResponse: never; - object?: GetLibrariesResponseBody$Outbound | undefined; + object?: GetAllLibrariesResponseBody$Outbound | undefined; }; /** @internal */ -export const GetLibrariesResponse$outboundSchema: z.ZodType< - GetLibrariesResponse$Outbound, +export const GetAllLibrariesResponse$outboundSchema: z.ZodType< + GetAllLibrariesResponse$Outbound, z.ZodTypeDef, - GetLibrariesResponse + GetAllLibrariesResponse > = z .object({ contentType: z.string(), @@ -506,7 +515,7 @@ export const GetLibrariesResponse$outboundSchema: z.ZodType< rawResponse: z.instanceof(Response).transform(() => { throw new Error("Response cannot be serialized"); }), - object: z.lazy(() => GetLibrariesResponseBody$outboundSchema).optional(), + object: z.lazy(() => GetAllLibrariesResponseBody$outboundSchema).optional(), }) .transform((v) => { return remap$(v, { @@ -520,11 +529,11 @@ export const GetLibrariesResponse$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 GetLibrariesResponse$ { - /** @deprecated use `GetLibrariesResponse$inboundSchema` instead. */ - export const inboundSchema = GetLibrariesResponse$inboundSchema; - /** @deprecated use `GetLibrariesResponse$outboundSchema` instead. */ - export const outboundSchema = GetLibrariesResponse$outboundSchema; - /** @deprecated use `GetLibrariesResponse$Outbound` instead. */ - export type Outbound = GetLibrariesResponse$Outbound; +export namespace GetAllLibrariesResponse$ { + /** @deprecated use `GetAllLibrariesResponse$inboundSchema` instead. */ + export const inboundSchema = GetAllLibrariesResponse$inboundSchema; + /** @deprecated use `GetAllLibrariesResponse$outboundSchema` instead. */ + export const outboundSchema = GetAllLibrariesResponse$outboundSchema; + /** @deprecated use `GetAllLibrariesResponse$Outbound` instead. */ + export type Outbound = GetAllLibrariesResponse$Outbound; } diff --git a/src/models/getbannerimageop.ts b/src/models/getbannerimageop.ts new file mode 100644 index 00000000..79376e4f --- /dev/null +++ b/src/models/getbannerimageop.ts @@ -0,0 +1,328 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../lib/primitives.js"; +import * as z from "zod"; + +export type GetBannerImageRequest = { + /** + * the id of the library item to return the children of. + */ + ratingKey: number; + width: number; + height: number; + minSize: number; + upscale: number; + /** + * Plex Authentication Token + */ + xPlexToken: string; +}; + +export type GetBannerImageErrors = { + 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 GetBannerImageResponseBodyData = { + 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 GetBannerImageResponseBody 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$: GetBannerImageResponseBodyData; + + constructor(err: GetBannerImageResponseBodyData) { + 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 = "GetBannerImageResponseBody"; + } +} + +export type GetBannerImageResponse = { + /** + * 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; + /** + * Successful response returning an image + */ + responseStream?: ReadableStream | undefined; + headers: { [k: string]: Array }; +}; + +/** @internal */ +export const GetBannerImageRequest$inboundSchema: z.ZodType< + GetBannerImageRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + ratingKey: z.number().int(), + width: z.number().int(), + height: z.number().int(), + minSize: z.number().int(), + upscale: z.number().int(), + "X-Plex-Token": z.string(), + }) + .transform((v) => { + return remap$(v, { + "X-Plex-Token": "xPlexToken", + }); + }); + +/** @internal */ +export type GetBannerImageRequest$Outbound = { + ratingKey: number; + width: number; + height: number; + minSize: number; + upscale: number; + "X-Plex-Token": string; +}; + +/** @internal */ +export const GetBannerImageRequest$outboundSchema: z.ZodType< + GetBannerImageRequest$Outbound, + z.ZodTypeDef, + GetBannerImageRequest +> = z + .object({ + ratingKey: z.number().int(), + width: z.number().int(), + height: z.number().int(), + minSize: z.number().int(), + upscale: z.number().int(), + xPlexToken: z.string(), + }) + .transform((v) => { + return remap$(v, { + xPlexToken: "X-Plex-Token", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetBannerImageRequest$ { + /** @deprecated use `GetBannerImageRequest$inboundSchema` instead. */ + export const inboundSchema = GetBannerImageRequest$inboundSchema; + /** @deprecated use `GetBannerImageRequest$outboundSchema` instead. */ + export const outboundSchema = GetBannerImageRequest$outboundSchema; + /** @deprecated use `GetBannerImageRequest$Outbound` instead. */ + export type Outbound = GetBannerImageRequest$Outbound; +} + +/** @internal */ +export const GetBannerImageErrors$inboundSchema: z.ZodType< + GetBannerImageErrors, + z.ZodTypeDef, + unknown +> = z.object({ + code: z.number().optional(), + message: z.string().optional(), + status: z.number().optional(), +}); + +/** @internal */ +export type GetBannerImageErrors$Outbound = { + code?: number | undefined; + message?: string | undefined; + status?: number | undefined; +}; + +/** @internal */ +export const GetBannerImageErrors$outboundSchema: z.ZodType< + GetBannerImageErrors$Outbound, + z.ZodTypeDef, + GetBannerImageErrors +> = z.object({ + code: z.number().optional(), + message: z.string().optional(), + status: z.number().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetBannerImageErrors$ { + /** @deprecated use `GetBannerImageErrors$inboundSchema` instead. */ + export const inboundSchema = GetBannerImageErrors$inboundSchema; + /** @deprecated use `GetBannerImageErrors$outboundSchema` instead. */ + export const outboundSchema = GetBannerImageErrors$outboundSchema; + /** @deprecated use `GetBannerImageErrors$Outbound` instead. */ + export type Outbound = GetBannerImageErrors$Outbound; +} + +/** @internal */ +export const GetBannerImageResponseBody$inboundSchema: z.ZodType< + GetBannerImageResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + errors: z.array(z.lazy(() => GetBannerImageErrors$inboundSchema)).optional(), + RawResponse: z.instanceof(Response).optional(), + }) + .transform((v) => { + const remapped = remap$(v, { + RawResponse: "rawResponse", + }); + + return new GetBannerImageResponseBody(remapped); + }); + +/** @internal */ +export type GetBannerImageResponseBody$Outbound = { + errors?: Array | undefined; + RawResponse?: never | undefined; +}; + +/** @internal */ +export const GetBannerImageResponseBody$outboundSchema: z.ZodType< + GetBannerImageResponseBody$Outbound, + z.ZodTypeDef, + GetBannerImageResponseBody +> = z + .instanceof(GetBannerImageResponseBody) + .transform((v) => v.data$) + .pipe( + z + .object({ + errors: z.array(z.lazy(() => GetBannerImageErrors$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 GetBannerImageResponseBody$ { + /** @deprecated use `GetBannerImageResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetBannerImageResponseBody$inboundSchema; + /** @deprecated use `GetBannerImageResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetBannerImageResponseBody$outboundSchema; + /** @deprecated use `GetBannerImageResponseBody$Outbound` instead. */ + export type Outbound = GetBannerImageResponseBody$Outbound; +} + +/** @internal */ +export const GetBannerImageResponse$inboundSchema: z.ZodType< + GetBannerImageResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + ContentType: z.string(), + StatusCode: z.number().int(), + RawResponse: z.instanceof(Response), + "response-stream": z.instanceof(ReadableStream).optional(), + Headers: z.record(z.array(z.string())), + }) + .transform((v) => { + return remap$(v, { + ContentType: "contentType", + StatusCode: "statusCode", + RawResponse: "rawResponse", + "response-stream": "responseStream", + Headers: "headers", + }); + }); + +/** @internal */ +export type GetBannerImageResponse$Outbound = { + ContentType: string; + StatusCode: number; + RawResponse: never; + "response-stream"?: ReadableStream | undefined; + Headers: { [k: string]: Array }; +}; + +/** @internal */ +export const GetBannerImageResponse$outboundSchema: z.ZodType< + GetBannerImageResponse$Outbound, + z.ZodTypeDef, + GetBannerImageResponse +> = z + .object({ + contentType: z.string(), + statusCode: z.number().int(), + rawResponse: z.instanceof(Response).transform(() => { + throw new Error("Response cannot be serialized"); + }), + responseStream: z.instanceof(ReadableStream).optional(), + headers: z.record(z.array(z.string())), + }) + .transform((v) => { + return remap$(v, { + contentType: "ContentType", + statusCode: "StatusCode", + rawResponse: "RawResponse", + responseStream: "response-stream", + headers: "Headers", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetBannerImageResponse$ { + /** @deprecated use `GetBannerImageResponse$inboundSchema` instead. */ + export const inboundSchema = GetBannerImageResponse$inboundSchema; + /** @deprecated use `GetBannerImageResponse$outboundSchema` instead. */ + export const outboundSchema = GetBannerImageResponse$outboundSchema; + /** @deprecated use `GetBannerImageResponse$Outbound` instead. */ + export type Outbound = GetBannerImageResponse$Outbound; +} diff --git a/src/models/getgeodataop.ts b/src/models/getgeodataop.ts index b18661d1..172d4494 100644 --- a/src/models/getgeodataop.ts +++ b/src/models/getgeodataop.ts @@ -235,11 +235,11 @@ export const GetGeoDataGeoData$inboundSchema: z.ZodType | undefined; +export type GetLibraryDetailsLibraryResponseBodyData = { + errors?: Array | undefined; /** * Raw HTTP response; suitable for custom response parsing */ @@ -52,17 +56,17 @@ export type GetLibraryLibraryResponseBodyData = { /** * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ -export class GetLibraryLibraryResponseBody extends Error { - errors?: Array | undefined; +export class GetLibraryDetailsLibraryResponseBody 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$: GetLibraryLibraryResponseBodyData; + data$: GetLibraryDetailsLibraryResponseBodyData; - constructor(err: GetLibraryLibraryResponseBodyData) { + constructor(err: GetLibraryDetailsLibraryResponseBodyData) { const message = "message" in err && typeof err.message === "string" ? err.message @@ -77,11 +81,11 @@ export class GetLibraryLibraryResponseBody extends Error { this.rawResponse = err.rawResponse; } - this.name = "GetLibraryLibraryResponseBody"; + this.name = "GetLibraryDetailsLibraryResponseBody"; } } -export type GetLibraryDirectory = { +export type GetLibraryDetailsDirectory = { key?: string | undefined; title?: string | undefined; secondary?: boolean | undefined; @@ -89,7 +93,7 @@ export type GetLibraryDirectory = { search?: boolean | undefined; }; -export type GetLibraryFilter = { +export type GetLibraryDetailsFilter = { filter?: string | undefined; filterType?: string | undefined; key?: string | undefined; @@ -113,12 +117,12 @@ export type Field = { subType?: string | undefined; }; -export type GetLibraryType = { +export type GetLibraryDetailsType = { key?: string | undefined; type?: string | undefined; title?: string | undefined; active?: boolean | undefined; - filter?: Array | undefined; + filter?: Array | undefined; sort?: Array | undefined; field?: Array | undefined; }; @@ -133,7 +137,7 @@ export type FieldType = { operator?: Array | undefined; }; -export type GetLibraryMediaContainer = { +export type GetLibraryDetailsMediaContainer = { size?: number | undefined; allowSync?: boolean | undefined; art?: string | undefined; @@ -146,19 +150,19 @@ export type GetLibraryMediaContainer = { title1?: string | undefined; viewGroup?: string | undefined; viewMode?: number | undefined; - directory?: Array | undefined; - type?: Array | undefined; + directory?: Array | undefined; + type?: Array | undefined; fieldType?: Array | undefined; }; /** * The details of the library */ -export type GetLibraryResponseBody = { - mediaContainer?: GetLibraryMediaContainer | undefined; +export type GetLibraryDetailsResponseBody = { + mediaContainer?: GetLibraryDetailsMediaContainer | undefined; }; -export type GetLibraryResponse = { +export type GetLibraryDetailsResponse = { /** * HTTP response content type for this operation */ @@ -174,7 +178,7 @@ export type GetLibraryResponse = { /** * The details of the library */ - object?: GetLibraryResponseBody | undefined; + object?: GetLibraryDetailsResponseBody | undefined; }; /** @internal */ @@ -197,25 +201,28 @@ export namespace IncludeDetails$ { } /** @internal */ -export const GetLibraryRequest$inboundSchema: z.ZodType = - z.object({ - sectionId: z.number(), - includeDetails: IncludeDetails$inboundSchema, - }); +export const GetLibraryDetailsRequest$inboundSchema: z.ZodType< + GetLibraryDetailsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + sectionKey: z.number().int(), + includeDetails: IncludeDetails$inboundSchema, +}); /** @internal */ -export type GetLibraryRequest$Outbound = { - sectionId: number; +export type GetLibraryDetailsRequest$Outbound = { + sectionKey: number; includeDetails: number; }; /** @internal */ -export const GetLibraryRequest$outboundSchema: z.ZodType< - GetLibraryRequest$Outbound, +export const GetLibraryDetailsRequest$outboundSchema: z.ZodType< + GetLibraryDetailsRequest$Outbound, z.ZodTypeDef, - GetLibraryRequest + GetLibraryDetailsRequest > = z.object({ - sectionId: z.number(), + sectionKey: z.number().int(), includeDetails: IncludeDetails$outboundSchema.default(IncludeDetails.Zero), }); @@ -223,35 +230,38 @@ export const GetLibraryRequest$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 GetLibraryRequest$ { - /** @deprecated use `GetLibraryRequest$inboundSchema` instead. */ - export const inboundSchema = GetLibraryRequest$inboundSchema; - /** @deprecated use `GetLibraryRequest$outboundSchema` instead. */ - export const outboundSchema = GetLibraryRequest$outboundSchema; - /** @deprecated use `GetLibraryRequest$Outbound` instead. */ - export type Outbound = GetLibraryRequest$Outbound; +export namespace GetLibraryDetailsRequest$ { + /** @deprecated use `GetLibraryDetailsRequest$inboundSchema` instead. */ + export const inboundSchema = GetLibraryDetailsRequest$inboundSchema; + /** @deprecated use `GetLibraryDetailsRequest$outboundSchema` instead. */ + export const outboundSchema = GetLibraryDetailsRequest$outboundSchema; + /** @deprecated use `GetLibraryDetailsRequest$Outbound` instead. */ + export type Outbound = GetLibraryDetailsRequest$Outbound; } /** @internal */ -export const GetLibraryErrors$inboundSchema: z.ZodType = - z.object({ - code: z.number().optional(), - message: z.string().optional(), - status: z.number().optional(), - }); +export const GetLibraryDetailsErrors$inboundSchema: z.ZodType< + GetLibraryDetailsErrors, + z.ZodTypeDef, + unknown +> = z.object({ + code: z.number().optional(), + message: z.string().optional(), + status: z.number().optional(), +}); /** @internal */ -export type GetLibraryErrors$Outbound = { +export type GetLibraryDetailsErrors$Outbound = { code?: number | undefined; message?: string | undefined; status?: number | undefined; }; /** @internal */ -export const GetLibraryErrors$outboundSchema: z.ZodType< - GetLibraryErrors$Outbound, +export const GetLibraryDetailsErrors$outboundSchema: z.ZodType< + GetLibraryDetailsErrors$Outbound, z.ZodTypeDef, - GetLibraryErrors + GetLibraryDetailsErrors > = z.object({ code: z.number().optional(), message: z.string().optional(), @@ -262,23 +272,23 @@ export const GetLibraryErrors$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 GetLibraryErrors$ { - /** @deprecated use `GetLibraryErrors$inboundSchema` instead. */ - export const inboundSchema = GetLibraryErrors$inboundSchema; - /** @deprecated use `GetLibraryErrors$outboundSchema` instead. */ - export const outboundSchema = GetLibraryErrors$outboundSchema; - /** @deprecated use `GetLibraryErrors$Outbound` instead. */ - export type Outbound = GetLibraryErrors$Outbound; +export namespace GetLibraryDetailsErrors$ { + /** @deprecated use `GetLibraryDetailsErrors$inboundSchema` instead. */ + export const inboundSchema = GetLibraryDetailsErrors$inboundSchema; + /** @deprecated use `GetLibraryDetailsErrors$outboundSchema` instead. */ + export const outboundSchema = GetLibraryDetailsErrors$outboundSchema; + /** @deprecated use `GetLibraryDetailsErrors$Outbound` instead. */ + export type Outbound = GetLibraryDetailsErrors$Outbound; } /** @internal */ -export const GetLibraryLibraryResponseBody$inboundSchema: z.ZodType< - GetLibraryLibraryResponseBody, +export const GetLibraryDetailsLibraryResponseBody$inboundSchema: z.ZodType< + GetLibraryDetailsLibraryResponseBody, z.ZodTypeDef, unknown > = z .object({ - errors: z.array(z.lazy(() => GetLibraryErrors$inboundSchema)).optional(), + errors: z.array(z.lazy(() => GetLibraryDetailsErrors$inboundSchema)).optional(), RawResponse: z.instanceof(Response).optional(), }) .transform((v) => { @@ -286,27 +296,27 @@ export const GetLibraryLibraryResponseBody$inboundSchema: z.ZodType< RawResponse: "rawResponse", }); - return new GetLibraryLibraryResponseBody(remapped); + return new GetLibraryDetailsLibraryResponseBody(remapped); }); /** @internal */ -export type GetLibraryLibraryResponseBody$Outbound = { - errors?: Array | undefined; +export type GetLibraryDetailsLibraryResponseBody$Outbound = { + errors?: Array | undefined; RawResponse?: never | undefined; }; /** @internal */ -export const GetLibraryLibraryResponseBody$outboundSchema: z.ZodType< - GetLibraryLibraryResponseBody$Outbound, +export const GetLibraryDetailsLibraryResponseBody$outboundSchema: z.ZodType< + GetLibraryDetailsLibraryResponseBody$Outbound, z.ZodTypeDef, - GetLibraryLibraryResponseBody + GetLibraryDetailsLibraryResponseBody > = z - .instanceof(GetLibraryLibraryResponseBody) + .instanceof(GetLibraryDetailsLibraryResponseBody) .transform((v) => v.data$) .pipe( z .object({ - errors: z.array(z.lazy(() => GetLibraryErrors$outboundSchema)).optional(), + errors: z.array(z.lazy(() => GetLibraryDetailsErrors$outboundSchema)).optional(), rawResponse: z .instanceof(Response) .transform(() => { @@ -325,18 +335,18 @@ export const GetLibraryLibraryResponseBody$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 GetLibraryLibraryResponseBody$ { - /** @deprecated use `GetLibraryLibraryResponseBody$inboundSchema` instead. */ - export const inboundSchema = GetLibraryLibraryResponseBody$inboundSchema; - /** @deprecated use `GetLibraryLibraryResponseBody$outboundSchema` instead. */ - export const outboundSchema = GetLibraryLibraryResponseBody$outboundSchema; - /** @deprecated use `GetLibraryLibraryResponseBody$Outbound` instead. */ - export type Outbound = GetLibraryLibraryResponseBody$Outbound; +export namespace GetLibraryDetailsLibraryResponseBody$ { + /** @deprecated use `GetLibraryDetailsLibraryResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetLibraryDetailsLibraryResponseBody$inboundSchema; + /** @deprecated use `GetLibraryDetailsLibraryResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetLibraryDetailsLibraryResponseBody$outboundSchema; + /** @deprecated use `GetLibraryDetailsLibraryResponseBody$Outbound` instead. */ + export type Outbound = GetLibraryDetailsLibraryResponseBody$Outbound; } /** @internal */ -export const GetLibraryDirectory$inboundSchema: z.ZodType< - GetLibraryDirectory, +export const GetLibraryDetailsDirectory$inboundSchema: z.ZodType< + GetLibraryDetailsDirectory, z.ZodTypeDef, unknown > = z.object({ @@ -348,7 +358,7 @@ export const GetLibraryDirectory$inboundSchema: z.ZodType< }); /** @internal */ -export type GetLibraryDirectory$Outbound = { +export type GetLibraryDetailsDirectory$Outbound = { key?: string | undefined; title?: string | undefined; secondary?: boolean | undefined; @@ -357,10 +367,10 @@ export type GetLibraryDirectory$Outbound = { }; /** @internal */ -export const GetLibraryDirectory$outboundSchema: z.ZodType< - GetLibraryDirectory$Outbound, +export const GetLibraryDetailsDirectory$outboundSchema: z.ZodType< + GetLibraryDetailsDirectory$Outbound, z.ZodTypeDef, - GetLibraryDirectory + GetLibraryDetailsDirectory > = z.object({ key: z.string().optional(), title: z.string().optional(), @@ -373,27 +383,30 @@ export const GetLibraryDirectory$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 GetLibraryDirectory$ { - /** @deprecated use `GetLibraryDirectory$inboundSchema` instead. */ - export const inboundSchema = GetLibraryDirectory$inboundSchema; - /** @deprecated use `GetLibraryDirectory$outboundSchema` instead. */ - export const outboundSchema = GetLibraryDirectory$outboundSchema; - /** @deprecated use `GetLibraryDirectory$Outbound` instead. */ - export type Outbound = GetLibraryDirectory$Outbound; +export namespace GetLibraryDetailsDirectory$ { + /** @deprecated use `GetLibraryDetailsDirectory$inboundSchema` instead. */ + export const inboundSchema = GetLibraryDetailsDirectory$inboundSchema; + /** @deprecated use `GetLibraryDetailsDirectory$outboundSchema` instead. */ + export const outboundSchema = GetLibraryDetailsDirectory$outboundSchema; + /** @deprecated use `GetLibraryDetailsDirectory$Outbound` instead. */ + export type Outbound = GetLibraryDetailsDirectory$Outbound; } /** @internal */ -export const GetLibraryFilter$inboundSchema: z.ZodType = - z.object({ - filter: z.string().optional(), - filterType: z.string().optional(), - key: z.string().optional(), - title: z.string().optional(), - type: z.string().optional(), - }); +export const GetLibraryDetailsFilter$inboundSchema: z.ZodType< + GetLibraryDetailsFilter, + z.ZodTypeDef, + unknown +> = z.object({ + filter: z.string().optional(), + filterType: z.string().optional(), + key: z.string().optional(), + title: z.string().optional(), + type: z.string().optional(), +}); /** @internal */ -export type GetLibraryFilter$Outbound = { +export type GetLibraryDetailsFilter$Outbound = { filter?: string | undefined; filterType?: string | undefined; key?: string | undefined; @@ -402,10 +415,10 @@ export type GetLibraryFilter$Outbound = { }; /** @internal */ -export const GetLibraryFilter$outboundSchema: z.ZodType< - GetLibraryFilter$Outbound, +export const GetLibraryDetailsFilter$outboundSchema: z.ZodType< + GetLibraryDetailsFilter$Outbound, z.ZodTypeDef, - GetLibraryFilter + GetLibraryDetailsFilter > = z.object({ filter: z.string().optional(), filterType: z.string().optional(), @@ -418,13 +431,13 @@ export const GetLibraryFilter$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 GetLibraryFilter$ { - /** @deprecated use `GetLibraryFilter$inboundSchema` instead. */ - export const inboundSchema = GetLibraryFilter$inboundSchema; - /** @deprecated use `GetLibraryFilter$outboundSchema` instead. */ - export const outboundSchema = GetLibraryFilter$outboundSchema; - /** @deprecated use `GetLibraryFilter$Outbound` instead. */ - export type Outbound = GetLibraryFilter$Outbound; +export namespace GetLibraryDetailsFilter$ { + /** @deprecated use `GetLibraryDetailsFilter$inboundSchema` instead. */ + export const inboundSchema = GetLibraryDetailsFilter$inboundSchema; + /** @deprecated use `GetLibraryDetailsFilter$outboundSchema` instead. */ + export const outboundSchema = GetLibraryDetailsFilter$outboundSchema; + /** @deprecated use `GetLibraryDetailsFilter$Outbound` instead. */ + export type Outbound = GetLibraryDetailsFilter$Outbound; } /** @internal */ @@ -508,13 +521,17 @@ export namespace Field$ { } /** @internal */ -export const GetLibraryType$inboundSchema: z.ZodType = z +export const GetLibraryDetailsType$inboundSchema: z.ZodType< + GetLibraryDetailsType, + z.ZodTypeDef, + unknown +> = z .object({ key: z.string().optional(), type: z.string().optional(), title: z.string().optional(), active: z.boolean().optional(), - Filter: z.array(z.lazy(() => GetLibraryFilter$inboundSchema)).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(), }) @@ -527,28 +544,28 @@ export const GetLibraryType$inboundSchema: z.ZodType | undefined; + Filter?: Array | undefined; Sort?: Array | undefined; Field?: Array | undefined; }; /** @internal */ -export const GetLibraryType$outboundSchema: z.ZodType< - GetLibraryType$Outbound, +export const GetLibraryDetailsType$outboundSchema: z.ZodType< + GetLibraryDetailsType$Outbound, z.ZodTypeDef, - GetLibraryType + GetLibraryDetailsType > = z .object({ key: z.string().optional(), type: z.string().optional(), title: z.string().optional(), active: z.boolean().optional(), - filter: z.array(z.lazy(() => GetLibraryFilter$outboundSchema)).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(), }) @@ -564,13 +581,13 @@ export const GetLibraryType$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 GetLibraryType$ { - /** @deprecated use `GetLibraryType$inboundSchema` instead. */ - export const inboundSchema = GetLibraryType$inboundSchema; - /** @deprecated use `GetLibraryType$outboundSchema` instead. */ - export const outboundSchema = GetLibraryType$outboundSchema; - /** @deprecated use `GetLibraryType$Outbound` instead. */ - export type Outbound = GetLibraryType$Outbound; +export namespace GetLibraryDetailsType$ { + /** @deprecated use `GetLibraryDetailsType$inboundSchema` instead. */ + export const inboundSchema = GetLibraryDetailsType$inboundSchema; + /** @deprecated use `GetLibraryDetailsType$outboundSchema` instead. */ + export const outboundSchema = GetLibraryDetailsType$outboundSchema; + /** @deprecated use `GetLibraryDetailsType$Outbound` instead. */ + export type Outbound = GetLibraryDetailsType$Outbound; } /** @internal */ @@ -649,8 +666,8 @@ export namespace FieldType$ { } /** @internal */ -export const GetLibraryMediaContainer$inboundSchema: z.ZodType< - GetLibraryMediaContainer, +export const GetLibraryDetailsMediaContainer$inboundSchema: z.ZodType< + GetLibraryDetailsMediaContainer, z.ZodTypeDef, unknown > = z @@ -667,8 +684,8 @@ export const GetLibraryMediaContainer$inboundSchema: z.ZodType< title1: z.string().optional(), viewGroup: z.string().optional(), viewMode: z.number().int().optional(), - Directory: z.array(z.lazy(() => GetLibraryDirectory$inboundSchema)).optional(), - Type: z.array(z.lazy(() => GetLibraryType$inboundSchema)).optional(), + Directory: z.array(z.lazy(() => GetLibraryDetailsDirectory$inboundSchema)).optional(), + Type: z.array(z.lazy(() => GetLibraryDetailsType$inboundSchema)).optional(), FieldType: z.array(z.lazy(() => FieldType$inboundSchema)).optional(), }) .transform((v) => { @@ -680,7 +697,7 @@ export const GetLibraryMediaContainer$inboundSchema: z.ZodType< }); /** @internal */ -export type GetLibraryMediaContainer$Outbound = { +export type GetLibraryDetailsMediaContainer$Outbound = { size?: number | undefined; allowSync?: boolean | undefined; art?: string | undefined; @@ -693,16 +710,16 @@ export type GetLibraryMediaContainer$Outbound = { title1?: string | undefined; viewGroup?: string | undefined; viewMode?: number | undefined; - Directory?: Array | undefined; - Type?: Array | undefined; + Directory?: Array | undefined; + Type?: Array | undefined; FieldType?: Array | undefined; }; /** @internal */ -export const GetLibraryMediaContainer$outboundSchema: z.ZodType< - GetLibraryMediaContainer$Outbound, +export const GetLibraryDetailsMediaContainer$outboundSchema: z.ZodType< + GetLibraryDetailsMediaContainer$Outbound, z.ZodTypeDef, - GetLibraryMediaContainer + GetLibraryDetailsMediaContainer > = z .object({ size: z.number().int().optional(), @@ -717,8 +734,8 @@ export const GetLibraryMediaContainer$outboundSchema: z.ZodType< title1: z.string().optional(), viewGroup: z.string().optional(), viewMode: z.number().int().optional(), - directory: z.array(z.lazy(() => GetLibraryDirectory$outboundSchema)).optional(), - type: z.array(z.lazy(() => GetLibraryType$outboundSchema)).optional(), + directory: z.array(z.lazy(() => GetLibraryDetailsDirectory$outboundSchema)).optional(), + type: z.array(z.lazy(() => GetLibraryDetailsType$outboundSchema)).optional(), fieldType: z.array(z.lazy(() => FieldType$outboundSchema)).optional(), }) .transform((v) => { @@ -733,23 +750,23 @@ export const GetLibraryMediaContainer$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 GetLibraryMediaContainer$ { - /** @deprecated use `GetLibraryMediaContainer$inboundSchema` instead. */ - export const inboundSchema = GetLibraryMediaContainer$inboundSchema; - /** @deprecated use `GetLibraryMediaContainer$outboundSchema` instead. */ - export const outboundSchema = GetLibraryMediaContainer$outboundSchema; - /** @deprecated use `GetLibraryMediaContainer$Outbound` instead. */ - export type Outbound = GetLibraryMediaContainer$Outbound; +export namespace GetLibraryDetailsMediaContainer$ { + /** @deprecated use `GetLibraryDetailsMediaContainer$inboundSchema` instead. */ + export const inboundSchema = GetLibraryDetailsMediaContainer$inboundSchema; + /** @deprecated use `GetLibraryDetailsMediaContainer$outboundSchema` instead. */ + export const outboundSchema = GetLibraryDetailsMediaContainer$outboundSchema; + /** @deprecated use `GetLibraryDetailsMediaContainer$Outbound` instead. */ + export type Outbound = GetLibraryDetailsMediaContainer$Outbound; } /** @internal */ -export const GetLibraryResponseBody$inboundSchema: z.ZodType< - GetLibraryResponseBody, +export const GetLibraryDetailsResponseBody$inboundSchema: z.ZodType< + GetLibraryDetailsResponseBody, z.ZodTypeDef, unknown > = z .object({ - MediaContainer: z.lazy(() => GetLibraryMediaContainer$inboundSchema).optional(), + MediaContainer: z.lazy(() => GetLibraryDetailsMediaContainer$inboundSchema).optional(), }) .transform((v) => { return remap$(v, { @@ -758,18 +775,18 @@ export const GetLibraryResponseBody$inboundSchema: z.ZodType< }); /** @internal */ -export type GetLibraryResponseBody$Outbound = { - MediaContainer?: GetLibraryMediaContainer$Outbound | undefined; +export type GetLibraryDetailsResponseBody$Outbound = { + MediaContainer?: GetLibraryDetailsMediaContainer$Outbound | undefined; }; /** @internal */ -export const GetLibraryResponseBody$outboundSchema: z.ZodType< - GetLibraryResponseBody$Outbound, +export const GetLibraryDetailsResponseBody$outboundSchema: z.ZodType< + GetLibraryDetailsResponseBody$Outbound, z.ZodTypeDef, - GetLibraryResponseBody + GetLibraryDetailsResponseBody > = z .object({ - mediaContainer: z.lazy(() => GetLibraryMediaContainer$outboundSchema).optional(), + mediaContainer: z.lazy(() => GetLibraryDetailsMediaContainer$outboundSchema).optional(), }) .transform((v) => { return remap$(v, { @@ -781,18 +798,18 @@ export const GetLibraryResponseBody$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 GetLibraryResponseBody$ { - /** @deprecated use `GetLibraryResponseBody$inboundSchema` instead. */ - export const inboundSchema = GetLibraryResponseBody$inboundSchema; - /** @deprecated use `GetLibraryResponseBody$outboundSchema` instead. */ - export const outboundSchema = GetLibraryResponseBody$outboundSchema; - /** @deprecated use `GetLibraryResponseBody$Outbound` instead. */ - export type Outbound = GetLibraryResponseBody$Outbound; +export namespace GetLibraryDetailsResponseBody$ { + /** @deprecated use `GetLibraryDetailsResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetLibraryDetailsResponseBody$inboundSchema; + /** @deprecated use `GetLibraryDetailsResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetLibraryDetailsResponseBody$outboundSchema; + /** @deprecated use `GetLibraryDetailsResponseBody$Outbound` instead. */ + export type Outbound = GetLibraryDetailsResponseBody$Outbound; } /** @internal */ -export const GetLibraryResponse$inboundSchema: z.ZodType< - GetLibraryResponse, +export const GetLibraryDetailsResponse$inboundSchema: z.ZodType< + GetLibraryDetailsResponse, z.ZodTypeDef, unknown > = z @@ -800,7 +817,7 @@ export const GetLibraryResponse$inboundSchema: z.ZodType< ContentType: z.string(), StatusCode: z.number().int(), RawResponse: z.instanceof(Response), - object: z.lazy(() => GetLibraryResponseBody$inboundSchema).optional(), + object: z.lazy(() => GetLibraryDetailsResponseBody$inboundSchema).optional(), }) .transform((v) => { return remap$(v, { @@ -811,18 +828,18 @@ export const GetLibraryResponse$inboundSchema: z.ZodType< }); /** @internal */ -export type GetLibraryResponse$Outbound = { +export type GetLibraryDetailsResponse$Outbound = { ContentType: string; StatusCode: number; RawResponse: never; - object?: GetLibraryResponseBody$Outbound | undefined; + object?: GetLibraryDetailsResponseBody$Outbound | undefined; }; /** @internal */ -export const GetLibraryResponse$outboundSchema: z.ZodType< - GetLibraryResponse$Outbound, +export const GetLibraryDetailsResponse$outboundSchema: z.ZodType< + GetLibraryDetailsResponse$Outbound, z.ZodTypeDef, - GetLibraryResponse + GetLibraryDetailsResponse > = z .object({ contentType: z.string(), @@ -830,7 +847,7 @@ export const GetLibraryResponse$outboundSchema: z.ZodType< rawResponse: z.instanceof(Response).transform(() => { throw new Error("Response cannot be serialized"); }), - object: z.lazy(() => GetLibraryResponseBody$outboundSchema).optional(), + object: z.lazy(() => GetLibraryDetailsResponseBody$outboundSchema).optional(), }) .transform((v) => { return remap$(v, { @@ -844,11 +861,11 @@ export const GetLibraryResponse$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 GetLibraryResponse$ { - /** @deprecated use `GetLibraryResponse$inboundSchema` instead. */ - export const inboundSchema = GetLibraryResponse$inboundSchema; - /** @deprecated use `GetLibraryResponse$outboundSchema` instead. */ - export const outboundSchema = GetLibraryResponse$outboundSchema; - /** @deprecated use `GetLibraryResponse$Outbound` instead. */ - export type Outbound = GetLibraryResponse$Outbound; +export namespace GetLibraryDetailsResponse$ { + /** @deprecated use `GetLibraryDetailsResponse$inboundSchema` instead. */ + export const inboundSchema = GetLibraryDetailsResponse$inboundSchema; + /** @deprecated use `GetLibraryDetailsResponse$outboundSchema` instead. */ + export const outboundSchema = GetLibraryDetailsResponse$outboundSchema; + /** @deprecated use `GetLibraryDetailsResponse$Outbound` instead. */ + export type Outbound = GetLibraryDetailsResponse$Outbound; } diff --git a/src/models/getlibraryitemsop.ts b/src/models/getlibraryitemsop.ts index ed5a9333..987d3514 100644 --- a/src/models/getlibraryitemsop.ts +++ b/src/models/getlibraryitemsop.ts @@ -31,11 +31,55 @@ export enum Tag { Folder = "folder", } +/** + * Adds the Guids object to the response + * + * @remarks + * + */ +export enum IncludeGuids { + Zero = 0, + One = 1, +} + +/** + * Adds the Meta object to the response + * + * @remarks + * + */ +export enum IncludeMeta { + Zero = 0, + One = 1, +} + +/** + * 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 { + One = 1, + Two = 2, + Three = 3, + Four = 4, +} + export type GetLibraryItemsRequest = { /** - * the Id of the library to query + * The unique key of the Plex library. + * + * @remarks + * Note: This is unique in the context of the Plex server. + * */ - sectionId?: any | undefined; + sectionKey: number; /** * A key representing a specific tag within the section. */ @@ -46,7 +90,44 @@ export type GetLibraryItemsRequest = { * @remarks * */ - includeGuids?: number | undefined; + includeGuids?: IncludeGuids | undefined; + /** + * Adds the Meta object to the response + * + * @remarks + * + */ + includeMeta?: IncludeMeta | 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; + /** + * 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 GetLibraryItemsErrors = { @@ -269,22 +350,92 @@ export namespace Tag$ { export const outboundSchema = Tag$outboundSchema; } +/** @internal */ +export const IncludeGuids$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(IncludeGuids); + +/** @internal */ +export const IncludeGuids$outboundSchema: z.ZodNativeEnum = + IncludeGuids$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace IncludeGuids$ { + /** @deprecated use `IncludeGuids$inboundSchema` instead. */ + export const inboundSchema = IncludeGuids$inboundSchema; + /** @deprecated use `IncludeGuids$outboundSchema` instead. */ + export const outboundSchema = IncludeGuids$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 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 GetLibraryItemsRequest$inboundSchema: z.ZodType< GetLibraryItemsRequest, z.ZodTypeDef, unknown -> = z.object({ - sectionId: z.any().optional(), - tag: Tag$inboundSchema, - includeGuids: z.number().int().optional(), -}); +> = z + .object({ + sectionKey: z.number().int(), + tag: Tag$inboundSchema, + includeGuids: IncludeGuids$inboundSchema.optional(), + includeMeta: IncludeMeta$inboundSchema.optional(), + type: Type$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 GetLibraryItemsRequest$Outbound = { - sectionId?: any | undefined; + sectionKey: number; tag: string; includeGuids?: number | undefined; + includeMeta?: number | undefined; + type: number; + "X-Plex-Container-Start": number; + "X-Plex-Container-Size": number; }; /** @internal */ @@ -292,11 +443,22 @@ export const GetLibraryItemsRequest$outboundSchema: z.ZodType< GetLibraryItemsRequest$Outbound, z.ZodTypeDef, GetLibraryItemsRequest -> = z.object({ - sectionId: z.any().optional(), - tag: Tag$outboundSchema, - includeGuids: z.number().int().optional(), -}); +> = z + .object({ + sectionKey: z.number().int(), + tag: Tag$outboundSchema, + includeGuids: IncludeGuids$outboundSchema.optional(), + includeMeta: IncludeMeta$outboundSchema.optional(), + type: Type$outboundSchema, + 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 diff --git a/src/models/getmediaprovidersop.ts b/src/models/getmediaprovidersop.ts new file mode 100644 index 00000000..bb887506 --- /dev/null +++ b/src/models/getmediaprovidersop.ts @@ -0,0 +1,848 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../lib/primitives.js"; +import * as z from "zod"; + +export type GetMediaProvidersRequest = { + /** + * Plex Authentication Token + */ + xPlexToken: string; +}; + +export type GetMediaProvidersErrors = { + 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 GetMediaProvidersServerResponseBodyData = { + 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 GetMediaProvidersServerResponseBody 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$: GetMediaProvidersServerResponseBodyData; + + constructor(err: GetMediaProvidersServerResponseBodyData) { + 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 = "GetMediaProvidersServerResponseBody"; + } +} + +export type Pivot = { + id?: string | undefined; + key?: string | undefined; + type?: string | undefined; + title?: string | undefined; + context?: string | undefined; + symbol?: string | undefined; +}; + +export type GetMediaProvidersDirectory = { + hubKey?: string | undefined; + title?: string | undefined; + agent?: string | undefined; + language?: string | undefined; + refreshing?: boolean | undefined; + scanner?: string | undefined; + uuid?: string | undefined; + id?: string | undefined; + key?: string | undefined; + type?: string | undefined; + subtype?: string | undefined; + updatedAt?: number | undefined; + scannedAt?: number | undefined; + pivot?: Array | undefined; +}; + +export type Feature = { + key?: string | undefined; + type?: string | undefined; + directory?: Array | undefined; +}; + +export type MediaProvider = { + identifier?: string | undefined; + title?: string | undefined; + types?: string | undefined; + protocols?: string | undefined; + feature?: Array | undefined; +}; + +export type GetMediaProvidersMediaContainer = { + size?: number | undefined; + allowCameraUpload?: boolean | undefined; + allowChannelAccess?: boolean | undefined; + allowSharing?: boolean | undefined; + allowSync?: boolean | undefined; + allowTuners?: boolean | undefined; + backgroundProcessing?: boolean | undefined; + certificate?: boolean | undefined; + companionProxy?: boolean | undefined; + countryCode?: string | undefined; + diagnostics?: string | undefined; + eventStream?: boolean | undefined; + friendlyName?: string | undefined; + livetv?: number | undefined; + machineIdentifier?: string | undefined; + musicAnalysis?: number | undefined; + myPlex?: boolean | undefined; + myPlexMappingState?: string | undefined; + myPlexSigninState?: string | undefined; + myPlexSubscription?: boolean | undefined; + myPlexUsername?: string | undefined; + offlineTranscode?: number | undefined; + ownerFeatures?: string | undefined; + platform?: string | undefined; + platformVersion?: string | undefined; + pluginHost?: boolean | undefined; + pushNotifications?: boolean | undefined; + readOnlyLibraries?: boolean | undefined; + streamingBrainABRVersion?: number | undefined; + streamingBrainVersion?: number | undefined; + sync?: boolean | undefined; + transcoderActiveVideoSessions?: number | undefined; + transcoderAudio?: boolean | undefined; + transcoderLyrics?: boolean | undefined; + transcoderSubtitles?: boolean | undefined; + transcoderVideo?: boolean | undefined; + transcoderVideoBitrates?: string | undefined; + transcoderVideoQualities?: string | undefined; + transcoderVideoResolutions?: string | undefined; + updatedAt?: number | undefined; + updater?: boolean | undefined; + version?: string | undefined; + voiceSearch?: boolean | undefined; + mediaProvider?: Array | undefined; +}; + +/** + * Media providers and their features + */ +export type GetMediaProvidersResponseBody = { + mediaContainer?: GetMediaProvidersMediaContainer | undefined; +}; + +export type GetMediaProvidersResponse = { + /** + * 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; + /** + * Media providers and their features + */ + object?: GetMediaProvidersResponseBody | undefined; +}; + +/** @internal */ +export const GetMediaProvidersRequest$inboundSchema: z.ZodType< + GetMediaProvidersRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + "X-Plex-Token": z.string(), + }) + .transform((v) => { + return remap$(v, { + "X-Plex-Token": "xPlexToken", + }); + }); + +/** @internal */ +export type GetMediaProvidersRequest$Outbound = { + "X-Plex-Token": string; +}; + +/** @internal */ +export const GetMediaProvidersRequest$outboundSchema: z.ZodType< + GetMediaProvidersRequest$Outbound, + z.ZodTypeDef, + GetMediaProvidersRequest +> = z + .object({ + xPlexToken: z.string(), + }) + .transform((v) => { + return remap$(v, { + xPlexToken: "X-Plex-Token", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetMediaProvidersRequest$ { + /** @deprecated use `GetMediaProvidersRequest$inboundSchema` instead. */ + export const inboundSchema = GetMediaProvidersRequest$inboundSchema; + /** @deprecated use `GetMediaProvidersRequest$outboundSchema` instead. */ + export const outboundSchema = GetMediaProvidersRequest$outboundSchema; + /** @deprecated use `GetMediaProvidersRequest$Outbound` instead. */ + export type Outbound = GetMediaProvidersRequest$Outbound; +} + +/** @internal */ +export const GetMediaProvidersErrors$inboundSchema: z.ZodType< + GetMediaProvidersErrors, + z.ZodTypeDef, + unknown +> = z.object({ + code: z.number().optional(), + message: z.string().optional(), + status: z.number().optional(), +}); + +/** @internal */ +export type GetMediaProvidersErrors$Outbound = { + code?: number | undefined; + message?: string | undefined; + status?: number | undefined; +}; + +/** @internal */ +export const GetMediaProvidersErrors$outboundSchema: z.ZodType< + GetMediaProvidersErrors$Outbound, + z.ZodTypeDef, + GetMediaProvidersErrors +> = z.object({ + code: z.number().optional(), + message: z.string().optional(), + status: z.number().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetMediaProvidersErrors$ { + /** @deprecated use `GetMediaProvidersErrors$inboundSchema` instead. */ + export const inboundSchema = GetMediaProvidersErrors$inboundSchema; + /** @deprecated use `GetMediaProvidersErrors$outboundSchema` instead. */ + export const outboundSchema = GetMediaProvidersErrors$outboundSchema; + /** @deprecated use `GetMediaProvidersErrors$Outbound` instead. */ + export type Outbound = GetMediaProvidersErrors$Outbound; +} + +/** @internal */ +export const GetMediaProvidersServerResponseBody$inboundSchema: z.ZodType< + GetMediaProvidersServerResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + errors: z.array(z.lazy(() => GetMediaProvidersErrors$inboundSchema)).optional(), + RawResponse: z.instanceof(Response).optional(), + }) + .transform((v) => { + const remapped = remap$(v, { + RawResponse: "rawResponse", + }); + + return new GetMediaProvidersServerResponseBody(remapped); + }); + +/** @internal */ +export type GetMediaProvidersServerResponseBody$Outbound = { + errors?: Array | undefined; + RawResponse?: never | undefined; +}; + +/** @internal */ +export const GetMediaProvidersServerResponseBody$outboundSchema: z.ZodType< + GetMediaProvidersServerResponseBody$Outbound, + z.ZodTypeDef, + GetMediaProvidersServerResponseBody +> = z + .instanceof(GetMediaProvidersServerResponseBody) + .transform((v) => v.data$) + .pipe( + z + .object({ + errors: z.array(z.lazy(() => GetMediaProvidersErrors$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 GetMediaProvidersServerResponseBody$ { + /** @deprecated use `GetMediaProvidersServerResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetMediaProvidersServerResponseBody$inboundSchema; + /** @deprecated use `GetMediaProvidersServerResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetMediaProvidersServerResponseBody$outboundSchema; + /** @deprecated use `GetMediaProvidersServerResponseBody$Outbound` instead. */ + export type Outbound = GetMediaProvidersServerResponseBody$Outbound; +} + +/** @internal */ +export const Pivot$inboundSchema: z.ZodType = z.object({ + id: z.string().optional(), + key: z.string().optional(), + type: z.string().optional(), + title: z.string().optional(), + context: z.string().optional(), + symbol: z.string().optional(), +}); + +/** @internal */ +export type Pivot$Outbound = { + id?: string | undefined; + key?: string | undefined; + type?: string | undefined; + title?: string | undefined; + context?: string | undefined; + symbol?: string | undefined; +}; + +/** @internal */ +export const Pivot$outboundSchema: z.ZodType = z.object({ + id: z.string().optional(), + key: z.string().optional(), + type: z.string().optional(), + title: z.string().optional(), + context: z.string().optional(), + symbol: 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 Pivot$ { + /** @deprecated use `Pivot$inboundSchema` instead. */ + export const inboundSchema = Pivot$inboundSchema; + /** @deprecated use `Pivot$outboundSchema` instead. */ + export const outboundSchema = Pivot$outboundSchema; + /** @deprecated use `Pivot$Outbound` instead. */ + export type Outbound = Pivot$Outbound; +} + +/** @internal */ +export const GetMediaProvidersDirectory$inboundSchema: z.ZodType< + GetMediaProvidersDirectory, + z.ZodTypeDef, + unknown +> = z + .object({ + hubKey: z.string().optional(), + title: z.string().optional(), + agent: z.string().optional(), + language: z.string().optional(), + refreshing: z.boolean().optional(), + scanner: z.string().optional(), + uuid: z.string().optional(), + id: z.string().optional(), + key: z.string().optional(), + type: z.string().optional(), + subtype: z.string().optional(), + updatedAt: z.number().int().optional(), + scannedAt: z.number().int().optional(), + Pivot: z.array(z.lazy(() => Pivot$inboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + Pivot: "pivot", + }); + }); + +/** @internal */ +export type GetMediaProvidersDirectory$Outbound = { + hubKey?: string | undefined; + title?: string | undefined; + agent?: string | undefined; + language?: string | undefined; + refreshing?: boolean | undefined; + scanner?: string | undefined; + uuid?: string | undefined; + id?: string | undefined; + key?: string | undefined; + type?: string | undefined; + subtype?: string | undefined; + updatedAt?: number | undefined; + scannedAt?: number | undefined; + Pivot?: Array | undefined; +}; + +/** @internal */ +export const GetMediaProvidersDirectory$outboundSchema: z.ZodType< + GetMediaProvidersDirectory$Outbound, + z.ZodTypeDef, + GetMediaProvidersDirectory +> = z + .object({ + hubKey: z.string().optional(), + title: z.string().optional(), + agent: z.string().optional(), + language: z.string().optional(), + refreshing: z.boolean().optional(), + scanner: z.string().optional(), + uuid: z.string().optional(), + id: z.string().optional(), + key: z.string().optional(), + type: z.string().optional(), + subtype: z.string().optional(), + updatedAt: z.number().int().optional(), + scannedAt: z.number().int().optional(), + pivot: z.array(z.lazy(() => Pivot$outboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + pivot: "Pivot", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetMediaProvidersDirectory$ { + /** @deprecated use `GetMediaProvidersDirectory$inboundSchema` instead. */ + export const inboundSchema = GetMediaProvidersDirectory$inboundSchema; + /** @deprecated use `GetMediaProvidersDirectory$outboundSchema` instead. */ + export const outboundSchema = GetMediaProvidersDirectory$outboundSchema; + /** @deprecated use `GetMediaProvidersDirectory$Outbound` instead. */ + export type Outbound = GetMediaProvidersDirectory$Outbound; +} + +/** @internal */ +export const Feature$inboundSchema: z.ZodType = z + .object({ + key: z.string().optional(), + type: z.string().optional(), + Directory: z.array(z.lazy(() => GetMediaProvidersDirectory$inboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + Directory: "directory", + }); + }); + +/** @internal */ +export type Feature$Outbound = { + key?: string | undefined; + type?: string | undefined; + Directory?: Array | undefined; +}; + +/** @internal */ +export const Feature$outboundSchema: z.ZodType = z + .object({ + key: z.string().optional(), + type: z.string().optional(), + directory: z.array(z.lazy(() => GetMediaProvidersDirectory$outboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + directory: "Directory", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Feature$ { + /** @deprecated use `Feature$inboundSchema` instead. */ + export const inboundSchema = Feature$inboundSchema; + /** @deprecated use `Feature$outboundSchema` instead. */ + export const outboundSchema = Feature$outboundSchema; + /** @deprecated use `Feature$Outbound` instead. */ + export type Outbound = Feature$Outbound; +} + +/** @internal */ +export const MediaProvider$inboundSchema: z.ZodType = z + .object({ + identifier: z.string().optional(), + title: z.string().optional(), + types: z.string().optional(), + protocols: z.string().optional(), + Feature: z.array(z.lazy(() => Feature$inboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + Feature: "feature", + }); + }); + +/** @internal */ +export type MediaProvider$Outbound = { + identifier?: string | undefined; + title?: string | undefined; + types?: string | undefined; + protocols?: string | undefined; + Feature?: Array | undefined; +}; + +/** @internal */ +export const MediaProvider$outboundSchema: z.ZodType< + MediaProvider$Outbound, + z.ZodTypeDef, + MediaProvider +> = z + .object({ + identifier: z.string().optional(), + title: z.string().optional(), + types: z.string().optional(), + protocols: z.string().optional(), + feature: z.array(z.lazy(() => Feature$outboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + feature: "Feature", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace MediaProvider$ { + /** @deprecated use `MediaProvider$inboundSchema` instead. */ + export const inboundSchema = MediaProvider$inboundSchema; + /** @deprecated use `MediaProvider$outboundSchema` instead. */ + export const outboundSchema = MediaProvider$outboundSchema; + /** @deprecated use `MediaProvider$Outbound` instead. */ + export type Outbound = MediaProvider$Outbound; +} + +/** @internal */ +export const GetMediaProvidersMediaContainer$inboundSchema: z.ZodType< + GetMediaProvidersMediaContainer, + z.ZodTypeDef, + unknown +> = z + .object({ + size: z.number().int().optional(), + allowCameraUpload: z.boolean().optional(), + allowChannelAccess: z.boolean().optional(), + allowSharing: z.boolean().optional(), + allowSync: z.boolean().optional(), + allowTuners: z.boolean().optional(), + backgroundProcessing: z.boolean().optional(), + certificate: z.boolean().optional(), + companionProxy: z.boolean().optional(), + countryCode: z.string().optional(), + diagnostics: z.string().optional(), + eventStream: z.boolean().optional(), + friendlyName: z.string().optional(), + livetv: z.number().int().optional(), + machineIdentifier: z.string().optional(), + musicAnalysis: z.number().int().optional(), + myPlex: z.boolean().optional(), + myPlexMappingState: z.string().optional(), + myPlexSigninState: z.string().optional(), + myPlexSubscription: z.boolean().optional(), + myPlexUsername: z.string().optional(), + offlineTranscode: z.number().int().optional(), + ownerFeatures: z.string().optional(), + platform: z.string().optional(), + platformVersion: z.string().optional(), + pluginHost: z.boolean().optional(), + pushNotifications: z.boolean().optional(), + readOnlyLibraries: z.boolean().optional(), + streamingBrainABRVersion: z.number().int().optional(), + streamingBrainVersion: z.number().int().optional(), + sync: z.boolean().optional(), + transcoderActiveVideoSessions: z.number().int().optional(), + transcoderAudio: z.boolean().optional(), + transcoderLyrics: z.boolean().optional(), + transcoderSubtitles: z.boolean().optional(), + transcoderVideo: z.boolean().optional(), + transcoderVideoBitrates: z.string().optional(), + transcoderVideoQualities: z.string().optional(), + transcoderVideoResolutions: z.string().optional(), + updatedAt: z.number().int().optional(), + updater: z.boolean().optional(), + version: z.string().optional(), + voiceSearch: z.boolean().optional(), + MediaProvider: z.array(z.lazy(() => MediaProvider$inboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + MediaProvider: "mediaProvider", + }); + }); + +/** @internal */ +export type GetMediaProvidersMediaContainer$Outbound = { + size?: number | undefined; + allowCameraUpload?: boolean | undefined; + allowChannelAccess?: boolean | undefined; + allowSharing?: boolean | undefined; + allowSync?: boolean | undefined; + allowTuners?: boolean | undefined; + backgroundProcessing?: boolean | undefined; + certificate?: boolean | undefined; + companionProxy?: boolean | undefined; + countryCode?: string | undefined; + diagnostics?: string | undefined; + eventStream?: boolean | undefined; + friendlyName?: string | undefined; + livetv?: number | undefined; + machineIdentifier?: string | undefined; + musicAnalysis?: number | undefined; + myPlex?: boolean | undefined; + myPlexMappingState?: string | undefined; + myPlexSigninState?: string | undefined; + myPlexSubscription?: boolean | undefined; + myPlexUsername?: string | undefined; + offlineTranscode?: number | undefined; + ownerFeatures?: string | undefined; + platform?: string | undefined; + platformVersion?: string | undefined; + pluginHost?: boolean | undefined; + pushNotifications?: boolean | undefined; + readOnlyLibraries?: boolean | undefined; + streamingBrainABRVersion?: number | undefined; + streamingBrainVersion?: number | undefined; + sync?: boolean | undefined; + transcoderActiveVideoSessions?: number | undefined; + transcoderAudio?: boolean | undefined; + transcoderLyrics?: boolean | undefined; + transcoderSubtitles?: boolean | undefined; + transcoderVideo?: boolean | undefined; + transcoderVideoBitrates?: string | undefined; + transcoderVideoQualities?: string | undefined; + transcoderVideoResolutions?: string | undefined; + updatedAt?: number | undefined; + updater?: boolean | undefined; + version?: string | undefined; + voiceSearch?: boolean | undefined; + MediaProvider?: Array | undefined; +}; + +/** @internal */ +export const GetMediaProvidersMediaContainer$outboundSchema: z.ZodType< + GetMediaProvidersMediaContainer$Outbound, + z.ZodTypeDef, + GetMediaProvidersMediaContainer +> = z + .object({ + size: z.number().int().optional(), + allowCameraUpload: z.boolean().optional(), + allowChannelAccess: z.boolean().optional(), + allowSharing: z.boolean().optional(), + allowSync: z.boolean().optional(), + allowTuners: z.boolean().optional(), + backgroundProcessing: z.boolean().optional(), + certificate: z.boolean().optional(), + companionProxy: z.boolean().optional(), + countryCode: z.string().optional(), + diagnostics: z.string().optional(), + eventStream: z.boolean().optional(), + friendlyName: z.string().optional(), + livetv: z.number().int().optional(), + machineIdentifier: z.string().optional(), + musicAnalysis: z.number().int().optional(), + myPlex: z.boolean().optional(), + myPlexMappingState: z.string().optional(), + myPlexSigninState: z.string().optional(), + myPlexSubscription: z.boolean().optional(), + myPlexUsername: z.string().optional(), + offlineTranscode: z.number().int().optional(), + ownerFeatures: z.string().optional(), + platform: z.string().optional(), + platformVersion: z.string().optional(), + pluginHost: z.boolean().optional(), + pushNotifications: z.boolean().optional(), + readOnlyLibraries: z.boolean().optional(), + streamingBrainABRVersion: z.number().int().optional(), + streamingBrainVersion: z.number().int().optional(), + sync: z.boolean().optional(), + transcoderActiveVideoSessions: z.number().int().optional(), + transcoderAudio: z.boolean().optional(), + transcoderLyrics: z.boolean().optional(), + transcoderSubtitles: z.boolean().optional(), + transcoderVideo: z.boolean().optional(), + transcoderVideoBitrates: z.string().optional(), + transcoderVideoQualities: z.string().optional(), + transcoderVideoResolutions: z.string().optional(), + updatedAt: z.number().int().optional(), + updater: z.boolean().optional(), + version: z.string().optional(), + voiceSearch: z.boolean().optional(), + mediaProvider: z.array(z.lazy(() => MediaProvider$outboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + mediaProvider: "MediaProvider", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetMediaProvidersMediaContainer$ { + /** @deprecated use `GetMediaProvidersMediaContainer$inboundSchema` instead. */ + export const inboundSchema = GetMediaProvidersMediaContainer$inboundSchema; + /** @deprecated use `GetMediaProvidersMediaContainer$outboundSchema` instead. */ + export const outboundSchema = GetMediaProvidersMediaContainer$outboundSchema; + /** @deprecated use `GetMediaProvidersMediaContainer$Outbound` instead. */ + export type Outbound = GetMediaProvidersMediaContainer$Outbound; +} + +/** @internal */ +export const GetMediaProvidersResponseBody$inboundSchema: z.ZodType< + GetMediaProvidersResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + MediaContainer: z.lazy(() => GetMediaProvidersMediaContainer$inboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + MediaContainer: "mediaContainer", + }); + }); + +/** @internal */ +export type GetMediaProvidersResponseBody$Outbound = { + MediaContainer?: GetMediaProvidersMediaContainer$Outbound | undefined; +}; + +/** @internal */ +export const GetMediaProvidersResponseBody$outboundSchema: z.ZodType< + GetMediaProvidersResponseBody$Outbound, + z.ZodTypeDef, + GetMediaProvidersResponseBody +> = z + .object({ + mediaContainer: z.lazy(() => GetMediaProvidersMediaContainer$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 GetMediaProvidersResponseBody$ { + /** @deprecated use `GetMediaProvidersResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetMediaProvidersResponseBody$inboundSchema; + /** @deprecated use `GetMediaProvidersResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetMediaProvidersResponseBody$outboundSchema; + /** @deprecated use `GetMediaProvidersResponseBody$Outbound` instead. */ + export type Outbound = GetMediaProvidersResponseBody$Outbound; +} + +/** @internal */ +export const GetMediaProvidersResponse$inboundSchema: z.ZodType< + GetMediaProvidersResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + ContentType: z.string(), + StatusCode: z.number().int(), + RawResponse: z.instanceof(Response), + object: z.lazy(() => GetMediaProvidersResponseBody$inboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + ContentType: "contentType", + StatusCode: "statusCode", + RawResponse: "rawResponse", + }); + }); + +/** @internal */ +export type GetMediaProvidersResponse$Outbound = { + ContentType: string; + StatusCode: number; + RawResponse: never; + object?: GetMediaProvidersResponseBody$Outbound | undefined; +}; + +/** @internal */ +export const GetMediaProvidersResponse$outboundSchema: z.ZodType< + GetMediaProvidersResponse$Outbound, + z.ZodTypeDef, + GetMediaProvidersResponse +> = z + .object({ + contentType: z.string(), + statusCode: z.number().int(), + rawResponse: z.instanceof(Response).transform(() => { + throw new Error("Response cannot be serialized"); + }), + object: z.lazy(() => GetMediaProvidersResponseBody$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 GetMediaProvidersResponse$ { + /** @deprecated use `GetMediaProvidersResponse$inboundSchema` instead. */ + export const inboundSchema = GetMediaProvidersResponse$inboundSchema; + /** @deprecated use `GetMediaProvidersResponse$outboundSchema` instead. */ + export const outboundSchema = GetMediaProvidersResponse$outboundSchema; + /** @deprecated use `GetMediaProvidersResponse$Outbound` instead. */ + export type Outbound = GetMediaProvidersResponse$Outbound; +} diff --git a/src/models/getmetadataop.ts b/src/models/getmetadatabyratingkeyop.ts similarity index 64% rename from src/models/getmetadataop.ts rename to src/models/getmetadatabyratingkeyop.ts index a68ac504..d7283b7a 100644 --- a/src/models/getmetadataop.ts +++ b/src/models/getmetadatabyratingkeyop.ts @@ -6,14 +6,14 @@ import { remap as remap$ } from "../lib/primitives.js"; import { RFCDate } from "../types/rfcdate.js"; import * as z from "zod"; -export type GetMetadataRequest = { +export type GetMetaDataByRatingKeyRequest = { /** * the id of the library item to return the children of. */ ratingKey: number; }; -export type GetMetadataErrors = { +export type GetMetaDataByRatingKeyErrors = { code?: number | undefined; message?: string | undefined; status?: number | undefined; @@ -22,8 +22,8 @@ export type GetMetadataErrors = { /** * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ -export type GetMetadataLibraryResponseBodyData = { - errors?: Array | undefined; +export type GetMetaDataByRatingKeyLibraryResponseBodyData = { + errors?: Array | undefined; /** * Raw HTTP response; suitable for custom response parsing */ @@ -33,17 +33,17 @@ export type GetMetadataLibraryResponseBodyData = { /** * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ -export class GetMetadataLibraryResponseBody extends Error { - errors?: Array | undefined; +export class GetMetaDataByRatingKeyLibraryResponseBody 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$: GetMetadataLibraryResponseBodyData; + data$: GetMetaDataByRatingKeyLibraryResponseBodyData; - constructor(err: GetMetadataLibraryResponseBodyData) { + constructor(err: GetMetaDataByRatingKeyLibraryResponseBodyData) { const message = "message" in err && typeof err.message === "string" ? err.message @@ -58,7 +58,7 @@ export class GetMetadataLibraryResponseBody extends Error { this.rawResponse = err.rawResponse; } - this.name = "GetMetadataLibraryResponseBody"; + this.name = "GetMetaDataByRatingKeyLibraryResponseBody"; } } @@ -97,7 +97,7 @@ export type Stream = { samplingRate?: number | undefined; }; -export type GetMetadataPart = { +export type GetMetaDataByRatingKeyPart = { id?: number | undefined; key?: string | undefined; duration?: number | undefined; @@ -111,7 +111,7 @@ export type GetMetadataPart = { stream?: Array | undefined; }; -export type GetMetadataMedia = { +export type GetMetaDataByRatingKeyMedia = { id?: number | undefined; duration?: number | undefined; bitrate?: number | undefined; @@ -128,16 +128,16 @@ export type GetMetadataMedia = { audioProfile?: string | undefined; has64bitOffsets?: boolean | undefined; videoProfile?: string | undefined; - part?: Array | undefined; + part?: Array | undefined; }; -export type GetMetadataGenre = { +export type GetMetaDataByRatingKeyGenre = { id?: number | undefined; filter?: string | undefined; tag?: string | undefined; }; -export type GetMetadataCountry = { +export type GetMetaDataByRatingKeyCountry = { id?: number | undefined; filter?: string | undefined; tag?: string | undefined; @@ -153,7 +153,7 @@ export type Ratings = { type?: string | undefined; }; -export type GetMetadataDirector = { +export type GetMetaDataByRatingKeyDirector = { id?: number | undefined; filter?: string | undefined; tag?: string | undefined; @@ -161,7 +161,7 @@ export type GetMetadataDirector = { thumb?: string | undefined; }; -export type GetMetadataWriter = { +export type GetMetaDataByRatingKeyWriter = { id?: number | undefined; filter?: string | undefined; tag?: string | undefined; @@ -169,7 +169,7 @@ export type GetMetadataWriter = { thumb?: string | undefined; }; -export type GetMetadataRole = { +export type GetMetaDataByRatingKeyRole = { id?: number | undefined; filter?: string | undefined; tag?: string | undefined; @@ -186,7 +186,7 @@ export type Producer = { thumb?: string | undefined; }; -export type GetMetadataMetadata = { +export type GetMetaDataByRatingKeyMetadata = { ratingKey?: string | undefined; key?: string | undefined; guid?: string | undefined; @@ -211,18 +211,18 @@ export type GetMetadataMetadata = { audienceRatingImage?: string | undefined; hasPremiumPrimaryExtra?: string | undefined; ratingImage?: string | undefined; - media?: Array | undefined; - genre?: Array | undefined; - country?: Array | undefined; + media?: Array | undefined; + genre?: Array | undefined; + country?: Array | undefined; guids?: Array | undefined; ratings?: Array | undefined; - director?: Array | undefined; - writer?: Array | undefined; - role?: Array | undefined; + director?: Array | undefined; + writer?: Array | undefined; + role?: Array | undefined; producer?: Array | undefined; }; -export type GetMetadataMediaContainer = { +export type GetMetaDataByRatingKeyMediaContainer = { size?: number | undefined; allowSync?: boolean | undefined; identifier?: string | undefined; @@ -231,17 +231,17 @@ export type GetMetadataMediaContainer = { librarySectionUUID?: string | undefined; mediaTagPrefix?: string | undefined; mediaTagVersion?: number | undefined; - metadata?: Array | undefined; + metadata?: Array | undefined; }; /** * The metadata of the library item. */ -export type GetMetadataResponseBody = { - mediaContainer?: GetMetadataMediaContainer | undefined; +export type GetMetaDataByRatingKeyResponseBody = { + mediaContainer?: GetMetaDataByRatingKeyMediaContainer | undefined; }; -export type GetMetadataResponse = { +export type GetMetaDataByRatingKeyResponse = { /** * HTTP response content type for this operation */ @@ -257,65 +257,68 @@ export type GetMetadataResponse = { /** * The metadata of the library item. */ - object?: GetMetadataResponseBody | undefined; + object?: GetMetaDataByRatingKeyResponseBody | undefined; }; /** @internal */ -export const GetMetadataRequest$inboundSchema: z.ZodType< - GetMetadataRequest, +export const GetMetaDataByRatingKeyRequest$inboundSchema: z.ZodType< + GetMetaDataByRatingKeyRequest, z.ZodTypeDef, unknown > = z.object({ - ratingKey: z.number(), + ratingKey: z.number().int(), }); /** @internal */ -export type GetMetadataRequest$Outbound = { +export type GetMetaDataByRatingKeyRequest$Outbound = { ratingKey: number; }; /** @internal */ -export const GetMetadataRequest$outboundSchema: z.ZodType< - GetMetadataRequest$Outbound, +export const GetMetaDataByRatingKeyRequest$outboundSchema: z.ZodType< + GetMetaDataByRatingKeyRequest$Outbound, z.ZodTypeDef, - GetMetadataRequest + GetMetaDataByRatingKeyRequest > = z.object({ - ratingKey: z.number(), + ratingKey: z.number().int(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace GetMetadataRequest$ { - /** @deprecated use `GetMetadataRequest$inboundSchema` instead. */ - export const inboundSchema = GetMetadataRequest$inboundSchema; - /** @deprecated use `GetMetadataRequest$outboundSchema` instead. */ - export const outboundSchema = GetMetadataRequest$outboundSchema; - /** @deprecated use `GetMetadataRequest$Outbound` instead. */ - export type Outbound = GetMetadataRequest$Outbound; +export namespace GetMetaDataByRatingKeyRequest$ { + /** @deprecated use `GetMetaDataByRatingKeyRequest$inboundSchema` instead. */ + export const inboundSchema = GetMetaDataByRatingKeyRequest$inboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyRequest$outboundSchema` instead. */ + export const outboundSchema = GetMetaDataByRatingKeyRequest$outboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyRequest$Outbound` instead. */ + export type Outbound = GetMetaDataByRatingKeyRequest$Outbound; } /** @internal */ -export const GetMetadataErrors$inboundSchema: z.ZodType = - z.object({ - code: z.number().optional(), - message: z.string().optional(), - status: z.number().optional(), - }); +export const GetMetaDataByRatingKeyErrors$inboundSchema: z.ZodType< + GetMetaDataByRatingKeyErrors, + z.ZodTypeDef, + unknown +> = z.object({ + code: z.number().optional(), + message: z.string().optional(), + status: z.number().optional(), +}); /** @internal */ -export type GetMetadataErrors$Outbound = { +export type GetMetaDataByRatingKeyErrors$Outbound = { code?: number | undefined; message?: string | undefined; status?: number | undefined; }; /** @internal */ -export const GetMetadataErrors$outboundSchema: z.ZodType< - GetMetadataErrors$Outbound, +export const GetMetaDataByRatingKeyErrors$outboundSchema: z.ZodType< + GetMetaDataByRatingKeyErrors$Outbound, z.ZodTypeDef, - GetMetadataErrors + GetMetaDataByRatingKeyErrors > = z.object({ code: z.number().optional(), message: z.string().optional(), @@ -326,23 +329,23 @@ export const GetMetadataErrors$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 GetMetadataErrors$ { - /** @deprecated use `GetMetadataErrors$inboundSchema` instead. */ - export const inboundSchema = GetMetadataErrors$inboundSchema; - /** @deprecated use `GetMetadataErrors$outboundSchema` instead. */ - export const outboundSchema = GetMetadataErrors$outboundSchema; - /** @deprecated use `GetMetadataErrors$Outbound` instead. */ - export type Outbound = GetMetadataErrors$Outbound; +export namespace GetMetaDataByRatingKeyErrors$ { + /** @deprecated use `GetMetaDataByRatingKeyErrors$inboundSchema` instead. */ + export const inboundSchema = GetMetaDataByRatingKeyErrors$inboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyErrors$outboundSchema` instead. */ + export const outboundSchema = GetMetaDataByRatingKeyErrors$outboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyErrors$Outbound` instead. */ + export type Outbound = GetMetaDataByRatingKeyErrors$Outbound; } /** @internal */ -export const GetMetadataLibraryResponseBody$inboundSchema: z.ZodType< - GetMetadataLibraryResponseBody, +export const GetMetaDataByRatingKeyLibraryResponseBody$inboundSchema: z.ZodType< + GetMetaDataByRatingKeyLibraryResponseBody, z.ZodTypeDef, unknown > = z .object({ - errors: z.array(z.lazy(() => GetMetadataErrors$inboundSchema)).optional(), + errors: z.array(z.lazy(() => GetMetaDataByRatingKeyErrors$inboundSchema)).optional(), RawResponse: z.instanceof(Response).optional(), }) .transform((v) => { @@ -350,27 +353,29 @@ export const GetMetadataLibraryResponseBody$inboundSchema: z.ZodType< RawResponse: "rawResponse", }); - return new GetMetadataLibraryResponseBody(remapped); + return new GetMetaDataByRatingKeyLibraryResponseBody(remapped); }); /** @internal */ -export type GetMetadataLibraryResponseBody$Outbound = { - errors?: Array | undefined; +export type GetMetaDataByRatingKeyLibraryResponseBody$Outbound = { + errors?: Array | undefined; RawResponse?: never | undefined; }; /** @internal */ -export const GetMetadataLibraryResponseBody$outboundSchema: z.ZodType< - GetMetadataLibraryResponseBody$Outbound, +export const GetMetaDataByRatingKeyLibraryResponseBody$outboundSchema: z.ZodType< + GetMetaDataByRatingKeyLibraryResponseBody$Outbound, z.ZodTypeDef, - GetMetadataLibraryResponseBody + GetMetaDataByRatingKeyLibraryResponseBody > = z - .instanceof(GetMetadataLibraryResponseBody) + .instanceof(GetMetaDataByRatingKeyLibraryResponseBody) .transform((v) => v.data$) .pipe( z .object({ - errors: z.array(z.lazy(() => GetMetadataErrors$outboundSchema)).optional(), + errors: z + .array(z.lazy(() => GetMetaDataByRatingKeyErrors$outboundSchema)) + .optional(), rawResponse: z .instanceof(Response) .transform(() => { @@ -389,13 +394,13 @@ export const GetMetadataLibraryResponseBody$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 GetMetadataLibraryResponseBody$ { - /** @deprecated use `GetMetadataLibraryResponseBody$inboundSchema` instead. */ - export const inboundSchema = GetMetadataLibraryResponseBody$inboundSchema; - /** @deprecated use `GetMetadataLibraryResponseBody$outboundSchema` instead. */ - export const outboundSchema = GetMetadataLibraryResponseBody$outboundSchema; - /** @deprecated use `GetMetadataLibraryResponseBody$Outbound` instead. */ - export type Outbound = GetMetadataLibraryResponseBody$Outbound; +export namespace GetMetaDataByRatingKeyLibraryResponseBody$ { + /** @deprecated use `GetMetaDataByRatingKeyLibraryResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetMetaDataByRatingKeyLibraryResponseBody$inboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyLibraryResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetMetaDataByRatingKeyLibraryResponseBody$outboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyLibraryResponseBody$Outbound` instead. */ + export type Outbound = GetMetaDataByRatingKeyLibraryResponseBody$Outbound; } /** @internal */ @@ -520,7 +525,11 @@ export namespace Stream$ { } /** @internal */ -export const GetMetadataPart$inboundSchema: z.ZodType = z +export const GetMetaDataByRatingKeyPart$inboundSchema: z.ZodType< + GetMetaDataByRatingKeyPart, + z.ZodTypeDef, + unknown +> = z .object({ id: z.number().int().optional(), key: z.string().optional(), @@ -541,7 +550,7 @@ export const GetMetadataPart$inboundSchema: z.ZodType = z .object({ id: z.number().int().optional(), @@ -584,68 +593,20 @@ export const GetMetadataPart$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 GetMetadataPart$ { - /** @deprecated use `GetMetadataPart$inboundSchema` instead. */ - export const inboundSchema = GetMetadataPart$inboundSchema; - /** @deprecated use `GetMetadataPart$outboundSchema` instead. */ - export const outboundSchema = GetMetadataPart$outboundSchema; - /** @deprecated use `GetMetadataPart$Outbound` instead. */ - export type Outbound = GetMetadataPart$Outbound; +export namespace GetMetaDataByRatingKeyPart$ { + /** @deprecated use `GetMetaDataByRatingKeyPart$inboundSchema` instead. */ + export const inboundSchema = GetMetaDataByRatingKeyPart$inboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyPart$outboundSchema` instead. */ + export const outboundSchema = GetMetaDataByRatingKeyPart$outboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyPart$Outbound` instead. */ + export type Outbound = GetMetaDataByRatingKeyPart$Outbound; } /** @internal */ -export const GetMetadataMedia$inboundSchema: z.ZodType = 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(), - optimizedForStreaming: z.number().int().optional(), - audioProfile: z.string().optional(), - has64bitOffsets: z.boolean().optional(), - videoProfile: z.string().optional(), - Part: z.array(z.lazy(() => GetMetadataPart$inboundSchema)).optional(), - }) - .transform((v) => { - return remap$(v, { - Part: "part", - }); - }); - -/** @internal */ -export type GetMetadataMedia$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; - optimizedForStreaming?: number | undefined; - audioProfile?: string | undefined; - has64bitOffsets?: boolean | undefined; - videoProfile?: string | undefined; - Part?: Array | undefined; -}; - -/** @internal */ -export const GetMetadataMedia$outboundSchema: z.ZodType< - GetMetadataMedia$Outbound, +export const GetMetaDataByRatingKeyMedia$inboundSchema: z.ZodType< + GetMetaDataByRatingKeyMedia, z.ZodTypeDef, - GetMetadataMedia + unknown > = z .object({ id: z.number().int().optional(), @@ -664,7 +625,59 @@ export const GetMetadataMedia$outboundSchema: z.ZodType< audioProfile: z.string().optional(), has64bitOffsets: z.boolean().optional(), videoProfile: z.string().optional(), - part: z.array(z.lazy(() => GetMetadataPart$outboundSchema)).optional(), + Part: z.array(z.lazy(() => GetMetaDataByRatingKeyPart$inboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + Part: "part", + }); + }); + +/** @internal */ +export type GetMetaDataByRatingKeyMedia$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; + optimizedForStreaming?: number | undefined; + audioProfile?: string | undefined; + has64bitOffsets?: boolean | undefined; + videoProfile?: string | undefined; + Part?: Array | undefined; +}; + +/** @internal */ +export const GetMetaDataByRatingKeyMedia$outboundSchema: z.ZodType< + GetMetaDataByRatingKeyMedia$Outbound, + z.ZodTypeDef, + GetMetaDataByRatingKeyMedia +> = 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(), + optimizedForStreaming: z.number().int().optional(), + audioProfile: z.string().optional(), + has64bitOffsets: z.boolean().optional(), + videoProfile: z.string().optional(), + part: z.array(z.lazy(() => GetMetaDataByRatingKeyPart$outboundSchema)).optional(), }) .transform((v) => { return remap$(v, { @@ -676,57 +689,18 @@ export const GetMetadataMedia$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 GetMetadataMedia$ { - /** @deprecated use `GetMetadataMedia$inboundSchema` instead. */ - export const inboundSchema = GetMetadataMedia$inboundSchema; - /** @deprecated use `GetMetadataMedia$outboundSchema` instead. */ - export const outboundSchema = GetMetadataMedia$outboundSchema; - /** @deprecated use `GetMetadataMedia$Outbound` instead. */ - export type Outbound = GetMetadataMedia$Outbound; +export namespace GetMetaDataByRatingKeyMedia$ { + /** @deprecated use `GetMetaDataByRatingKeyMedia$inboundSchema` instead. */ + export const inboundSchema = GetMetaDataByRatingKeyMedia$inboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyMedia$outboundSchema` instead. */ + export const outboundSchema = GetMetaDataByRatingKeyMedia$outboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyMedia$Outbound` instead. */ + export type Outbound = GetMetaDataByRatingKeyMedia$Outbound; } /** @internal */ -export const GetMetadataGenre$inboundSchema: z.ZodType = - z.object({ - id: z.number().int().optional(), - filter: z.string().optional(), - tag: z.string().optional(), - }); - -/** @internal */ -export type GetMetadataGenre$Outbound = { - id?: number | undefined; - filter?: string | undefined; - tag?: string | undefined; -}; - -/** @internal */ -export const GetMetadataGenre$outboundSchema: z.ZodType< - GetMetadataGenre$Outbound, - z.ZodTypeDef, - GetMetadataGenre -> = z.object({ - id: z.number().int().optional(), - filter: z.string().optional(), - 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 GetMetadataGenre$ { - /** @deprecated use `GetMetadataGenre$inboundSchema` instead. */ - export const inboundSchema = GetMetadataGenre$inboundSchema; - /** @deprecated use `GetMetadataGenre$outboundSchema` instead. */ - export const outboundSchema = GetMetadataGenre$outboundSchema; - /** @deprecated use `GetMetadataGenre$Outbound` instead. */ - export type Outbound = GetMetadataGenre$Outbound; -} - -/** @internal */ -export const GetMetadataCountry$inboundSchema: z.ZodType< - GetMetadataCountry, +export const GetMetaDataByRatingKeyGenre$inboundSchema: z.ZodType< + GetMetaDataByRatingKeyGenre, z.ZodTypeDef, unknown > = z.object({ @@ -736,17 +710,17 @@ export const GetMetadataCountry$inboundSchema: z.ZodType< }); /** @internal */ -export type GetMetadataCountry$Outbound = { +export type GetMetaDataByRatingKeyGenre$Outbound = { id?: number | undefined; filter?: string | undefined; tag?: string | undefined; }; /** @internal */ -export const GetMetadataCountry$outboundSchema: z.ZodType< - GetMetadataCountry$Outbound, +export const GetMetaDataByRatingKeyGenre$outboundSchema: z.ZodType< + GetMetaDataByRatingKeyGenre$Outbound, z.ZodTypeDef, - GetMetadataCountry + GetMetaDataByRatingKeyGenre > = z.object({ id: z.number().int().optional(), filter: z.string().optional(), @@ -757,13 +731,55 @@ export const GetMetadataCountry$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 GetMetadataCountry$ { - /** @deprecated use `GetMetadataCountry$inboundSchema` instead. */ - export const inboundSchema = GetMetadataCountry$inboundSchema; - /** @deprecated use `GetMetadataCountry$outboundSchema` instead. */ - export const outboundSchema = GetMetadataCountry$outboundSchema; - /** @deprecated use `GetMetadataCountry$Outbound` instead. */ - export type Outbound = GetMetadataCountry$Outbound; +export namespace GetMetaDataByRatingKeyGenre$ { + /** @deprecated use `GetMetaDataByRatingKeyGenre$inboundSchema` instead. */ + export const inboundSchema = GetMetaDataByRatingKeyGenre$inboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyGenre$outboundSchema` instead. */ + export const outboundSchema = GetMetaDataByRatingKeyGenre$outboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyGenre$Outbound` instead. */ + export type Outbound = GetMetaDataByRatingKeyGenre$Outbound; +} + +/** @internal */ +export const GetMetaDataByRatingKeyCountry$inboundSchema: z.ZodType< + GetMetaDataByRatingKeyCountry, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.number().int().optional(), + filter: z.string().optional(), + tag: z.string().optional(), +}); + +/** @internal */ +export type GetMetaDataByRatingKeyCountry$Outbound = { + id?: number | undefined; + filter?: string | undefined; + tag?: string | undefined; +}; + +/** @internal */ +export const GetMetaDataByRatingKeyCountry$outboundSchema: z.ZodType< + GetMetaDataByRatingKeyCountry$Outbound, + z.ZodTypeDef, + GetMetaDataByRatingKeyCountry +> = z.object({ + id: z.number().int().optional(), + filter: z.string().optional(), + 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 GetMetaDataByRatingKeyCountry$ { + /** @deprecated use `GetMetaDataByRatingKeyCountry$inboundSchema` instead. */ + export const inboundSchema = GetMetaDataByRatingKeyCountry$inboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyCountry$outboundSchema` instead. */ + export const outboundSchema = GetMetaDataByRatingKeyCountry$outboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyCountry$Outbound` instead. */ + export type Outbound = GetMetaDataByRatingKeyCountry$Outbound; } /** @internal */ @@ -829,8 +845,8 @@ export namespace Ratings$ { } /** @internal */ -export const GetMetadataDirector$inboundSchema: z.ZodType< - GetMetadataDirector, +export const GetMetaDataByRatingKeyDirector$inboundSchema: z.ZodType< + GetMetaDataByRatingKeyDirector, z.ZodTypeDef, unknown > = z.object({ @@ -842,7 +858,7 @@ export const GetMetadataDirector$inboundSchema: z.ZodType< }); /** @internal */ -export type GetMetadataDirector$Outbound = { +export type GetMetaDataByRatingKeyDirector$Outbound = { id?: number | undefined; filter?: string | undefined; tag?: string | undefined; @@ -851,10 +867,10 @@ export type GetMetadataDirector$Outbound = { }; /** @internal */ -export const GetMetadataDirector$outboundSchema: z.ZodType< - GetMetadataDirector$Outbound, +export const GetMetaDataByRatingKeyDirector$outboundSchema: z.ZodType< + GetMetaDataByRatingKeyDirector$Outbound, z.ZodTypeDef, - GetMetadataDirector + GetMetaDataByRatingKeyDirector > = z.object({ id: z.number().int().optional(), filter: z.string().optional(), @@ -867,27 +883,30 @@ export const GetMetadataDirector$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 GetMetadataDirector$ { - /** @deprecated use `GetMetadataDirector$inboundSchema` instead. */ - export const inboundSchema = GetMetadataDirector$inboundSchema; - /** @deprecated use `GetMetadataDirector$outboundSchema` instead. */ - export const outboundSchema = GetMetadataDirector$outboundSchema; - /** @deprecated use `GetMetadataDirector$Outbound` instead. */ - export type Outbound = GetMetadataDirector$Outbound; +export namespace GetMetaDataByRatingKeyDirector$ { + /** @deprecated use `GetMetaDataByRatingKeyDirector$inboundSchema` instead. */ + export const inboundSchema = GetMetaDataByRatingKeyDirector$inboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyDirector$outboundSchema` instead. */ + export const outboundSchema = GetMetaDataByRatingKeyDirector$outboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyDirector$Outbound` instead. */ + export type Outbound = GetMetaDataByRatingKeyDirector$Outbound; } /** @internal */ -export const GetMetadataWriter$inboundSchema: z.ZodType = - z.object({ - id: z.number().int().optional(), - filter: z.string().optional(), - tag: z.string().optional(), - tagKey: z.string().optional(), - thumb: z.string().optional(), - }); +export const GetMetaDataByRatingKeyWriter$inboundSchema: z.ZodType< + GetMetaDataByRatingKeyWriter, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.number().int().optional(), + filter: z.string().optional(), + tag: z.string().optional(), + tagKey: z.string().optional(), + thumb: z.string().optional(), +}); /** @internal */ -export type GetMetadataWriter$Outbound = { +export type GetMetaDataByRatingKeyWriter$Outbound = { id?: number | undefined; filter?: string | undefined; tag?: string | undefined; @@ -896,10 +915,10 @@ export type GetMetadataWriter$Outbound = { }; /** @internal */ -export const GetMetadataWriter$outboundSchema: z.ZodType< - GetMetadataWriter$Outbound, +export const GetMetaDataByRatingKeyWriter$outboundSchema: z.ZodType< + GetMetaDataByRatingKeyWriter$Outbound, z.ZodTypeDef, - GetMetadataWriter + GetMetaDataByRatingKeyWriter > = z.object({ id: z.number().int().optional(), filter: z.string().optional(), @@ -912,28 +931,31 @@ export const GetMetadataWriter$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 GetMetadataWriter$ { - /** @deprecated use `GetMetadataWriter$inboundSchema` instead. */ - export const inboundSchema = GetMetadataWriter$inboundSchema; - /** @deprecated use `GetMetadataWriter$outboundSchema` instead. */ - export const outboundSchema = GetMetadataWriter$outboundSchema; - /** @deprecated use `GetMetadataWriter$Outbound` instead. */ - export type Outbound = GetMetadataWriter$Outbound; +export namespace GetMetaDataByRatingKeyWriter$ { + /** @deprecated use `GetMetaDataByRatingKeyWriter$inboundSchema` instead. */ + export const inboundSchema = GetMetaDataByRatingKeyWriter$inboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyWriter$outboundSchema` instead. */ + export const outboundSchema = GetMetaDataByRatingKeyWriter$outboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyWriter$Outbound` instead. */ + export type Outbound = GetMetaDataByRatingKeyWriter$Outbound; } /** @internal */ -export const GetMetadataRole$inboundSchema: z.ZodType = - z.object({ - id: z.number().int().optional(), - filter: z.string().optional(), - tag: z.string().optional(), - tagKey: z.string().optional(), - role: z.string().optional(), - thumb: z.string().optional(), - }); +export const GetMetaDataByRatingKeyRole$inboundSchema: z.ZodType< + GetMetaDataByRatingKeyRole, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.number().int().optional(), + filter: z.string().optional(), + tag: z.string().optional(), + tagKey: z.string().optional(), + role: z.string().optional(), + thumb: z.string().optional(), +}); /** @internal */ -export type GetMetadataRole$Outbound = { +export type GetMetaDataByRatingKeyRole$Outbound = { id?: number | undefined; filter?: string | undefined; tag?: string | undefined; @@ -943,10 +965,10 @@ export type GetMetadataRole$Outbound = { }; /** @internal */ -export const GetMetadataRole$outboundSchema: z.ZodType< - GetMetadataRole$Outbound, +export const GetMetaDataByRatingKeyRole$outboundSchema: z.ZodType< + GetMetaDataByRatingKeyRole$Outbound, z.ZodTypeDef, - GetMetadataRole + GetMetaDataByRatingKeyRole > = z.object({ id: z.number().int().optional(), filter: z.string().optional(), @@ -960,13 +982,13 @@ export const GetMetadataRole$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 GetMetadataRole$ { - /** @deprecated use `GetMetadataRole$inboundSchema` instead. */ - export const inboundSchema = GetMetadataRole$inboundSchema; - /** @deprecated use `GetMetadataRole$outboundSchema` instead. */ - export const outboundSchema = GetMetadataRole$outboundSchema; - /** @deprecated use `GetMetadataRole$Outbound` instead. */ - export type Outbound = GetMetadataRole$Outbound; +export namespace GetMetaDataByRatingKeyRole$ { + /** @deprecated use `GetMetaDataByRatingKeyRole$inboundSchema` instead. */ + export const inboundSchema = GetMetaDataByRatingKeyRole$inboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyRole$outboundSchema` instead. */ + export const outboundSchema = GetMetaDataByRatingKeyRole$outboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyRole$Outbound` instead. */ + export type Outbound = GetMetaDataByRatingKeyRole$Outbound; } /** @internal */ @@ -1011,8 +1033,8 @@ export namespace Producer$ { } /** @internal */ -export const GetMetadataMetadata$inboundSchema: z.ZodType< - GetMetadataMetadata, +export const GetMetaDataByRatingKeyMetadata$inboundSchema: z.ZodType< + GetMetaDataByRatingKeyMetadata, z.ZodTypeDef, unknown > = z @@ -1044,14 +1066,14 @@ export const GetMetadataMetadata$inboundSchema: z.ZodType< audienceRatingImage: z.string().optional(), hasPremiumPrimaryExtra: z.string().optional(), ratingImage: z.string().optional(), - Media: z.array(z.lazy(() => GetMetadataMedia$inboundSchema)).optional(), - Genre: z.array(z.lazy(() => GetMetadataGenre$inboundSchema)).optional(), - Country: z.array(z.lazy(() => GetMetadataCountry$inboundSchema)).optional(), + Media: z.array(z.lazy(() => GetMetaDataByRatingKeyMedia$inboundSchema)).optional(), + Genre: z.array(z.lazy(() => GetMetaDataByRatingKeyGenre$inboundSchema)).optional(), + Country: z.array(z.lazy(() => GetMetaDataByRatingKeyCountry$inboundSchema)).optional(), Guid: z.array(z.lazy(() => Guids$inboundSchema)).optional(), Rating: z.array(z.lazy(() => Ratings$inboundSchema)).optional(), - Director: z.array(z.lazy(() => GetMetadataDirector$inboundSchema)).optional(), - Writer: z.array(z.lazy(() => GetMetadataWriter$inboundSchema)).optional(), - Role: z.array(z.lazy(() => GetMetadataRole$inboundSchema)).optional(), + Director: z.array(z.lazy(() => GetMetaDataByRatingKeyDirector$inboundSchema)).optional(), + Writer: z.array(z.lazy(() => GetMetaDataByRatingKeyWriter$inboundSchema)).optional(), + Role: z.array(z.lazy(() => GetMetaDataByRatingKeyRole$inboundSchema)).optional(), Producer: z.array(z.lazy(() => Producer$inboundSchema)).optional(), }) .transform((v) => { @@ -1069,7 +1091,7 @@ export const GetMetadataMetadata$inboundSchema: z.ZodType< }); /** @internal */ -export type GetMetadataMetadata$Outbound = { +export type GetMetaDataByRatingKeyMetadata$Outbound = { ratingKey?: string | undefined; key?: string | undefined; guid?: string | undefined; @@ -1094,22 +1116,22 @@ export type GetMetadataMetadata$Outbound = { audienceRatingImage?: string | undefined; hasPremiumPrimaryExtra?: string | undefined; ratingImage?: string | undefined; - Media?: Array | undefined; - Genre?: Array | undefined; - Country?: Array | undefined; + Media?: Array | undefined; + Genre?: Array | undefined; + Country?: Array | undefined; Guid?: Array | undefined; Rating?: Array | undefined; - Director?: Array | undefined; - Writer?: Array | undefined; - Role?: Array | undefined; + Director?: Array | undefined; + Writer?: Array | undefined; + Role?: Array | undefined; Producer?: Array | undefined; }; /** @internal */ -export const GetMetadataMetadata$outboundSchema: z.ZodType< - GetMetadataMetadata$Outbound, +export const GetMetaDataByRatingKeyMetadata$outboundSchema: z.ZodType< + GetMetaDataByRatingKeyMetadata$Outbound, z.ZodTypeDef, - GetMetadataMetadata + GetMetaDataByRatingKeyMetadata > = z .object({ ratingKey: z.string().optional(), @@ -1139,14 +1161,14 @@ export const GetMetadataMetadata$outboundSchema: z.ZodType< audienceRatingImage: z.string().optional(), hasPremiumPrimaryExtra: z.string().optional(), ratingImage: z.string().optional(), - media: z.array(z.lazy(() => GetMetadataMedia$outboundSchema)).optional(), - genre: z.array(z.lazy(() => GetMetadataGenre$outboundSchema)).optional(), - country: z.array(z.lazy(() => GetMetadataCountry$outboundSchema)).optional(), + media: z.array(z.lazy(() => GetMetaDataByRatingKeyMedia$outboundSchema)).optional(), + genre: z.array(z.lazy(() => GetMetaDataByRatingKeyGenre$outboundSchema)).optional(), + country: z.array(z.lazy(() => GetMetaDataByRatingKeyCountry$outboundSchema)).optional(), guids: z.array(z.lazy(() => Guids$outboundSchema)).optional(), ratings: z.array(z.lazy(() => Ratings$outboundSchema)).optional(), - director: z.array(z.lazy(() => GetMetadataDirector$outboundSchema)).optional(), - writer: z.array(z.lazy(() => GetMetadataWriter$outboundSchema)).optional(), - role: z.array(z.lazy(() => GetMetadataRole$outboundSchema)).optional(), + director: z.array(z.lazy(() => GetMetaDataByRatingKeyDirector$outboundSchema)).optional(), + writer: z.array(z.lazy(() => GetMetaDataByRatingKeyWriter$outboundSchema)).optional(), + role: z.array(z.lazy(() => GetMetaDataByRatingKeyRole$outboundSchema)).optional(), producer: z.array(z.lazy(() => Producer$outboundSchema)).optional(), }) .transform((v) => { @@ -1167,18 +1189,18 @@ export const GetMetadataMetadata$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 GetMetadataMetadata$ { - /** @deprecated use `GetMetadataMetadata$inboundSchema` instead. */ - export const inboundSchema = GetMetadataMetadata$inboundSchema; - /** @deprecated use `GetMetadataMetadata$outboundSchema` instead. */ - export const outboundSchema = GetMetadataMetadata$outboundSchema; - /** @deprecated use `GetMetadataMetadata$Outbound` instead. */ - export type Outbound = GetMetadataMetadata$Outbound; +export namespace GetMetaDataByRatingKeyMetadata$ { + /** @deprecated use `GetMetaDataByRatingKeyMetadata$inboundSchema` instead. */ + export const inboundSchema = GetMetaDataByRatingKeyMetadata$inboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyMetadata$outboundSchema` instead. */ + export const outboundSchema = GetMetaDataByRatingKeyMetadata$outboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyMetadata$Outbound` instead. */ + export type Outbound = GetMetaDataByRatingKeyMetadata$Outbound; } /** @internal */ -export const GetMetadataMediaContainer$inboundSchema: z.ZodType< - GetMetadataMediaContainer, +export const GetMetaDataByRatingKeyMediaContainer$inboundSchema: z.ZodType< + GetMetaDataByRatingKeyMediaContainer, z.ZodTypeDef, unknown > = z @@ -1191,7 +1213,7 @@ export const GetMetadataMediaContainer$inboundSchema: z.ZodType< librarySectionUUID: z.string().optional(), mediaTagPrefix: z.string().optional(), mediaTagVersion: z.number().int().optional(), - Metadata: z.array(z.lazy(() => GetMetadataMetadata$inboundSchema)).optional(), + Metadata: z.array(z.lazy(() => GetMetaDataByRatingKeyMetadata$inboundSchema)).optional(), }) .transform((v) => { return remap$(v, { @@ -1200,7 +1222,7 @@ export const GetMetadataMediaContainer$inboundSchema: z.ZodType< }); /** @internal */ -export type GetMetadataMediaContainer$Outbound = { +export type GetMetaDataByRatingKeyMediaContainer$Outbound = { size?: number | undefined; allowSync?: boolean | undefined; identifier?: string | undefined; @@ -1209,14 +1231,14 @@ export type GetMetadataMediaContainer$Outbound = { librarySectionUUID?: string | undefined; mediaTagPrefix?: string | undefined; mediaTagVersion?: number | undefined; - Metadata?: Array | undefined; + Metadata?: Array | undefined; }; /** @internal */ -export const GetMetadataMediaContainer$outboundSchema: z.ZodType< - GetMetadataMediaContainer$Outbound, +export const GetMetaDataByRatingKeyMediaContainer$outboundSchema: z.ZodType< + GetMetaDataByRatingKeyMediaContainer$Outbound, z.ZodTypeDef, - GetMetadataMediaContainer + GetMetaDataByRatingKeyMediaContainer > = z .object({ size: z.number().int().optional(), @@ -1227,7 +1249,7 @@ export const GetMetadataMediaContainer$outboundSchema: z.ZodType< librarySectionUUID: z.string().optional(), mediaTagPrefix: z.string().optional(), mediaTagVersion: z.number().int().optional(), - metadata: z.array(z.lazy(() => GetMetadataMetadata$outboundSchema)).optional(), + metadata: z.array(z.lazy(() => GetMetaDataByRatingKeyMetadata$outboundSchema)).optional(), }) .transform((v) => { return remap$(v, { @@ -1239,23 +1261,23 @@ export const GetMetadataMediaContainer$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 GetMetadataMediaContainer$ { - /** @deprecated use `GetMetadataMediaContainer$inboundSchema` instead. */ - export const inboundSchema = GetMetadataMediaContainer$inboundSchema; - /** @deprecated use `GetMetadataMediaContainer$outboundSchema` instead. */ - export const outboundSchema = GetMetadataMediaContainer$outboundSchema; - /** @deprecated use `GetMetadataMediaContainer$Outbound` instead. */ - export type Outbound = GetMetadataMediaContainer$Outbound; +export namespace GetMetaDataByRatingKeyMediaContainer$ { + /** @deprecated use `GetMetaDataByRatingKeyMediaContainer$inboundSchema` instead. */ + export const inboundSchema = GetMetaDataByRatingKeyMediaContainer$inboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyMediaContainer$outboundSchema` instead. */ + export const outboundSchema = GetMetaDataByRatingKeyMediaContainer$outboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyMediaContainer$Outbound` instead. */ + export type Outbound = GetMetaDataByRatingKeyMediaContainer$Outbound; } /** @internal */ -export const GetMetadataResponseBody$inboundSchema: z.ZodType< - GetMetadataResponseBody, +export const GetMetaDataByRatingKeyResponseBody$inboundSchema: z.ZodType< + GetMetaDataByRatingKeyResponseBody, z.ZodTypeDef, unknown > = z .object({ - MediaContainer: z.lazy(() => GetMetadataMediaContainer$inboundSchema).optional(), + MediaContainer: z.lazy(() => GetMetaDataByRatingKeyMediaContainer$inboundSchema).optional(), }) .transform((v) => { return remap$(v, { @@ -1264,18 +1286,20 @@ export const GetMetadataResponseBody$inboundSchema: z.ZodType< }); /** @internal */ -export type GetMetadataResponseBody$Outbound = { - MediaContainer?: GetMetadataMediaContainer$Outbound | undefined; +export type GetMetaDataByRatingKeyResponseBody$Outbound = { + MediaContainer?: GetMetaDataByRatingKeyMediaContainer$Outbound | undefined; }; /** @internal */ -export const GetMetadataResponseBody$outboundSchema: z.ZodType< - GetMetadataResponseBody$Outbound, +export const GetMetaDataByRatingKeyResponseBody$outboundSchema: z.ZodType< + GetMetaDataByRatingKeyResponseBody$Outbound, z.ZodTypeDef, - GetMetadataResponseBody + GetMetaDataByRatingKeyResponseBody > = z .object({ - mediaContainer: z.lazy(() => GetMetadataMediaContainer$outboundSchema).optional(), + mediaContainer: z + .lazy(() => GetMetaDataByRatingKeyMediaContainer$outboundSchema) + .optional(), }) .transform((v) => { return remap$(v, { @@ -1287,18 +1311,18 @@ export const GetMetadataResponseBody$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 GetMetadataResponseBody$ { - /** @deprecated use `GetMetadataResponseBody$inboundSchema` instead. */ - export const inboundSchema = GetMetadataResponseBody$inboundSchema; - /** @deprecated use `GetMetadataResponseBody$outboundSchema` instead. */ - export const outboundSchema = GetMetadataResponseBody$outboundSchema; - /** @deprecated use `GetMetadataResponseBody$Outbound` instead. */ - export type Outbound = GetMetadataResponseBody$Outbound; +export namespace GetMetaDataByRatingKeyResponseBody$ { + /** @deprecated use `GetMetaDataByRatingKeyResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetMetaDataByRatingKeyResponseBody$inboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetMetaDataByRatingKeyResponseBody$outboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyResponseBody$Outbound` instead. */ + export type Outbound = GetMetaDataByRatingKeyResponseBody$Outbound; } /** @internal */ -export const GetMetadataResponse$inboundSchema: z.ZodType< - GetMetadataResponse, +export const GetMetaDataByRatingKeyResponse$inboundSchema: z.ZodType< + GetMetaDataByRatingKeyResponse, z.ZodTypeDef, unknown > = z @@ -1306,7 +1330,7 @@ export const GetMetadataResponse$inboundSchema: z.ZodType< ContentType: z.string(), StatusCode: z.number().int(), RawResponse: z.instanceof(Response), - object: z.lazy(() => GetMetadataResponseBody$inboundSchema).optional(), + object: z.lazy(() => GetMetaDataByRatingKeyResponseBody$inboundSchema).optional(), }) .transform((v) => { return remap$(v, { @@ -1317,18 +1341,18 @@ export const GetMetadataResponse$inboundSchema: z.ZodType< }); /** @internal */ -export type GetMetadataResponse$Outbound = { +export type GetMetaDataByRatingKeyResponse$Outbound = { ContentType: string; StatusCode: number; RawResponse: never; - object?: GetMetadataResponseBody$Outbound | undefined; + object?: GetMetaDataByRatingKeyResponseBody$Outbound | undefined; }; /** @internal */ -export const GetMetadataResponse$outboundSchema: z.ZodType< - GetMetadataResponse$Outbound, +export const GetMetaDataByRatingKeyResponse$outboundSchema: z.ZodType< + GetMetaDataByRatingKeyResponse$Outbound, z.ZodTypeDef, - GetMetadataResponse + GetMetaDataByRatingKeyResponse > = z .object({ contentType: z.string(), @@ -1336,7 +1360,7 @@ export const GetMetadataResponse$outboundSchema: z.ZodType< rawResponse: z.instanceof(Response).transform(() => { throw new Error("Response cannot be serialized"); }), - object: z.lazy(() => GetMetadataResponseBody$outboundSchema).optional(), + object: z.lazy(() => GetMetaDataByRatingKeyResponseBody$outboundSchema).optional(), }) .transform((v) => { return remap$(v, { @@ -1350,11 +1374,11 @@ export const GetMetadataResponse$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 GetMetadataResponse$ { - /** @deprecated use `GetMetadataResponse$inboundSchema` instead. */ - export const inboundSchema = GetMetadataResponse$inboundSchema; - /** @deprecated use `GetMetadataResponse$outboundSchema` instead. */ - export const outboundSchema = GetMetadataResponse$outboundSchema; - /** @deprecated use `GetMetadataResponse$Outbound` instead. */ - export type Outbound = GetMetadataResponse$Outbound; +export namespace GetMetaDataByRatingKeyResponse$ { + /** @deprecated use `GetMetaDataByRatingKeyResponse$inboundSchema` instead. */ + export const inboundSchema = GetMetaDataByRatingKeyResponse$inboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyResponse$outboundSchema` instead. */ + export const outboundSchema = GetMetaDataByRatingKeyResponse$outboundSchema; + /** @deprecated use `GetMetaDataByRatingKeyResponse$Outbound` instead. */ + export type Outbound = GetMetaDataByRatingKeyResponse$Outbound; } diff --git a/src/models/getpinop.ts b/src/models/getpinop.ts index 7d2c4c91..b80f0e09 100644 --- a/src/models/getpinop.ts +++ b/src/models/getpinop.ts @@ -38,13 +38,7 @@ export type GetPinRequest = { * */ xPlexClientIdentifier?: string | undefined; - /** - * Product name of the application shown in the list of devices - * - * @remarks - * - */ - xPlexProduct: string; + xPlexProduct?: string | undefined; }; export type GetPinErrors = { @@ -239,9 +233,9 @@ export namespace GetPinGlobals$ { /** @internal */ export const GetPinRequest$inboundSchema: z.ZodType = z .object({ - strong: z.boolean(), + strong: z.boolean().default(false), "X-Plex-Client-Identifier": z.string().optional(), - "X-Plex-Product": z.string(), + "X-Plex-Product": z.string().optional(), }) .transform((v) => { return remap$(v, { @@ -254,7 +248,7 @@ export const GetPinRequest$inboundSchema: z.ZodType { return remap$(v, { @@ -396,11 +390,11 @@ export const GeoData$inboundSchema: z.ZodType = continent_code: z.string(), country: z.string(), city: z.string(), - european_union_member: z.boolean(), + european_union_member: z.boolean().default(false), time_zone: z.string(), postal_code: z.number().int(), - in_privacy_restricted_country: z.boolean(), - in_privacy_restricted_region: z.boolean(), + in_privacy_restricted_country: z.boolean().default(false), + in_privacy_restricted_region: z.boolean().default(false), subdivisions: z.string(), coordinates: z.string(), }) @@ -478,7 +472,7 @@ export const GetPinAuthPinContainer$inboundSchema: z.ZodType< id: z.number().int(), code: z.string(), product: z.string(), - trusted: z.boolean(), + trusted: z.boolean().default(false), qr: z.string(), clientIdentifier: z.string(), location: z.lazy(() => GeoData$inboundSchema), diff --git a/src/models/getplaylistcontentsop.ts b/src/models/getplaylistcontentsop.ts index db0ba36d..bea0289c 100644 --- a/src/models/getplaylistcontentsop.ts +++ b/src/models/getplaylistcontentsop.ts @@ -6,15 +6,41 @@ import { remap as remap$ } from "../lib/primitives.js"; import { RFCDate } from "../types/rfcdate.js"; import * as z from "zod"; +/** + * 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 GetPlaylistContentsQueryParamType { + One = 1, + Two = 2, + Three = 3, + Four = 4, +} + export type GetPlaylistContentsRequest = { /** * the ID of the playlist */ playlistID: number; /** - * the metadata type of the item to return + * 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: number; + type: GetPlaylistContentsQueryParamType; }; export type GetPlaylistContentsErrors = { @@ -192,6 +218,27 @@ export type GetPlaylistContentsResponse = { object?: GetPlaylistContentsResponseBody | undefined; }; +/** @internal */ +export const GetPlaylistContentsQueryParamType$inboundSchema: z.ZodNativeEnum< + typeof GetPlaylistContentsQueryParamType +> = z.nativeEnum(GetPlaylistContentsQueryParamType); + +/** @internal */ +export const GetPlaylistContentsQueryParamType$outboundSchema: z.ZodNativeEnum< + typeof GetPlaylistContentsQueryParamType +> = GetPlaylistContentsQueryParamType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetPlaylistContentsQueryParamType$ { + /** @deprecated use `GetPlaylistContentsQueryParamType$inboundSchema` instead. */ + export const inboundSchema = GetPlaylistContentsQueryParamType$inboundSchema; + /** @deprecated use `GetPlaylistContentsQueryParamType$outboundSchema` instead. */ + export const outboundSchema = GetPlaylistContentsQueryParamType$outboundSchema; +} + /** @internal */ export const GetPlaylistContentsRequest$inboundSchema: z.ZodType< GetPlaylistContentsRequest, @@ -199,7 +246,7 @@ export const GetPlaylistContentsRequest$inboundSchema: z.ZodType< unknown > = z.object({ playlistID: z.number(), - type: z.number(), + type: GetPlaylistContentsQueryParamType$inboundSchema, }); /** @internal */ @@ -215,7 +262,7 @@ export const GetPlaylistContentsRequest$outboundSchema: z.ZodType< GetPlaylistContentsRequest > = z.object({ playlistID: z.number(), - type: z.number(), + type: GetPlaylistContentsQueryParamType$outboundSchema, }); /** diff --git a/src/models/getrecentlyaddedop.ts b/src/models/getrecentlyaddedop.ts index 1207e363..1829aad3 100644 --- a/src/models/getrecentlyaddedop.ts +++ b/src/models/getrecentlyaddedop.ts @@ -5,6 +5,27 @@ import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; +export type GetRecentlyAddedRequest = { + /** + * 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 GetRecentlyAddedErrors = { code?: number | undefined; message?: string | undefined; @@ -177,6 +198,59 @@ export type GetRecentlyAddedResponse = { object?: GetRecentlyAddedResponseBody | undefined; }; +/** @internal */ +export const GetRecentlyAddedRequest$inboundSchema: z.ZodType< + GetRecentlyAddedRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + "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 GetRecentlyAddedRequest$Outbound = { + "X-Plex-Container-Start": number; + "X-Plex-Container-Size": number; +}; + +/** @internal */ +export const GetRecentlyAddedRequest$outboundSchema: z.ZodType< + GetRecentlyAddedRequest$Outbound, + z.ZodTypeDef, + GetRecentlyAddedRequest +> = z + .object({ + 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 GetRecentlyAddedRequest$ { + /** @deprecated use `GetRecentlyAddedRequest$inboundSchema` instead. */ + export const inboundSchema = GetRecentlyAddedRequest$inboundSchema; + /** @deprecated use `GetRecentlyAddedRequest$outboundSchema` instead. */ + export const outboundSchema = GetRecentlyAddedRequest$outboundSchema; + /** @deprecated use `GetRecentlyAddedRequest$Outbound` instead. */ + export type Outbound = GetRecentlyAddedRequest$Outbound; +} + /** @internal */ export const GetRecentlyAddedErrors$inboundSchema: z.ZodType< GetRecentlyAddedErrors, diff --git a/src/models/getrefreshlibrarymetadataop.ts b/src/models/getrefreshlibrarymetadataop.ts new file mode 100644 index 00000000..edc61c94 --- /dev/null +++ b/src/models/getrefreshlibrarymetadataop.ts @@ -0,0 +1,316 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../lib/primitives.js"; +import * as z from "zod"; + +/** + * Force the refresh even if the library is already being refreshed. + */ +export enum Force { + Zero = 0, + One = 1, +} + +export type GetRefreshLibraryMetadataRequest = { + /** + * The unique key of the Plex library. + * + * @remarks + * Note: This is unique in the context of the Plex server. + * + */ + sectionKey: number; + /** + * Force the refresh even if the library is already being refreshed. + */ + force?: Force | undefined; +}; + +export type GetRefreshLibraryMetadataErrors = { + 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 GetRefreshLibraryMetadataResponseBodyData = { + 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 GetRefreshLibraryMetadataResponseBody 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$: GetRefreshLibraryMetadataResponseBodyData; + + constructor(err: GetRefreshLibraryMetadataResponseBodyData) { + 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 = "GetRefreshLibraryMetadataResponseBody"; + } +} + +export type GetRefreshLibraryMetadataResponse = { + /** + * 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; +}; + +/** @internal */ +export const Force$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Force); + +/** @internal */ +export const Force$outboundSchema: z.ZodNativeEnum = Force$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Force$ { + /** @deprecated use `Force$inboundSchema` instead. */ + export const inboundSchema = Force$inboundSchema; + /** @deprecated use `Force$outboundSchema` instead. */ + export const outboundSchema = Force$outboundSchema; +} + +/** @internal */ +export const GetRefreshLibraryMetadataRequest$inboundSchema: z.ZodType< + GetRefreshLibraryMetadataRequest, + z.ZodTypeDef, + unknown +> = z.object({ + sectionKey: z.number().int(), + force: Force$inboundSchema.optional(), +}); + +/** @internal */ +export type GetRefreshLibraryMetadataRequest$Outbound = { + sectionKey: number; + force?: number | undefined; +}; + +/** @internal */ +export const GetRefreshLibraryMetadataRequest$outboundSchema: z.ZodType< + GetRefreshLibraryMetadataRequest$Outbound, + z.ZodTypeDef, + GetRefreshLibraryMetadataRequest +> = z.object({ + sectionKey: z.number().int(), + force: Force$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRefreshLibraryMetadataRequest$ { + /** @deprecated use `GetRefreshLibraryMetadataRequest$inboundSchema` instead. */ + export const inboundSchema = GetRefreshLibraryMetadataRequest$inboundSchema; + /** @deprecated use `GetRefreshLibraryMetadataRequest$outboundSchema` instead. */ + export const outboundSchema = GetRefreshLibraryMetadataRequest$outboundSchema; + /** @deprecated use `GetRefreshLibraryMetadataRequest$Outbound` instead. */ + export type Outbound = GetRefreshLibraryMetadataRequest$Outbound; +} + +/** @internal */ +export const GetRefreshLibraryMetadataErrors$inboundSchema: z.ZodType< + GetRefreshLibraryMetadataErrors, + z.ZodTypeDef, + unknown +> = z.object({ + code: z.number().optional(), + message: z.string().optional(), + status: z.number().optional(), +}); + +/** @internal */ +export type GetRefreshLibraryMetadataErrors$Outbound = { + code?: number | undefined; + message?: string | undefined; + status?: number | undefined; +}; + +/** @internal */ +export const GetRefreshLibraryMetadataErrors$outboundSchema: z.ZodType< + GetRefreshLibraryMetadataErrors$Outbound, + z.ZodTypeDef, + GetRefreshLibraryMetadataErrors +> = z.object({ + code: z.number().optional(), + message: z.string().optional(), + status: z.number().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRefreshLibraryMetadataErrors$ { + /** @deprecated use `GetRefreshLibraryMetadataErrors$inboundSchema` instead. */ + export const inboundSchema = GetRefreshLibraryMetadataErrors$inboundSchema; + /** @deprecated use `GetRefreshLibraryMetadataErrors$outboundSchema` instead. */ + export const outboundSchema = GetRefreshLibraryMetadataErrors$outboundSchema; + /** @deprecated use `GetRefreshLibraryMetadataErrors$Outbound` instead. */ + export type Outbound = GetRefreshLibraryMetadataErrors$Outbound; +} + +/** @internal */ +export const GetRefreshLibraryMetadataResponseBody$inboundSchema: z.ZodType< + GetRefreshLibraryMetadataResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + errors: z.array(z.lazy(() => GetRefreshLibraryMetadataErrors$inboundSchema)).optional(), + RawResponse: z.instanceof(Response).optional(), + }) + .transform((v) => { + const remapped = remap$(v, { + RawResponse: "rawResponse", + }); + + return new GetRefreshLibraryMetadataResponseBody(remapped); + }); + +/** @internal */ +export type GetRefreshLibraryMetadataResponseBody$Outbound = { + errors?: Array | undefined; + RawResponse?: never | undefined; +}; + +/** @internal */ +export const GetRefreshLibraryMetadataResponseBody$outboundSchema: z.ZodType< + GetRefreshLibraryMetadataResponseBody$Outbound, + z.ZodTypeDef, + GetRefreshLibraryMetadataResponseBody +> = z + .instanceof(GetRefreshLibraryMetadataResponseBody) + .transform((v) => v.data$) + .pipe( + z + .object({ + errors: z + .array(z.lazy(() => GetRefreshLibraryMetadataErrors$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 GetRefreshLibraryMetadataResponseBody$ { + /** @deprecated use `GetRefreshLibraryMetadataResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetRefreshLibraryMetadataResponseBody$inboundSchema; + /** @deprecated use `GetRefreshLibraryMetadataResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetRefreshLibraryMetadataResponseBody$outboundSchema; + /** @deprecated use `GetRefreshLibraryMetadataResponseBody$Outbound` instead. */ + export type Outbound = GetRefreshLibraryMetadataResponseBody$Outbound; +} + +/** @internal */ +export const GetRefreshLibraryMetadataResponse$inboundSchema: z.ZodType< + GetRefreshLibraryMetadataResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + ContentType: z.string(), + StatusCode: z.number().int(), + RawResponse: z.instanceof(Response), + }) + .transform((v) => { + return remap$(v, { + ContentType: "contentType", + StatusCode: "statusCode", + RawResponse: "rawResponse", + }); + }); + +/** @internal */ +export type GetRefreshLibraryMetadataResponse$Outbound = { + ContentType: string; + StatusCode: number; + RawResponse: never; +}; + +/** @internal */ +export const GetRefreshLibraryMetadataResponse$outboundSchema: z.ZodType< + GetRefreshLibraryMetadataResponse$Outbound, + z.ZodTypeDef, + GetRefreshLibraryMetadataResponse +> = z + .object({ + contentType: z.string(), + statusCode: z.number().int(), + rawResponse: z.instanceof(Response).transform(() => { + throw new Error("Response cannot be serialized"); + }), + }) + .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 GetRefreshLibraryMetadataResponse$ { + /** @deprecated use `GetRefreshLibraryMetadataResponse$inboundSchema` instead. */ + export const inboundSchema = GetRefreshLibraryMetadataResponse$inboundSchema; + /** @deprecated use `GetRefreshLibraryMetadataResponse$outboundSchema` instead. */ + export const outboundSchema = GetRefreshLibraryMetadataResponse$outboundSchema; + /** @deprecated use `GetRefreshLibraryMetadataResponse$Outbound` instead. */ + export type Outbound = GetRefreshLibraryMetadataResponse$Outbound; +} diff --git a/src/models/searchlibraryop.ts b/src/models/getsearchlibraryop.ts similarity index 56% rename from src/models/searchlibraryop.ts rename to src/models/getsearchlibraryop.ts index 727b6aa7..aca117e5 100644 --- a/src/models/searchlibraryop.ts +++ b/src/models/getsearchlibraryop.ts @@ -6,27 +6,47 @@ import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; /** - * Plex content type to search for + * 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 { +export enum QueryParamType { One = 1, Two = 2, Three = 3, Four = 4, } -export type SearchLibraryRequest = { +export type GetSearchLibraryRequest = { /** - * the Id of the library to query + * The unique key of the Plex library. + * + * @remarks + * Note: This is unique in the context of the Plex server. + * */ - sectionId: number; + sectionKey: number; /** - * Plex content type to search for + * 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; + type: QueryParamType; }; -export type SearchLibraryErrors = { +export type GetSearchLibraryErrors = { code?: number | undefined; message?: string | undefined; status?: number | undefined; @@ -35,8 +55,8 @@ export type SearchLibraryErrors = { /** * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ -export type SearchLibraryLibraryResponseBodyData = { - errors?: Array | undefined; +export type GetSearchLibraryLibraryResponseBodyData = { + errors?: Array | undefined; /** * Raw HTTP response; suitable for custom response parsing */ @@ -46,17 +66,17 @@ export type SearchLibraryLibraryResponseBodyData = { /** * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ -export class SearchLibraryLibraryResponseBody extends Error { - errors?: Array | undefined; +export class GetSearchLibraryLibraryResponseBody 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$: SearchLibraryLibraryResponseBodyData; + data$: GetSearchLibraryLibraryResponseBodyData; - constructor(err: SearchLibraryLibraryResponseBodyData) { + constructor(err: GetSearchLibraryLibraryResponseBodyData) { const message = "message" in err && typeof err.message === "string" ? err.message @@ -71,11 +91,11 @@ export class SearchLibraryLibraryResponseBody extends Error { this.rawResponse = err.rawResponse; } - this.name = "SearchLibraryLibraryResponseBody"; + this.name = "GetSearchLibraryLibraryResponseBody"; } } -export type SearchLibraryMetadata = { +export type GetSearchLibraryMetadata = { ratingKey?: string | undefined; key?: string | undefined; parentRatingKey?: string | undefined; @@ -98,7 +118,7 @@ export type SearchLibraryMetadata = { updatedAt?: number | undefined; }; -export type SearchLibraryMediaContainer = { +export type GetSearchLibraryMediaContainer = { size?: number | undefined; allowSync?: boolean | undefined; art?: string | undefined; @@ -111,17 +131,17 @@ export type SearchLibraryMediaContainer = { title2?: string | undefined; viewGroup?: string | undefined; viewMode?: number | undefined; - metadata?: Array | undefined; + metadata?: Array | undefined; }; /** * The contents of the library by section and type */ -export type SearchLibraryResponseBody = { - mediaContainer?: SearchLibraryMediaContainer | undefined; +export type GetSearchLibraryResponseBody = { + mediaContainer?: GetSearchLibraryMediaContainer | undefined; }; -export type SearchLibraryResponse = { +export type GetSearchLibraryResponse = { /** * HTTP response content type for this operation */ @@ -137,68 +157,70 @@ export type SearchLibraryResponse = { /** * The contents of the library by section and type */ - object?: SearchLibraryResponseBody | undefined; + object?: GetSearchLibraryResponseBody | undefined; }; /** @internal */ -export const Type$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Type); +export const QueryParamType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(QueryParamType); /** @internal */ -export const Type$outboundSchema: z.ZodNativeEnum = Type$inboundSchema; +export const QueryParamType$outboundSchema: z.ZodNativeEnum = + 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 Type$ { - /** @deprecated use `Type$inboundSchema` instead. */ - export const inboundSchema = Type$inboundSchema; - /** @deprecated use `Type$outboundSchema` instead. */ - export const outboundSchema = Type$outboundSchema; +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 SearchLibraryRequest$inboundSchema: z.ZodType< - SearchLibraryRequest, +export const GetSearchLibraryRequest$inboundSchema: z.ZodType< + GetSearchLibraryRequest, z.ZodTypeDef, unknown > = z.object({ - sectionId: z.number().int(), - type: Type$inboundSchema, + sectionKey: z.number().int(), + type: QueryParamType$inboundSchema, }); /** @internal */ -export type SearchLibraryRequest$Outbound = { - sectionId: number; +export type GetSearchLibraryRequest$Outbound = { + sectionKey: number; type: number; }; /** @internal */ -export const SearchLibraryRequest$outboundSchema: z.ZodType< - SearchLibraryRequest$Outbound, +export const GetSearchLibraryRequest$outboundSchema: z.ZodType< + GetSearchLibraryRequest$Outbound, z.ZodTypeDef, - SearchLibraryRequest + GetSearchLibraryRequest > = z.object({ - sectionId: z.number().int(), - type: Type$outboundSchema, + sectionKey: z.number().int(), + type: QueryParamType$outboundSchema, }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace SearchLibraryRequest$ { - /** @deprecated use `SearchLibraryRequest$inboundSchema` instead. */ - export const inboundSchema = SearchLibraryRequest$inboundSchema; - /** @deprecated use `SearchLibraryRequest$outboundSchema` instead. */ - export const outboundSchema = SearchLibraryRequest$outboundSchema; - /** @deprecated use `SearchLibraryRequest$Outbound` instead. */ - export type Outbound = SearchLibraryRequest$Outbound; +export namespace GetSearchLibraryRequest$ { + /** @deprecated use `GetSearchLibraryRequest$inboundSchema` instead. */ + export const inboundSchema = GetSearchLibraryRequest$inboundSchema; + /** @deprecated use `GetSearchLibraryRequest$outboundSchema` instead. */ + export const outboundSchema = GetSearchLibraryRequest$outboundSchema; + /** @deprecated use `GetSearchLibraryRequest$Outbound` instead. */ + export type Outbound = GetSearchLibraryRequest$Outbound; } /** @internal */ -export const SearchLibraryErrors$inboundSchema: z.ZodType< - SearchLibraryErrors, +export const GetSearchLibraryErrors$inboundSchema: z.ZodType< + GetSearchLibraryErrors, z.ZodTypeDef, unknown > = z.object({ @@ -208,17 +230,17 @@ export const SearchLibraryErrors$inboundSchema: z.ZodType< }); /** @internal */ -export type SearchLibraryErrors$Outbound = { +export type GetSearchLibraryErrors$Outbound = { code?: number | undefined; message?: string | undefined; status?: number | undefined; }; /** @internal */ -export const SearchLibraryErrors$outboundSchema: z.ZodType< - SearchLibraryErrors$Outbound, +export const GetSearchLibraryErrors$outboundSchema: z.ZodType< + GetSearchLibraryErrors$Outbound, z.ZodTypeDef, - SearchLibraryErrors + GetSearchLibraryErrors > = z.object({ code: z.number().optional(), message: z.string().optional(), @@ -229,23 +251,23 @@ export const SearchLibraryErrors$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 SearchLibraryErrors$ { - /** @deprecated use `SearchLibraryErrors$inboundSchema` instead. */ - export const inboundSchema = SearchLibraryErrors$inboundSchema; - /** @deprecated use `SearchLibraryErrors$outboundSchema` instead. */ - export const outboundSchema = SearchLibraryErrors$outboundSchema; - /** @deprecated use `SearchLibraryErrors$Outbound` instead. */ - export type Outbound = SearchLibraryErrors$Outbound; +export namespace GetSearchLibraryErrors$ { + /** @deprecated use `GetSearchLibraryErrors$inboundSchema` instead. */ + export const inboundSchema = GetSearchLibraryErrors$inboundSchema; + /** @deprecated use `GetSearchLibraryErrors$outboundSchema` instead. */ + export const outboundSchema = GetSearchLibraryErrors$outboundSchema; + /** @deprecated use `GetSearchLibraryErrors$Outbound` instead. */ + export type Outbound = GetSearchLibraryErrors$Outbound; } /** @internal */ -export const SearchLibraryLibraryResponseBody$inboundSchema: z.ZodType< - SearchLibraryLibraryResponseBody, +export const GetSearchLibraryLibraryResponseBody$inboundSchema: z.ZodType< + GetSearchLibraryLibraryResponseBody, z.ZodTypeDef, unknown > = z .object({ - errors: z.array(z.lazy(() => SearchLibraryErrors$inboundSchema)).optional(), + errors: z.array(z.lazy(() => GetSearchLibraryErrors$inboundSchema)).optional(), RawResponse: z.instanceof(Response).optional(), }) .transform((v) => { @@ -253,27 +275,27 @@ export const SearchLibraryLibraryResponseBody$inboundSchema: z.ZodType< RawResponse: "rawResponse", }); - return new SearchLibraryLibraryResponseBody(remapped); + return new GetSearchLibraryLibraryResponseBody(remapped); }); /** @internal */ -export type SearchLibraryLibraryResponseBody$Outbound = { - errors?: Array | undefined; +export type GetSearchLibraryLibraryResponseBody$Outbound = { + errors?: Array | undefined; RawResponse?: never | undefined; }; /** @internal */ -export const SearchLibraryLibraryResponseBody$outboundSchema: z.ZodType< - SearchLibraryLibraryResponseBody$Outbound, +export const GetSearchLibraryLibraryResponseBody$outboundSchema: z.ZodType< + GetSearchLibraryLibraryResponseBody$Outbound, z.ZodTypeDef, - SearchLibraryLibraryResponseBody + GetSearchLibraryLibraryResponseBody > = z - .instanceof(SearchLibraryLibraryResponseBody) + .instanceof(GetSearchLibraryLibraryResponseBody) .transform((v) => v.data$) .pipe( z .object({ - errors: z.array(z.lazy(() => SearchLibraryErrors$outboundSchema)).optional(), + errors: z.array(z.lazy(() => GetSearchLibraryErrors$outboundSchema)).optional(), rawResponse: z .instanceof(Response) .transform(() => { @@ -292,18 +314,18 @@ export const SearchLibraryLibraryResponseBody$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 SearchLibraryLibraryResponseBody$ { - /** @deprecated use `SearchLibraryLibraryResponseBody$inboundSchema` instead. */ - export const inboundSchema = SearchLibraryLibraryResponseBody$inboundSchema; - /** @deprecated use `SearchLibraryLibraryResponseBody$outboundSchema` instead. */ - export const outboundSchema = SearchLibraryLibraryResponseBody$outboundSchema; - /** @deprecated use `SearchLibraryLibraryResponseBody$Outbound` instead. */ - export type Outbound = SearchLibraryLibraryResponseBody$Outbound; +export namespace GetSearchLibraryLibraryResponseBody$ { + /** @deprecated use `GetSearchLibraryLibraryResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetSearchLibraryLibraryResponseBody$inboundSchema; + /** @deprecated use `GetSearchLibraryLibraryResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetSearchLibraryLibraryResponseBody$outboundSchema; + /** @deprecated use `GetSearchLibraryLibraryResponseBody$Outbound` instead. */ + export type Outbound = GetSearchLibraryLibraryResponseBody$Outbound; } /** @internal */ -export const SearchLibraryMetadata$inboundSchema: z.ZodType< - SearchLibraryMetadata, +export const GetSearchLibraryMetadata$inboundSchema: z.ZodType< + GetSearchLibraryMetadata, z.ZodTypeDef, unknown > = z.object({ @@ -330,7 +352,7 @@ export const SearchLibraryMetadata$inboundSchema: z.ZodType< }); /** @internal */ -export type SearchLibraryMetadata$Outbound = { +export type GetSearchLibraryMetadata$Outbound = { ratingKey?: string | undefined; key?: string | undefined; parentRatingKey?: string | undefined; @@ -354,10 +376,10 @@ export type SearchLibraryMetadata$Outbound = { }; /** @internal */ -export const SearchLibraryMetadata$outboundSchema: z.ZodType< - SearchLibraryMetadata$Outbound, +export const GetSearchLibraryMetadata$outboundSchema: z.ZodType< + GetSearchLibraryMetadata$Outbound, z.ZodTypeDef, - SearchLibraryMetadata + GetSearchLibraryMetadata > = z.object({ ratingKey: z.string().optional(), key: z.string().optional(), @@ -385,18 +407,18 @@ export const SearchLibraryMetadata$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 SearchLibraryMetadata$ { - /** @deprecated use `SearchLibraryMetadata$inboundSchema` instead. */ - export const inboundSchema = SearchLibraryMetadata$inboundSchema; - /** @deprecated use `SearchLibraryMetadata$outboundSchema` instead. */ - export const outboundSchema = SearchLibraryMetadata$outboundSchema; - /** @deprecated use `SearchLibraryMetadata$Outbound` instead. */ - export type Outbound = SearchLibraryMetadata$Outbound; +export namespace GetSearchLibraryMetadata$ { + /** @deprecated use `GetSearchLibraryMetadata$inboundSchema` instead. */ + export const inboundSchema = GetSearchLibraryMetadata$inboundSchema; + /** @deprecated use `GetSearchLibraryMetadata$outboundSchema` instead. */ + export const outboundSchema = GetSearchLibraryMetadata$outboundSchema; + /** @deprecated use `GetSearchLibraryMetadata$Outbound` instead. */ + export type Outbound = GetSearchLibraryMetadata$Outbound; } /** @internal */ -export const SearchLibraryMediaContainer$inboundSchema: z.ZodType< - SearchLibraryMediaContainer, +export const GetSearchLibraryMediaContainer$inboundSchema: z.ZodType< + GetSearchLibraryMediaContainer, z.ZodTypeDef, unknown > = z @@ -413,7 +435,7 @@ export const SearchLibraryMediaContainer$inboundSchema: z.ZodType< title2: z.string().optional(), viewGroup: z.string().optional(), viewMode: z.number().int().optional(), - Metadata: z.array(z.lazy(() => SearchLibraryMetadata$inboundSchema)).optional(), + Metadata: z.array(z.lazy(() => GetSearchLibraryMetadata$inboundSchema)).optional(), }) .transform((v) => { return remap$(v, { @@ -422,7 +444,7 @@ export const SearchLibraryMediaContainer$inboundSchema: z.ZodType< }); /** @internal */ -export type SearchLibraryMediaContainer$Outbound = { +export type GetSearchLibraryMediaContainer$Outbound = { size?: number | undefined; allowSync?: boolean | undefined; art?: string | undefined; @@ -435,14 +457,14 @@ export type SearchLibraryMediaContainer$Outbound = { title2?: string | undefined; viewGroup?: string | undefined; viewMode?: number | undefined; - Metadata?: Array | undefined; + Metadata?: Array | undefined; }; /** @internal */ -export const SearchLibraryMediaContainer$outboundSchema: z.ZodType< - SearchLibraryMediaContainer$Outbound, +export const GetSearchLibraryMediaContainer$outboundSchema: z.ZodType< + GetSearchLibraryMediaContainer$Outbound, z.ZodTypeDef, - SearchLibraryMediaContainer + GetSearchLibraryMediaContainer > = z .object({ size: z.number().int().optional(), @@ -457,7 +479,7 @@ export const SearchLibraryMediaContainer$outboundSchema: z.ZodType< title2: z.string().optional(), viewGroup: z.string().optional(), viewMode: z.number().int().optional(), - metadata: z.array(z.lazy(() => SearchLibraryMetadata$outboundSchema)).optional(), + metadata: z.array(z.lazy(() => GetSearchLibraryMetadata$outboundSchema)).optional(), }) .transform((v) => { return remap$(v, { @@ -469,23 +491,23 @@ export const SearchLibraryMediaContainer$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 SearchLibraryMediaContainer$ { - /** @deprecated use `SearchLibraryMediaContainer$inboundSchema` instead. */ - export const inboundSchema = SearchLibraryMediaContainer$inboundSchema; - /** @deprecated use `SearchLibraryMediaContainer$outboundSchema` instead. */ - export const outboundSchema = SearchLibraryMediaContainer$outboundSchema; - /** @deprecated use `SearchLibraryMediaContainer$Outbound` instead. */ - export type Outbound = SearchLibraryMediaContainer$Outbound; +export namespace GetSearchLibraryMediaContainer$ { + /** @deprecated use `GetSearchLibraryMediaContainer$inboundSchema` instead. */ + export const inboundSchema = GetSearchLibraryMediaContainer$inboundSchema; + /** @deprecated use `GetSearchLibraryMediaContainer$outboundSchema` instead. */ + export const outboundSchema = GetSearchLibraryMediaContainer$outboundSchema; + /** @deprecated use `GetSearchLibraryMediaContainer$Outbound` instead. */ + export type Outbound = GetSearchLibraryMediaContainer$Outbound; } /** @internal */ -export const SearchLibraryResponseBody$inboundSchema: z.ZodType< - SearchLibraryResponseBody, +export const GetSearchLibraryResponseBody$inboundSchema: z.ZodType< + GetSearchLibraryResponseBody, z.ZodTypeDef, unknown > = z .object({ - MediaContainer: z.lazy(() => SearchLibraryMediaContainer$inboundSchema).optional(), + MediaContainer: z.lazy(() => GetSearchLibraryMediaContainer$inboundSchema).optional(), }) .transform((v) => { return remap$(v, { @@ -494,18 +516,18 @@ export const SearchLibraryResponseBody$inboundSchema: z.ZodType< }); /** @internal */ -export type SearchLibraryResponseBody$Outbound = { - MediaContainer?: SearchLibraryMediaContainer$Outbound | undefined; +export type GetSearchLibraryResponseBody$Outbound = { + MediaContainer?: GetSearchLibraryMediaContainer$Outbound | undefined; }; /** @internal */ -export const SearchLibraryResponseBody$outboundSchema: z.ZodType< - SearchLibraryResponseBody$Outbound, +export const GetSearchLibraryResponseBody$outboundSchema: z.ZodType< + GetSearchLibraryResponseBody$Outbound, z.ZodTypeDef, - SearchLibraryResponseBody + GetSearchLibraryResponseBody > = z .object({ - mediaContainer: z.lazy(() => SearchLibraryMediaContainer$outboundSchema).optional(), + mediaContainer: z.lazy(() => GetSearchLibraryMediaContainer$outboundSchema).optional(), }) .transform((v) => { return remap$(v, { @@ -517,18 +539,18 @@ export const SearchLibraryResponseBody$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 SearchLibraryResponseBody$ { - /** @deprecated use `SearchLibraryResponseBody$inboundSchema` instead. */ - export const inboundSchema = SearchLibraryResponseBody$inboundSchema; - /** @deprecated use `SearchLibraryResponseBody$outboundSchema` instead. */ - export const outboundSchema = SearchLibraryResponseBody$outboundSchema; - /** @deprecated use `SearchLibraryResponseBody$Outbound` instead. */ - export type Outbound = SearchLibraryResponseBody$Outbound; +export namespace GetSearchLibraryResponseBody$ { + /** @deprecated use `GetSearchLibraryResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetSearchLibraryResponseBody$inboundSchema; + /** @deprecated use `GetSearchLibraryResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetSearchLibraryResponseBody$outboundSchema; + /** @deprecated use `GetSearchLibraryResponseBody$Outbound` instead. */ + export type Outbound = GetSearchLibraryResponseBody$Outbound; } /** @internal */ -export const SearchLibraryResponse$inboundSchema: z.ZodType< - SearchLibraryResponse, +export const GetSearchLibraryResponse$inboundSchema: z.ZodType< + GetSearchLibraryResponse, z.ZodTypeDef, unknown > = z @@ -536,7 +558,7 @@ export const SearchLibraryResponse$inboundSchema: z.ZodType< ContentType: z.string(), StatusCode: z.number().int(), RawResponse: z.instanceof(Response), - object: z.lazy(() => SearchLibraryResponseBody$inboundSchema).optional(), + object: z.lazy(() => GetSearchLibraryResponseBody$inboundSchema).optional(), }) .transform((v) => { return remap$(v, { @@ -547,18 +569,18 @@ export const SearchLibraryResponse$inboundSchema: z.ZodType< }); /** @internal */ -export type SearchLibraryResponse$Outbound = { +export type GetSearchLibraryResponse$Outbound = { ContentType: string; StatusCode: number; RawResponse: never; - object?: SearchLibraryResponseBody$Outbound | undefined; + object?: GetSearchLibraryResponseBody$Outbound | undefined; }; /** @internal */ -export const SearchLibraryResponse$outboundSchema: z.ZodType< - SearchLibraryResponse$Outbound, +export const GetSearchLibraryResponse$outboundSchema: z.ZodType< + GetSearchLibraryResponse$Outbound, z.ZodTypeDef, - SearchLibraryResponse + GetSearchLibraryResponse > = z .object({ contentType: z.string(), @@ -566,7 +588,7 @@ export const SearchLibraryResponse$outboundSchema: z.ZodType< rawResponse: z.instanceof(Response).transform(() => { throw new Error("Response cannot be serialized"); }), - object: z.lazy(() => SearchLibraryResponseBody$outboundSchema).optional(), + object: z.lazy(() => GetSearchLibraryResponseBody$outboundSchema).optional(), }) .transform((v) => { return remap$(v, { @@ -580,11 +602,11 @@ export const SearchLibraryResponse$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 SearchLibraryResponse$ { - /** @deprecated use `SearchLibraryResponse$inboundSchema` instead. */ - export const inboundSchema = SearchLibraryResponse$inboundSchema; - /** @deprecated use `SearchLibraryResponse$outboundSchema` instead. */ - export const outboundSchema = SearchLibraryResponse$outboundSchema; - /** @deprecated use `SearchLibraryResponse$Outbound` instead. */ - export type Outbound = SearchLibraryResponse$Outbound; +export namespace GetSearchLibraryResponse$ { + /** @deprecated use `GetSearchLibraryResponse$inboundSchema` instead. */ + export const inboundSchema = GetSearchLibraryResponse$inboundSchema; + /** @deprecated use `GetSearchLibraryResponse$outboundSchema` instead. */ + export const outboundSchema = GetSearchLibraryResponse$outboundSchema; + /** @deprecated use `GetSearchLibraryResponse$Outbound` instead. */ + export type Outbound = GetSearchLibraryResponse$Outbound; } diff --git a/src/models/getserveridentityop.ts b/src/models/getserveridentityop.ts index 14109b85..e639f132 100644 --- a/src/models/getserveridentityop.ts +++ b/src/models/getserveridentityop.ts @@ -5,17 +5,12 @@ import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; -export type GetServerIdentityErrors = { - code?: number | undefined; - message?: string | undefined; - status?: number | undefined; -}; - /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + * Request Timeout */ export type GetServerIdentityServerResponseBodyData = { - errors?: Array | undefined; + code?: number | undefined; + message?: string | undefined; /** * Raw HTTP response; suitable for custom response parsing */ @@ -23,10 +18,10 @@ export type GetServerIdentityServerResponseBodyData = { }; /** - * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + * Request Timeout */ export class GetServerIdentityServerResponseBody extends Error { - errors?: Array | undefined; + code?: number | undefined; /** * Raw HTTP response; suitable for custom response parsing */ @@ -43,8 +38,8 @@ export class GetServerIdentityServerResponseBody extends Error { super(message); this.data$ = err; - if (err.errors != null) { - this.errors = err.errors; + if (err.code != null) { + this.code = err.code; } if (err.rawResponse != null) { this.rawResponse = err.rawResponse; @@ -87,48 +82,6 @@ export type GetServerIdentityResponse = { object?: GetServerIdentityResponseBody | undefined; }; -/** @internal */ -export const GetServerIdentityErrors$inboundSchema: z.ZodType< - GetServerIdentityErrors, - z.ZodTypeDef, - unknown -> = z.object({ - code: z.number().optional(), - message: z.string().optional(), - status: z.number().optional(), -}); - -/** @internal */ -export type GetServerIdentityErrors$Outbound = { - code?: number | undefined; - message?: string | undefined; - status?: number | undefined; -}; - -/** @internal */ -export const GetServerIdentityErrors$outboundSchema: z.ZodType< - GetServerIdentityErrors$Outbound, - z.ZodTypeDef, - GetServerIdentityErrors -> = z.object({ - code: z.number().optional(), - message: z.string().optional(), - status: z.number().optional(), -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetServerIdentityErrors$ { - /** @deprecated use `GetServerIdentityErrors$inboundSchema` instead. */ - export const inboundSchema = GetServerIdentityErrors$inboundSchema; - /** @deprecated use `GetServerIdentityErrors$outboundSchema` instead. */ - export const outboundSchema = GetServerIdentityErrors$outboundSchema; - /** @deprecated use `GetServerIdentityErrors$Outbound` instead. */ - export type Outbound = GetServerIdentityErrors$Outbound; -} - /** @internal */ export const GetServerIdentityServerResponseBody$inboundSchema: z.ZodType< GetServerIdentityServerResponseBody, @@ -136,7 +89,8 @@ export const GetServerIdentityServerResponseBody$inboundSchema: z.ZodType< unknown > = z .object({ - errors: z.array(z.lazy(() => GetServerIdentityErrors$inboundSchema)).optional(), + code: z.number().int().optional(), + message: z.string().optional(), RawResponse: z.instanceof(Response).optional(), }) .transform((v) => { @@ -149,7 +103,8 @@ export const GetServerIdentityServerResponseBody$inboundSchema: z.ZodType< /** @internal */ export type GetServerIdentityServerResponseBody$Outbound = { - errors?: Array | undefined; + code?: number | undefined; + message?: string | undefined; RawResponse?: never | undefined; }; @@ -164,7 +119,8 @@ export const GetServerIdentityServerResponseBody$outboundSchema: z.ZodType< .pipe( z .object({ - errors: z.array(z.lazy(() => GetServerIdentityErrors$outboundSchema)).optional(), + code: z.number().int().optional(), + message: z.string().optional(), rawResponse: z .instanceof(Response) .transform(() => { diff --git a/src/models/getresourcesop.ts b/src/models/getserverresourcesop.ts similarity index 59% rename from src/models/getresourcesop.ts rename to src/models/getserverresourcesop.ts index e615fca5..5b92748e 100644 --- a/src/models/getresourcesop.ts +++ b/src/models/getserverresourcesop.ts @@ -5,9 +5,9 @@ import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; -export const GetResourcesOpServerList = ["https://plex.tv/api/v2"] as const; +export const GetServerResourcesOpServerList = ["https://plex.tv/api/v2"] as const; -export type GetResourcesGlobals = { +export type GetServerResourcesGlobals = { /** * The unique identifier for the client application * @@ -29,6 +29,10 @@ export enum IncludeHttps { /** * Include Relay addresses in the results + * + * @remarks + * E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400 + * */ export enum IncludeRelay { Zero = 0, @@ -43,7 +47,7 @@ export enum IncludeIPv6 { One = 1, } -export type GetResourcesRequest = { +export type GetServerResourcesRequest = { /** * The unique identifier for the client application * @@ -53,12 +57,20 @@ export type GetResourcesRequest = { * */ xPlexClientIdentifier?: string | undefined; + /** + * Plex Authentication Token + */ + xPlexToken: string; /** * Include Https entries in the results */ includeHttps?: IncludeHttps | undefined; /** * Include Relay addresses in the results + * + * @remarks + * E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400 + * */ includeRelay?: IncludeRelay | undefined; /** @@ -67,7 +79,7 @@ export type GetResourcesRequest = { includeIPv6?: IncludeIPv6 | undefined; }; -export type GetResourcesErrors = { +export type GetServerResourcesErrors = { code?: number | undefined; message?: string | undefined; status?: number | undefined; @@ -76,8 +88,8 @@ export type GetResourcesErrors = { /** * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ -export type GetResourcesResponseBodyData = { - errors?: Array | undefined; +export type GetServerResourcesResponseBodyData = { + errors?: Array | undefined; /** * Raw HTTP response; suitable for custom response parsing */ @@ -87,17 +99,17 @@ export type GetResourcesResponseBodyData = { /** * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ -export class GetResourcesResponseBody extends Error { - errors?: Array | undefined; +export class GetServerResourcesResponseBody 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$: GetResourcesResponseBodyData; + data$: GetServerResourcesResponseBodyData; - constructor(err: GetResourcesResponseBodyData) { + constructor(err: GetServerResourcesResponseBodyData) { const message = "message" in err && typeof err.message === "string" ? err.message @@ -112,48 +124,51 @@ export class GetResourcesResponseBody extends Error { this.rawResponse = err.rawResponse; } - this.name = "GetResourcesResponseBody"; + this.name = "GetServerResourcesResponseBody"; } } export type Connections = { - protocol?: string | undefined; - address?: string | undefined; - port?: number | undefined; - uri?: string | undefined; - local?: boolean | undefined; - relay?: boolean | undefined; - iPv6?: boolean | undefined; + protocol: string; + address: string; + port: number; + uri: string; + local: boolean; + relay: boolean; + iPv6: boolean; }; export type PlexDevice = { name: string; product: string; productVersion: string; - platform: string; - platformVersion: string; - device: string; + platform: string | null; + platformVersion: string | null; + device: string | null; clientIdentifier: string; createdAt: Date; lastSeenAt: Date; provides: string; - ownerId?: string | undefined; - sourceTitle?: string | undefined; - publicAddress?: string | undefined; - accessToken?: string | undefined; - owned?: boolean | undefined; - home?: boolean | undefined; - synced?: boolean | undefined; - relay?: boolean | undefined; - presence?: boolean | undefined; - httpsRequired?: boolean | undefined; - publicAddressMatches?: boolean | undefined; - dnsRebindingProtection?: boolean | undefined; - natLoopbackSupported?: boolean | undefined; - connections?: Array | undefined; + /** + * ownerId is null when the device is owned by the token used to send the request + */ + ownerId: number | null; + sourceTitle: string | null; + publicAddress: string; + accessToken: string; + owned: boolean; + home: boolean; + synced: boolean; + relay: boolean; + presence: boolean; + httpsRequired: boolean; + publicAddressMatches: boolean; + dnsRebindingProtection: boolean; + natLoopbackSupported: boolean; + connections: Array; }; -export type GetResourcesResponse = { +export type GetServerResourcesResponse = { /** * HTTP response content type for this operation */ @@ -173,8 +188,8 @@ export type GetResourcesResponse = { }; /** @internal */ -export const GetResourcesGlobals$inboundSchema: z.ZodType< - GetResourcesGlobals, +export const GetServerResourcesGlobals$inboundSchema: z.ZodType< + GetServerResourcesGlobals, z.ZodTypeDef, unknown > = z @@ -188,15 +203,15 @@ export const GetResourcesGlobals$inboundSchema: z.ZodType< }); /** @internal */ -export type GetResourcesGlobals$Outbound = { +export type GetServerResourcesGlobals$Outbound = { "X-Plex-Client-Identifier"?: string | undefined; }; /** @internal */ -export const GetResourcesGlobals$outboundSchema: z.ZodType< - GetResourcesGlobals$Outbound, +export const GetServerResourcesGlobals$outboundSchema: z.ZodType< + GetServerResourcesGlobals$Outbound, z.ZodTypeDef, - GetResourcesGlobals + GetServerResourcesGlobals > = z .object({ xPlexClientIdentifier: z.string().optional(), @@ -211,13 +226,13 @@ export const GetResourcesGlobals$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 GetResourcesGlobals$ { - /** @deprecated use `GetResourcesGlobals$inboundSchema` instead. */ - export const inboundSchema = GetResourcesGlobals$inboundSchema; - /** @deprecated use `GetResourcesGlobals$outboundSchema` instead. */ - export const outboundSchema = GetResourcesGlobals$outboundSchema; - /** @deprecated use `GetResourcesGlobals$Outbound` instead. */ - export type Outbound = GetResourcesGlobals$Outbound; +export namespace GetServerResourcesGlobals$ { + /** @deprecated use `GetServerResourcesGlobals$inboundSchema` instead. */ + export const inboundSchema = GetServerResourcesGlobals$inboundSchema; + /** @deprecated use `GetServerResourcesGlobals$outboundSchema` instead. */ + export const outboundSchema = GetServerResourcesGlobals$outboundSchema; + /** @deprecated use `GetServerResourcesGlobals$Outbound` instead. */ + export type Outbound = GetServerResourcesGlobals$Outbound; } /** @internal */ @@ -278,46 +293,51 @@ export namespace IncludeIPv6$ { } /** @internal */ -export const GetResourcesRequest$inboundSchema: z.ZodType< - GetResourcesRequest, +export const GetServerResourcesRequest$inboundSchema: z.ZodType< + GetServerResourcesRequest, z.ZodTypeDef, unknown > = z .object({ "X-Plex-Client-Identifier": z.string().optional(), - includeHttps: IncludeHttps$inboundSchema.optional(), - includeRelay: IncludeRelay$inboundSchema.optional(), - includeIPv6: IncludeIPv6$inboundSchema.optional(), + "X-Plex-Token": z.string(), + includeHttps: IncludeHttps$inboundSchema, + includeRelay: IncludeRelay$inboundSchema, + includeIPv6: IncludeIPv6$inboundSchema, }) .transform((v) => { return remap$(v, { "X-Plex-Client-Identifier": "xPlexClientIdentifier", + "X-Plex-Token": "xPlexToken", }); }); /** @internal */ -export type GetResourcesRequest$Outbound = { +export type GetServerResourcesRequest$Outbound = { "X-Plex-Client-Identifier"?: string | undefined; - includeHttps?: number | undefined; - includeRelay?: number | undefined; - includeIPv6?: number | undefined; + "X-Plex-Token": string; + includeHttps: number; + includeRelay: number; + includeIPv6: number; }; /** @internal */ -export const GetResourcesRequest$outboundSchema: z.ZodType< - GetResourcesRequest$Outbound, +export const GetServerResourcesRequest$outboundSchema: z.ZodType< + GetServerResourcesRequest$Outbound, z.ZodTypeDef, - GetResourcesRequest + GetServerResourcesRequest > = z .object({ xPlexClientIdentifier: z.string().optional(), - includeHttps: IncludeHttps$outboundSchema.optional(), - includeRelay: IncludeRelay$outboundSchema.optional(), - includeIPv6: IncludeIPv6$outboundSchema.optional(), + xPlexToken: z.string(), + includeHttps: IncludeHttps$outboundSchema.default(IncludeHttps.Zero), + includeRelay: IncludeRelay$outboundSchema.default(IncludeRelay.Zero), + includeIPv6: IncludeIPv6$outboundSchema.default(IncludeIPv6.Zero), }) .transform((v) => { return remap$(v, { xPlexClientIdentifier: "X-Plex-Client-Identifier", + xPlexToken: "X-Plex-Token", }); }); @@ -325,18 +345,18 @@ export const GetResourcesRequest$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 GetResourcesRequest$ { - /** @deprecated use `GetResourcesRequest$inboundSchema` instead. */ - export const inboundSchema = GetResourcesRequest$inboundSchema; - /** @deprecated use `GetResourcesRequest$outboundSchema` instead. */ - export const outboundSchema = GetResourcesRequest$outboundSchema; - /** @deprecated use `GetResourcesRequest$Outbound` instead. */ - export type Outbound = GetResourcesRequest$Outbound; +export namespace GetServerResourcesRequest$ { + /** @deprecated use `GetServerResourcesRequest$inboundSchema` instead. */ + export const inboundSchema = GetServerResourcesRequest$inboundSchema; + /** @deprecated use `GetServerResourcesRequest$outboundSchema` instead. */ + export const outboundSchema = GetServerResourcesRequest$outboundSchema; + /** @deprecated use `GetServerResourcesRequest$Outbound` instead. */ + export type Outbound = GetServerResourcesRequest$Outbound; } /** @internal */ -export const GetResourcesErrors$inboundSchema: z.ZodType< - GetResourcesErrors, +export const GetServerResourcesErrors$inboundSchema: z.ZodType< + GetServerResourcesErrors, z.ZodTypeDef, unknown > = z.object({ @@ -346,17 +366,17 @@ export const GetResourcesErrors$inboundSchema: z.ZodType< }); /** @internal */ -export type GetResourcesErrors$Outbound = { +export type GetServerResourcesErrors$Outbound = { code?: number | undefined; message?: string | undefined; status?: number | undefined; }; /** @internal */ -export const GetResourcesErrors$outboundSchema: z.ZodType< - GetResourcesErrors$Outbound, +export const GetServerResourcesErrors$outboundSchema: z.ZodType< + GetServerResourcesErrors$Outbound, z.ZodTypeDef, - GetResourcesErrors + GetServerResourcesErrors > = z.object({ code: z.number().optional(), message: z.string().optional(), @@ -367,23 +387,23 @@ export const GetResourcesErrors$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 GetResourcesErrors$ { - /** @deprecated use `GetResourcesErrors$inboundSchema` instead. */ - export const inboundSchema = GetResourcesErrors$inboundSchema; - /** @deprecated use `GetResourcesErrors$outboundSchema` instead. */ - export const outboundSchema = GetResourcesErrors$outboundSchema; - /** @deprecated use `GetResourcesErrors$Outbound` instead. */ - export type Outbound = GetResourcesErrors$Outbound; +export namespace GetServerResourcesErrors$ { + /** @deprecated use `GetServerResourcesErrors$inboundSchema` instead. */ + export const inboundSchema = GetServerResourcesErrors$inboundSchema; + /** @deprecated use `GetServerResourcesErrors$outboundSchema` instead. */ + export const outboundSchema = GetServerResourcesErrors$outboundSchema; + /** @deprecated use `GetServerResourcesErrors$Outbound` instead. */ + export type Outbound = GetServerResourcesErrors$Outbound; } /** @internal */ -export const GetResourcesResponseBody$inboundSchema: z.ZodType< - GetResourcesResponseBody, +export const GetServerResourcesResponseBody$inboundSchema: z.ZodType< + GetServerResourcesResponseBody, z.ZodTypeDef, unknown > = z .object({ - errors: z.array(z.lazy(() => GetResourcesErrors$inboundSchema)).optional(), + errors: z.array(z.lazy(() => GetServerResourcesErrors$inboundSchema)).optional(), RawResponse: z.instanceof(Response).optional(), }) .transform((v) => { @@ -391,27 +411,27 @@ export const GetResourcesResponseBody$inboundSchema: z.ZodType< RawResponse: "rawResponse", }); - return new GetResourcesResponseBody(remapped); + return new GetServerResourcesResponseBody(remapped); }); /** @internal */ -export type GetResourcesResponseBody$Outbound = { - errors?: Array | undefined; +export type GetServerResourcesResponseBody$Outbound = { + errors?: Array | undefined; RawResponse?: never | undefined; }; /** @internal */ -export const GetResourcesResponseBody$outboundSchema: z.ZodType< - GetResourcesResponseBody$Outbound, +export const GetServerResourcesResponseBody$outboundSchema: z.ZodType< + GetServerResourcesResponseBody$Outbound, z.ZodTypeDef, - GetResourcesResponseBody + GetServerResourcesResponseBody > = z - .instanceof(GetResourcesResponseBody) + .instanceof(GetServerResourcesResponseBody) .transform((v) => v.data$) .pipe( z .object({ - errors: z.array(z.lazy(() => GetResourcesErrors$outboundSchema)).optional(), + errors: z.array(z.lazy(() => GetServerResourcesErrors$outboundSchema)).optional(), rawResponse: z .instanceof(Response) .transform(() => { @@ -430,25 +450,25 @@ export const GetResourcesResponseBody$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 GetResourcesResponseBody$ { - /** @deprecated use `GetResourcesResponseBody$inboundSchema` instead. */ - export const inboundSchema = GetResourcesResponseBody$inboundSchema; - /** @deprecated use `GetResourcesResponseBody$outboundSchema` instead. */ - export const outboundSchema = GetResourcesResponseBody$outboundSchema; - /** @deprecated use `GetResourcesResponseBody$Outbound` instead. */ - export type Outbound = GetResourcesResponseBody$Outbound; +export namespace GetServerResourcesResponseBody$ { + /** @deprecated use `GetServerResourcesResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetServerResourcesResponseBody$inboundSchema; + /** @deprecated use `GetServerResourcesResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetServerResourcesResponseBody$outboundSchema; + /** @deprecated use `GetServerResourcesResponseBody$Outbound` instead. */ + export type Outbound = GetServerResourcesResponseBody$Outbound; } /** @internal */ export const Connections$inboundSchema: z.ZodType = z .object({ - protocol: z.string().optional(), - address: z.string().optional(), - port: z.number().optional(), - uri: z.string().optional(), - local: z.boolean().optional(), - relay: z.boolean().optional(), - IPv6: z.boolean().optional(), + protocol: z.string(), + address: z.string(), + port: z.number(), + uri: z.string(), + local: z.boolean(), + relay: z.boolean(), + IPv6: z.boolean(), }) .transform((v) => { return remap$(v, { @@ -458,13 +478,13 @@ export const Connections$inboundSchema: z.ZodType = z .object({ - protocol: z.string().optional(), - address: z.string().optional(), - port: z.number().optional(), - uri: z.string().optional(), - local: z.boolean().optional(), - relay: z.boolean().optional(), - iPv6: z.boolean().optional(), + protocol: z.string(), + address: z.string(), + port: z.number(), + uri: z.string(), + local: z.boolean(), + relay: z.boolean(), + iPv6: z.boolean(), }) .transform((v) => { return remap$(v, { @@ -506,9 +526,9 @@ export const PlexDevice$inboundSchema: z.ZodType new Date(v)), provides: z.string(), - ownerId: z.string().optional(), - sourceTitle: z.string().optional(), - publicAddress: z.string().optional(), - accessToken: z.string().optional(), - owned: z.boolean().optional(), - home: z.boolean().optional(), - synced: z.boolean().optional(), - relay: z.boolean().optional(), - presence: z.boolean().optional(), - httpsRequired: z.boolean().optional(), - publicAddressMatches: z.boolean().optional(), - dnsRebindingProtection: z.boolean().optional(), - natLoopbackSupported: z.boolean().optional(), - connections: z.array(z.lazy(() => Connections$inboundSchema)).optional(), + ownerId: z.nullable(z.number().int()), + sourceTitle: z.nullable(z.string()), + publicAddress: z.string(), + accessToken: z.string(), + owned: z.boolean(), + home: z.boolean(), + synced: z.boolean(), + relay: z.boolean(), + presence: z.boolean(), + httpsRequired: z.boolean(), + publicAddressMatches: z.boolean(), + dnsRebindingProtection: z.boolean(), + natLoopbackSupported: z.boolean(), + connections: z.array(z.lazy(() => Connections$inboundSchema)), }); /** @internal */ @@ -540,27 +560,27 @@ export type PlexDevice$Outbound = { name: string; product: string; productVersion: string; - platform: string; - platformVersion: string; - device: string; + platform: string | null; + platformVersion: string | null; + device: string | null; clientIdentifier: string; createdAt: string; lastSeenAt: string; provides: string; - ownerId?: string | undefined; - sourceTitle?: string | undefined; - publicAddress?: string | undefined; - accessToken?: string | undefined; - owned?: boolean | undefined; - home?: boolean | undefined; - synced?: boolean | undefined; - relay?: boolean | undefined; - presence?: boolean | undefined; - httpsRequired?: boolean | undefined; - publicAddressMatches?: boolean | undefined; - dnsRebindingProtection?: boolean | undefined; - natLoopbackSupported?: boolean | undefined; - connections?: Array | undefined; + ownerId: number | null; + sourceTitle: string | null; + publicAddress: string; + accessToken: string; + owned: boolean; + home: boolean; + synced: boolean; + relay: boolean; + presence: boolean; + httpsRequired: boolean; + publicAddressMatches: boolean; + dnsRebindingProtection: boolean; + natLoopbackSupported: boolean; + connections: Array; }; /** @internal */ @@ -569,27 +589,27 @@ export const PlexDevice$outboundSchema: z.ZodType v.toISOString()), lastSeenAt: z.date().transform((v) => v.toISOString()), provides: z.string(), - ownerId: z.string().optional(), - sourceTitle: z.string().optional(), - publicAddress: z.string().optional(), - accessToken: z.string().optional(), - owned: z.boolean().optional(), - home: z.boolean().optional(), - synced: z.boolean().optional(), - relay: z.boolean().optional(), - presence: z.boolean().optional(), - httpsRequired: z.boolean().optional(), - publicAddressMatches: z.boolean().optional(), - dnsRebindingProtection: z.boolean().optional(), - natLoopbackSupported: z.boolean().optional(), - connections: z.array(z.lazy(() => Connections$outboundSchema)).optional(), + ownerId: z.nullable(z.number().int()), + sourceTitle: z.nullable(z.string()), + publicAddress: z.string(), + accessToken: z.string(), + owned: z.boolean(), + home: z.boolean(), + synced: z.boolean(), + relay: z.boolean(), + presence: z.boolean(), + httpsRequired: z.boolean(), + publicAddressMatches: z.boolean(), + dnsRebindingProtection: z.boolean(), + natLoopbackSupported: z.boolean(), + connections: z.array(z.lazy(() => Connections$outboundSchema)), }); /** @@ -606,8 +626,8 @@ export namespace PlexDevice$ { } /** @internal */ -export const GetResourcesResponse$inboundSchema: z.ZodType< - GetResourcesResponse, +export const GetServerResourcesResponse$inboundSchema: z.ZodType< + GetServerResourcesResponse, z.ZodTypeDef, unknown > = z @@ -627,7 +647,7 @@ export const GetResourcesResponse$inboundSchema: z.ZodType< }); /** @internal */ -export type GetResourcesResponse$Outbound = { +export type GetServerResourcesResponse$Outbound = { ContentType: string; StatusCode: number; RawResponse: never; @@ -635,10 +655,10 @@ export type GetResourcesResponse$Outbound = { }; /** @internal */ -export const GetResourcesResponse$outboundSchema: z.ZodType< - GetResourcesResponse$Outbound, +export const GetServerResourcesResponse$outboundSchema: z.ZodType< + GetServerResourcesResponse$Outbound, z.ZodTypeDef, - GetResourcesResponse + GetServerResourcesResponse > = z .object({ contentType: z.string(), @@ -661,11 +681,11 @@ export const GetResourcesResponse$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 GetResourcesResponse$ { - /** @deprecated use `GetResourcesResponse$inboundSchema` instead. */ - export const inboundSchema = GetResourcesResponse$inboundSchema; - /** @deprecated use `GetResourcesResponse$outboundSchema` instead. */ - export const outboundSchema = GetResourcesResponse$outboundSchema; - /** @deprecated use `GetResourcesResponse$Outbound` instead. */ - export type Outbound = GetResourcesResponse$Outbound; +export namespace GetServerResourcesResponse$ { + /** @deprecated use `GetServerResourcesResponse$inboundSchema` instead. */ + export const inboundSchema = GetServerResourcesResponse$inboundSchema; + /** @deprecated use `GetServerResourcesResponse$outboundSchema` instead. */ + export const outboundSchema = GetServerResourcesResponse$outboundSchema; + /** @deprecated use `GetServerResourcesResponse$Outbound` instead. */ + export type Outbound = GetServerResourcesResponse$Outbound; } diff --git a/src/models/getsessionhistoryop.ts b/src/models/getsessionhistoryop.ts index 725bc099..4999f264 100644 --- a/src/models/getsessionhistoryop.ts +++ b/src/models/getsessionhistoryop.ts @@ -13,7 +13,7 @@ import * as z from "zod"; * (Unknown if viewedAt is the only supported column) * */ -export type Filter = {}; +export type QueryParamFilter = {}; export type GetSessionHistoryRequest = { /** @@ -37,7 +37,7 @@ export type GetSessionHistoryRequest = { * (Unknown if viewedAt is the only supported column) * */ - filter?: Filter | undefined; + filter?: QueryParamFilter | undefined; /** * Filters the results based on the id of a valid library section * @@ -150,25 +150,30 @@ export type GetSessionHistoryResponse = { }; /** @internal */ -export const Filter$inboundSchema: z.ZodType = z.object({}); +export const QueryParamFilter$inboundSchema: z.ZodType = + z.object({}); /** @internal */ -export type Filter$Outbound = {}; +export type QueryParamFilter$Outbound = {}; /** @internal */ -export const Filter$outboundSchema: z.ZodType = z.object({}); +export const QueryParamFilter$outboundSchema: z.ZodType< + QueryParamFilter$Outbound, + z.ZodTypeDef, + QueryParamFilter +> = z.object({}); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace Filter$ { - /** @deprecated use `Filter$inboundSchema` instead. */ - export const inboundSchema = Filter$inboundSchema; - /** @deprecated use `Filter$outboundSchema` instead. */ - export const outboundSchema = Filter$outboundSchema; - /** @deprecated use `Filter$Outbound` instead. */ - export type Outbound = Filter$Outbound; +export namespace QueryParamFilter$ { + /** @deprecated use `QueryParamFilter$inboundSchema` instead. */ + export const inboundSchema = QueryParamFilter$inboundSchema; + /** @deprecated use `QueryParamFilter$outboundSchema` instead. */ + export const outboundSchema = QueryParamFilter$outboundSchema; + /** @deprecated use `QueryParamFilter$Outbound` instead. */ + export type Outbound = QueryParamFilter$Outbound; } /** @internal */ @@ -179,7 +184,7 @@ export const GetSessionHistoryRequest$inboundSchema: z.ZodType< > = z.object({ sort: z.string().optional(), accountId: z.number().int().optional(), - filter: z.lazy(() => Filter$inboundSchema).optional(), + filter: z.lazy(() => QueryParamFilter$inboundSchema).optional(), librarySectionID: z.number().int().optional(), }); @@ -187,7 +192,7 @@ export const GetSessionHistoryRequest$inboundSchema: z.ZodType< export type GetSessionHistoryRequest$Outbound = { sort?: string | undefined; accountId?: number | undefined; - filter?: Filter$Outbound | undefined; + filter?: QueryParamFilter$Outbound | undefined; librarySectionID?: number | undefined; }; @@ -199,7 +204,7 @@ export const GetSessionHistoryRequest$outboundSchema: z.ZodType< > = z.object({ sort: z.string().optional(), accountId: z.number().int().optional(), - filter: z.lazy(() => Filter$outboundSchema).optional(), + filter: z.lazy(() => QueryParamFilter$outboundSchema).optional(), librarySectionID: z.number().int().optional(), }); diff --git a/src/models/getthumbimageop.ts b/src/models/getthumbimageop.ts new file mode 100644 index 00000000..d4e3e9f9 --- /dev/null +++ b/src/models/getthumbimageop.ts @@ -0,0 +1,328 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { remap as remap$ } from "../lib/primitives.js"; +import * as z from "zod"; + +export type GetThumbImageRequest = { + /** + * the id of the library item to return the children of. + */ + ratingKey: number; + width: number; + height: number; + minSize: number; + upscale: number; + /** + * Plex Authentication Token + */ + xPlexToken: string; +}; + +export type GetThumbImageErrors = { + 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 GetThumbImageResponseBodyData = { + 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 GetThumbImageResponseBody 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$: GetThumbImageResponseBodyData; + + constructor(err: GetThumbImageResponseBodyData) { + 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 = "GetThumbImageResponseBody"; + } +} + +export type GetThumbImageResponse = { + /** + * 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; + /** + * Successful response returning an image + */ + responseStream?: ReadableStream | undefined; + headers: { [k: string]: Array }; +}; + +/** @internal */ +export const GetThumbImageRequest$inboundSchema: z.ZodType< + GetThumbImageRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + ratingKey: z.number().int(), + width: z.number().int(), + height: z.number().int(), + minSize: z.number().int(), + upscale: z.number().int(), + "X-Plex-Token": z.string(), + }) + .transform((v) => { + return remap$(v, { + "X-Plex-Token": "xPlexToken", + }); + }); + +/** @internal */ +export type GetThumbImageRequest$Outbound = { + ratingKey: number; + width: number; + height: number; + minSize: number; + upscale: number; + "X-Plex-Token": string; +}; + +/** @internal */ +export const GetThumbImageRequest$outboundSchema: z.ZodType< + GetThumbImageRequest$Outbound, + z.ZodTypeDef, + GetThumbImageRequest +> = z + .object({ + ratingKey: z.number().int(), + width: z.number().int(), + height: z.number().int(), + minSize: z.number().int(), + upscale: z.number().int(), + xPlexToken: z.string(), + }) + .transform((v) => { + return remap$(v, { + xPlexToken: "X-Plex-Token", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetThumbImageRequest$ { + /** @deprecated use `GetThumbImageRequest$inboundSchema` instead. */ + export const inboundSchema = GetThumbImageRequest$inboundSchema; + /** @deprecated use `GetThumbImageRequest$outboundSchema` instead. */ + export const outboundSchema = GetThumbImageRequest$outboundSchema; + /** @deprecated use `GetThumbImageRequest$Outbound` instead. */ + export type Outbound = GetThumbImageRequest$Outbound; +} + +/** @internal */ +export const GetThumbImageErrors$inboundSchema: z.ZodType< + GetThumbImageErrors, + z.ZodTypeDef, + unknown +> = z.object({ + code: z.number().optional(), + message: z.string().optional(), + status: z.number().optional(), +}); + +/** @internal */ +export type GetThumbImageErrors$Outbound = { + code?: number | undefined; + message?: string | undefined; + status?: number | undefined; +}; + +/** @internal */ +export const GetThumbImageErrors$outboundSchema: z.ZodType< + GetThumbImageErrors$Outbound, + z.ZodTypeDef, + GetThumbImageErrors +> = z.object({ + code: z.number().optional(), + message: z.string().optional(), + status: z.number().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetThumbImageErrors$ { + /** @deprecated use `GetThumbImageErrors$inboundSchema` instead. */ + export const inboundSchema = GetThumbImageErrors$inboundSchema; + /** @deprecated use `GetThumbImageErrors$outboundSchema` instead. */ + export const outboundSchema = GetThumbImageErrors$outboundSchema; + /** @deprecated use `GetThumbImageErrors$Outbound` instead. */ + export type Outbound = GetThumbImageErrors$Outbound; +} + +/** @internal */ +export const GetThumbImageResponseBody$inboundSchema: z.ZodType< + GetThumbImageResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + errors: z.array(z.lazy(() => GetThumbImageErrors$inboundSchema)).optional(), + RawResponse: z.instanceof(Response).optional(), + }) + .transform((v) => { + const remapped = remap$(v, { + RawResponse: "rawResponse", + }); + + return new GetThumbImageResponseBody(remapped); + }); + +/** @internal */ +export type GetThumbImageResponseBody$Outbound = { + errors?: Array | undefined; + RawResponse?: never | undefined; +}; + +/** @internal */ +export const GetThumbImageResponseBody$outboundSchema: z.ZodType< + GetThumbImageResponseBody$Outbound, + z.ZodTypeDef, + GetThumbImageResponseBody +> = z + .instanceof(GetThumbImageResponseBody) + .transform((v) => v.data$) + .pipe( + z + .object({ + errors: z.array(z.lazy(() => GetThumbImageErrors$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 GetThumbImageResponseBody$ { + /** @deprecated use `GetThumbImageResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetThumbImageResponseBody$inboundSchema; + /** @deprecated use `GetThumbImageResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetThumbImageResponseBody$outboundSchema; + /** @deprecated use `GetThumbImageResponseBody$Outbound` instead. */ + export type Outbound = GetThumbImageResponseBody$Outbound; +} + +/** @internal */ +export const GetThumbImageResponse$inboundSchema: z.ZodType< + GetThumbImageResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + ContentType: z.string(), + StatusCode: z.number().int(), + RawResponse: z.instanceof(Response), + "response-stream": z.instanceof(ReadableStream).optional(), + Headers: z.record(z.array(z.string())), + }) + .transform((v) => { + return remap$(v, { + ContentType: "contentType", + StatusCode: "statusCode", + RawResponse: "rawResponse", + "response-stream": "responseStream", + Headers: "headers", + }); + }); + +/** @internal */ +export type GetThumbImageResponse$Outbound = { + ContentType: string; + StatusCode: number; + RawResponse: never; + "response-stream"?: ReadableStream | undefined; + Headers: { [k: string]: Array }; +}; + +/** @internal */ +export const GetThumbImageResponse$outboundSchema: z.ZodType< + GetThumbImageResponse$Outbound, + z.ZodTypeDef, + GetThumbImageResponse +> = z + .object({ + contentType: z.string(), + statusCode: z.number().int(), + rawResponse: z.instanceof(Response).transform(() => { + throw new Error("Response cannot be serialized"); + }), + responseStream: z.instanceof(ReadableStream).optional(), + headers: z.record(z.array(z.string())), + }) + .transform((v) => { + return remap$(v, { + contentType: "ContentType", + statusCode: "StatusCode", + rawResponse: "RawResponse", + responseStream: "response-stream", + headers: "Headers", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetThumbImageResponse$ { + /** @deprecated use `GetThumbImageResponse$inboundSchema` instead. */ + export const inboundSchema = GetThumbImageResponse$inboundSchema; + /** @deprecated use `GetThumbImageResponse$outboundSchema` instead. */ + export const outboundSchema = GetThumbImageResponse$outboundSchema; + /** @deprecated use `GetThumbImageResponse$Outbound` instead. */ + export type Outbound = GetThumbImageResponse$Outbound; +} diff --git a/src/models/gettokenbypinidop.ts b/src/models/gettokenbypinidop.ts index 6c7fcfca..032507a0 100644 --- a/src/models/gettokenbypinidop.ts +++ b/src/models/gettokenbypinidop.ts @@ -35,7 +35,7 @@ export type GetTokenByPinIdRequest = { pinID: number; }; -export type GetTokenByPinIdErrors = { +export type GetTokenByPinIdPlexErrors = { code?: number | undefined; message?: string | undefined; }; @@ -43,6 +43,55 @@ export type GetTokenByPinIdErrors = { /** * Not Found or Expired */ +export type GetTokenByPinIdPlexResponseBodyData = { + errors?: Array | undefined; + /** + * Raw HTTP response; suitable for custom response parsing + */ + rawResponse?: Response | undefined; +}; + +/** + * Not Found or Expired + */ +export class GetTokenByPinIdPlexResponseBody 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$: GetTokenByPinIdPlexResponseBodyData; + + constructor(err: GetTokenByPinIdPlexResponseBodyData) { + 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 = "GetTokenByPinIdPlexResponseBody"; + } +} + +export type GetTokenByPinIdErrors = { + code?: number | undefined; + message?: string | undefined; + status?: number | undefined; +}; + +/** + * Bad Request response when the X-Plex-Client-Identifier is missing + */ export type GetTokenByPinIdResponseBodyData = { errors?: Array | undefined; /** @@ -52,7 +101,7 @@ export type GetTokenByPinIdResponseBodyData = { }; /** - * Not Found or Expired + * Bad Request response when the X-Plex-Client-Identifier is missing */ export class GetTokenByPinIdResponseBody extends Error { errors?: Array | undefined; @@ -279,8 +328,8 @@ export namespace GetTokenByPinIdRequest$ { } /** @internal */ -export const GetTokenByPinIdErrors$inboundSchema: z.ZodType< - GetTokenByPinIdErrors, +export const GetTokenByPinIdPlexErrors$inboundSchema: z.ZodType< + GetTokenByPinIdPlexErrors, z.ZodTypeDef, unknown > = z.object({ @@ -288,10 +337,114 @@ export const GetTokenByPinIdErrors$inboundSchema: z.ZodType< message: z.string().optional(), }); +/** @internal */ +export type GetTokenByPinIdPlexErrors$Outbound = { + code?: number | undefined; + message?: string | undefined; +}; + +/** @internal */ +export const GetTokenByPinIdPlexErrors$outboundSchema: z.ZodType< + GetTokenByPinIdPlexErrors$Outbound, + z.ZodTypeDef, + GetTokenByPinIdPlexErrors +> = z.object({ + code: z.number().int().optional(), + message: 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 GetTokenByPinIdPlexErrors$ { + /** @deprecated use `GetTokenByPinIdPlexErrors$inboundSchema` instead. */ + export const inboundSchema = GetTokenByPinIdPlexErrors$inboundSchema; + /** @deprecated use `GetTokenByPinIdPlexErrors$outboundSchema` instead. */ + export const outboundSchema = GetTokenByPinIdPlexErrors$outboundSchema; + /** @deprecated use `GetTokenByPinIdPlexErrors$Outbound` instead. */ + export type Outbound = GetTokenByPinIdPlexErrors$Outbound; +} + +/** @internal */ +export const GetTokenByPinIdPlexResponseBody$inboundSchema: z.ZodType< + GetTokenByPinIdPlexResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + errors: z.array(z.lazy(() => GetTokenByPinIdPlexErrors$inboundSchema)).optional(), + RawResponse: z.instanceof(Response).optional(), + }) + .transform((v) => { + const remapped = remap$(v, { + RawResponse: "rawResponse", + }); + + return new GetTokenByPinIdPlexResponseBody(remapped); + }); + +/** @internal */ +export type GetTokenByPinIdPlexResponseBody$Outbound = { + errors?: Array | undefined; + RawResponse?: never | undefined; +}; + +/** @internal */ +export const GetTokenByPinIdPlexResponseBody$outboundSchema: z.ZodType< + GetTokenByPinIdPlexResponseBody$Outbound, + z.ZodTypeDef, + GetTokenByPinIdPlexResponseBody +> = z + .instanceof(GetTokenByPinIdPlexResponseBody) + .transform((v) => v.data$) + .pipe( + z + .object({ + errors: z.array(z.lazy(() => GetTokenByPinIdPlexErrors$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 GetTokenByPinIdPlexResponseBody$ { + /** @deprecated use `GetTokenByPinIdPlexResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetTokenByPinIdPlexResponseBody$inboundSchema; + /** @deprecated use `GetTokenByPinIdPlexResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetTokenByPinIdPlexResponseBody$outboundSchema; + /** @deprecated use `GetTokenByPinIdPlexResponseBody$Outbound` instead. */ + export type Outbound = GetTokenByPinIdPlexResponseBody$Outbound; +} + +/** @internal */ +export const GetTokenByPinIdErrors$inboundSchema: z.ZodType< + GetTokenByPinIdErrors, + z.ZodTypeDef, + unknown +> = z.object({ + code: z.number().int().optional(), + message: z.string().optional(), + status: z.number().int().optional(), +}); + /** @internal */ export type GetTokenByPinIdErrors$Outbound = { code?: number | undefined; message?: string | undefined; + status?: number | undefined; }; /** @internal */ @@ -302,6 +455,7 @@ export const GetTokenByPinIdErrors$outboundSchema: z.ZodType< > = z.object({ code: z.number().int().optional(), message: z.string().optional(), + status: z.number().int().optional(), }); /** @@ -391,11 +545,11 @@ export const GetTokenByPinIdGeoData$inboundSchema: z.ZodType< continent_code: z.string(), country: z.string(), city: z.string(), - european_union_member: z.boolean(), + european_union_member: z.boolean().default(false), time_zone: z.string(), postal_code: z.number().int(), - in_privacy_restricted_country: z.boolean(), - in_privacy_restricted_region: z.boolean(), + in_privacy_restricted_country: z.boolean().default(false), + in_privacy_restricted_region: z.boolean().default(false), subdivisions: z.string(), coordinates: z.string(), }) @@ -477,7 +631,7 @@ export const GetTokenByPinIdAuthPinContainer$inboundSchema: z.ZodType< id: z.number().int(), code: z.string(), product: z.string(), - trusted: z.boolean(), + trusted: z.boolean().default(false), qr: z.string(), clientIdentifier: z.string(), location: z.lazy(() => GetTokenByPinIdGeoData$inboundSchema), diff --git a/src/models/gettopwatchedcontentop.ts b/src/models/gettopwatchedcontentop.ts index 193c74e7..eac8acfb 100644 --- a/src/models/gettopwatchedcontentop.ts +++ b/src/models/gettopwatchedcontentop.ts @@ -6,11 +6,37 @@ import { remap as remap$ } from "../lib/primitives.js"; import { RFCDate } from "../types/rfcdate.js"; import * as z from "zod"; +/** + * 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 GetTopWatchedContentQueryParamType { + One = 1, + Two = 2, + Three = 3, + Four = 4, +} + export type GetTopWatchedContentRequest = { /** - * the library type (1 - movies, 2 - shows, 3 - music) + * 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: number; + type: GetTopWatchedContentQueryParamType; /** * Adds the Guids object to the response * @@ -20,6 +46,55 @@ export type GetTopWatchedContentRequest = { includeGuids?: number | undefined; }; +export type GetTopWatchedContentErrors = { + 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 GetTopWatchedContentLibraryResponseBodyData = { + 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 GetTopWatchedContentLibraryResponseBody 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$: GetTopWatchedContentLibraryResponseBodyData; + + constructor(err: GetTopWatchedContentLibraryResponseBodyData) { + 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 = "GetTopWatchedContentLibraryResponseBody"; + } +} + export type GetTopWatchedContentGenre = { id?: number | undefined; filter?: string | undefined; @@ -45,7 +120,7 @@ export type GetTopWatchedContentRole = { thumb?: string | undefined; }; -export type GetTopWatchedContentUser = { +export type User = { id?: number | undefined; }; @@ -81,7 +156,7 @@ export type GetTopWatchedContentMetadata = { country?: Array | undefined; guids?: Array | undefined; role?: Array | undefined; - user?: Array | undefined; + user?: Array | undefined; }; export type GetTopWatchedContentMediaContainer = { @@ -119,13 +194,34 @@ export type GetTopWatchedContentResponse = { object?: GetTopWatchedContentResponseBody | undefined; }; +/** @internal */ +export const GetTopWatchedContentQueryParamType$inboundSchema: z.ZodNativeEnum< + typeof GetTopWatchedContentQueryParamType +> = z.nativeEnum(GetTopWatchedContentQueryParamType); + +/** @internal */ +export const GetTopWatchedContentQueryParamType$outboundSchema: z.ZodNativeEnum< + typeof GetTopWatchedContentQueryParamType +> = GetTopWatchedContentQueryParamType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTopWatchedContentQueryParamType$ { + /** @deprecated use `GetTopWatchedContentQueryParamType$inboundSchema` instead. */ + export const inboundSchema = GetTopWatchedContentQueryParamType$inboundSchema; + /** @deprecated use `GetTopWatchedContentQueryParamType$outboundSchema` instead. */ + export const outboundSchema = GetTopWatchedContentQueryParamType$outboundSchema; +} + /** @internal */ export const GetTopWatchedContentRequest$inboundSchema: z.ZodType< GetTopWatchedContentRequest, z.ZodTypeDef, unknown > = z.object({ - type: z.number().int(), + type: GetTopWatchedContentQueryParamType$inboundSchema, includeGuids: z.number().int().optional(), }); @@ -141,7 +237,7 @@ export const GetTopWatchedContentRequest$outboundSchema: z.ZodType< z.ZodTypeDef, GetTopWatchedContentRequest > = z.object({ - type: z.number().int(), + type: GetTopWatchedContentQueryParamType$outboundSchema, includeGuids: z.number().int().optional(), }); @@ -158,6 +254,111 @@ export namespace GetTopWatchedContentRequest$ { export type Outbound = GetTopWatchedContentRequest$Outbound; } +/** @internal */ +export const GetTopWatchedContentErrors$inboundSchema: z.ZodType< + GetTopWatchedContentErrors, + z.ZodTypeDef, + unknown +> = z.object({ + code: z.number().optional(), + message: z.string().optional(), + status: z.number().optional(), +}); + +/** @internal */ +export type GetTopWatchedContentErrors$Outbound = { + code?: number | undefined; + message?: string | undefined; + status?: number | undefined; +}; + +/** @internal */ +export const GetTopWatchedContentErrors$outboundSchema: z.ZodType< + GetTopWatchedContentErrors$Outbound, + z.ZodTypeDef, + GetTopWatchedContentErrors +> = z.object({ + code: z.number().optional(), + message: z.string().optional(), + status: z.number().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTopWatchedContentErrors$ { + /** @deprecated use `GetTopWatchedContentErrors$inboundSchema` instead. */ + export const inboundSchema = GetTopWatchedContentErrors$inboundSchema; + /** @deprecated use `GetTopWatchedContentErrors$outboundSchema` instead. */ + export const outboundSchema = GetTopWatchedContentErrors$outboundSchema; + /** @deprecated use `GetTopWatchedContentErrors$Outbound` instead. */ + export type Outbound = GetTopWatchedContentErrors$Outbound; +} + +/** @internal */ +export const GetTopWatchedContentLibraryResponseBody$inboundSchema: z.ZodType< + GetTopWatchedContentLibraryResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + errors: z.array(z.lazy(() => GetTopWatchedContentErrors$inboundSchema)).optional(), + RawResponse: z.instanceof(Response).optional(), + }) + .transform((v) => { + const remapped = remap$(v, { + RawResponse: "rawResponse", + }); + + return new GetTopWatchedContentLibraryResponseBody(remapped); + }); + +/** @internal */ +export type GetTopWatchedContentLibraryResponseBody$Outbound = { + errors?: Array | undefined; + RawResponse?: never | undefined; +}; + +/** @internal */ +export const GetTopWatchedContentLibraryResponseBody$outboundSchema: z.ZodType< + GetTopWatchedContentLibraryResponseBody$Outbound, + z.ZodTypeDef, + GetTopWatchedContentLibraryResponseBody +> = z + .instanceof(GetTopWatchedContentLibraryResponseBody) + .transform((v) => v.data$) + .pipe( + z + .object({ + errors: z.array(z.lazy(() => GetTopWatchedContentErrors$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 GetTopWatchedContentLibraryResponseBody$ { + /** @deprecated use `GetTopWatchedContentLibraryResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetTopWatchedContentLibraryResponseBody$inboundSchema; + /** @deprecated use `GetTopWatchedContentLibraryResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetTopWatchedContentLibraryResponseBody$outboundSchema; + /** @deprecated use `GetTopWatchedContentLibraryResponseBody$Outbound` instead. */ + export type Outbound = GetTopWatchedContentLibraryResponseBody$Outbound; +} + /** @internal */ export const GetTopWatchedContentGenre$inboundSchema: z.ZodType< GetTopWatchedContentGenre, @@ -330,25 +531,17 @@ export namespace GetTopWatchedContentRole$ { } /** @internal */ -export const GetTopWatchedContentUser$inboundSchema: z.ZodType< - GetTopWatchedContentUser, - z.ZodTypeDef, - unknown -> = z.object({ +export const User$inboundSchema: z.ZodType = z.object({ id: z.number().int().optional(), }); /** @internal */ -export type GetTopWatchedContentUser$Outbound = { +export type User$Outbound = { id?: number | undefined; }; /** @internal */ -export const GetTopWatchedContentUser$outboundSchema: z.ZodType< - GetTopWatchedContentUser$Outbound, - z.ZodTypeDef, - GetTopWatchedContentUser -> = z.object({ +export const User$outboundSchema: z.ZodType = z.object({ id: z.number().int().optional(), }); @@ -356,13 +549,13 @@ export const GetTopWatchedContentUser$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 GetTopWatchedContentUser$ { - /** @deprecated use `GetTopWatchedContentUser$inboundSchema` instead. */ - export const inboundSchema = GetTopWatchedContentUser$inboundSchema; - /** @deprecated use `GetTopWatchedContentUser$outboundSchema` instead. */ - export const outboundSchema = GetTopWatchedContentUser$outboundSchema; - /** @deprecated use `GetTopWatchedContentUser$Outbound` instead. */ - export type Outbound = GetTopWatchedContentUser$Outbound; +export namespace User$ { + /** @deprecated use `User$inboundSchema` instead. */ + export const inboundSchema = User$inboundSchema; + /** @deprecated use `User$outboundSchema` instead. */ + export const outboundSchema = User$outboundSchema; + /** @deprecated use `User$Outbound` instead. */ + export type Outbound = User$Outbound; } /** @internal */ @@ -406,7 +599,7 @@ export const GetTopWatchedContentMetadata$inboundSchema: z.ZodType< Country: z.array(z.lazy(() => GetTopWatchedContentCountry$inboundSchema)).optional(), Guid: z.array(z.lazy(() => GetTopWatchedContentGuids$inboundSchema)).optional(), Role: z.array(z.lazy(() => GetTopWatchedContentRole$inboundSchema)).optional(), - User: z.array(z.lazy(() => GetTopWatchedContentUser$inboundSchema)).optional(), + User: z.array(z.lazy(() => User$inboundSchema)).optional(), }) .transform((v) => { return remap$(v, { @@ -451,7 +644,7 @@ export type GetTopWatchedContentMetadata$Outbound = { Country?: Array | undefined; Guid?: Array | undefined; Role?: Array | undefined; - User?: Array | undefined; + User?: Array | undefined; }; /** @internal */ @@ -495,7 +688,7 @@ export const GetTopWatchedContentMetadata$outboundSchema: z.ZodType< country: z.array(z.lazy(() => GetTopWatchedContentCountry$outboundSchema)).optional(), guids: z.array(z.lazy(() => GetTopWatchedContentGuids$outboundSchema)).optional(), role: z.array(z.lazy(() => GetTopWatchedContentRole$outboundSchema)).optional(), - user: z.array(z.lazy(() => GetTopWatchedContentUser$outboundSchema)).optional(), + user: z.array(z.lazy(() => User$outboundSchema)).optional(), }) .transform((v) => { return remap$(v, { diff --git a/src/models/getuserdetailsop.ts b/src/models/getuserdetailsop.ts index fedbd308..7a9a6bde 100644 --- a/src/models/getuserdetailsop.ts +++ b/src/models/getuserdetailsop.ts @@ -7,6 +7,13 @@ import * as z from "zod"; export const GetUserDetailsOpServerList = ["https://plex.tv/api/v2"] as const; +export type GetUserDetailsRequest = { + /** + * Plex Authentication Token + */ + xPlexToken: string; +}; + export type GetUserDetailsErrors = { code?: number | undefined; message?: string | undefined; @@ -60,10 +67,44 @@ export class GetUserDetailsResponseBody extends Error { * Your current mailing list status */ export enum MailingListStatus { - Subscribed = "subscribed", + Active = "active", Unsubscribed = "unsubscribed", } +/** + * The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) + */ +export enum AutoSelectSubtitle { + Zero = "0", + One = "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) + */ +export enum DefaultSubtitleAccessibility { + Zero = "0", + One = "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", +} + +export enum WatchedIndicator { + Zero = "0", + One = "1", +} + +export enum MediaReviewsVisibility { + Zero = 0, + One = 1, +} + export type UserProfile = { /** * If the account has automatically select audio and subtitle tracks enabled @@ -72,25 +113,25 @@ export type UserProfile = { /** * The preferred audio language for the account */ - defaultAudioLanguage?: string | undefined; + defaultAudioLanguage: string | null; /** * The preferred subtitle language for the account */ - defaultSubtitleLanguage?: string | undefined; + defaultSubtitleLanguage: string | null; /** * The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) */ - autoSelectSubtitle?: number | undefined; + 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?: number | undefined; + 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?: number | undefined; - watchedIndicator?: number | undefined; - mediaReviewsVisibility?: number | undefined; + defaultSubtitleForced?: DefaultSubtitleForced | undefined; + watchedIndicator?: WatchedIndicator | undefined; + mediaReviewsVisibility?: MediaReviewsVisibility | undefined; }; export enum GetUserDetailsStatus { @@ -171,7 +212,7 @@ export enum Features { /** * String representation of subscriptionActive */ -export enum GetUserDetailsPlexStatus { +export enum GetUserDetailsAuthenticationStatus { Inactive = "Inactive", Active = "Active", } @@ -191,11 +232,11 @@ export type Subscription = { /** * Date the account subscribed to Plex Pass */ - subscribedAt?: Date | undefined; + subscribedAt?: string | null | undefined; /** * String representation of subscriptionActive */ - status?: GetUserDetailsPlexStatus | undefined; + status?: GetUserDetailsAuthenticationStatus | undefined; /** * Payment service used for your Plex Pass subscription */ @@ -271,7 +312,7 @@ export enum GetUserDetailsFeatures { /** * String representation of subscriptionActive */ -export enum GetUserDetailsPlexResponseStatus { +export enum GetUserDetailsAuthenticationResponseStatus { Inactive = "Inactive", Active = "Active", } @@ -288,11 +329,11 @@ export type GetUserDetailsSubscription = { /** * Date the account subscribed to Plex Pass */ - subscribedAt?: Date | undefined; + subscribedAt?: string | null | undefined; /** * String representation of subscriptionActive */ - status?: GetUserDetailsPlexResponseStatus | undefined; + status?: GetUserDetailsAuthenticationResponseStatus | undefined; /** * Payment service used for your Plex Pass subscription */ @@ -322,7 +363,7 @@ export type GetUserDetailsUserPlexAccount = { /** * Unknown */ - anonymous?: boolean | undefined; + anonymous?: boolean | null | undefined; /** * The account token */ @@ -409,7 +450,7 @@ export type GetUserDetailsUserPlexAccount = { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ pin?: string | undefined; - profile: Array; + profile: UserProfile; /** * If the account has a Plex Home PIN enabled */ @@ -481,6 +522,54 @@ export type GetUserDetailsResponse = { userPlexAccount?: GetUserDetailsUserPlexAccount | undefined; }; +/** @internal */ +export const GetUserDetailsRequest$inboundSchema: z.ZodType< + GetUserDetailsRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + "X-Plex-Token": z.string(), + }) + .transform((v) => { + return remap$(v, { + "X-Plex-Token": "xPlexToken", + }); + }); + +/** @internal */ +export type GetUserDetailsRequest$Outbound = { + "X-Plex-Token": string; +}; + +/** @internal */ +export const GetUserDetailsRequest$outboundSchema: z.ZodType< + GetUserDetailsRequest$Outbound, + z.ZodTypeDef, + GetUserDetailsRequest +> = z + .object({ + xPlexToken: z.string(), + }) + .transform((v) => { + return remap$(v, { + xPlexToken: "X-Plex-Token", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserDetailsRequest$ { + /** @deprecated use `GetUserDetailsRequest$inboundSchema` instead. */ + export const inboundSchema = GetUserDetailsRequest$inboundSchema; + /** @deprecated use `GetUserDetailsRequest$outboundSchema` instead. */ + export const outboundSchema = GetUserDetailsRequest$outboundSchema; + /** @deprecated use `GetUserDetailsRequest$Outbound` instead. */ + export type Outbound = GetUserDetailsRequest$Outbound; +} + /** @internal */ export const GetUserDetailsErrors$inboundSchema: z.ZodType< GetUserDetailsErrors, @@ -605,27 +694,124 @@ export namespace MailingListStatus$ { export const outboundSchema = MailingListStatus$outboundSchema; } +/** @internal */ +export const AutoSelectSubtitle$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(AutoSelectSubtitle); + +/** @internal */ +export const AutoSelectSubtitle$outboundSchema: z.ZodNativeEnum = + AutoSelectSubtitle$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AutoSelectSubtitle$ { + /** @deprecated use `AutoSelectSubtitle$inboundSchema` instead. */ + export const inboundSchema = AutoSelectSubtitle$inboundSchema; + /** @deprecated use `AutoSelectSubtitle$outboundSchema` instead. */ + export const outboundSchema = AutoSelectSubtitle$outboundSchema; +} + +/** @internal */ +export const DefaultSubtitleAccessibility$inboundSchema: z.ZodNativeEnum< + typeof DefaultSubtitleAccessibility +> = z.nativeEnum(DefaultSubtitleAccessibility); + +/** @internal */ +export const DefaultSubtitleAccessibility$outboundSchema: z.ZodNativeEnum< + typeof DefaultSubtitleAccessibility +> = DefaultSubtitleAccessibility$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DefaultSubtitleAccessibility$ { + /** @deprecated use `DefaultSubtitleAccessibility$inboundSchema` instead. */ + export const inboundSchema = DefaultSubtitleAccessibility$inboundSchema; + /** @deprecated use `DefaultSubtitleAccessibility$outboundSchema` instead. */ + export const outboundSchema = DefaultSubtitleAccessibility$outboundSchema; +} + +/** @internal */ +export const DefaultSubtitleForced$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(DefaultSubtitleForced); + +/** @internal */ +export const DefaultSubtitleForced$outboundSchema: z.ZodNativeEnum = + DefaultSubtitleForced$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DefaultSubtitleForced$ { + /** @deprecated use `DefaultSubtitleForced$inboundSchema` instead. */ + export const inboundSchema = DefaultSubtitleForced$inboundSchema; + /** @deprecated use `DefaultSubtitleForced$outboundSchema` instead. */ + export const outboundSchema = DefaultSubtitleForced$outboundSchema; +} + +/** @internal */ +export const WatchedIndicator$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(WatchedIndicator); + +/** @internal */ +export const WatchedIndicator$outboundSchema: z.ZodNativeEnum = + WatchedIndicator$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WatchedIndicator$ { + /** @deprecated use `WatchedIndicator$inboundSchema` instead. */ + export const inboundSchema = WatchedIndicator$inboundSchema; + /** @deprecated use `WatchedIndicator$outboundSchema` instead. */ + export const outboundSchema = WatchedIndicator$outboundSchema; +} + +/** @internal */ +export const MediaReviewsVisibility$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(MediaReviewsVisibility); + +/** @internal */ +export const MediaReviewsVisibility$outboundSchema: z.ZodNativeEnum = + MediaReviewsVisibility$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace MediaReviewsVisibility$ { + /** @deprecated use `MediaReviewsVisibility$inboundSchema` instead. */ + export const inboundSchema = MediaReviewsVisibility$inboundSchema; + /** @deprecated use `MediaReviewsVisibility$outboundSchema` instead. */ + export const outboundSchema = MediaReviewsVisibility$outboundSchema; +} + /** @internal */ export const UserProfile$inboundSchema: z.ZodType = z.object({ autoSelectAudio: z.boolean().default(true), - defaultAudioLanguage: z.string().optional(), - defaultSubtitleLanguage: z.string().optional(), - autoSelectSubtitle: z.number().int().optional(), - defaultSubtitleAccessibility: z.number().int().optional(), - defaultSubtitleForced: z.number().int().optional(), - watchedIndicator: z.number().int().optional(), - mediaReviewsVisibility: z.number().int().optional(), + 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(), }); /** @internal */ export type UserProfile$Outbound = { autoSelectAudio: boolean; - defaultAudioLanguage?: string | undefined; - defaultSubtitleLanguage?: string | undefined; - autoSelectSubtitle?: number | undefined; - defaultSubtitleAccessibility?: number | undefined; - defaultSubtitleForced?: number | undefined; - watchedIndicator?: number | undefined; + defaultAudioLanguage: string | null; + defaultSubtitleLanguage: string | null; + autoSelectSubtitle?: string | undefined; + defaultSubtitleAccessibility?: string | undefined; + defaultSubtitleForced?: string | undefined; + watchedIndicator?: string | undefined; mediaReviewsVisibility?: number | undefined; }; @@ -636,13 +822,13 @@ export const UserProfile$outboundSchema: z.ZodType< UserProfile > = z.object({ autoSelectAudio: z.boolean().default(true), - defaultAudioLanguage: z.string().optional(), - defaultSubtitleLanguage: z.string().optional(), - autoSelectSubtitle: z.number().int().optional(), - defaultSubtitleAccessibility: z.number().int().optional(), - defaultSubtitleForced: z.number().int().optional(), - watchedIndicator: z.number().int().optional(), - mediaReviewsVisibility: z.number().int().optional(), + defaultAudioLanguage: z.nullable(z.string()), + defaultSubtitleLanguage: z.nullable(z.string()), + autoSelectSubtitle: AutoSelectSubtitle$outboundSchema.optional(), + defaultSubtitleAccessibility: DefaultSubtitleAccessibility$outboundSchema.optional(), + defaultSubtitleForced: DefaultSubtitleForced$outboundSchema.optional(), + watchedIndicator: WatchedIndicator$outboundSchema.optional(), + mediaReviewsVisibility: MediaReviewsVisibility$outboundSchema.optional(), }); /** @@ -736,36 +922,32 @@ export namespace Features$ { } /** @internal */ -export const GetUserDetailsPlexStatus$inboundSchema: z.ZodNativeEnum< - typeof GetUserDetailsPlexStatus -> = z.nativeEnum(GetUserDetailsPlexStatus); +export const GetUserDetailsAuthenticationStatus$inboundSchema: z.ZodNativeEnum< + typeof GetUserDetailsAuthenticationStatus +> = z.nativeEnum(GetUserDetailsAuthenticationStatus); /** @internal */ -export const GetUserDetailsPlexStatus$outboundSchema: z.ZodNativeEnum< - typeof GetUserDetailsPlexStatus -> = GetUserDetailsPlexStatus$inboundSchema; +export const GetUserDetailsAuthenticationStatus$outboundSchema: z.ZodNativeEnum< + typeof GetUserDetailsAuthenticationStatus +> = GetUserDetailsAuthenticationStatus$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace GetUserDetailsPlexStatus$ { - /** @deprecated use `GetUserDetailsPlexStatus$inboundSchema` instead. */ - export const inboundSchema = GetUserDetailsPlexStatus$inboundSchema; - /** @deprecated use `GetUserDetailsPlexStatus$outboundSchema` instead. */ - export const outboundSchema = GetUserDetailsPlexStatus$outboundSchema; +export namespace GetUserDetailsAuthenticationStatus$ { + /** @deprecated use `GetUserDetailsAuthenticationStatus$inboundSchema` instead. */ + export const inboundSchema = GetUserDetailsAuthenticationStatus$inboundSchema; + /** @deprecated use `GetUserDetailsAuthenticationStatus$outboundSchema` instead. */ + export const outboundSchema = GetUserDetailsAuthenticationStatus$outboundSchema; } /** @internal */ export const Subscription$inboundSchema: z.ZodType = z.object({ features: z.array(Features$inboundSchema).optional(), active: z.boolean().optional(), - subscribedAt: z - .string() - .datetime({ offset: true }) - .transform((v) => new Date(v)) - .optional(), - status: GetUserDetailsPlexStatus$inboundSchema.optional(), + subscribedAt: z.nullable(z.string()).optional(), + status: GetUserDetailsAuthenticationStatus$inboundSchema.optional(), paymentService: z.nullable(z.string()).optional(), plan: z.nullable(z.string()).optional(), }); @@ -774,7 +956,7 @@ export const Subscription$inboundSchema: z.ZodType | undefined; active?: boolean | undefined; - subscribedAt?: string | undefined; + subscribedAt?: string | null | undefined; status?: string | undefined; paymentService?: string | null | undefined; plan?: string | null | undefined; @@ -788,11 +970,8 @@ export const Subscription$outboundSchema: z.ZodType< > = z.object({ features: z.array(Features$outboundSchema).optional(), active: z.boolean().optional(), - subscribedAt: z - .date() - .transform((v) => v.toISOString()) - .optional(), - status: GetUserDetailsPlexStatus$outboundSchema.optional(), + subscribedAt: z.nullable(z.string()).optional(), + status: GetUserDetailsAuthenticationStatus$outboundSchema.optional(), paymentService: z.nullable(z.string()).optional(), plan: z.nullable(z.string()).optional(), }); @@ -830,24 +1009,24 @@ export namespace GetUserDetailsFeatures$ { } /** @internal */ -export const GetUserDetailsPlexResponseStatus$inboundSchema: z.ZodNativeEnum< - typeof GetUserDetailsPlexResponseStatus -> = z.nativeEnum(GetUserDetailsPlexResponseStatus); +export const GetUserDetailsAuthenticationResponseStatus$inboundSchema: z.ZodNativeEnum< + typeof GetUserDetailsAuthenticationResponseStatus +> = z.nativeEnum(GetUserDetailsAuthenticationResponseStatus); /** @internal */ -export const GetUserDetailsPlexResponseStatus$outboundSchema: z.ZodNativeEnum< - typeof GetUserDetailsPlexResponseStatus -> = GetUserDetailsPlexResponseStatus$inboundSchema; +export const GetUserDetailsAuthenticationResponseStatus$outboundSchema: z.ZodNativeEnum< + typeof GetUserDetailsAuthenticationResponseStatus +> = GetUserDetailsAuthenticationResponseStatus$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace GetUserDetailsPlexResponseStatus$ { - /** @deprecated use `GetUserDetailsPlexResponseStatus$inboundSchema` instead. */ - export const inboundSchema = GetUserDetailsPlexResponseStatus$inboundSchema; - /** @deprecated use `GetUserDetailsPlexResponseStatus$outboundSchema` instead. */ - export const outboundSchema = GetUserDetailsPlexResponseStatus$outboundSchema; +export namespace GetUserDetailsAuthenticationResponseStatus$ { + /** @deprecated use `GetUserDetailsAuthenticationResponseStatus$inboundSchema` instead. */ + export const inboundSchema = GetUserDetailsAuthenticationResponseStatus$inboundSchema; + /** @deprecated use `GetUserDetailsAuthenticationResponseStatus$outboundSchema` instead. */ + export const outboundSchema = GetUserDetailsAuthenticationResponseStatus$outboundSchema; } /** @internal */ @@ -858,12 +1037,8 @@ export const GetUserDetailsSubscription$inboundSchema: z.ZodType< > = z.object({ features: z.array(GetUserDetailsFeatures$inboundSchema).optional(), active: z.boolean().optional(), - subscribedAt: z - .string() - .datetime({ offset: true }) - .transform((v) => new Date(v)) - .optional(), - status: GetUserDetailsPlexResponseStatus$inboundSchema.optional(), + subscribedAt: z.nullable(z.string()).optional(), + status: GetUserDetailsAuthenticationResponseStatus$inboundSchema.optional(), paymentService: z.nullable(z.string()).optional(), plan: z.nullable(z.string()).optional(), }); @@ -872,7 +1047,7 @@ export const GetUserDetailsSubscription$inboundSchema: z.ZodType< export type GetUserDetailsSubscription$Outbound = { features?: Array | undefined; active?: boolean | undefined; - subscribedAt?: string | undefined; + subscribedAt?: string | null | undefined; status?: string | undefined; paymentService?: string | null | undefined; plan?: string | null | undefined; @@ -886,11 +1061,8 @@ export const GetUserDetailsSubscription$outboundSchema: z.ZodType< > = z.object({ features: z.array(GetUserDetailsFeatures$outboundSchema).optional(), active: z.boolean().optional(), - subscribedAt: z - .date() - .transform((v) => v.toISOString()) - .optional(), - status: GetUserDetailsPlexResponseStatus$outboundSchema.optional(), + subscribedAt: z.nullable(z.string()).optional(), + status: GetUserDetailsAuthenticationResponseStatus$outboundSchema.optional(), paymentService: z.nullable(z.string()).optional(), plan: z.nullable(z.string()).optional(), }); @@ -927,32 +1099,32 @@ export const GetUserDetailsUserPlexAccount$inboundSchema: z.ZodType< .datetime({ offset: true }) .transform((v) => new Date(v)) ), - anonymous: z.boolean(), + anonymous: z.nullable(z.boolean().default(false)), authToken: z.string(), - backupCodesCreated: z.boolean(), - confirmed: z.boolean(), + backupCodesCreated: z.boolean().default(false), + confirmed: z.boolean().default(false), country: z.string(), email: z.string(), - emailOnlyAuth: z.boolean(), - experimentalFeatures: z.boolean(), + emailOnlyAuth: z.boolean().default(false), + experimentalFeatures: z.boolean().default(false), friendlyName: z.string(), entitlements: z.array(z.string()), - guest: z.boolean(), + guest: z.boolean().default(false), hasPassword: z.boolean().default(true), - home: z.boolean(), - homeAdmin: z.boolean(), + home: z.boolean().default(false), + homeAdmin: z.boolean().default(false), homeSize: z.number().int(), id: z.number().int(), joinedAt: z.number().int(), locale: z.nullable(z.string()), - mailingListActive: z.boolean(), + mailingListActive: z.boolean().default(false), mailingListStatus: MailingListStatus$inboundSchema, maxHomeSize: z.number().int(), pin: z.string().optional(), - profile: z.array(z.lazy(() => UserProfile$inboundSchema)), - protected: z.boolean(), + profile: z.lazy(() => UserProfile$inboundSchema), + protected: z.boolean().default(false), rememberExpiresAt: z.number().int(), - restricted: z.boolean(), + restricted: z.boolean().default(false), roles: z.array(z.string()).optional(), scrobbleTypes: z.string(), services: z.array(z.lazy(() => Services$inboundSchema)), @@ -961,7 +1133,7 @@ export const GetUserDetailsUserPlexAccount$inboundSchema: z.ZodType< subscriptions: z.array(z.lazy(() => GetUserDetailsSubscription$inboundSchema)), thumb: z.string(), title: z.string(), - twoFactorEnabled: z.boolean(), + twoFactorEnabled: z.boolean().default(false), username: z.string(), uuid: z.string(), }); @@ -971,7 +1143,7 @@ export type GetUserDetailsUserPlexAccount$Outbound = { adsConsent: boolean | null; adsConsentReminderAt: string | null; adsConsentSetAt: string | null; - anonymous: boolean; + anonymous: boolean | null; authToken: string; backupCodesCreated: boolean; confirmed: boolean; @@ -993,7 +1165,7 @@ export type GetUserDetailsUserPlexAccount$Outbound = { mailingListStatus: string; maxHomeSize: number; pin?: string | undefined; - profile: Array; + profile: UserProfile$Outbound; protected: boolean; rememberExpiresAt: number; restricted: boolean; @@ -1019,7 +1191,7 @@ export const GetUserDetailsUserPlexAccount$outboundSchema: z.ZodType< adsConsent: z.nullable(z.boolean()), adsConsentReminderAt: z.nullable(z.date().transform((v) => v.toISOString())), adsConsentSetAt: z.nullable(z.date().transform((v) => v.toISOString())), - anonymous: z.boolean().default(false), + anonymous: z.nullable(z.boolean().default(false)), authToken: z.string(), backupCodesCreated: z.boolean().default(false), confirmed: z.boolean().default(false), @@ -1041,7 +1213,7 @@ export const GetUserDetailsUserPlexAccount$outboundSchema: z.ZodType< mailingListStatus: MailingListStatus$outboundSchema, maxHomeSize: z.number().int(), pin: z.string().optional(), - profile: z.array(z.lazy(() => UserProfile$outboundSchema)), + profile: z.lazy(() => UserProfile$outboundSchema), protected: z.boolean().default(false), rememberExpiresAt: z.number().int(), restricted: z.boolean().default(false), diff --git a/src/models/getuserfriendsop.ts b/src/models/getuserfriendsop.ts index b08337e1..99fc585d 100644 --- a/src/models/getuserfriendsop.ts +++ b/src/models/getuserfriendsop.ts @@ -313,7 +313,7 @@ export const Friend$inboundSchema: z.ZodType = z. friendlyName: z.nullable(z.string()), home: z.boolean(), id: z.number().int(), - restricted: z.boolean(), + restricted: z.boolean().default(false), sharedServers: z.array(z.lazy(() => SharedServers$inboundSchema)), sharedSources: z.array(z.lazy(() => SharedSources$inboundSchema)), status: Status$inboundSchema, diff --git a/src/models/getwatchlistop.ts b/src/models/getwatchlistop.ts index b4f64c92..8d73b511 100644 --- a/src/models/getwatchlistop.ts +++ b/src/models/getwatchlistop.ts @@ -6,7 +6,7 @@ import { remap as remap$ } from "../lib/primitives.js"; import { RFCDate } from "../types/rfcdate.js"; import * as z from "zod"; -export const GetWatchlistOpServerList = [ +export const GetWatchListOpServerList = [ /** * The plex metadata provider server */ @@ -16,7 +16,7 @@ export const GetWatchlistOpServerList = [ /** * Filter */ -export enum PathParamFilter { +export enum Filter { All = "all", Available = "available", Released = "released", @@ -55,11 +55,11 @@ export enum IncludeExternalMedia { Zero = 0, } -export type GetWatchlistRequest = { +export type GetWatchListRequest = { /** * Filter */ - filter: PathParamFilter; + filter: Filter; /** * In the format "field:dir". Available fields are "watchlistedAt" (Added At), * @@ -98,15 +98,12 @@ export type GetWatchlistRequest = { * */ includeExternalMedia?: IncludeExternalMedia | undefined; - /** - * User Token - */ - xPlexToken: string; /** * 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; @@ -115,12 +112,17 @@ export type GetWatchlistRequest = { * * @remarks * If the number of items exceeds the limit, the response will be paginated. + * By default this is 50 * */ xPlexContainerSize?: number | undefined; + /** + * Plex Authentication Token + */ + xPlexToken: string; }; -export type GetWatchlistErrors = { +export type GetWatchListErrors = { code?: number | undefined; message?: string | undefined; status?: number | undefined; @@ -129,8 +131,8 @@ export type GetWatchlistErrors = { /** * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ -export type GetWatchlistWatchlistResponseBodyData = { - errors?: Array | undefined; +export type GetWatchListWatchlistResponseBodyData = { + errors?: Array | undefined; /** * Raw HTTP response; suitable for custom response parsing */ @@ -140,17 +142,17 @@ export type GetWatchlistWatchlistResponseBodyData = { /** * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ -export class GetWatchlistWatchlistResponseBody extends Error { - errors?: Array | undefined; +export class GetWatchListWatchlistResponseBody 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$: GetWatchlistWatchlistResponseBodyData; + data$: GetWatchListWatchlistResponseBodyData; - constructor(err: GetWatchlistWatchlistResponseBodyData) { + constructor(err: GetWatchListWatchlistResponseBodyData) { const message = "message" in err && typeof err.message === "string" ? err.message @@ -165,7 +167,7 @@ export class GetWatchlistWatchlistResponseBody extends Error { this.rawResponse = err.rawResponse; } - this.name = "GetWatchlistWatchlistResponseBody"; + this.name = "GetWatchListWatchlistResponseBody"; } } @@ -216,7 +218,7 @@ export type Metadata = { /** * Watchlist Data */ -export type GetWatchlistResponseBody = { +export type GetWatchListResponseBody = { librarySectionID?: string | undefined; librarySectionTitle?: string | undefined; offset?: number | undefined; @@ -226,7 +228,7 @@ export type GetWatchlistResponseBody = { metadata?: Array | undefined; }; -export type GetWatchlistResponse = { +export type GetWatchListResponse = { /** * HTTP response content type for this operation */ @@ -242,26 +244,24 @@ export type GetWatchlistResponse = { /** * Watchlist Data */ - object?: GetWatchlistResponseBody | undefined; + object?: GetWatchListResponseBody | undefined; }; /** @internal */ -export const PathParamFilter$inboundSchema: z.ZodNativeEnum = - z.nativeEnum(PathParamFilter); +export const Filter$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Filter); /** @internal */ -export const PathParamFilter$outboundSchema: z.ZodNativeEnum = - PathParamFilter$inboundSchema; +export const Filter$outboundSchema: z.ZodNativeEnum = Filter$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace PathParamFilter$ { - /** @deprecated use `PathParamFilter$inboundSchema` instead. */ - export const inboundSchema = PathParamFilter$inboundSchema; - /** @deprecated use `PathParamFilter$outboundSchema` instead. */ - export const outboundSchema = PathParamFilter$outboundSchema; +export namespace Filter$ { + /** @deprecated use `Filter$inboundSchema` instead. */ + export const inboundSchema = Filter$inboundSchema; + /** @deprecated use `Filter$outboundSchema` instead. */ + export const outboundSchema = Filter$outboundSchema; } /** @internal */ @@ -320,65 +320,65 @@ export namespace IncludeExternalMedia$ { } /** @internal */ -export const GetWatchlistRequest$inboundSchema: z.ZodType< - GetWatchlistRequest, +export const GetWatchListRequest$inboundSchema: z.ZodType< + GetWatchListRequest, z.ZodTypeDef, unknown > = z .object({ - filter: PathParamFilter$inboundSchema, + filter: Filter$inboundSchema, sort: z.string().optional(), libtype: Libtype$inboundSchema.optional(), maxresults: z.number().int().optional(), includeCollections: IncludeCollections$inboundSchema.optional(), includeExternalMedia: IncludeExternalMedia$inboundSchema.optional(), + "X-Plex-Container-Start": z.number().int().default(0), + "X-Plex-Container-Size": z.number().int().default(50), "X-Plex-Token": z.string(), - "X-Plex-Container-Start": z.number().int().optional(), - "X-Plex-Container-Size": z.number().int().optional(), }) .transform((v) => { return remap$(v, { - "X-Plex-Token": "xPlexToken", "X-Plex-Container-Start": "xPlexContainerStart", "X-Plex-Container-Size": "xPlexContainerSize", + "X-Plex-Token": "xPlexToken", }); }); /** @internal */ -export type GetWatchlistRequest$Outbound = { +export type GetWatchListRequest$Outbound = { filter: string; sort?: string | undefined; libtype?: string | undefined; maxresults?: number | undefined; includeCollections?: number | undefined; includeExternalMedia?: number | undefined; + "X-Plex-Container-Start": number; + "X-Plex-Container-Size": number; "X-Plex-Token": string; - "X-Plex-Container-Start"?: number | undefined; - "X-Plex-Container-Size"?: number | undefined; }; /** @internal */ -export const GetWatchlistRequest$outboundSchema: z.ZodType< - GetWatchlistRequest$Outbound, +export const GetWatchListRequest$outboundSchema: z.ZodType< + GetWatchListRequest$Outbound, z.ZodTypeDef, - GetWatchlistRequest + GetWatchListRequest > = z .object({ - filter: PathParamFilter$outboundSchema, + filter: Filter$outboundSchema, sort: z.string().optional(), libtype: Libtype$outboundSchema.optional(), maxresults: z.number().int().optional(), includeCollections: IncludeCollections$outboundSchema.optional(), includeExternalMedia: IncludeExternalMedia$outboundSchema.optional(), + xPlexContainerStart: z.number().int().default(0), + xPlexContainerSize: z.number().int().default(50), xPlexToken: z.string(), - xPlexContainerStart: z.number().int().optional(), - xPlexContainerSize: z.number().int().optional(), }) .transform((v) => { return remap$(v, { - xPlexToken: "X-Plex-Token", xPlexContainerStart: "X-Plex-Container-Start", xPlexContainerSize: "X-Plex-Container-Size", + xPlexToken: "X-Plex-Token", }); }); @@ -386,18 +386,18 @@ export const GetWatchlistRequest$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 GetWatchlistRequest$ { - /** @deprecated use `GetWatchlistRequest$inboundSchema` instead. */ - export const inboundSchema = GetWatchlistRequest$inboundSchema; - /** @deprecated use `GetWatchlistRequest$outboundSchema` instead. */ - export const outboundSchema = GetWatchlistRequest$outboundSchema; - /** @deprecated use `GetWatchlistRequest$Outbound` instead. */ - export type Outbound = GetWatchlistRequest$Outbound; +export namespace GetWatchListRequest$ { + /** @deprecated use `GetWatchListRequest$inboundSchema` instead. */ + export const inboundSchema = GetWatchListRequest$inboundSchema; + /** @deprecated use `GetWatchListRequest$outboundSchema` instead. */ + export const outboundSchema = GetWatchListRequest$outboundSchema; + /** @deprecated use `GetWatchListRequest$Outbound` instead. */ + export type Outbound = GetWatchListRequest$Outbound; } /** @internal */ -export const GetWatchlistErrors$inboundSchema: z.ZodType< - GetWatchlistErrors, +export const GetWatchListErrors$inboundSchema: z.ZodType< + GetWatchListErrors, z.ZodTypeDef, unknown > = z.object({ @@ -407,17 +407,17 @@ export const GetWatchlistErrors$inboundSchema: z.ZodType< }); /** @internal */ -export type GetWatchlistErrors$Outbound = { +export type GetWatchListErrors$Outbound = { code?: number | undefined; message?: string | undefined; status?: number | undefined; }; /** @internal */ -export const GetWatchlistErrors$outboundSchema: z.ZodType< - GetWatchlistErrors$Outbound, +export const GetWatchListErrors$outboundSchema: z.ZodType< + GetWatchListErrors$Outbound, z.ZodTypeDef, - GetWatchlistErrors + GetWatchListErrors > = z.object({ code: z.number().optional(), message: z.string().optional(), @@ -428,23 +428,23 @@ export const GetWatchlistErrors$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 GetWatchlistErrors$ { - /** @deprecated use `GetWatchlistErrors$inboundSchema` instead. */ - export const inboundSchema = GetWatchlistErrors$inboundSchema; - /** @deprecated use `GetWatchlistErrors$outboundSchema` instead. */ - export const outboundSchema = GetWatchlistErrors$outboundSchema; - /** @deprecated use `GetWatchlistErrors$Outbound` instead. */ - export type Outbound = GetWatchlistErrors$Outbound; +export namespace GetWatchListErrors$ { + /** @deprecated use `GetWatchListErrors$inboundSchema` instead. */ + export const inboundSchema = GetWatchListErrors$inboundSchema; + /** @deprecated use `GetWatchListErrors$outboundSchema` instead. */ + export const outboundSchema = GetWatchListErrors$outboundSchema; + /** @deprecated use `GetWatchListErrors$Outbound` instead. */ + export type Outbound = GetWatchListErrors$Outbound; } /** @internal */ -export const GetWatchlistWatchlistResponseBody$inboundSchema: z.ZodType< - GetWatchlistWatchlistResponseBody, +export const GetWatchListWatchlistResponseBody$inboundSchema: z.ZodType< + GetWatchListWatchlistResponseBody, z.ZodTypeDef, unknown > = z .object({ - errors: z.array(z.lazy(() => GetWatchlistErrors$inboundSchema)).optional(), + errors: z.array(z.lazy(() => GetWatchListErrors$inboundSchema)).optional(), RawResponse: z.instanceof(Response).optional(), }) .transform((v) => { @@ -452,27 +452,27 @@ export const GetWatchlistWatchlistResponseBody$inboundSchema: z.ZodType< RawResponse: "rawResponse", }); - return new GetWatchlistWatchlistResponseBody(remapped); + return new GetWatchListWatchlistResponseBody(remapped); }); /** @internal */ -export type GetWatchlistWatchlistResponseBody$Outbound = { - errors?: Array | undefined; +export type GetWatchListWatchlistResponseBody$Outbound = { + errors?: Array | undefined; RawResponse?: never | undefined; }; /** @internal */ -export const GetWatchlistWatchlistResponseBody$outboundSchema: z.ZodType< - GetWatchlistWatchlistResponseBody$Outbound, +export const GetWatchListWatchlistResponseBody$outboundSchema: z.ZodType< + GetWatchListWatchlistResponseBody$Outbound, z.ZodTypeDef, - GetWatchlistWatchlistResponseBody + GetWatchListWatchlistResponseBody > = z - .instanceof(GetWatchlistWatchlistResponseBody) + .instanceof(GetWatchListWatchlistResponseBody) .transform((v) => v.data$) .pipe( z .object({ - errors: z.array(z.lazy(() => GetWatchlistErrors$outboundSchema)).optional(), + errors: z.array(z.lazy(() => GetWatchListErrors$outboundSchema)).optional(), rawResponse: z .instanceof(Response) .transform(() => { @@ -491,13 +491,13 @@ export const GetWatchlistWatchlistResponseBody$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 GetWatchlistWatchlistResponseBody$ { - /** @deprecated use `GetWatchlistWatchlistResponseBody$inboundSchema` instead. */ - export const inboundSchema = GetWatchlistWatchlistResponseBody$inboundSchema; - /** @deprecated use `GetWatchlistWatchlistResponseBody$outboundSchema` instead. */ - export const outboundSchema = GetWatchlistWatchlistResponseBody$outboundSchema; - /** @deprecated use `GetWatchlistWatchlistResponseBody$Outbound` instead. */ - export type Outbound = GetWatchlistWatchlistResponseBody$Outbound; +export namespace GetWatchListWatchlistResponseBody$ { + /** @deprecated use `GetWatchListWatchlistResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetWatchListWatchlistResponseBody$inboundSchema; + /** @deprecated use `GetWatchListWatchlistResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetWatchListWatchlistResponseBody$outboundSchema; + /** @deprecated use `GetWatchListWatchlistResponseBody$Outbound` instead. */ + export type Outbound = GetWatchListWatchlistResponseBody$Outbound; } /** @internal */ @@ -683,8 +683,8 @@ export namespace Metadata$ { } /** @internal */ -export const GetWatchlistResponseBody$inboundSchema: z.ZodType< - GetWatchlistResponseBody, +export const GetWatchListResponseBody$inboundSchema: z.ZodType< + GetWatchListResponseBody, z.ZodTypeDef, unknown > = z @@ -704,7 +704,7 @@ export const GetWatchlistResponseBody$inboundSchema: z.ZodType< }); /** @internal */ -export type GetWatchlistResponseBody$Outbound = { +export type GetWatchListResponseBody$Outbound = { librarySectionID?: string | undefined; librarySectionTitle?: string | undefined; offset?: number | undefined; @@ -715,10 +715,10 @@ export type GetWatchlistResponseBody$Outbound = { }; /** @internal */ -export const GetWatchlistResponseBody$outboundSchema: z.ZodType< - GetWatchlistResponseBody$Outbound, +export const GetWatchListResponseBody$outboundSchema: z.ZodType< + GetWatchListResponseBody$Outbound, z.ZodTypeDef, - GetWatchlistResponseBody + GetWatchListResponseBody > = z .object({ librarySectionID: z.string().optional(), @@ -739,18 +739,18 @@ export const GetWatchlistResponseBody$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 GetWatchlistResponseBody$ { - /** @deprecated use `GetWatchlistResponseBody$inboundSchema` instead. */ - export const inboundSchema = GetWatchlistResponseBody$inboundSchema; - /** @deprecated use `GetWatchlistResponseBody$outboundSchema` instead. */ - export const outboundSchema = GetWatchlistResponseBody$outboundSchema; - /** @deprecated use `GetWatchlistResponseBody$Outbound` instead. */ - export type Outbound = GetWatchlistResponseBody$Outbound; +export namespace GetWatchListResponseBody$ { + /** @deprecated use `GetWatchListResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetWatchListResponseBody$inboundSchema; + /** @deprecated use `GetWatchListResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetWatchListResponseBody$outboundSchema; + /** @deprecated use `GetWatchListResponseBody$Outbound` instead. */ + export type Outbound = GetWatchListResponseBody$Outbound; } /** @internal */ -export const GetWatchlistResponse$inboundSchema: z.ZodType< - GetWatchlistResponse, +export const GetWatchListResponse$inboundSchema: z.ZodType< + GetWatchListResponse, z.ZodTypeDef, unknown > = z @@ -758,7 +758,7 @@ export const GetWatchlistResponse$inboundSchema: z.ZodType< ContentType: z.string(), StatusCode: z.number().int(), RawResponse: z.instanceof(Response), - object: z.lazy(() => GetWatchlistResponseBody$inboundSchema).optional(), + object: z.lazy(() => GetWatchListResponseBody$inboundSchema).optional(), }) .transform((v) => { return remap$(v, { @@ -769,18 +769,18 @@ export const GetWatchlistResponse$inboundSchema: z.ZodType< }); /** @internal */ -export type GetWatchlistResponse$Outbound = { +export type GetWatchListResponse$Outbound = { ContentType: string; StatusCode: number; RawResponse: never; - object?: GetWatchlistResponseBody$Outbound | undefined; + object?: GetWatchListResponseBody$Outbound | undefined; }; /** @internal */ -export const GetWatchlistResponse$outboundSchema: z.ZodType< - GetWatchlistResponse$Outbound, +export const GetWatchListResponse$outboundSchema: z.ZodType< + GetWatchListResponse$Outbound, z.ZodTypeDef, - GetWatchlistResponse + GetWatchListResponse > = z .object({ contentType: z.string(), @@ -788,7 +788,7 @@ export const GetWatchlistResponse$outboundSchema: z.ZodType< rawResponse: z.instanceof(Response).transform(() => { throw new Error("Response cannot be serialized"); }), - object: z.lazy(() => GetWatchlistResponseBody$outboundSchema).optional(), + object: z.lazy(() => GetWatchListResponseBody$outboundSchema).optional(), }) .transform((v) => { return remap$(v, { @@ -802,11 +802,11 @@ export const GetWatchlistResponse$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 GetWatchlistResponse$ { - /** @deprecated use `GetWatchlistResponse$inboundSchema` instead. */ - export const inboundSchema = GetWatchlistResponse$inboundSchema; - /** @deprecated use `GetWatchlistResponse$outboundSchema` instead. */ - export const outboundSchema = GetWatchlistResponse$outboundSchema; - /** @deprecated use `GetWatchlistResponse$Outbound` instead. */ - export type Outbound = GetWatchlistResponse$Outbound; +export namespace GetWatchListResponse$ { + /** @deprecated use `GetWatchListResponse$inboundSchema` instead. */ + export const inboundSchema = GetWatchListResponse$inboundSchema; + /** @deprecated use `GetWatchListResponse$outboundSchema` instead. */ + export const outboundSchema = GetWatchListResponse$outboundSchema; + /** @deprecated use `GetWatchListResponse$Outbound` instead. */ + export type Outbound = GetWatchListResponse$Outbound; } diff --git a/src/models/index.ts b/src/models/index.ts index 296afc6c..f089e03c 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -11,8 +11,10 @@ export * from "./createplaylistop.js"; export * from "./deletelibraryop.js"; export * from "./deleteplaylistop.js"; export * from "./enablepapertrailop.js"; +export * from "./getalllibrariesop.js"; export * from "./getavailableclientsop.js"; export * from "./getbandwidthstatisticsop.js"; +export * from "./getbannerimageop.js"; export * from "./getbutlertasksop.js"; export * from "./getcompanionsdataop.js"; export * from "./getdevicesop.js"; @@ -20,12 +22,12 @@ export * from "./getfilehashop.js"; export * from "./getgeodataop.js"; export * from "./getglobalhubsop.js"; export * from "./gethomedataop.js"; -export * from "./getlibrariesop.js"; +export * from "./getlibrarydetailsop.js"; export * from "./getlibraryhubsop.js"; export * from "./getlibraryitemsop.js"; -export * from "./getlibraryop.js"; +export * from "./getmediaprovidersop.js"; +export * from "./getmetadatabyratingkeyop.js"; export * from "./getmetadatachildrenop.js"; -export * from "./getmetadataop.js"; export * from "./getmyplexaccountop.js"; export * from "./getondeckop.js"; export * from "./getpinop.js"; @@ -33,19 +35,22 @@ export * from "./getplaylistcontentsop.js"; export * from "./getplaylistop.js"; export * from "./getplaylistsop.js"; export * from "./getrecentlyaddedop.js"; +export * from "./getrefreshlibrarymetadataop.js"; export * from "./getresizedphotoop.js"; -export * from "./getresourcesop.js"; export * from "./getresourcesstatisticsop.js"; +export * from "./getsearchlibraryop.js"; export * from "./getsearchresultsop.js"; export * from "./getserveractivitiesop.js"; export * from "./getservercapabilitiesop.js"; export * from "./getserveridentityop.js"; export * from "./getserverlistop.js"; export * from "./getserverpreferencesop.js"; +export * from "./getserverresourcesop.js"; export * from "./getsessionhistoryop.js"; export * from "./getsessionsop.js"; export * from "./getsourceconnectioninformationop.js"; export * from "./getstatisticsop.js"; +export * from "./getthumbimageop.js"; export * from "./gettimelineop.js"; export * from "./gettokenbypinidop.js"; export * from "./gettopwatchedcontentop.js"; @@ -63,10 +68,8 @@ export * from "./markunplayedop.js"; export * from "./performsearchop.js"; export * from "./performvoicesearchop.js"; export * from "./postuserssignindataop.js"; -export * from "./refreshlibraryop.js"; export * from "./sdkerror.js"; export * from "./sdkvalidationerror.js"; -export * from "./searchlibraryop.js"; export * from "./security.js"; export * from "./startalltasksop.js"; export * from "./starttaskop.js"; diff --git a/src/models/postuserssignindataop.ts b/src/models/postuserssignindataop.ts index 75d47865..f2108e84 100644 --- a/src/models/postuserssignindataop.ts +++ b/src/models/postuserssignindataop.ts @@ -5,9 +5,9 @@ import { remap as remap$ } from "../lib/primitives.js"; import * as z from "zod"; -export const PostUsersSigninDataOpServerList = ["https://plex.tv/api/v2"] as const; +export const PostUsersSignInDataOpServerList = ["https://plex.tv/api/v2"] as const; -export type PostUsersSigninDataGlobals = { +export type PostUsersSignInDataGlobals = { /** * The unique identifier for the client application * @@ -22,13 +22,13 @@ export type PostUsersSigninDataGlobals = { /** * Login credentials */ -export type PostUsersSigninDataRequestBody = { +export type PostUsersSignInDataRequestBody = { login: string; password: string; rememberMe?: boolean | undefined; }; -export type PostUsersSigninDataRequest = { +export type PostUsersSignInDataRequest = { /** * The unique identifier for the client application * @@ -41,10 +41,10 @@ export type PostUsersSigninDataRequest = { /** * Login credentials */ - requestBody?: PostUsersSigninDataRequestBody | undefined; + requestBody?: PostUsersSignInDataRequestBody | undefined; }; -export type PostUsersSigninDataErrors = { +export type PostUsersSignInDataErrors = { code?: number | undefined; message?: string | undefined; status?: number | undefined; @@ -53,8 +53,8 @@ export type PostUsersSigninDataErrors = { /** * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ -export type PostUsersSigninDataResponseBodyData = { - errors?: Array | undefined; +export type PostUsersSignInDataResponseBodyData = { + errors?: Array | undefined; /** * Raw HTTP response; suitable for custom response parsing */ @@ -64,17 +64,17 @@ export type PostUsersSigninDataResponseBodyData = { /** * Unauthorized - Returned if the X-Plex-Token is missing from the header or query. */ -export class PostUsersSigninDataResponseBody extends Error { - errors?: Array | undefined; +export class PostUsersSignInDataResponseBody 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$: PostUsersSigninDataResponseBodyData; + data$: PostUsersSignInDataResponseBodyData; - constructor(err: PostUsersSigninDataResponseBodyData) { + constructor(err: PostUsersSignInDataResponseBodyData) { const message = "message" in err && typeof err.message === "string" ? err.message @@ -89,19 +89,53 @@ export class PostUsersSigninDataResponseBody extends Error { this.rawResponse = err.rawResponse; } - this.name = "PostUsersSigninDataResponseBody"; + this.name = "PostUsersSignInDataResponseBody"; } } /** * Your current mailing list status */ -export enum PostUsersSigninDataMailingListStatus { - Subscribed = "subscribed", +export enum PostUsersSignInDataMailingListStatus { + Active = "active", Unsubscribed = "unsubscribed", } -export type PostUsersSigninDataUserProfile = { +/** + * The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) + */ +export enum PostUsersSignInDataAutoSelectSubtitle { + Zero = "0", + One = "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) + */ +export enum PostUsersSignInDataDefaultSubtitleAccessibility { + Zero = "0", + One = "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", +} + +export enum PostUsersSignInDataWatchedIndicator { + Zero = "0", + One = "1", +} + +export enum PostUsersSignInDataMediaReviewsVisibility { + Zero = 0, + One = 1, +} + +export type PostUsersSignInDataUserProfile = { /** * If the account has automatically select audio and subtitle tracks enabled */ @@ -109,41 +143,41 @@ export type PostUsersSigninDataUserProfile = { /** * The preferred audio language for the account */ - defaultAudioLanguage?: string | undefined; + defaultAudioLanguage: string | null; /** * The preferred subtitle language for the account */ - defaultSubtitleLanguage?: string | undefined; + defaultSubtitleLanguage: string | null; /** * The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled) */ - autoSelectSubtitle?: number | undefined; + 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?: number | undefined; + 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?: number | undefined; - watchedIndicator?: number | undefined; - mediaReviewsVisibility?: number | undefined; + defaultSubtitleForced?: PostUsersSignInDataDefaultSubtitleForced | undefined; + watchedIndicator?: PostUsersSignInDataWatchedIndicator | undefined; + mediaReviewsVisibility?: PostUsersSignInDataMediaReviewsVisibility | undefined; }; -export enum PostUsersSigninDataStatus { +export enum PostUsersSignInDataStatus { Online = "online", Offline = "offline", } -export type PostUsersSigninDataServices = { +export type PostUsersSignInDataServices = { identifier: string; endpoint: string; token: string | null; secret: string | null; - status: PostUsersSigninDataStatus; + status: PostUsersSignInDataStatus; }; -export enum PostUsersSigninDataFeatures { +export enum PostUsersSignInDataFeatures { AndroidDolbyVision = "Android - Dolby Vision", AndroidPiP = "Android - PiP", CUSunset = "CU Sunset", @@ -208,7 +242,7 @@ export enum PostUsersSigninDataFeatures { /** * String representation of subscriptionActive */ -export enum PostUsersSigninDataUserStatus { +export enum PostUsersSignInDataAuthenticationStatus { Inactive = "Inactive", Active = "Active", } @@ -216,11 +250,11 @@ export enum PostUsersSigninDataUserStatus { /** * If the account’s Plex Pass subscription is active */ -export type PostUsersSigninDataSubscription = { +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 */ @@ -228,11 +262,11 @@ export type PostUsersSigninDataSubscription = { /** * Date the account subscribed to Plex Pass */ - subscribedAt?: Date | undefined; + subscribedAt?: string | null | undefined; /** * String representation of subscriptionActive */ - status?: PostUsersSigninDataUserStatus | undefined; + status?: PostUsersSignInDataAuthenticationStatus | undefined; /** * Payment service used for your Plex Pass subscription */ @@ -243,7 +277,7 @@ export type PostUsersSigninDataSubscription = { plan?: string | null | undefined; }; -export enum PostUsersSigninDataUserFeatures { +export enum PostUsersSignInDataAuthenticationFeatures { AndroidDolbyVision = "Android - Dolby Vision", AndroidPiP = "Android - PiP", CUSunset = "CU Sunset", @@ -308,16 +342,16 @@ export enum PostUsersSigninDataUserFeatures { /** * String representation of subscriptionActive */ -export enum PostUsersSigninDataUserResponseStatus { +export enum PostUsersSignInDataAuthenticationResponseStatus { Inactive = "Inactive", Active = "Active", } -export type PostUsersSigninDataUserSubscription = { +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 */ @@ -325,11 +359,11 @@ export type PostUsersSigninDataUserSubscription = { /** * Date the account subscribed to Plex Pass */ - subscribedAt?: Date | undefined; + subscribedAt?: string | null | undefined; /** * String representation of subscriptionActive */ - status?: PostUsersSigninDataUserResponseStatus | undefined; + status?: PostUsersSignInDataAuthenticationResponseStatus | undefined; /** * Payment service used for your Plex Pass subscription */ @@ -340,7 +374,7 @@ export type PostUsersSigninDataUserSubscription = { plan?: string | null | undefined; }; -export enum PostUsersSigninDataState { +export enum PostUsersSignInDataState { Ended = "ended", } @@ -354,13 +388,7 @@ export type Billing = { export type PastSubscription = { id: string | null; mode: string | null; - /** - * Unix epoch datetime - */ renewsAt: number | null; - /** - * Unix epoch datetime - */ endsAt: number | null; canceled?: boolean | undefined; gracePeriod?: boolean | undefined; @@ -371,8 +399,8 @@ export type PastSubscription = { canConvert?: boolean | undefined; type: string; transfer: string | null; - state: PostUsersSigninDataState; - billing: Array; + state: PostUsersSignInDataState; + billing: Billing; }; export type Trials = {}; @@ -380,7 +408,7 @@ export type Trials = {}; /** * Returns the user account data with a valid auth token */ -export type PostUsersSigninDataUserPlexAccount = { +export type PostUsersSignInDataUserPlexAccount = { /** * Unknown */ @@ -396,7 +424,7 @@ export type PostUsersSigninDataUserPlexAccount = { /** * Unknown */ - anonymous?: boolean | undefined; + anonymous?: boolean | null | undefined; /** * The account token */ @@ -472,7 +500,7 @@ export type PostUsersSigninDataUserPlexAccount = { /** * Your current mailing list status */ - mailingListStatus: PostUsersSigninDataMailingListStatus; + mailingListStatus: PostUsersSignInDataMailingListStatus; /** * The maximum number of accounts allowed in the Plex Home */ @@ -483,7 +511,7 @@ export type PostUsersSigninDataUserPlexAccount = { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ pin?: string | undefined; - profile: Array; + profile: PostUsersSignInDataUserProfile; /** * If the account has a Plex Home PIN enabled */ @@ -504,16 +532,16 @@ export type PostUsersSigninDataUserPlexAccount = { * Unknown */ scrobbleTypes: string; - services: Array; + services: Array; /** * If the account’s Plex Pass subscription is active */ - subscription: PostUsersSigninDataSubscription; + subscription: PostUsersSignInDataSubscription; /** * Description of the Plex Pass subscription */ subscriptionDescription: string | null; - subscriptions: Array; + subscriptions: Array; /** * URL of the account thumbnail */ @@ -538,7 +566,7 @@ export type PostUsersSigninDataUserPlexAccount = { trials: Array; }; -export type PostUsersSigninDataResponse = { +export type PostUsersSignInDataResponse = { /** * HTTP response content type for this operation */ @@ -554,12 +582,12 @@ export type PostUsersSigninDataResponse = { /** * Returns the user account data with a valid auth token */ - userPlexAccount?: PostUsersSigninDataUserPlexAccount | undefined; + userPlexAccount?: PostUsersSignInDataUserPlexAccount | undefined; }; /** @internal */ -export const PostUsersSigninDataGlobals$inboundSchema: z.ZodType< - PostUsersSigninDataGlobals, +export const PostUsersSignInDataGlobals$inboundSchema: z.ZodType< + PostUsersSignInDataGlobals, z.ZodTypeDef, unknown > = z @@ -573,15 +601,15 @@ export const PostUsersSigninDataGlobals$inboundSchema: z.ZodType< }); /** @internal */ -export type PostUsersSigninDataGlobals$Outbound = { +export type PostUsersSignInDataGlobals$Outbound = { "X-Plex-Client-Identifier"?: string | undefined; }; /** @internal */ -export const PostUsersSigninDataGlobals$outboundSchema: z.ZodType< - PostUsersSigninDataGlobals$Outbound, +export const PostUsersSignInDataGlobals$outboundSchema: z.ZodType< + PostUsersSignInDataGlobals$Outbound, z.ZodTypeDef, - PostUsersSigninDataGlobals + PostUsersSignInDataGlobals > = z .object({ xPlexClientIdentifier: z.string().optional(), @@ -596,38 +624,38 @@ export const PostUsersSigninDataGlobals$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 PostUsersSigninDataGlobals$ { - /** @deprecated use `PostUsersSigninDataGlobals$inboundSchema` instead. */ - export const inboundSchema = PostUsersSigninDataGlobals$inboundSchema; - /** @deprecated use `PostUsersSigninDataGlobals$outboundSchema` instead. */ - export const outboundSchema = PostUsersSigninDataGlobals$outboundSchema; - /** @deprecated use `PostUsersSigninDataGlobals$Outbound` instead. */ - export type Outbound = PostUsersSigninDataGlobals$Outbound; +export namespace PostUsersSignInDataGlobals$ { + /** @deprecated use `PostUsersSignInDataGlobals$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataGlobals$inboundSchema; + /** @deprecated use `PostUsersSignInDataGlobals$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataGlobals$outboundSchema; + /** @deprecated use `PostUsersSignInDataGlobals$Outbound` instead. */ + export type Outbound = PostUsersSignInDataGlobals$Outbound; } /** @internal */ -export const PostUsersSigninDataRequestBody$inboundSchema: z.ZodType< - PostUsersSigninDataRequestBody, +export const PostUsersSignInDataRequestBody$inboundSchema: z.ZodType< + PostUsersSignInDataRequestBody, z.ZodTypeDef, unknown > = z.object({ login: z.string(), password: z.string(), - rememberMe: z.boolean(), + rememberMe: z.boolean().default(false), }); /** @internal */ -export type PostUsersSigninDataRequestBody$Outbound = { +export type PostUsersSignInDataRequestBody$Outbound = { login: string; password: string; rememberMe: boolean; }; /** @internal */ -export const PostUsersSigninDataRequestBody$outboundSchema: z.ZodType< - PostUsersSigninDataRequestBody$Outbound, +export const PostUsersSignInDataRequestBody$outboundSchema: z.ZodType< + PostUsersSignInDataRequestBody$Outbound, z.ZodTypeDef, - PostUsersSigninDataRequestBody + PostUsersSignInDataRequestBody > = z.object({ login: z.string(), password: z.string(), @@ -638,24 +666,24 @@ export const PostUsersSigninDataRequestBody$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 PostUsersSigninDataRequestBody$ { - /** @deprecated use `PostUsersSigninDataRequestBody$inboundSchema` instead. */ - export const inboundSchema = PostUsersSigninDataRequestBody$inboundSchema; - /** @deprecated use `PostUsersSigninDataRequestBody$outboundSchema` instead. */ - export const outboundSchema = PostUsersSigninDataRequestBody$outboundSchema; - /** @deprecated use `PostUsersSigninDataRequestBody$Outbound` instead. */ - export type Outbound = PostUsersSigninDataRequestBody$Outbound; +export namespace PostUsersSignInDataRequestBody$ { + /** @deprecated use `PostUsersSignInDataRequestBody$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataRequestBody$inboundSchema; + /** @deprecated use `PostUsersSignInDataRequestBody$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataRequestBody$outboundSchema; + /** @deprecated use `PostUsersSignInDataRequestBody$Outbound` instead. */ + export type Outbound = PostUsersSignInDataRequestBody$Outbound; } /** @internal */ -export const PostUsersSigninDataRequest$inboundSchema: z.ZodType< - PostUsersSigninDataRequest, +export const PostUsersSignInDataRequest$inboundSchema: z.ZodType< + PostUsersSignInDataRequest, z.ZodTypeDef, unknown > = z .object({ "X-Plex-Client-Identifier": z.string().optional(), - RequestBody: z.lazy(() => PostUsersSigninDataRequestBody$inboundSchema).optional(), + RequestBody: z.lazy(() => PostUsersSignInDataRequestBody$inboundSchema).optional(), }) .transform((v) => { return remap$(v, { @@ -665,20 +693,20 @@ export const PostUsersSigninDataRequest$inboundSchema: z.ZodType< }); /** @internal */ -export type PostUsersSigninDataRequest$Outbound = { +export type PostUsersSignInDataRequest$Outbound = { "X-Plex-Client-Identifier"?: string | undefined; - RequestBody?: PostUsersSigninDataRequestBody$Outbound | undefined; + RequestBody?: PostUsersSignInDataRequestBody$Outbound | undefined; }; /** @internal */ -export const PostUsersSigninDataRequest$outboundSchema: z.ZodType< - PostUsersSigninDataRequest$Outbound, +export const PostUsersSignInDataRequest$outboundSchema: z.ZodType< + PostUsersSignInDataRequest$Outbound, z.ZodTypeDef, - PostUsersSigninDataRequest + PostUsersSignInDataRequest > = z .object({ xPlexClientIdentifier: z.string().optional(), - requestBody: z.lazy(() => PostUsersSigninDataRequestBody$outboundSchema).optional(), + requestBody: z.lazy(() => PostUsersSignInDataRequestBody$outboundSchema).optional(), }) .transform((v) => { return remap$(v, { @@ -691,18 +719,18 @@ export const PostUsersSigninDataRequest$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 PostUsersSigninDataRequest$ { - /** @deprecated use `PostUsersSigninDataRequest$inboundSchema` instead. */ - export const inboundSchema = PostUsersSigninDataRequest$inboundSchema; - /** @deprecated use `PostUsersSigninDataRequest$outboundSchema` instead. */ - export const outboundSchema = PostUsersSigninDataRequest$outboundSchema; - /** @deprecated use `PostUsersSigninDataRequest$Outbound` instead. */ - export type Outbound = PostUsersSigninDataRequest$Outbound; +export namespace PostUsersSignInDataRequest$ { + /** @deprecated use `PostUsersSignInDataRequest$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataRequest$inboundSchema; + /** @deprecated use `PostUsersSignInDataRequest$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataRequest$outboundSchema; + /** @deprecated use `PostUsersSignInDataRequest$Outbound` instead. */ + export type Outbound = PostUsersSignInDataRequest$Outbound; } /** @internal */ -export const PostUsersSigninDataErrors$inboundSchema: z.ZodType< - PostUsersSigninDataErrors, +export const PostUsersSignInDataErrors$inboundSchema: z.ZodType< + PostUsersSignInDataErrors, z.ZodTypeDef, unknown > = z.object({ @@ -712,17 +740,17 @@ export const PostUsersSigninDataErrors$inboundSchema: z.ZodType< }); /** @internal */ -export type PostUsersSigninDataErrors$Outbound = { +export type PostUsersSignInDataErrors$Outbound = { code?: number | undefined; message?: string | undefined; status?: number | undefined; }; /** @internal */ -export const PostUsersSigninDataErrors$outboundSchema: z.ZodType< - PostUsersSigninDataErrors$Outbound, +export const PostUsersSignInDataErrors$outboundSchema: z.ZodType< + PostUsersSignInDataErrors$Outbound, z.ZodTypeDef, - PostUsersSigninDataErrors + PostUsersSignInDataErrors > = z.object({ code: z.number().optional(), message: z.string().optional(), @@ -733,23 +761,23 @@ export const PostUsersSigninDataErrors$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 PostUsersSigninDataErrors$ { - /** @deprecated use `PostUsersSigninDataErrors$inboundSchema` instead. */ - export const inboundSchema = PostUsersSigninDataErrors$inboundSchema; - /** @deprecated use `PostUsersSigninDataErrors$outboundSchema` instead. */ - export const outboundSchema = PostUsersSigninDataErrors$outboundSchema; - /** @deprecated use `PostUsersSigninDataErrors$Outbound` instead. */ - export type Outbound = PostUsersSigninDataErrors$Outbound; +export namespace PostUsersSignInDataErrors$ { + /** @deprecated use `PostUsersSignInDataErrors$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataErrors$inboundSchema; + /** @deprecated use `PostUsersSignInDataErrors$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataErrors$outboundSchema; + /** @deprecated use `PostUsersSignInDataErrors$Outbound` instead. */ + export type Outbound = PostUsersSignInDataErrors$Outbound; } /** @internal */ -export const PostUsersSigninDataResponseBody$inboundSchema: z.ZodType< - PostUsersSigninDataResponseBody, +export const PostUsersSignInDataResponseBody$inboundSchema: z.ZodType< + PostUsersSignInDataResponseBody, z.ZodTypeDef, unknown > = z .object({ - errors: z.array(z.lazy(() => PostUsersSigninDataErrors$inboundSchema)).optional(), + errors: z.array(z.lazy(() => PostUsersSignInDataErrors$inboundSchema)).optional(), RawResponse: z.instanceof(Response).optional(), }) .transform((v) => { @@ -757,27 +785,27 @@ export const PostUsersSigninDataResponseBody$inboundSchema: z.ZodType< RawResponse: "rawResponse", }); - return new PostUsersSigninDataResponseBody(remapped); + return new PostUsersSignInDataResponseBody(remapped); }); /** @internal */ -export type PostUsersSigninDataResponseBody$Outbound = { - errors?: Array | undefined; +export type PostUsersSignInDataResponseBody$Outbound = { + errors?: Array | undefined; RawResponse?: never | undefined; }; /** @internal */ -export const PostUsersSigninDataResponseBody$outboundSchema: z.ZodType< - PostUsersSigninDataResponseBody$Outbound, +export const PostUsersSignInDataResponseBody$outboundSchema: z.ZodType< + PostUsersSignInDataResponseBody$Outbound, z.ZodTypeDef, - PostUsersSigninDataResponseBody + PostUsersSignInDataResponseBody > = z - .instanceof(PostUsersSigninDataResponseBody) + .instanceof(PostUsersSignInDataResponseBody) .transform((v) => v.data$) .pipe( z .object({ - errors: z.array(z.lazy(() => PostUsersSigninDataErrors$outboundSchema)).optional(), + errors: z.array(z.lazy(() => PostUsersSignInDataErrors$outboundSchema)).optional(), rawResponse: z .instanceof(Response) .transform(() => { @@ -796,117 +824,224 @@ export const PostUsersSigninDataResponseBody$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 PostUsersSigninDataResponseBody$ { - /** @deprecated use `PostUsersSigninDataResponseBody$inboundSchema` instead. */ - export const inboundSchema = PostUsersSigninDataResponseBody$inboundSchema; - /** @deprecated use `PostUsersSigninDataResponseBody$outboundSchema` instead. */ - export const outboundSchema = PostUsersSigninDataResponseBody$outboundSchema; - /** @deprecated use `PostUsersSigninDataResponseBody$Outbound` instead. */ - export type Outbound = PostUsersSigninDataResponseBody$Outbound; +export namespace PostUsersSignInDataResponseBody$ { + /** @deprecated use `PostUsersSignInDataResponseBody$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataResponseBody$inboundSchema; + /** @deprecated use `PostUsersSignInDataResponseBody$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataResponseBody$outboundSchema; + /** @deprecated use `PostUsersSignInDataResponseBody$Outbound` instead. */ + export type Outbound = PostUsersSignInDataResponseBody$Outbound; } /** @internal */ -export const PostUsersSigninDataMailingListStatus$inboundSchema: z.ZodNativeEnum< - typeof PostUsersSigninDataMailingListStatus -> = z.nativeEnum(PostUsersSigninDataMailingListStatus); +export const PostUsersSignInDataMailingListStatus$inboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataMailingListStatus +> = z.nativeEnum(PostUsersSignInDataMailingListStatus); /** @internal */ -export const PostUsersSigninDataMailingListStatus$outboundSchema: z.ZodNativeEnum< - typeof PostUsersSigninDataMailingListStatus -> = PostUsersSigninDataMailingListStatus$inboundSchema; +export const PostUsersSignInDataMailingListStatus$outboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataMailingListStatus +> = PostUsersSignInDataMailingListStatus$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace PostUsersSigninDataMailingListStatus$ { - /** @deprecated use `PostUsersSigninDataMailingListStatus$inboundSchema` instead. */ - export const inboundSchema = PostUsersSigninDataMailingListStatus$inboundSchema; - /** @deprecated use `PostUsersSigninDataMailingListStatus$outboundSchema` instead. */ - export const outboundSchema = PostUsersSigninDataMailingListStatus$outboundSchema; +export namespace PostUsersSignInDataMailingListStatus$ { + /** @deprecated use `PostUsersSignInDataMailingListStatus$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataMailingListStatus$inboundSchema; + /** @deprecated use `PostUsersSignInDataMailingListStatus$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataMailingListStatus$outboundSchema; } /** @internal */ -export const PostUsersSigninDataUserProfile$inboundSchema: z.ZodType< - PostUsersSigninDataUserProfile, +export const PostUsersSignInDataAutoSelectSubtitle$inboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataAutoSelectSubtitle +> = z.nativeEnum(PostUsersSignInDataAutoSelectSubtitle); + +/** @internal */ +export const PostUsersSignInDataAutoSelectSubtitle$outboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataAutoSelectSubtitle +> = PostUsersSignInDataAutoSelectSubtitle$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PostUsersSignInDataAutoSelectSubtitle$ { + /** @deprecated use `PostUsersSignInDataAutoSelectSubtitle$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataAutoSelectSubtitle$inboundSchema; + /** @deprecated use `PostUsersSignInDataAutoSelectSubtitle$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataAutoSelectSubtitle$outboundSchema; +} + +/** @internal */ +export const PostUsersSignInDataDefaultSubtitleAccessibility$inboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataDefaultSubtitleAccessibility +> = z.nativeEnum(PostUsersSignInDataDefaultSubtitleAccessibility); + +/** @internal */ +export const PostUsersSignInDataDefaultSubtitleAccessibility$outboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataDefaultSubtitleAccessibility +> = PostUsersSignInDataDefaultSubtitleAccessibility$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PostUsersSignInDataDefaultSubtitleAccessibility$ { + /** @deprecated use `PostUsersSignInDataDefaultSubtitleAccessibility$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataDefaultSubtitleAccessibility$inboundSchema; + /** @deprecated use `PostUsersSignInDataDefaultSubtitleAccessibility$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataDefaultSubtitleAccessibility$outboundSchema; +} + +/** @internal */ +export const PostUsersSignInDataDefaultSubtitleForced$inboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataDefaultSubtitleForced +> = z.nativeEnum(PostUsersSignInDataDefaultSubtitleForced); + +/** @internal */ +export const PostUsersSignInDataDefaultSubtitleForced$outboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataDefaultSubtitleForced +> = PostUsersSignInDataDefaultSubtitleForced$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PostUsersSignInDataDefaultSubtitleForced$ { + /** @deprecated use `PostUsersSignInDataDefaultSubtitleForced$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataDefaultSubtitleForced$inboundSchema; + /** @deprecated use `PostUsersSignInDataDefaultSubtitleForced$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataDefaultSubtitleForced$outboundSchema; +} + +/** @internal */ +export const PostUsersSignInDataWatchedIndicator$inboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataWatchedIndicator +> = z.nativeEnum(PostUsersSignInDataWatchedIndicator); + +/** @internal */ +export const PostUsersSignInDataWatchedIndicator$outboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataWatchedIndicator +> = PostUsersSignInDataWatchedIndicator$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PostUsersSignInDataWatchedIndicator$ { + /** @deprecated use `PostUsersSignInDataWatchedIndicator$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataWatchedIndicator$inboundSchema; + /** @deprecated use `PostUsersSignInDataWatchedIndicator$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataWatchedIndicator$outboundSchema; +} + +/** @internal */ +export const PostUsersSignInDataMediaReviewsVisibility$inboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataMediaReviewsVisibility +> = z.nativeEnum(PostUsersSignInDataMediaReviewsVisibility); + +/** @internal */ +export const PostUsersSignInDataMediaReviewsVisibility$outboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataMediaReviewsVisibility +> = PostUsersSignInDataMediaReviewsVisibility$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PostUsersSignInDataMediaReviewsVisibility$ { + /** @deprecated use `PostUsersSignInDataMediaReviewsVisibility$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataMediaReviewsVisibility$inboundSchema; + /** @deprecated use `PostUsersSignInDataMediaReviewsVisibility$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataMediaReviewsVisibility$outboundSchema; +} + +/** @internal */ +export const PostUsersSignInDataUserProfile$inboundSchema: z.ZodType< + PostUsersSignInDataUserProfile, z.ZodTypeDef, unknown > = z.object({ autoSelectAudio: z.boolean().default(true), - defaultAudioLanguage: z.string().optional(), - defaultSubtitleLanguage: z.string().optional(), - autoSelectSubtitle: z.number().int().optional(), - defaultSubtitleAccessibility: z.number().int().optional(), - defaultSubtitleForced: z.number().int().optional(), - watchedIndicator: z.number().int().optional(), - mediaReviewsVisibility: z.number().int().optional(), + defaultAudioLanguage: z.nullable(z.string()), + defaultSubtitleLanguage: z.nullable(z.string()), + autoSelectSubtitle: PostUsersSignInDataAutoSelectSubtitle$inboundSchema.optional(), + defaultSubtitleAccessibility: + PostUsersSignInDataDefaultSubtitleAccessibility$inboundSchema.optional(), + defaultSubtitleForced: PostUsersSignInDataDefaultSubtitleForced$inboundSchema.optional(), + watchedIndicator: PostUsersSignInDataWatchedIndicator$inboundSchema.optional(), + mediaReviewsVisibility: PostUsersSignInDataMediaReviewsVisibility$inboundSchema.optional(), }); /** @internal */ -export type PostUsersSigninDataUserProfile$Outbound = { +export type PostUsersSignInDataUserProfile$Outbound = { autoSelectAudio: boolean; - defaultAudioLanguage?: string | undefined; - defaultSubtitleLanguage?: string | undefined; - autoSelectSubtitle?: number | undefined; - defaultSubtitleAccessibility?: number | undefined; - defaultSubtitleForced?: number | undefined; - watchedIndicator?: number | undefined; + defaultAudioLanguage: string | null; + defaultSubtitleLanguage: string | null; + autoSelectSubtitle?: string | undefined; + defaultSubtitleAccessibility?: string | undefined; + defaultSubtitleForced?: string | undefined; + watchedIndicator?: string | undefined; mediaReviewsVisibility?: number | undefined; }; /** @internal */ -export const PostUsersSigninDataUserProfile$outboundSchema: z.ZodType< - PostUsersSigninDataUserProfile$Outbound, +export const PostUsersSignInDataUserProfile$outboundSchema: z.ZodType< + PostUsersSignInDataUserProfile$Outbound, z.ZodTypeDef, - PostUsersSigninDataUserProfile + PostUsersSignInDataUserProfile > = z.object({ autoSelectAudio: z.boolean().default(true), - defaultAudioLanguage: z.string().optional(), - defaultSubtitleLanguage: z.string().optional(), - autoSelectSubtitle: z.number().int().optional(), - defaultSubtitleAccessibility: z.number().int().optional(), - defaultSubtitleForced: z.number().int().optional(), - watchedIndicator: z.number().int().optional(), - mediaReviewsVisibility: z.number().int().optional(), + defaultAudioLanguage: z.nullable(z.string()), + defaultSubtitleLanguage: z.nullable(z.string()), + autoSelectSubtitle: PostUsersSignInDataAutoSelectSubtitle$outboundSchema.optional(), + defaultSubtitleAccessibility: + PostUsersSignInDataDefaultSubtitleAccessibility$outboundSchema.optional(), + defaultSubtitleForced: PostUsersSignInDataDefaultSubtitleForced$outboundSchema.optional(), + watchedIndicator: PostUsersSignInDataWatchedIndicator$outboundSchema.optional(), + mediaReviewsVisibility: PostUsersSignInDataMediaReviewsVisibility$outboundSchema.optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace PostUsersSigninDataUserProfile$ { - /** @deprecated use `PostUsersSigninDataUserProfile$inboundSchema` instead. */ - export const inboundSchema = PostUsersSigninDataUserProfile$inboundSchema; - /** @deprecated use `PostUsersSigninDataUserProfile$outboundSchema` instead. */ - export const outboundSchema = PostUsersSigninDataUserProfile$outboundSchema; - /** @deprecated use `PostUsersSigninDataUserProfile$Outbound` instead. */ - export type Outbound = PostUsersSigninDataUserProfile$Outbound; +export namespace PostUsersSignInDataUserProfile$ { + /** @deprecated use `PostUsersSignInDataUserProfile$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataUserProfile$inboundSchema; + /** @deprecated use `PostUsersSignInDataUserProfile$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataUserProfile$outboundSchema; + /** @deprecated use `PostUsersSignInDataUserProfile$Outbound` instead. */ + export type Outbound = PostUsersSignInDataUserProfile$Outbound; } /** @internal */ -export const PostUsersSigninDataStatus$inboundSchema: z.ZodNativeEnum< - typeof PostUsersSigninDataStatus -> = z.nativeEnum(PostUsersSigninDataStatus); +export const PostUsersSignInDataStatus$inboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataStatus +> = z.nativeEnum(PostUsersSignInDataStatus); /** @internal */ -export const PostUsersSigninDataStatus$outboundSchema: z.ZodNativeEnum< - typeof PostUsersSigninDataStatus -> = PostUsersSigninDataStatus$inboundSchema; +export const PostUsersSignInDataStatus$outboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataStatus +> = PostUsersSignInDataStatus$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace PostUsersSigninDataStatus$ { - /** @deprecated use `PostUsersSigninDataStatus$inboundSchema` instead. */ - export const inboundSchema = PostUsersSigninDataStatus$inboundSchema; - /** @deprecated use `PostUsersSigninDataStatus$outboundSchema` instead. */ - export const outboundSchema = PostUsersSigninDataStatus$outboundSchema; +export namespace PostUsersSignInDataStatus$ { + /** @deprecated use `PostUsersSignInDataStatus$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataStatus$inboundSchema; + /** @deprecated use `PostUsersSignInDataStatus$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataStatus$outboundSchema; } /** @internal */ -export const PostUsersSigninDataServices$inboundSchema: z.ZodType< - PostUsersSigninDataServices, +export const PostUsersSignInDataServices$inboundSchema: z.ZodType< + PostUsersSignInDataServices, z.ZodTypeDef, unknown > = z.object({ @@ -914,11 +1049,11 @@ export const PostUsersSigninDataServices$inboundSchema: z.ZodType< endpoint: z.string(), token: z.nullable(z.string()), secret: z.nullable(z.string()), - status: PostUsersSigninDataStatus$inboundSchema, + status: PostUsersSignInDataStatus$inboundSchema, }); /** @internal */ -export type PostUsersSigninDataServices$Outbound = { +export type PostUsersSignInDataServices$Outbound = { identifier: string; endpoint: string; token: string | null; @@ -927,114 +1062,107 @@ export type PostUsersSigninDataServices$Outbound = { }; /** @internal */ -export const PostUsersSigninDataServices$outboundSchema: z.ZodType< - PostUsersSigninDataServices$Outbound, +export const PostUsersSignInDataServices$outboundSchema: z.ZodType< + PostUsersSignInDataServices$Outbound, z.ZodTypeDef, - PostUsersSigninDataServices + PostUsersSignInDataServices > = z.object({ identifier: z.string(), endpoint: z.string(), token: z.nullable(z.string()), secret: z.nullable(z.string()), - status: PostUsersSigninDataStatus$outboundSchema, + status: PostUsersSignInDataStatus$outboundSchema, }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace PostUsersSigninDataServices$ { - /** @deprecated use `PostUsersSigninDataServices$inboundSchema` instead. */ - export const inboundSchema = PostUsersSigninDataServices$inboundSchema; - /** @deprecated use `PostUsersSigninDataServices$outboundSchema` instead. */ - export const outboundSchema = PostUsersSigninDataServices$outboundSchema; - /** @deprecated use `PostUsersSigninDataServices$Outbound` instead. */ - export type Outbound = PostUsersSigninDataServices$Outbound; +export namespace PostUsersSignInDataServices$ { + /** @deprecated use `PostUsersSignInDataServices$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataServices$inboundSchema; + /** @deprecated use `PostUsersSignInDataServices$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataServices$outboundSchema; + /** @deprecated use `PostUsersSignInDataServices$Outbound` instead. */ + export type Outbound = PostUsersSignInDataServices$Outbound; } /** @internal */ -export const PostUsersSigninDataFeatures$inboundSchema: z.ZodNativeEnum< - typeof PostUsersSigninDataFeatures -> = z.nativeEnum(PostUsersSigninDataFeatures); +export const PostUsersSignInDataFeatures$inboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataFeatures +> = z.nativeEnum(PostUsersSignInDataFeatures); /** @internal */ -export const PostUsersSigninDataFeatures$outboundSchema: z.ZodNativeEnum< - typeof PostUsersSigninDataFeatures -> = PostUsersSigninDataFeatures$inboundSchema; +export const PostUsersSignInDataFeatures$outboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataFeatures +> = PostUsersSignInDataFeatures$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace PostUsersSigninDataFeatures$ { - /** @deprecated use `PostUsersSigninDataFeatures$inboundSchema` instead. */ - export const inboundSchema = PostUsersSigninDataFeatures$inboundSchema; - /** @deprecated use `PostUsersSigninDataFeatures$outboundSchema` instead. */ - export const outboundSchema = PostUsersSigninDataFeatures$outboundSchema; +export namespace PostUsersSignInDataFeatures$ { + /** @deprecated use `PostUsersSignInDataFeatures$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataFeatures$inboundSchema; + /** @deprecated use `PostUsersSignInDataFeatures$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataFeatures$outboundSchema; } /** @internal */ -export const PostUsersSigninDataUserStatus$inboundSchema: z.ZodNativeEnum< - typeof PostUsersSigninDataUserStatus -> = z.nativeEnum(PostUsersSigninDataUserStatus); +export const PostUsersSignInDataAuthenticationStatus$inboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataAuthenticationStatus +> = z.nativeEnum(PostUsersSignInDataAuthenticationStatus); /** @internal */ -export const PostUsersSigninDataUserStatus$outboundSchema: z.ZodNativeEnum< - typeof PostUsersSigninDataUserStatus -> = PostUsersSigninDataUserStatus$inboundSchema; +export const PostUsersSignInDataAuthenticationStatus$outboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataAuthenticationStatus +> = PostUsersSignInDataAuthenticationStatus$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace PostUsersSigninDataUserStatus$ { - /** @deprecated use `PostUsersSigninDataUserStatus$inboundSchema` instead. */ - export const inboundSchema = PostUsersSigninDataUserStatus$inboundSchema; - /** @deprecated use `PostUsersSigninDataUserStatus$outboundSchema` instead. */ - export const outboundSchema = PostUsersSigninDataUserStatus$outboundSchema; +export namespace PostUsersSignInDataAuthenticationStatus$ { + /** @deprecated use `PostUsersSignInDataAuthenticationStatus$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataAuthenticationStatus$inboundSchema; + /** @deprecated use `PostUsersSignInDataAuthenticationStatus$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataAuthenticationStatus$outboundSchema; } /** @internal */ -export const PostUsersSigninDataSubscription$inboundSchema: z.ZodType< - PostUsersSigninDataSubscription, +export const PostUsersSignInDataSubscription$inboundSchema: z.ZodType< + PostUsersSignInDataSubscription, z.ZodTypeDef, unknown > = z.object({ - features: z.array(PostUsersSigninDataFeatures$inboundSchema).optional(), + features: z.array(PostUsersSignInDataFeatures$inboundSchema).optional(), active: z.boolean().optional(), - subscribedAt: z - .string() - .datetime({ offset: true }) - .transform((v) => new Date(v)) - .optional(), - status: PostUsersSigninDataUserStatus$inboundSchema.optional(), + subscribedAt: z.nullable(z.string()).optional(), + status: PostUsersSignInDataAuthenticationStatus$inboundSchema.optional(), paymentService: z.nullable(z.string()).optional(), plan: z.nullable(z.string()).optional(), }); /** @internal */ -export type PostUsersSigninDataSubscription$Outbound = { +export type PostUsersSignInDataSubscription$Outbound = { features?: Array | undefined; active?: boolean | undefined; - subscribedAt?: string | undefined; + subscribedAt?: string | null | undefined; status?: string | undefined; paymentService?: string | null | undefined; plan?: string | null | undefined; }; /** @internal */ -export const PostUsersSigninDataSubscription$outboundSchema: z.ZodType< - PostUsersSigninDataSubscription$Outbound, +export const PostUsersSignInDataSubscription$outboundSchema: z.ZodType< + PostUsersSignInDataSubscription$Outbound, z.ZodTypeDef, - PostUsersSigninDataSubscription + PostUsersSignInDataSubscription > = z.object({ - features: z.array(PostUsersSigninDataFeatures$outboundSchema).optional(), + features: z.array(PostUsersSignInDataFeatures$outboundSchema).optional(), active: z.boolean().optional(), - subscribedAt: z - .date() - .transform((v) => v.toISOString()) - .optional(), - status: PostUsersSigninDataUserStatus$outboundSchema.optional(), + subscribedAt: z.nullable(z.string()).optional(), + status: PostUsersSignInDataAuthenticationStatus$outboundSchema.optional(), paymentService: z.nullable(z.string()).optional(), plan: z.nullable(z.string()).optional(), }); @@ -1043,98 +1171,91 @@ export const PostUsersSigninDataSubscription$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 PostUsersSigninDataSubscription$ { - /** @deprecated use `PostUsersSigninDataSubscription$inboundSchema` instead. */ - export const inboundSchema = PostUsersSigninDataSubscription$inboundSchema; - /** @deprecated use `PostUsersSigninDataSubscription$outboundSchema` instead. */ - export const outboundSchema = PostUsersSigninDataSubscription$outboundSchema; - /** @deprecated use `PostUsersSigninDataSubscription$Outbound` instead. */ - export type Outbound = PostUsersSigninDataSubscription$Outbound; +export namespace PostUsersSignInDataSubscription$ { + /** @deprecated use `PostUsersSignInDataSubscription$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataSubscription$inboundSchema; + /** @deprecated use `PostUsersSignInDataSubscription$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataSubscription$outboundSchema; + /** @deprecated use `PostUsersSignInDataSubscription$Outbound` instead. */ + export type Outbound = PostUsersSignInDataSubscription$Outbound; } /** @internal */ -export const PostUsersSigninDataUserFeatures$inboundSchema: z.ZodNativeEnum< - typeof PostUsersSigninDataUserFeatures -> = z.nativeEnum(PostUsersSigninDataUserFeatures); +export const PostUsersSignInDataAuthenticationFeatures$inboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataAuthenticationFeatures +> = z.nativeEnum(PostUsersSignInDataAuthenticationFeatures); /** @internal */ -export const PostUsersSigninDataUserFeatures$outboundSchema: z.ZodNativeEnum< - typeof PostUsersSigninDataUserFeatures -> = PostUsersSigninDataUserFeatures$inboundSchema; +export const PostUsersSignInDataAuthenticationFeatures$outboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataAuthenticationFeatures +> = PostUsersSignInDataAuthenticationFeatures$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace PostUsersSigninDataUserFeatures$ { - /** @deprecated use `PostUsersSigninDataUserFeatures$inboundSchema` instead. */ - export const inboundSchema = PostUsersSigninDataUserFeatures$inboundSchema; - /** @deprecated use `PostUsersSigninDataUserFeatures$outboundSchema` instead. */ - export const outboundSchema = PostUsersSigninDataUserFeatures$outboundSchema; +export namespace PostUsersSignInDataAuthenticationFeatures$ { + /** @deprecated use `PostUsersSignInDataAuthenticationFeatures$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataAuthenticationFeatures$inboundSchema; + /** @deprecated use `PostUsersSignInDataAuthenticationFeatures$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataAuthenticationFeatures$outboundSchema; } /** @internal */ -export const PostUsersSigninDataUserResponseStatus$inboundSchema: z.ZodNativeEnum< - typeof PostUsersSigninDataUserResponseStatus -> = z.nativeEnum(PostUsersSigninDataUserResponseStatus); +export const PostUsersSignInDataAuthenticationResponseStatus$inboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataAuthenticationResponseStatus +> = z.nativeEnum(PostUsersSignInDataAuthenticationResponseStatus); /** @internal */ -export const PostUsersSigninDataUserResponseStatus$outboundSchema: z.ZodNativeEnum< - typeof PostUsersSigninDataUserResponseStatus -> = PostUsersSigninDataUserResponseStatus$inboundSchema; +export const PostUsersSignInDataAuthenticationResponseStatus$outboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataAuthenticationResponseStatus +> = PostUsersSignInDataAuthenticationResponseStatus$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace PostUsersSigninDataUserResponseStatus$ { - /** @deprecated use `PostUsersSigninDataUserResponseStatus$inboundSchema` instead. */ - export const inboundSchema = PostUsersSigninDataUserResponseStatus$inboundSchema; - /** @deprecated use `PostUsersSigninDataUserResponseStatus$outboundSchema` instead. */ - export const outboundSchema = PostUsersSigninDataUserResponseStatus$outboundSchema; +export namespace PostUsersSignInDataAuthenticationResponseStatus$ { + /** @deprecated use `PostUsersSignInDataAuthenticationResponseStatus$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataAuthenticationResponseStatus$inboundSchema; + /** @deprecated use `PostUsersSignInDataAuthenticationResponseStatus$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataAuthenticationResponseStatus$outboundSchema; } /** @internal */ -export const PostUsersSigninDataUserSubscription$inboundSchema: z.ZodType< - PostUsersSigninDataUserSubscription, +export const PostUsersSignInDataAuthenticationSubscription$inboundSchema: z.ZodType< + PostUsersSignInDataAuthenticationSubscription, z.ZodTypeDef, unknown > = z.object({ - features: z.array(PostUsersSigninDataUserFeatures$inboundSchema).optional(), + features: z.array(PostUsersSignInDataAuthenticationFeatures$inboundSchema).optional(), active: z.boolean().optional(), - subscribedAt: z - .string() - .datetime({ offset: true }) - .transform((v) => new Date(v)) - .optional(), - status: PostUsersSigninDataUserResponseStatus$inboundSchema.optional(), + subscribedAt: z.nullable(z.string()).optional(), + status: PostUsersSignInDataAuthenticationResponseStatus$inboundSchema.optional(), paymentService: z.nullable(z.string()).optional(), plan: z.nullable(z.string()).optional(), }); /** @internal */ -export type PostUsersSigninDataUserSubscription$Outbound = { +export type PostUsersSignInDataAuthenticationSubscription$Outbound = { features?: Array | undefined; active?: boolean | undefined; - subscribedAt?: string | undefined; + subscribedAt?: string | null | undefined; status?: string | undefined; paymentService?: string | null | undefined; plan?: string | null | undefined; }; /** @internal */ -export const PostUsersSigninDataUserSubscription$outboundSchema: z.ZodType< - PostUsersSigninDataUserSubscription$Outbound, +export const PostUsersSignInDataAuthenticationSubscription$outboundSchema: z.ZodType< + PostUsersSignInDataAuthenticationSubscription$Outbound, z.ZodTypeDef, - PostUsersSigninDataUserSubscription + PostUsersSignInDataAuthenticationSubscription > = z.object({ - features: z.array(PostUsersSigninDataUserFeatures$outboundSchema).optional(), + features: z.array(PostUsersSignInDataAuthenticationFeatures$outboundSchema).optional(), active: z.boolean().optional(), - subscribedAt: z - .date() - .transform((v) => v.toISOString()) - .optional(), - status: PostUsersSigninDataUserResponseStatus$outboundSchema.optional(), + subscribedAt: z.nullable(z.string()).optional(), + status: PostUsersSignInDataAuthenticationResponseStatus$outboundSchema.optional(), paymentService: z.nullable(z.string()).optional(), plan: z.nullable(z.string()).optional(), }); @@ -1143,34 +1264,34 @@ export const PostUsersSigninDataUserSubscription$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 PostUsersSigninDataUserSubscription$ { - /** @deprecated use `PostUsersSigninDataUserSubscription$inboundSchema` instead. */ - export const inboundSchema = PostUsersSigninDataUserSubscription$inboundSchema; - /** @deprecated use `PostUsersSigninDataUserSubscription$outboundSchema` instead. */ - export const outboundSchema = PostUsersSigninDataUserSubscription$outboundSchema; - /** @deprecated use `PostUsersSigninDataUserSubscription$Outbound` instead. */ - export type Outbound = PostUsersSigninDataUserSubscription$Outbound; +export namespace PostUsersSignInDataAuthenticationSubscription$ { + /** @deprecated use `PostUsersSignInDataAuthenticationSubscription$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataAuthenticationSubscription$inboundSchema; + /** @deprecated use `PostUsersSignInDataAuthenticationSubscription$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataAuthenticationSubscription$outboundSchema; + /** @deprecated use `PostUsersSignInDataAuthenticationSubscription$Outbound` instead. */ + export type Outbound = PostUsersSignInDataAuthenticationSubscription$Outbound; } /** @internal */ -export const PostUsersSigninDataState$inboundSchema: z.ZodNativeEnum< - typeof PostUsersSigninDataState -> = z.nativeEnum(PostUsersSigninDataState); +export const PostUsersSignInDataState$inboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataState +> = z.nativeEnum(PostUsersSignInDataState); /** @internal */ -export const PostUsersSigninDataState$outboundSchema: z.ZodNativeEnum< - typeof PostUsersSigninDataState -> = PostUsersSigninDataState$inboundSchema; +export const PostUsersSignInDataState$outboundSchema: z.ZodNativeEnum< + typeof PostUsersSignInDataState +> = PostUsersSignInDataState$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace PostUsersSigninDataState$ { - /** @deprecated use `PostUsersSigninDataState$inboundSchema` instead. */ - export const inboundSchema = PostUsersSigninDataState$inboundSchema; - /** @deprecated use `PostUsersSigninDataState$outboundSchema` instead. */ - export const outboundSchema = PostUsersSigninDataState$outboundSchema; +export namespace PostUsersSignInDataState$ { + /** @deprecated use `PostUsersSignInDataState$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataState$inboundSchema; + /** @deprecated use `PostUsersSignInDataState$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataState$outboundSchema; } /** @internal */ @@ -1241,17 +1362,17 @@ export const PastSubscription$inboundSchema: z.ZodType Billing$inboundSchema)), + state: PostUsersSignInDataState$inboundSchema, + billing: z.lazy(() => Billing$inboundSchema), }); /** @internal */ @@ -1270,7 +1391,7 @@ export type PastSubscription$Outbound = { type: string; transfer: string | null; state: string; - billing: Array; + billing: Billing$Outbound; }; /** @internal */ @@ -1292,8 +1413,8 @@ export const PastSubscription$outboundSchema: z.ZodType< canConvert: z.boolean().default(false), type: z.string(), transfer: z.nullable(z.string()), - state: PostUsersSigninDataState$outboundSchema, - billing: z.array(z.lazy(() => Billing$outboundSchema)), + state: PostUsersSignInDataState$outboundSchema, + billing: z.lazy(() => Billing$outboundSchema), }); /** @@ -1332,8 +1453,8 @@ export namespace Trials$ { } /** @internal */ -export const PostUsersSigninDataUserPlexAccount$inboundSchema: z.ZodType< - PostUsersSigninDataUserPlexAccount, +export const PostUsersSignInDataUserPlexAccount$inboundSchema: z.ZodType< + PostUsersSignInDataUserPlexAccount, z.ZodTypeDef, unknown > = z.object({ @@ -1350,41 +1471,43 @@ export const PostUsersSigninDataUserPlexAccount$inboundSchema: z.ZodType< .datetime({ offset: true }) .transform((v) => new Date(v)) ), - anonymous: z.boolean(), + anonymous: z.nullable(z.boolean().default(false)), authToken: z.string(), - backupCodesCreated: z.boolean(), - confirmed: z.boolean(), + backupCodesCreated: z.boolean().default(false), + confirmed: z.boolean().default(false), country: z.string(), email: z.string(), - emailOnlyAuth: z.boolean(), - experimentalFeatures: z.boolean(), + emailOnlyAuth: z.boolean().default(false), + experimentalFeatures: z.boolean().default(false), friendlyName: z.string(), entitlements: z.array(z.string()), - guest: z.boolean(), + guest: z.boolean().default(false), hasPassword: z.boolean().default(true), - home: z.boolean(), - homeAdmin: z.boolean(), + home: z.boolean().default(false), + homeAdmin: z.boolean().default(false), homeSize: z.number().int(), id: z.number().int(), joinedAt: z.number().int(), locale: z.nullable(z.string()), - mailingListActive: z.boolean(), - mailingListStatus: PostUsersSigninDataMailingListStatus$inboundSchema, + mailingListActive: z.boolean().default(false), + mailingListStatus: PostUsersSignInDataMailingListStatus$inboundSchema, maxHomeSize: z.number().int(), pin: z.string().optional(), - profile: z.array(z.lazy(() => PostUsersSigninDataUserProfile$inboundSchema)), - protected: z.boolean(), + profile: z.lazy(() => PostUsersSignInDataUserProfile$inboundSchema), + protected: z.boolean().default(false), rememberExpiresAt: z.number().int(), - restricted: z.boolean(), + restricted: z.boolean().default(false), roles: z.array(z.string()).optional(), scrobbleTypes: z.string(), - services: z.array(z.lazy(() => PostUsersSigninDataServices$inboundSchema)), - subscription: z.lazy(() => PostUsersSigninDataSubscription$inboundSchema), + services: z.array(z.lazy(() => PostUsersSignInDataServices$inboundSchema)), + subscription: z.lazy(() => PostUsersSignInDataSubscription$inboundSchema), subscriptionDescription: z.nullable(z.string()), - subscriptions: z.array(z.lazy(() => PostUsersSigninDataUserSubscription$inboundSchema)), + subscriptions: z.array( + z.lazy(() => PostUsersSignInDataAuthenticationSubscription$inboundSchema) + ), thumb: z.string(), title: z.string(), - twoFactorEnabled: z.boolean(), + twoFactorEnabled: z.boolean().default(false), username: z.string(), uuid: z.string(), pastSubscriptions: z.array(z.lazy(() => PastSubscription$inboundSchema)), @@ -1392,11 +1515,11 @@ export const PostUsersSigninDataUserPlexAccount$inboundSchema: z.ZodType< }); /** @internal */ -export type PostUsersSigninDataUserPlexAccount$Outbound = { +export type PostUsersSignInDataUserPlexAccount$Outbound = { adsConsent: boolean | null; adsConsentReminderAt: string | null; adsConsentSetAt: string | null; - anonymous: boolean; + anonymous: boolean | null; authToken: string; backupCodesCreated: boolean; confirmed: boolean; @@ -1418,16 +1541,16 @@ export type PostUsersSigninDataUserPlexAccount$Outbound = { mailingListStatus: string; maxHomeSize: number; pin?: string | undefined; - profile: Array; + profile: PostUsersSignInDataUserProfile$Outbound; protected: boolean; rememberExpiresAt: number; restricted: boolean; roles?: Array | undefined; scrobbleTypes: string; - services: Array; - subscription: PostUsersSigninDataSubscription$Outbound; + services: Array; + subscription: PostUsersSignInDataSubscription$Outbound; subscriptionDescription: string | null; - subscriptions: Array; + subscriptions: Array; thumb: string; title: string; twoFactorEnabled: boolean; @@ -1438,15 +1561,15 @@ export type PostUsersSigninDataUserPlexAccount$Outbound = { }; /** @internal */ -export const PostUsersSigninDataUserPlexAccount$outboundSchema: z.ZodType< - PostUsersSigninDataUserPlexAccount$Outbound, +export const PostUsersSignInDataUserPlexAccount$outboundSchema: z.ZodType< + PostUsersSignInDataUserPlexAccount$Outbound, z.ZodTypeDef, - PostUsersSigninDataUserPlexAccount + PostUsersSignInDataUserPlexAccount > = z.object({ adsConsent: z.nullable(z.boolean()), adsConsentReminderAt: z.nullable(z.date().transform((v) => v.toISOString())), adsConsentSetAt: z.nullable(z.date().transform((v) => v.toISOString())), - anonymous: z.boolean().default(false), + anonymous: z.nullable(z.boolean().default(false)), authToken: z.string(), backupCodesCreated: z.boolean().default(false), confirmed: z.boolean().default(false), @@ -1465,19 +1588,21 @@ export const PostUsersSigninDataUserPlexAccount$outboundSchema: z.ZodType< joinedAt: z.number().int(), locale: z.nullable(z.string()), mailingListActive: z.boolean().default(false), - mailingListStatus: PostUsersSigninDataMailingListStatus$outboundSchema, + mailingListStatus: PostUsersSignInDataMailingListStatus$outboundSchema, maxHomeSize: z.number().int(), pin: z.string().optional(), - profile: z.array(z.lazy(() => PostUsersSigninDataUserProfile$outboundSchema)), + profile: z.lazy(() => PostUsersSignInDataUserProfile$outboundSchema), protected: z.boolean().default(false), rememberExpiresAt: z.number().int(), restricted: z.boolean().default(false), roles: z.array(z.string()).optional(), scrobbleTypes: z.string(), - services: z.array(z.lazy(() => PostUsersSigninDataServices$outboundSchema)), - subscription: z.lazy(() => PostUsersSigninDataSubscription$outboundSchema), + services: z.array(z.lazy(() => PostUsersSignInDataServices$outboundSchema)), + subscription: z.lazy(() => PostUsersSignInDataSubscription$outboundSchema), subscriptionDescription: z.nullable(z.string()), - subscriptions: z.array(z.lazy(() => PostUsersSigninDataUserSubscription$outboundSchema)), + subscriptions: z.array( + z.lazy(() => PostUsersSignInDataAuthenticationSubscription$outboundSchema) + ), thumb: z.string(), title: z.string(), twoFactorEnabled: z.boolean().default(false), @@ -1491,18 +1616,18 @@ export const PostUsersSigninDataUserPlexAccount$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 PostUsersSigninDataUserPlexAccount$ { - /** @deprecated use `PostUsersSigninDataUserPlexAccount$inboundSchema` instead. */ - export const inboundSchema = PostUsersSigninDataUserPlexAccount$inboundSchema; - /** @deprecated use `PostUsersSigninDataUserPlexAccount$outboundSchema` instead. */ - export const outboundSchema = PostUsersSigninDataUserPlexAccount$outboundSchema; - /** @deprecated use `PostUsersSigninDataUserPlexAccount$Outbound` instead. */ - export type Outbound = PostUsersSigninDataUserPlexAccount$Outbound; +export namespace PostUsersSignInDataUserPlexAccount$ { + /** @deprecated use `PostUsersSignInDataUserPlexAccount$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataUserPlexAccount$inboundSchema; + /** @deprecated use `PostUsersSignInDataUserPlexAccount$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataUserPlexAccount$outboundSchema; + /** @deprecated use `PostUsersSignInDataUserPlexAccount$Outbound` instead. */ + export type Outbound = PostUsersSignInDataUserPlexAccount$Outbound; } /** @internal */ -export const PostUsersSigninDataResponse$inboundSchema: z.ZodType< - PostUsersSigninDataResponse, +export const PostUsersSignInDataResponse$inboundSchema: z.ZodType< + PostUsersSignInDataResponse, z.ZodTypeDef, unknown > = z @@ -1510,7 +1635,7 @@ export const PostUsersSigninDataResponse$inboundSchema: z.ZodType< ContentType: z.string(), StatusCode: z.number().int(), RawResponse: z.instanceof(Response), - UserPlexAccount: z.lazy(() => PostUsersSigninDataUserPlexAccount$inboundSchema).optional(), + UserPlexAccount: z.lazy(() => PostUsersSignInDataUserPlexAccount$inboundSchema).optional(), }) .transform((v) => { return remap$(v, { @@ -1522,18 +1647,18 @@ export const PostUsersSigninDataResponse$inboundSchema: z.ZodType< }); /** @internal */ -export type PostUsersSigninDataResponse$Outbound = { +export type PostUsersSignInDataResponse$Outbound = { ContentType: string; StatusCode: number; RawResponse: never; - UserPlexAccount?: PostUsersSigninDataUserPlexAccount$Outbound | undefined; + UserPlexAccount?: PostUsersSignInDataUserPlexAccount$Outbound | undefined; }; /** @internal */ -export const PostUsersSigninDataResponse$outboundSchema: z.ZodType< - PostUsersSigninDataResponse$Outbound, +export const PostUsersSignInDataResponse$outboundSchema: z.ZodType< + PostUsersSignInDataResponse$Outbound, z.ZodTypeDef, - PostUsersSigninDataResponse + PostUsersSignInDataResponse > = z .object({ contentType: z.string(), @@ -1541,7 +1666,7 @@ export const PostUsersSigninDataResponse$outboundSchema: z.ZodType< rawResponse: z.instanceof(Response).transform(() => { throw new Error("Response cannot be serialized"); }), - userPlexAccount: z.lazy(() => PostUsersSigninDataUserPlexAccount$outboundSchema).optional(), + userPlexAccount: z.lazy(() => PostUsersSignInDataUserPlexAccount$outboundSchema).optional(), }) .transform((v) => { return remap$(v, { @@ -1556,11 +1681,11 @@ export const PostUsersSigninDataResponse$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 PostUsersSigninDataResponse$ { - /** @deprecated use `PostUsersSigninDataResponse$inboundSchema` instead. */ - export const inboundSchema = PostUsersSigninDataResponse$inboundSchema; - /** @deprecated use `PostUsersSigninDataResponse$outboundSchema` instead. */ - export const outboundSchema = PostUsersSigninDataResponse$outboundSchema; - /** @deprecated use `PostUsersSigninDataResponse$Outbound` instead. */ - export type Outbound = PostUsersSigninDataResponse$Outbound; +export namespace PostUsersSignInDataResponse$ { + /** @deprecated use `PostUsersSignInDataResponse$inboundSchema` instead. */ + export const inboundSchema = PostUsersSignInDataResponse$inboundSchema; + /** @deprecated use `PostUsersSignInDataResponse$outboundSchema` instead. */ + export const outboundSchema = PostUsersSignInDataResponse$outboundSchema; + /** @deprecated use `PostUsersSignInDataResponse$Outbound` instead. */ + export type Outbound = PostUsersSignInDataResponse$Outbound; } diff --git a/src/models/refreshlibraryop.ts b/src/models/refreshlibraryop.ts deleted file mode 100644 index 4b816abf..00000000 --- a/src/models/refreshlibraryop.ts +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { remap as remap$ } from "../lib/primitives.js"; -import * as z from "zod"; - -export type RefreshLibraryRequest = { - /** - * the Id of the library to refresh - */ - sectionId: number; -}; - -export type RefreshLibraryErrors = { - 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 RefreshLibraryResponseBodyData = { - 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 RefreshLibraryResponseBody 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$: RefreshLibraryResponseBodyData; - - constructor(err: RefreshLibraryResponseBodyData) { - 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 = "RefreshLibraryResponseBody"; - } -} - -export type RefreshLibraryResponse = { - /** - * 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; -}; - -/** @internal */ -export const RefreshLibraryRequest$inboundSchema: z.ZodType< - RefreshLibraryRequest, - z.ZodTypeDef, - unknown -> = z.object({ - sectionId: z.number(), -}); - -/** @internal */ -export type RefreshLibraryRequest$Outbound = { - sectionId: number; -}; - -/** @internal */ -export const RefreshLibraryRequest$outboundSchema: z.ZodType< - RefreshLibraryRequest$Outbound, - z.ZodTypeDef, - RefreshLibraryRequest -> = z.object({ - sectionId: z.number(), -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace RefreshLibraryRequest$ { - /** @deprecated use `RefreshLibraryRequest$inboundSchema` instead. */ - export const inboundSchema = RefreshLibraryRequest$inboundSchema; - /** @deprecated use `RefreshLibraryRequest$outboundSchema` instead. */ - export const outboundSchema = RefreshLibraryRequest$outboundSchema; - /** @deprecated use `RefreshLibraryRequest$Outbound` instead. */ - export type Outbound = RefreshLibraryRequest$Outbound; -} - -/** @internal */ -export const RefreshLibraryErrors$inboundSchema: z.ZodType< - RefreshLibraryErrors, - z.ZodTypeDef, - unknown -> = z.object({ - code: z.number().optional(), - message: z.string().optional(), - status: z.number().optional(), -}); - -/** @internal */ -export type RefreshLibraryErrors$Outbound = { - code?: number | undefined; - message?: string | undefined; - status?: number | undefined; -}; - -/** @internal */ -export const RefreshLibraryErrors$outboundSchema: z.ZodType< - RefreshLibraryErrors$Outbound, - z.ZodTypeDef, - RefreshLibraryErrors -> = z.object({ - code: z.number().optional(), - message: z.string().optional(), - status: z.number().optional(), -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace RefreshLibraryErrors$ { - /** @deprecated use `RefreshLibraryErrors$inboundSchema` instead. */ - export const inboundSchema = RefreshLibraryErrors$inboundSchema; - /** @deprecated use `RefreshLibraryErrors$outboundSchema` instead. */ - export const outboundSchema = RefreshLibraryErrors$outboundSchema; - /** @deprecated use `RefreshLibraryErrors$Outbound` instead. */ - export type Outbound = RefreshLibraryErrors$Outbound; -} - -/** @internal */ -export const RefreshLibraryResponseBody$inboundSchema: z.ZodType< - RefreshLibraryResponseBody, - z.ZodTypeDef, - unknown -> = z - .object({ - errors: z.array(z.lazy(() => RefreshLibraryErrors$inboundSchema)).optional(), - RawResponse: z.instanceof(Response).optional(), - }) - .transform((v) => { - const remapped = remap$(v, { - RawResponse: "rawResponse", - }); - - return new RefreshLibraryResponseBody(remapped); - }); - -/** @internal */ -export type RefreshLibraryResponseBody$Outbound = { - errors?: Array | undefined; - RawResponse?: never | undefined; -}; - -/** @internal */ -export const RefreshLibraryResponseBody$outboundSchema: z.ZodType< - RefreshLibraryResponseBody$Outbound, - z.ZodTypeDef, - RefreshLibraryResponseBody -> = z - .instanceof(RefreshLibraryResponseBody) - .transform((v) => v.data$) - .pipe( - z - .object({ - errors: z.array(z.lazy(() => RefreshLibraryErrors$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 RefreshLibraryResponseBody$ { - /** @deprecated use `RefreshLibraryResponseBody$inboundSchema` instead. */ - export const inboundSchema = RefreshLibraryResponseBody$inboundSchema; - /** @deprecated use `RefreshLibraryResponseBody$outboundSchema` instead. */ - export const outboundSchema = RefreshLibraryResponseBody$outboundSchema; - /** @deprecated use `RefreshLibraryResponseBody$Outbound` instead. */ - export type Outbound = RefreshLibraryResponseBody$Outbound; -} - -/** @internal */ -export const RefreshLibraryResponse$inboundSchema: z.ZodType< - RefreshLibraryResponse, - z.ZodTypeDef, - unknown -> = z - .object({ - ContentType: z.string(), - StatusCode: z.number().int(), - RawResponse: z.instanceof(Response), - }) - .transform((v) => { - return remap$(v, { - ContentType: "contentType", - StatusCode: "statusCode", - RawResponse: "rawResponse", - }); - }); - -/** @internal */ -export type RefreshLibraryResponse$Outbound = { - ContentType: string; - StatusCode: number; - RawResponse: never; -}; - -/** @internal */ -export const RefreshLibraryResponse$outboundSchema: z.ZodType< - RefreshLibraryResponse$Outbound, - z.ZodTypeDef, - RefreshLibraryResponse -> = z - .object({ - contentType: z.string(), - statusCode: z.number().int(), - rawResponse: z.instanceof(Response).transform(() => { - throw new Error("Response cannot be serialized"); - }), - }) - .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 RefreshLibraryResponse$ { - /** @deprecated use `RefreshLibraryResponse$inboundSchema` instead. */ - export const inboundSchema = RefreshLibraryResponse$inboundSchema; - /** @deprecated use `RefreshLibraryResponse$outboundSchema` instead. */ - export const outboundSchema = RefreshLibraryResponse$outboundSchema; - /** @deprecated use `RefreshLibraryResponse$Outbound` instead. */ - export type Outbound = RefreshLibraryResponse$Outbound; -} diff --git a/src/models/uploadplaylistop.ts b/src/models/uploadplaylistop.ts index ed500bc3..aa59a458 100644 --- a/src/models/uploadplaylistop.ts +++ b/src/models/uploadplaylistop.ts @@ -14,7 +14,7 @@ import * as z from "zod"; * 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. * */ -export enum Force { +export enum QueryParamForce { Zero = 0, One = 1, } @@ -41,7 +41,7 @@ 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: Force; + force: QueryParamForce; }; export type UploadPlaylistErrors = { @@ -109,20 +109,22 @@ export type UploadPlaylistResponse = { }; /** @internal */ -export const Force$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Force); +export const QueryParamForce$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(QueryParamForce); /** @internal */ -export const Force$outboundSchema: z.ZodNativeEnum = Force$inboundSchema; +export const QueryParamForce$outboundSchema: z.ZodNativeEnum = + QueryParamForce$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace Force$ { - /** @deprecated use `Force$inboundSchema` instead. */ - export const inboundSchema = Force$inboundSchema; - /** @deprecated use `Force$outboundSchema` instead. */ - export const outboundSchema = Force$outboundSchema; +export namespace QueryParamForce$ { + /** @deprecated use `QueryParamForce$inboundSchema` instead. */ + export const inboundSchema = QueryParamForce$inboundSchema; + /** @deprecated use `QueryParamForce$outboundSchema` instead. */ + export const outboundSchema = QueryParamForce$outboundSchema; } /** @internal */ @@ -132,7 +134,7 @@ export const UploadPlaylistRequest$inboundSchema: z.ZodType< unknown > = z.object({ path: z.string(), - force: Force$inboundSchema, + force: QueryParamForce$inboundSchema, }); /** @internal */ @@ -148,7 +150,7 @@ export const UploadPlaylistRequest$outboundSchema: z.ZodType< UploadPlaylistRequest > = z.object({ path: z.string(), - force: Force$outboundSchema, + force: QueryParamForce$outboundSchema, }); /** diff --git a/src/sdk/authentication.ts b/src/sdk/authentication.ts index db471891..dbe7916e 100644 --- a/src/sdk/authentication.ts +++ b/src/sdk/authentication.ts @@ -4,6 +4,8 @@ import { authenticationGetSourceConnectionInformation } from "../funcs/authenticationGetSourceConnectionInformation.js"; import { authenticationGetTransientToken } from "../funcs/authenticationGetTransientToken.js"; +import { authenticationGetUserDetails } from "../funcs/authenticationGetUserDetails.js"; +import { authenticationPostUsersSignInData } from "../funcs/authenticationPostUsersSignInData.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as models from "../models/index.js"; import { unwrapAsync } from "../types/fp.js"; @@ -38,4 +40,33 @@ export class Authentication extends ClientSDK { ): Promise { return unwrapAsync(authenticationGetSourceConnectionInformation(this, source, options)); } + + /** + * Get User Data By Token + * + * @remarks + * Get the User data from the provided X-Plex-Token + */ + async getUserDetails( + xPlexToken: string, + options?: RequestOptions & { serverURL?: string } + ): Promise { + return unwrapAsync(authenticationGetUserDetails(this, xPlexToken, options)); + } + + /** + * Get User SignIn Data + * + * @remarks + * Sign in user with username and password and return user data with Plex authentication token + */ + async postUsersSignInData( + xPlexClientIdentifier?: string | undefined, + requestBody?: models.PostUsersSignInDataRequestBody | undefined, + options?: RequestOptions & { serverURL?: string } + ): Promise { + return unwrapAsync( + authenticationPostUsersSignInData(this, xPlexClientIdentifier, requestBody, options) + ); + } } diff --git a/src/sdk/library.ts b/src/sdk/library.ts index a3f540c4..76293dab 100644 --- a/src/sdk/library.ts +++ b/src/sdk/library.ts @@ -3,17 +3,17 @@ */ import { libraryDeleteLibrary } from "../funcs/libraryDeleteLibrary.js"; +import { libraryGetAllLibraries } from "../funcs/libraryGetAllLibraries.js"; import { libraryGetFileHash } from "../funcs/libraryGetFileHash.js"; -import { libraryGetLibraries } from "../funcs/libraryGetLibraries.js"; -import { libraryGetLibrary } from "../funcs/libraryGetLibrary.js"; +import { libraryGetLibraryDetails } from "../funcs/libraryGetLibraryDetails.js"; import { libraryGetLibraryItems } from "../funcs/libraryGetLibraryItems.js"; -import { libraryGetMetadata } from "../funcs/libraryGetMetadata.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 { libraryGetRefreshLibraryMetadata } from "../funcs/libraryGetRefreshLibraryMetadata.js"; +import { libraryGetSearchLibrary } from "../funcs/libraryGetSearchLibrary.js"; import { libraryGetTopWatchedContent } from "../funcs/libraryGetTopWatchedContent.js"; -import { libraryRefreshLibrary } from "../funcs/libraryRefreshLibrary.js"; -import { librarySearchLibrary } from "../funcs/librarySearchLibrary.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as models from "../models/index.js"; import { unwrapAsync } from "../types/fp.js"; @@ -40,8 +40,14 @@ export class Library extends ClientSDK { * This endpoint will return the recently added content. * */ - async getRecentlyAdded(options?: RequestOptions): Promise { - return unwrapAsync(libraryGetRecentlyAdded(this, options)); + async getRecentlyAdded( + xPlexContainerStart?: number | undefined, + xPlexContainerSize?: number | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync( + libraryGetRecentlyAdded(this, xPlexContainerStart, xPlexContainerSize, options) + ); } /** @@ -56,8 +62,8 @@ export class Library extends ClientSDK { * This allows a client to provide a rich interface around the media (e.g. allow sorting movies by release year). * */ - async getLibraries(options?: RequestOptions): Promise { - return unwrapAsync(libraryGetLibraries(this, options)); + async getAllLibraries(options?: RequestOptions): Promise { + return unwrapAsync(libraryGetAllLibraries(this, options)); } /** @@ -105,25 +111,25 @@ export class Library extends ClientSDK { * > **Note**: Filters and sorts are optional; without them, no filtering controls are rendered. * */ - async getLibrary( - sectionId: number, + async getLibraryDetails( + sectionKey: number, includeDetails?: models.IncludeDetails | undefined, options?: RequestOptions - ): Promise { - return unwrapAsync(libraryGetLibrary(this, sectionId, includeDetails, options)); + ): Promise { + return unwrapAsync(libraryGetLibraryDetails(this, sectionKey, includeDetails, options)); } /** * Delete Library Section * * @remarks - * Delate a library using a specific section + * Delete a library using a specific section id */ async deleteLibrary( - sectionId: number, + sectionKey: number, options?: RequestOptions ): Promise { - return unwrapAsync(libraryDeleteLibrary(this, sectionId, options)); + return unwrapAsync(libraryDeleteLibrary(this, sectionKey, options)); } /** @@ -153,26 +159,25 @@ export class Library extends ClientSDK { * */ async getLibraryItems( - sectionId: any, - tag: models.Tag, - includeGuids?: number | undefined, + request: models.GetLibraryItemsRequest, options?: RequestOptions ): Promise { - return unwrapAsync(libraryGetLibraryItems(this, sectionId, tag, includeGuids, options)); + return unwrapAsync(libraryGetLibraryItems(this, request, options)); } /** - * Refresh Library + * Refresh Metadata Of The Library * * @remarks - * This endpoint Refreshes the library. + * This endpoint Refreshes all the Metadata of the library. * */ - async refreshLibrary( - sectionId: number, + async getRefreshLibraryMetadata( + sectionKey: number, + force?: models.Force | undefined, options?: RequestOptions - ): Promise { - return unwrapAsync(libraryRefreshLibrary(this, sectionId, options)); + ): Promise { + return unwrapAsync(libraryGetRefreshLibraryMetadata(this, sectionKey, force, options)); } /** @@ -199,26 +204,26 @@ export class Library extends ClientSDK { * > **Note**: Filters and sorts are optional; without them, no filtering controls are rendered. * */ - async searchLibrary( - sectionId: number, - type: models.Type, + async getSearchLibrary( + sectionKey: number, + type: models.QueryParamType, options?: RequestOptions - ): Promise { - return unwrapAsync(librarySearchLibrary(this, sectionId, type, options)); + ): Promise { + return unwrapAsync(libraryGetSearchLibrary(this, sectionKey, type, options)); } /** - * Get Items Metadata + * Get Metadata by RatingKey * * @remarks * This endpoint will return the metadata of a library item specified with the ratingKey. * */ - async getMetadata( + async getMetaDataByRatingKey( ratingKey: number, options?: RequestOptions - ): Promise { - return unwrapAsync(libraryGetMetadata(this, ratingKey, options)); + ): Promise { + return unwrapAsync(libraryGetMetaDataByRatingKey(this, ratingKey, options)); } /** @@ -244,7 +249,7 @@ export class Library extends ClientSDK { * */ async getTopWatchedContent( - type: number, + type: models.GetTopWatchedContentQueryParamType, includeGuids?: number | undefined, options?: RequestOptions ): Promise { diff --git a/src/sdk/media.ts b/src/sdk/media.ts index fbc622a1..cfb11d42 100644 --- a/src/sdk/media.ts +++ b/src/sdk/media.ts @@ -2,6 +2,8 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ +import { mediaGetBannerImage } from "../funcs/mediaGetBannerImage.js"; +import { mediaGetThumbImage } from "../funcs/mediaGetThumbImage.js"; import { mediaMarkPlayed } from "../funcs/mediaMarkPlayed.js"; import { mediaMarkUnplayed } from "../funcs/mediaMarkUnplayed.js"; import { mediaUpdatePlayProgress } from "../funcs/mediaUpdatePlayProgress.js"; @@ -48,4 +50,30 @@ export class Media extends ClientSDK { ): Promise { return unwrapAsync(mediaUpdatePlayProgress(this, key, time, state, options)); } + + /** + * Get Banner Image + * + * @remarks + * Gets the banner image of the media item + */ + async getBannerImage( + request: models.GetBannerImageRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(mediaGetBannerImage(this, request, options)); + } + + /** + * Get Thumb Image + * + * @remarks + * Gets the thumbnail image of the media item + */ + async getThumbImage( + request: models.GetThumbImageRequest, + options?: RequestOptions + ): Promise { + return unwrapAsync(mediaGetThumbImage(this, request, options)); + } } diff --git a/src/sdk/playlists.ts b/src/sdk/playlists.ts index fc24d6ab..63faf347 100644 --- a/src/sdk/playlists.ts +++ b/src/sdk/playlists.ts @@ -103,7 +103,7 @@ export class Playlists extends ClientSDK { */ async getPlaylistContents( playlistID: number, - type: number, + type: models.GetPlaylistContentsQueryParamType, options?: RequestOptions ): Promise { return unwrapAsync(playlistsGetPlaylistContents(this, playlistID, type, options)); @@ -151,7 +151,7 @@ export class Playlists extends ClientSDK { */ async uploadPlaylist( path: string, - force: models.Force, + force: models.QueryParamForce, options?: RequestOptions ): Promise { return unwrapAsync(playlistsUploadPlaylist(this, path, force, options)); diff --git a/src/sdk/plex.ts b/src/sdk/plex.ts index d11fdef3..2f2addf5 100644 --- a/src/sdk/plex.ts +++ b/src/sdk/plex.ts @@ -6,9 +6,8 @@ import { plexGetCompanionsData } from "../funcs/plexGetCompanionsData.js"; import { plexGetGeoData } from "../funcs/plexGetGeoData.js"; import { plexGetHomeData } from "../funcs/plexGetHomeData.js"; import { plexGetPin } from "../funcs/plexGetPin.js"; -import { plexGetResources } from "../funcs/plexGetResources.js"; +import { plexGetServerResources } from "../funcs/plexGetServerResources.js"; import { plexGetTokenByPinId } from "../funcs/plexGetTokenByPinId.js"; -import { plexGetUserDetails } from "../funcs/plexGetUserDetails.js"; import { plexGetUserFriends } from "../funcs/plexGetUserFriends.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as models from "../models/index.js"; @@ -62,28 +61,16 @@ export class Plex extends ClientSDK { } /** - * Get Resources + * Get Server Resources * * @remarks - * Get Resources + * Get Plex server access tokens and server connections */ - async getResources( - xPlexClientIdentifier?: string | undefined, - includeHttps?: models.IncludeHttps | undefined, - includeRelay?: models.IncludeRelay | undefined, - includeIPv6?: models.IncludeIPv6 | undefined, + async getServerResources( + request: models.GetServerResourcesRequest, options?: RequestOptions & { serverURL?: string } - ): Promise { - return unwrapAsync( - plexGetResources( - this, - xPlexClientIdentifier, - includeHttps, - includeRelay, - includeIPv6, - options - ) - ); + ): Promise { + return unwrapAsync(plexGetServerResources(this, request, options)); } /** @@ -93,12 +80,12 @@ export class Plex extends ClientSDK { * Retrieve a Pin from Plex.tv for authentication flows */ async getPin( - xPlexProduct: string, strong?: boolean | undefined, xPlexClientIdentifier?: string | undefined, + xPlexProduct?: string | undefined, options?: RequestOptions & { serverURL?: string } ): Promise { - return unwrapAsync(plexGetPin(this, xPlexProduct, strong, xPlexClientIdentifier, options)); + return unwrapAsync(plexGetPin(this, strong, xPlexClientIdentifier, xPlexProduct, options)); } /** @@ -114,16 +101,4 @@ export class Plex extends ClientSDK { ): Promise { return unwrapAsync(plexGetTokenByPinId(this, pinID, xPlexClientIdentifier, options)); } - - /** - * Get UserData By Token - * - * @remarks - * Get the User data from the provided X-Plex-Token - */ - async getUserDetails( - options?: RequestOptions & { serverURL?: string } - ): Promise { - return unwrapAsync(plexGetUserDetails(this, options)); - } } diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index d0254562..81bdd08c 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -17,7 +17,6 @@ import { Server } from "./server.js"; import { Sessions } from "./sessions.js"; import { Statistics } from "./statistics.js"; import { Updater } from "./updater.js"; -import { User } from "./user.js"; import { Video } from "./video.js"; import { Watchlist } from "./watchlist.js"; @@ -67,6 +66,11 @@ export class PlexAPI extends ClientSDK { return (this._library ??= new Library(this.options$)); } + private _watchlist?: Watchlist; + get watchlist(): Watchlist { + return (this._watchlist ??= new Watchlist(this.options$)); + } + private _log?: Log; get log(): Log { return (this._log ??= new Log(this.options$)); @@ -96,14 +100,4 @@ export class PlexAPI extends ClientSDK { get updater(): Updater { return (this._updater ??= new Updater(this.options$)); } - - private _user?: User; - get user(): User { - return (this._user ??= new User(this.options$)); - } - - private _watchlist?: Watchlist; - get watchlist(): Watchlist { - return (this._watchlist ??= new Watchlist(this.options$)); - } } diff --git a/src/sdk/server.ts b/src/sdk/server.ts index f67d9bdd..92b72718 100644 --- a/src/sdk/server.ts +++ b/src/sdk/server.ts @@ -4,6 +4,7 @@ import { serverGetAvailableClients } from "../funcs/serverGetAvailableClients.js"; import { serverGetDevices } from "../funcs/serverGetDevices.js"; +import { serverGetMediaProviders } from "../funcs/serverGetMediaProviders.js"; import { serverGetMyPlexAccount } from "../funcs/serverGetMyPlexAccount.js"; import { serverGetResizedPhoto } from "../funcs/serverGetResizedPhoto.js"; import { serverGetServerCapabilities } from "../funcs/serverGetServerCapabilities.js"; @@ -65,7 +66,7 @@ export class Server extends ClientSDK { * Get Server Identity * * @remarks - * Get Server Identity + * This request is useful to determine if the server is online or offline */ async getServerIdentity(options?: RequestOptions): Promise { return unwrapAsync(serverGetServerIdentity(this, options)); @@ -95,6 +96,19 @@ export class Server extends ClientSDK { return unwrapAsync(serverGetResizedPhoto(this, request, options)); } + /** + * Get Media Providers + * + * @remarks + * Retrieves media providers and their features from the Plex server. + */ + async getMediaProviders( + xPlexToken: string, + options?: RequestOptions + ): Promise { + return unwrapAsync(serverGetMediaProviders(this, xPlexToken, options)); + } + /** * Get Server List * diff --git a/src/sdk/sessions.ts b/src/sdk/sessions.ts index 059d8021..b9ee68cd 100644 --- a/src/sdk/sessions.ts +++ b/src/sdk/sessions.ts @@ -30,7 +30,7 @@ export class Sessions extends ClientSDK { async getSessionHistory( sort?: string | undefined, accountId?: number | undefined, - filter?: models.Filter | undefined, + filter?: models.QueryParamFilter | undefined, librarySectionID?: number | undefined, options?: RequestOptions ): Promise { diff --git a/src/sdk/user.ts b/src/sdk/user.ts deleted file mode 100644 index 9910cd01..00000000 --- a/src/sdk/user.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { userPostUsersSigninData } from "../funcs/userPostUsersSigninData.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as models from "../models/index.js"; -import { unwrapAsync } from "../types/fp.js"; - -export class User extends ClientSDK { - /** - * Get User SignIn Data - * - * @remarks - * Sign in user with username and password and return user data with Plex authentication token - */ - async postUsersSigninData( - xPlexClientIdentifier?: string | undefined, - requestBody?: models.PostUsersSigninDataRequestBody | undefined, - options?: RequestOptions & { serverURL?: string } - ): Promise { - return unwrapAsync( - userPostUsersSigninData(this, xPlexClientIdentifier, requestBody, options) - ); - } -} diff --git a/src/sdk/watchlist.ts b/src/sdk/watchlist.ts index 99fdf517..bd3551bb 100644 --- a/src/sdk/watchlist.ts +++ b/src/sdk/watchlist.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { watchlistGetWatchlist } from "../funcs/watchlistGetWatchlist.js"; +import { watchlistGetWatchList } from "../funcs/watchlistGetWatchList.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as models from "../models/index.js"; import { unwrapAsync } from "../types/fp.js"; @@ -14,10 +14,10 @@ export class Watchlist extends ClientSDK { * @remarks * Get User Watchlist */ - async getWatchlist( - request: models.GetWatchlistRequest, + async getWatchList( + request: models.GetWatchListRequest, options?: RequestOptions & { serverURL?: string } - ): Promise { - return unwrapAsync(watchlistGetWatchlist(this, request, options)); + ): Promise { + return unwrapAsync(watchlistGetWatchList(this, request, options)); } } diff --git a/src/types/streams.ts b/src/types/streams.ts new file mode 100644 index 00000000..a0163e7a --- /dev/null +++ b/src/types/streams.ts @@ -0,0 +1,21 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +export function isReadableStream( + val: unknown, +): val is ReadableStream { + if (typeof val !== "object" || val === null) { + return false; + } + + // Check for the presence of methods specific to ReadableStream + const stream = val as ReadableStream; + + // ReadableStream has methods like getReader, cancel, and tee + return ( + typeof stream.getReader === "function" && + typeof stream.cancel === "function" && + typeof stream.tee === "function" + ); +}