mirror of
https://github.com/LukeHagar/plexjs.git
synced 2025-12-06 12:37:46 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
17d56a96d6 | ||
|
|
1d4f25475d | ||
|
|
a1f6c6f515 | ||
|
|
022d345196 | ||
|
|
6cec42bef1 | ||
|
|
eaa84306f6 | ||
|
|
45ee7680a7 | ||
|
|
8668cc2ca6 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
/hooks
|
||||||
/models
|
/models
|
||||||
/models/errors
|
/models/errors
|
||||||
/types
|
/types
|
||||||
|
|||||||
@@ -1,44 +1,46 @@
|
|||||||
lockVersion: 2.0.0
|
lockVersion: 2.0.0
|
||||||
id: 16f22cbf-f23f-4419-8924-3a4b06381947
|
id: 16f22cbf-f23f-4419-8924-3a4b06381947
|
||||||
management:
|
management:
|
||||||
docChecksum: 95d4ac4070b7f9db42126fc81b258e02
|
docChecksum: 278d186496d83d5830ba4870f8cad39d
|
||||||
docVersion: 0.0.3
|
docVersion: 0.0.3
|
||||||
speakeasyVersion: internal
|
speakeasyVersion: internal
|
||||||
generationVersion: 2.237.3
|
generationVersion: 2.269.0
|
||||||
releaseVersion: 0.5.3
|
releaseVersion: 0.8.0
|
||||||
configChecksum: 86bdd2d91c582938b3f3e2587f792c5c
|
configChecksum: ebb8bf50e4df7f6adf9363aaa49f8a39
|
||||||
repoURL: https://github.com/LukeHagar/plexjs.git
|
repoURL: https://github.com/LukeHagar/plexjs.git
|
||||||
repoSubDirectory: .
|
repoSubDirectory: .
|
||||||
installationURL: https://github.com/LukeHagar/plexjs
|
installationURL: https://github.com/LukeHagar/plexjs
|
||||||
published: true
|
published: true
|
||||||
features:
|
features:
|
||||||
typescript:
|
typescript:
|
||||||
constsAndDefaults: 0.1.1
|
constsAndDefaults: 0.1.3
|
||||||
core: 3.4.7
|
core: 3.5.1
|
||||||
flattening: 2.81.1
|
flattening: 2.81.1
|
||||||
globalSecurity: 2.82.2
|
globalSecurity: 2.82.2
|
||||||
globalServerURLs: 2.82.1
|
globalServerURLs: 2.82.3
|
||||||
|
methodServerURLs: 2.82.1
|
||||||
nameOverrides: 2.81.1
|
nameOverrides: 2.81.1
|
||||||
unions: 2.85.0
|
responseFormat: 0.1.0
|
||||||
generatedFiles:
|
generatedFiles:
|
||||||
- src/sdk/server.ts
|
- src/sdk/server.ts
|
||||||
- src/sdk/media.ts
|
- src/sdk/media.ts
|
||||||
|
- src/sdk/video.ts
|
||||||
- src/sdk/activities.ts
|
- src/sdk/activities.ts
|
||||||
- src/sdk/butler.ts
|
- src/sdk/butler.ts
|
||||||
- src/sdk/hubs.ts
|
- src/sdk/hubs.ts
|
||||||
- src/sdk/search.ts
|
- src/sdk/search.ts
|
||||||
- src/sdk/library.ts
|
- src/sdk/library.ts
|
||||||
- src/sdk/log.ts
|
- src/sdk/log.ts
|
||||||
|
- src/sdk/plex.ts
|
||||||
- src/sdk/playlists.ts
|
- src/sdk/playlists.ts
|
||||||
- src/sdk/security.ts
|
- src/sdk/security.ts
|
||||||
|
- src/sdk/statistics.ts
|
||||||
- src/sdk/sessions.ts
|
- src/sdk/sessions.ts
|
||||||
- src/sdk/updater.ts
|
- src/sdk/updater.ts
|
||||||
- src/sdk/video.ts
|
|
||||||
- src/sdk/sdk.ts
|
- src/sdk/sdk.ts
|
||||||
- .eslintrc.js
|
- .eslintrc.js
|
||||||
- .npmignore
|
- .npmignore
|
||||||
- RUNTIMES.md
|
- RUNTIMES.md
|
||||||
- package-lock.json
|
|
||||||
- package.json
|
- package.json
|
||||||
- src/index.ts
|
- src/index.ts
|
||||||
- src/lib/base64.ts
|
- src/lib/base64.ts
|
||||||
@@ -69,6 +71,8 @@ generatedFiles:
|
|||||||
- src/models/operations/markplayed.ts
|
- src/models/operations/markplayed.ts
|
||||||
- src/models/operations/markunplayed.ts
|
- src/models/operations/markunplayed.ts
|
||||||
- src/models/operations/updateplayprogress.ts
|
- src/models/operations/updateplayprogress.ts
|
||||||
|
- src/models/operations/gettimeline.ts
|
||||||
|
- src/models/operations/startuniversaltranscode.ts
|
||||||
- src/models/operations/getserveractivities.ts
|
- src/models/operations/getserveractivities.ts
|
||||||
- src/models/operations/cancelserveractivities.ts
|
- src/models/operations/cancelserveractivities.ts
|
||||||
- src/models/operations/getbutlertasks.ts
|
- src/models/operations/getbutlertasks.ts
|
||||||
@@ -95,6 +99,8 @@ generatedFiles:
|
|||||||
- src/models/operations/logline.ts
|
- src/models/operations/logline.ts
|
||||||
- src/models/operations/logmultiline.ts
|
- src/models/operations/logmultiline.ts
|
||||||
- src/models/operations/enablepapertrail.ts
|
- src/models/operations/enablepapertrail.ts
|
||||||
|
- src/models/operations/getpin.ts
|
||||||
|
- src/models/operations/gettoken.ts
|
||||||
- src/models/operations/createplaylist.ts
|
- src/models/operations/createplaylist.ts
|
||||||
- src/models/operations/getplaylists.ts
|
- src/models/operations/getplaylists.ts
|
||||||
- src/models/operations/getplaylist.ts
|
- src/models/operations/getplaylist.ts
|
||||||
@@ -106,6 +112,7 @@ generatedFiles:
|
|||||||
- src/models/operations/uploadplaylist.ts
|
- src/models/operations/uploadplaylist.ts
|
||||||
- src/models/operations/gettransienttoken.ts
|
- src/models/operations/gettransienttoken.ts
|
||||||
- src/models/operations/getsourceconnectioninformation.ts
|
- src/models/operations/getsourceconnectioninformation.ts
|
||||||
|
- src/models/operations/getstatistics.ts
|
||||||
- src/models/operations/getsessions.ts
|
- src/models/operations/getsessions.ts
|
||||||
- src/models/operations/getsessionhistory.ts
|
- src/models/operations/getsessionhistory.ts
|
||||||
- src/models/operations/gettranscodesessions.ts
|
- src/models/operations/gettranscodesessions.ts
|
||||||
@@ -113,8 +120,6 @@ generatedFiles:
|
|||||||
- src/models/operations/getupdatestatus.ts
|
- src/models/operations/getupdatestatus.ts
|
||||||
- src/models/operations/checkforupdates.ts
|
- src/models/operations/checkforupdates.ts
|
||||||
- src/models/operations/applyupdates.ts
|
- src/models/operations/applyupdates.ts
|
||||||
- src/models/operations/startuniversaltranscode.ts
|
|
||||||
- src/models/operations/gettimeline.ts
|
|
||||||
- src/models/errors/getservercapabilities.ts
|
- src/models/errors/getservercapabilities.ts
|
||||||
- src/models/errors/getserverpreferences.ts
|
- src/models/errors/getserverpreferences.ts
|
||||||
- src/models/errors/getavailableclients.ts
|
- src/models/errors/getavailableclients.ts
|
||||||
@@ -126,6 +131,8 @@ generatedFiles:
|
|||||||
- src/models/errors/markplayed.ts
|
- src/models/errors/markplayed.ts
|
||||||
- src/models/errors/markunplayed.ts
|
- src/models/errors/markunplayed.ts
|
||||||
- src/models/errors/updateplayprogress.ts
|
- src/models/errors/updateplayprogress.ts
|
||||||
|
- src/models/errors/gettimeline.ts
|
||||||
|
- src/models/errors/startuniversaltranscode.ts
|
||||||
- src/models/errors/getserveractivities.ts
|
- src/models/errors/getserveractivities.ts
|
||||||
- src/models/errors/cancelserveractivities.ts
|
- src/models/errors/cancelserveractivities.ts
|
||||||
- src/models/errors/getbutlertasks.ts
|
- src/models/errors/getbutlertasks.ts
|
||||||
@@ -150,6 +157,8 @@ generatedFiles:
|
|||||||
- src/models/errors/logline.ts
|
- src/models/errors/logline.ts
|
||||||
- src/models/errors/logmultiline.ts
|
- src/models/errors/logmultiline.ts
|
||||||
- src/models/errors/enablepapertrail.ts
|
- src/models/errors/enablepapertrail.ts
|
||||||
|
- src/models/errors/getpin.ts
|
||||||
|
- src/models/errors/gettoken.ts
|
||||||
- src/models/errors/createplaylist.ts
|
- src/models/errors/createplaylist.ts
|
||||||
- src/models/errors/getplaylists.ts
|
- src/models/errors/getplaylists.ts
|
||||||
- src/models/errors/getplaylist.ts
|
- src/models/errors/getplaylist.ts
|
||||||
@@ -161,6 +170,7 @@ generatedFiles:
|
|||||||
- src/models/errors/uploadplaylist.ts
|
- src/models/errors/uploadplaylist.ts
|
||||||
- src/models/errors/gettransienttoken.ts
|
- src/models/errors/gettransienttoken.ts
|
||||||
- src/models/errors/getsourceconnectioninformation.ts
|
- src/models/errors/getsourceconnectioninformation.ts
|
||||||
|
- src/models/errors/getstatistics.ts
|
||||||
- src/models/errors/getsessions.ts
|
- src/models/errors/getsessions.ts
|
||||||
- src/models/errors/getsessionhistory.ts
|
- src/models/errors/getsessionhistory.ts
|
||||||
- src/models/errors/gettranscodesessions.ts
|
- src/models/errors/gettranscodesessions.ts
|
||||||
@@ -168,8 +178,6 @@ generatedFiles:
|
|||||||
- src/models/errors/getupdatestatus.ts
|
- src/models/errors/getupdatestatus.ts
|
||||||
- src/models/errors/checkforupdates.ts
|
- src/models/errors/checkforupdates.ts
|
||||||
- src/models/errors/applyupdates.ts
|
- src/models/errors/applyupdates.ts
|
||||||
- src/models/errors/startuniversaltranscode.ts
|
|
||||||
- src/models/errors/gettimeline.ts
|
|
||||||
- src/models/components/security.ts
|
- src/models/components/security.ts
|
||||||
- src/models/errors/index.ts
|
- src/models/errors/index.ts
|
||||||
- src/models/operations/index.ts
|
- src/models/operations/index.ts
|
||||||
@@ -178,8 +186,6 @@ generatedFiles:
|
|||||||
- docs/models/operations/mediacontainer.md
|
- docs/models/operations/mediacontainer.md
|
||||||
- docs/models/operations/getservercapabilitiesresponsebody.md
|
- docs/models/operations/getservercapabilitiesresponsebody.md
|
||||||
- docs/models/operations/getservercapabilitiesresponse.md
|
- docs/models/operations/getservercapabilitiesresponse.md
|
||||||
- docs/models/operations/two.md
|
|
||||||
- docs/models/operations/one.md
|
|
||||||
- docs/models/operations/setting.md
|
- docs/models/operations/setting.md
|
||||||
- docs/models/operations/getserverpreferencesmediacontainer.md
|
- docs/models/operations/getserverpreferencesmediacontainer.md
|
||||||
- docs/models/operations/getserverpreferencesresponsebody.md
|
- docs/models/operations/getserverpreferencesresponsebody.md
|
||||||
@@ -212,6 +218,11 @@ generatedFiles:
|
|||||||
- docs/models/operations/markunplayedresponse.md
|
- docs/models/operations/markunplayedresponse.md
|
||||||
- docs/models/operations/updateplayprogressrequest.md
|
- docs/models/operations/updateplayprogressrequest.md
|
||||||
- docs/models/operations/updateplayprogressresponse.md
|
- docs/models/operations/updateplayprogressresponse.md
|
||||||
|
- docs/models/operations/state.md
|
||||||
|
- docs/models/operations/gettimelinerequest.md
|
||||||
|
- docs/models/operations/gettimelineresponse.md
|
||||||
|
- docs/models/operations/startuniversaltranscoderequest.md
|
||||||
|
- docs/models/operations/startuniversaltranscoderesponse.md
|
||||||
- docs/models/operations/context.md
|
- docs/models/operations/context.md
|
||||||
- docs/models/operations/activity.md
|
- docs/models/operations/activity.md
|
||||||
- docs/models/operations/getserveractivitiesmediacontainer.md
|
- docs/models/operations/getserveractivitiesmediacontainer.md
|
||||||
@@ -283,7 +294,7 @@ generatedFiles:
|
|||||||
- docs/models/operations/getrecentlyaddedmediacontainer.md
|
- docs/models/operations/getrecentlyaddedmediacontainer.md
|
||||||
- docs/models/operations/getrecentlyaddedresponsebody.md
|
- docs/models/operations/getrecentlyaddedresponsebody.md
|
||||||
- docs/models/operations/getrecentlyaddedresponse.md
|
- docs/models/operations/getrecentlyaddedresponse.md
|
||||||
- docs/models/operations/location.md
|
- docs/models/operations/getlibrarieslocation.md
|
||||||
- docs/models/operations/getlibrariesdirectory.md
|
- docs/models/operations/getlibrariesdirectory.md
|
||||||
- docs/models/operations/getlibrariesmediacontainer.md
|
- docs/models/operations/getlibrariesmediacontainer.md
|
||||||
- docs/models/operations/getlibrariesresponsebody.md
|
- docs/models/operations/getlibrariesresponsebody.md
|
||||||
@@ -317,7 +328,7 @@ generatedFiles:
|
|||||||
- docs/models/operations/getlibraryitemsresponse.md
|
- docs/models/operations/getlibraryitemsresponse.md
|
||||||
- docs/models/operations/refreshlibraryrequest.md
|
- docs/models/operations/refreshlibraryrequest.md
|
||||||
- docs/models/operations/refreshlibraryresponse.md
|
- docs/models/operations/refreshlibraryresponse.md
|
||||||
- docs/models/operations/typet.md
|
- docs/models/operations/type.md
|
||||||
- docs/models/operations/searchlibraryrequest.md
|
- docs/models/operations/searchlibraryrequest.md
|
||||||
- docs/models/operations/searchlibrarymetadata.md
|
- docs/models/operations/searchlibrarymetadata.md
|
||||||
- docs/models/operations/searchlibrarymediacontainer.md
|
- docs/models/operations/searchlibrarymediacontainer.md
|
||||||
@@ -358,6 +369,12 @@ generatedFiles:
|
|||||||
- docs/models/operations/loglineresponse.md
|
- docs/models/operations/loglineresponse.md
|
||||||
- docs/models/operations/logmultilineresponse.md
|
- docs/models/operations/logmultilineresponse.md
|
||||||
- docs/models/operations/enablepapertrailresponse.md
|
- docs/models/operations/enablepapertrailresponse.md
|
||||||
|
- docs/models/operations/getpinrequest.md
|
||||||
|
- docs/models/operations/location.md
|
||||||
|
- docs/models/operations/getpinresponsebody.md
|
||||||
|
- docs/models/operations/getpinresponse.md
|
||||||
|
- docs/models/operations/gettokenrequest.md
|
||||||
|
- docs/models/operations/gettokenresponse.md
|
||||||
- docs/models/operations/queryparamtype.md
|
- docs/models/operations/queryparamtype.md
|
||||||
- docs/models/operations/smart.md
|
- docs/models/operations/smart.md
|
||||||
- docs/models/operations/createplaylistrequest.md
|
- docs/models/operations/createplaylistrequest.md
|
||||||
@@ -409,6 +426,13 @@ generatedFiles:
|
|||||||
- docs/models/operations/gettransienttokenresponse.md
|
- docs/models/operations/gettransienttokenresponse.md
|
||||||
- docs/models/operations/getsourceconnectioninformationrequest.md
|
- docs/models/operations/getsourceconnectioninformationrequest.md
|
||||||
- docs/models/operations/getsourceconnectioninformationresponse.md
|
- docs/models/operations/getsourceconnectioninformationresponse.md
|
||||||
|
- docs/models/operations/getstatisticsrequest.md
|
||||||
|
- docs/models/operations/getstatisticsdevice.md
|
||||||
|
- docs/models/operations/account.md
|
||||||
|
- docs/models/operations/statisticsmedia.md
|
||||||
|
- docs/models/operations/getstatisticsmediacontainer.md
|
||||||
|
- docs/models/operations/getstatisticsresponsebody.md
|
||||||
|
- docs/models/operations/getstatisticsresponse.md
|
||||||
- docs/models/operations/getsessionsstream.md
|
- docs/models/operations/getsessionsstream.md
|
||||||
- docs/models/operations/getsessionspart.md
|
- docs/models/operations/getsessionspart.md
|
||||||
- docs/models/operations/getsessionsmedia.md
|
- docs/models/operations/getsessionsmedia.md
|
||||||
@@ -440,11 +464,6 @@ generatedFiles:
|
|||||||
- docs/models/operations/skip.md
|
- docs/models/operations/skip.md
|
||||||
- docs/models/operations/applyupdatesrequest.md
|
- docs/models/operations/applyupdatesrequest.md
|
||||||
- docs/models/operations/applyupdatesresponse.md
|
- docs/models/operations/applyupdatesresponse.md
|
||||||
- docs/models/operations/startuniversaltranscoderequest.md
|
|
||||||
- docs/models/operations/startuniversaltranscoderesponse.md
|
|
||||||
- docs/models/operations/state.md
|
|
||||||
- docs/models/operations/gettimelinerequest.md
|
|
||||||
- docs/models/operations/gettimelineresponse.md
|
|
||||||
- docs/models/errors/errors.md
|
- docs/models/errors/errors.md
|
||||||
- docs/models/errors/getservercapabilitiesresponsebody.md
|
- docs/models/errors/getservercapabilitiesresponsebody.md
|
||||||
- docs/models/errors/getserverpreferenceserrors.md
|
- docs/models/errors/getserverpreferenceserrors.md
|
||||||
@@ -467,6 +486,10 @@ generatedFiles:
|
|||||||
- docs/models/errors/markunplayedresponsebody.md
|
- docs/models/errors/markunplayedresponsebody.md
|
||||||
- docs/models/errors/updateplayprogresserrors.md
|
- docs/models/errors/updateplayprogresserrors.md
|
||||||
- docs/models/errors/updateplayprogressresponsebody.md
|
- docs/models/errors/updateplayprogressresponsebody.md
|
||||||
|
- docs/models/errors/gettimelineerrors.md
|
||||||
|
- docs/models/errors/gettimelineresponsebody.md
|
||||||
|
- docs/models/errors/startuniversaltranscodeerrors.md
|
||||||
|
- docs/models/errors/startuniversaltranscoderesponsebody.md
|
||||||
- docs/models/errors/getserveractivitieserrors.md
|
- docs/models/errors/getserveractivitieserrors.md
|
||||||
- docs/models/errors/getserveractivitiesresponsebody.md
|
- docs/models/errors/getserveractivitiesresponsebody.md
|
||||||
- docs/models/errors/cancelserveractivitieserrors.md
|
- docs/models/errors/cancelserveractivitieserrors.md
|
||||||
@@ -515,6 +538,10 @@ generatedFiles:
|
|||||||
- docs/models/errors/logmultilineresponsebody.md
|
- docs/models/errors/logmultilineresponsebody.md
|
||||||
- docs/models/errors/enablepapertrailerrors.md
|
- docs/models/errors/enablepapertrailerrors.md
|
||||||
- docs/models/errors/enablepapertrailresponsebody.md
|
- docs/models/errors/enablepapertrailresponsebody.md
|
||||||
|
- docs/models/errors/getpinerrors.md
|
||||||
|
- docs/models/errors/getpinresponsebody.md
|
||||||
|
- docs/models/errors/gettokenerrors.md
|
||||||
|
- docs/models/errors/gettokenresponsebody.md
|
||||||
- docs/models/errors/createplaylisterrors.md
|
- docs/models/errors/createplaylisterrors.md
|
||||||
- docs/models/errors/createplaylistresponsebody.md
|
- docs/models/errors/createplaylistresponsebody.md
|
||||||
- docs/models/errors/getplaylistserrors.md
|
- docs/models/errors/getplaylistserrors.md
|
||||||
@@ -537,6 +564,8 @@ generatedFiles:
|
|||||||
- docs/models/errors/gettransienttokenresponsebody.md
|
- docs/models/errors/gettransienttokenresponsebody.md
|
||||||
- docs/models/errors/getsourceconnectioninformationerrors.md
|
- docs/models/errors/getsourceconnectioninformationerrors.md
|
||||||
- docs/models/errors/getsourceconnectioninformationresponsebody.md
|
- docs/models/errors/getsourceconnectioninformationresponsebody.md
|
||||||
|
- docs/models/errors/getstatisticserrors.md
|
||||||
|
- docs/models/errors/getstatisticsresponsebody.md
|
||||||
- docs/models/errors/getsessionserrors.md
|
- docs/models/errors/getsessionserrors.md
|
||||||
- docs/models/errors/getsessionsresponsebody.md
|
- docs/models/errors/getsessionsresponsebody.md
|
||||||
- docs/models/errors/getsessionhistoryerrors.md
|
- docs/models/errors/getsessionhistoryerrors.md
|
||||||
@@ -551,24 +580,25 @@ generatedFiles:
|
|||||||
- docs/models/errors/checkforupdatesresponsebody.md
|
- docs/models/errors/checkforupdatesresponsebody.md
|
||||||
- docs/models/errors/applyupdateserrors.md
|
- docs/models/errors/applyupdateserrors.md
|
||||||
- docs/models/errors/applyupdatesresponsebody.md
|
- docs/models/errors/applyupdatesresponsebody.md
|
||||||
- docs/models/errors/startuniversaltranscodeerrors.md
|
|
||||||
- docs/models/errors/startuniversaltranscoderesponsebody.md
|
|
||||||
- docs/models/errors/gettimelineerrors.md
|
|
||||||
- docs/models/errors/gettimelineresponsebody.md
|
|
||||||
- docs/models/components/security.md
|
- docs/models/components/security.md
|
||||||
- docs/sdks/plexapi/README.md
|
- docs/sdks/plexapi/README.md
|
||||||
- docs/sdks/server/README.md
|
- docs/sdks/server/README.md
|
||||||
- docs/sdks/media/README.md
|
- docs/sdks/media/README.md
|
||||||
|
- docs/sdks/video/README.md
|
||||||
- docs/sdks/activities/README.md
|
- docs/sdks/activities/README.md
|
||||||
- docs/sdks/butler/README.md
|
- docs/sdks/butler/README.md
|
||||||
- docs/sdks/hubs/README.md
|
- docs/sdks/hubs/README.md
|
||||||
- docs/sdks/search/README.md
|
- docs/sdks/search/README.md
|
||||||
- docs/sdks/library/README.md
|
- docs/sdks/library/README.md
|
||||||
- docs/sdks/log/README.md
|
- docs/sdks/log/README.md
|
||||||
|
- docs/sdks/plex/README.md
|
||||||
- docs/sdks/playlists/README.md
|
- docs/sdks/playlists/README.md
|
||||||
- docs/sdks/security/README.md
|
- docs/sdks/security/README.md
|
||||||
|
- docs/sdks/statistics/README.md
|
||||||
- docs/sdks/sessions/README.md
|
- docs/sdks/sessions/README.md
|
||||||
- docs/sdks/updater/README.md
|
- docs/sdks/updater/README.md
|
||||||
- docs/sdks/video/README.md
|
|
||||||
- USAGE.md
|
- USAGE.md
|
||||||
- .gitattributes
|
- .gitattributes
|
||||||
|
- src/hooks/hooks.ts
|
||||||
|
- src/hooks/types.ts
|
||||||
|
- src/hooks/index.ts
|
||||||
|
|||||||
46
README.md
46
README.md
@@ -67,6 +67,11 @@ run();
|
|||||||
* [markUnplayed](docs/sdks/media/README.md#markunplayed) - Mark Media Unplayed
|
* [markUnplayed](docs/sdks/media/README.md#markunplayed) - Mark Media Unplayed
|
||||||
* [updatePlayProgress](docs/sdks/media/README.md#updateplayprogress) - Update Media Play Progress
|
* [updatePlayProgress](docs/sdks/media/README.md#updateplayprogress) - Update Media Play Progress
|
||||||
|
|
||||||
|
### [video](docs/sdks/video/README.md)
|
||||||
|
|
||||||
|
* [getTimeline](docs/sdks/video/README.md#gettimeline) - Get the timeline for a media item
|
||||||
|
* [startUniversalTranscode](docs/sdks/video/README.md#startuniversaltranscode) - Start Universal Transcode
|
||||||
|
|
||||||
### [activities](docs/sdks/activities/README.md)
|
### [activities](docs/sdks/activities/README.md)
|
||||||
|
|
||||||
* [getServerActivities](docs/sdks/activities/README.md#getserveractivities) - Get Server Activities
|
* [getServerActivities](docs/sdks/activities/README.md#getserveractivities) - Get Server Activities
|
||||||
@@ -111,6 +116,11 @@ run();
|
|||||||
* [logMultiLine](docs/sdks/log/README.md#logmultiline) - Logging a multi-line message
|
* [logMultiLine](docs/sdks/log/README.md#logmultiline) - Logging a multi-line message
|
||||||
* [enablePaperTrail](docs/sdks/log/README.md#enablepapertrail) - Enabling Papertrail
|
* [enablePaperTrail](docs/sdks/log/README.md#enablepapertrail) - Enabling Papertrail
|
||||||
|
|
||||||
|
### [plex](docs/sdks/plex/README.md)
|
||||||
|
|
||||||
|
* [getPin](docs/sdks/plex/README.md#getpin) - Get a Pin
|
||||||
|
* [getToken](docs/sdks/plex/README.md#gettoken) - Get Access Token
|
||||||
|
|
||||||
### [playlists](docs/sdks/playlists/README.md)
|
### [playlists](docs/sdks/playlists/README.md)
|
||||||
|
|
||||||
* [createPlaylist](docs/sdks/playlists/README.md#createplaylist) - Create a Playlist
|
* [createPlaylist](docs/sdks/playlists/README.md#createplaylist) - Create a Playlist
|
||||||
@@ -128,6 +138,10 @@ run();
|
|||||||
* [getTransientToken](docs/sdks/security/README.md#gettransienttoken) - Get a Transient Token.
|
* [getTransientToken](docs/sdks/security/README.md#gettransienttoken) - Get a Transient Token.
|
||||||
* [getSourceConnectionInformation](docs/sdks/security/README.md#getsourceconnectioninformation) - Get Source Connection Information
|
* [getSourceConnectionInformation](docs/sdks/security/README.md#getsourceconnectioninformation) - Get Source Connection Information
|
||||||
|
|
||||||
|
### [statistics](docs/sdks/statistics/README.md)
|
||||||
|
|
||||||
|
* [getStatistics](docs/sdks/statistics/README.md#getstatistics) - Get Media Statistics
|
||||||
|
|
||||||
### [sessions](docs/sdks/sessions/README.md)
|
### [sessions](docs/sdks/sessions/README.md)
|
||||||
|
|
||||||
* [getSessions](docs/sdks/sessions/README.md#getsessions) - Get Active Sessions
|
* [getSessions](docs/sdks/sessions/README.md#getsessions) - Get Active Sessions
|
||||||
@@ -140,11 +154,6 @@ run();
|
|||||||
* [getUpdateStatus](docs/sdks/updater/README.md#getupdatestatus) - Querying status of updates
|
* [getUpdateStatus](docs/sdks/updater/README.md#getupdatestatus) - Querying status of updates
|
||||||
* [checkForUpdates](docs/sdks/updater/README.md#checkforupdates) - Checking for updates
|
* [checkForUpdates](docs/sdks/updater/README.md#checkforupdates) - Checking for updates
|
||||||
* [applyUpdates](docs/sdks/updater/README.md#applyupdates) - Apply Updates
|
* [applyUpdates](docs/sdks/updater/README.md#applyupdates) - Apply Updates
|
||||||
|
|
||||||
### [video](docs/sdks/video/README.md)
|
|
||||||
|
|
||||||
* [startUniversalTranscode](docs/sdks/video/README.md#startuniversaltranscode) - Start Universal Transcode
|
|
||||||
* [getTimeline](docs/sdks/video/README.md#gettimeline) - Get the timeline for a media item
|
|
||||||
<!-- End Available Resources and Operations [operations] -->
|
<!-- End Available Resources and Operations [operations] -->
|
||||||
|
|
||||||
<!-- Start Error Handling [errors] -->
|
<!-- Start Error Handling [errors] -->
|
||||||
@@ -161,7 +170,6 @@ Example
|
|||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { PlexAPI } from "@lukehagar/plexjs";
|
import { PlexAPI } from "@lukehagar/plexjs";
|
||||||
import * as errors from "@lukehagar/plexjs/models/errors";
|
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
const sdk = new PlexAPI({
|
const sdk = new PlexAPI({
|
||||||
@@ -250,6 +258,32 @@ async function run() {
|
|||||||
|
|
||||||
run();
|
run();
|
||||||
|
|
||||||
|
```
|
||||||
|
### Override Server URL Per-Operation
|
||||||
|
|
||||||
|
The server URL can also be overridden on a per-operation basis, provided a server list was specified for the operation. For example:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { PlexAPI } from "@lukehagar/plexjs";
|
||||||
|
|
||||||
|
async function run() {
|
||||||
|
const sdk = new PlexAPI({
|
||||||
|
accessToken: "<YOUR_API_KEY_HERE>",
|
||||||
|
});
|
||||||
|
|
||||||
|
const xPlexClientIdentifier = "<value>";
|
||||||
|
const strong = false;
|
||||||
|
|
||||||
|
const result = await sdk.plex.getPin(xPlexClientIdentifier, strong, {
|
||||||
|
serverURL: "https://plex.tv/api/v2",
|
||||||
|
});
|
||||||
|
|
||||||
|
// Handle the result
|
||||||
|
console.log(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
run();
|
||||||
|
|
||||||
```
|
```
|
||||||
<!-- End Server Selection [server] -->
|
<!-- End Server Selection [server] -->
|
||||||
|
|
||||||
|
|||||||
40
RELEASES.md
40
RELEASES.md
@@ -149,3 +149,43 @@ Based on:
|
|||||||
- [typescript v0.5.3] .
|
- [typescript v0.5.3] .
|
||||||
### Releases
|
### Releases
|
||||||
- [NPM v0.5.3] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.5.3 - .
|
- [NPM v0.5.3] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.5.3 - .
|
||||||
|
|
||||||
|
## 2024-01-31 15:05:58
|
||||||
|
### Changes
|
||||||
|
Based on:
|
||||||
|
- OpenAPI Doc 0.0.3
|
||||||
|
- Speakeasy CLI 1.158.0 (2.239.4) https://github.com/speakeasy-api/speakeasy
|
||||||
|
### Generated
|
||||||
|
- [typescript v0.6.0] .
|
||||||
|
### Releases
|
||||||
|
- [NPM v0.6.0] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.6.0 - .
|
||||||
|
|
||||||
|
## 2024-02-01 00:27:20
|
||||||
|
### Changes
|
||||||
|
Based on:
|
||||||
|
- OpenAPI Doc 0.0.3
|
||||||
|
- Speakeasy CLI 1.161.0 (2.245.1) https://github.com/speakeasy-api/speakeasy
|
||||||
|
### Generated
|
||||||
|
- [typescript v0.6.1] .
|
||||||
|
### Releases
|
||||||
|
- [NPM v0.6.1] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.6.1 - .
|
||||||
|
|
||||||
|
## 2024-02-05 14:23:50
|
||||||
|
### Changes
|
||||||
|
Based on:
|
||||||
|
- OpenAPI Doc 0.0.3
|
||||||
|
- Speakeasy CLI 1.166.1 (2.249.1) https://github.com/speakeasy-api/speakeasy
|
||||||
|
### Generated
|
||||||
|
- [typescript v0.7.0] .
|
||||||
|
### Releases
|
||||||
|
- [NPM v0.7.0] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.7.0 - .
|
||||||
|
|
||||||
|
## 2024-02-23 14:46:22
|
||||||
|
### Changes
|
||||||
|
Based on:
|
||||||
|
- OpenAPI Doc 0.0.3
|
||||||
|
- Speakeasy CLI 1.193.0 (2.269.0) https://github.com/speakeasy-api/speakeasy
|
||||||
|
### Generated
|
||||||
|
- [typescript v0.8.0] .
|
||||||
|
### Releases
|
||||||
|
- [NPM v0.8.0] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.8.0 - .
|
||||||
10
docs/models/errors/getpinerrors.md
Normal file
10
docs/models/errors/getpinerrors.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# GetPinErrors
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
|
||||||
|
| `code` | *number* | :heavy_minus_sign: | N/A | 1000 |
|
||||||
|
| `message` | *string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing |
|
||||||
|
| `status` | *number* | :heavy_minus_sign: | N/A | 400 |
|
||||||
11
docs/models/errors/getpinresponsebody.md
Normal file
11
docs/models/errors/getpinresponsebody.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GetPinResponseBody
|
||||||
|
|
||||||
|
X-Plex-Client-Identifier is missing
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
|
||||||
|
| `errors` | [errors.GetPinErrors](../../models/errors/getpinerrors.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 |
|
||||||
10
docs/models/errors/getstatisticserrors.md
Normal file
10
docs/models/errors/getstatisticserrors.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# GetStatisticsErrors
|
||||||
|
|
||||||
|
|
||||||
|
## 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 |
|
||||||
11
docs/models/errors/getstatisticsresponsebody.md
Normal file
11
docs/models/errors/getstatisticsresponsebody.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GetStatisticsResponseBody
|
||||||
|
|
||||||
|
Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
|
||||||
|
| `errors` | [errors.GetStatisticsErrors](../../models/errors/getstatisticserrors.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 |
|
||||||
10
docs/models/errors/gettokenerrors.md
Normal file
10
docs/models/errors/gettokenerrors.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# GetTokenErrors
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
|
||||||
|
| `code` | *number* | :heavy_minus_sign: | N/A | 1000 |
|
||||||
|
| `message` | *string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing |
|
||||||
|
| `status` | *number* | :heavy_minus_sign: | N/A | 400 |
|
||||||
11
docs/models/errors/gettokenresponsebody.md
Normal file
11
docs/models/errors/gettokenresponsebody.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GetTokenResponseBody
|
||||||
|
|
||||||
|
X-Plex-Client-Identifier is missing
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
|
||||||
|
| `errors` | [errors.GetTokenErrors](../../models/errors/gettokenerrors.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 |
|
||||||
15
docs/models/operations/account.md
Normal file
15
docs/models/operations/account.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# Account
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
|
||||||
|
| `id` | *number* | :heavy_minus_sign: | N/A | 238960586 |
|
||||||
|
| `key` | *string* | :heavy_minus_sign: | N/A | /accounts/238960586 |
|
||||||
|
| `name` | *string* | :heavy_minus_sign: | N/A | Diane |
|
||||||
|
| `defaultAudioLanguage` | *string* | :heavy_minus_sign: | N/A | en |
|
||||||
|
| `autoSelectAudio` | *boolean* | :heavy_minus_sign: | N/A | true |
|
||||||
|
| `defaultSubtitleLanguage` | *string* | :heavy_minus_sign: | N/A | en |
|
||||||
|
| `subtitleMode` | *number* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `thumb` | *string* | :heavy_minus_sign: | N/A | https://plex.tv/users/50d83634246da1de/avatar?c=1707110967 |
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
|
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
|
||||||
| `allowSync` | *boolean* | :heavy_minus_sign: | N/A | true |
|
| `allowSync` | *boolean* | :heavy_minus_sign: | N/A | true |
|
||||||
| `art` | *string* | :heavy_minus_sign: | N/A | /:/resources/movie-fanart.jpg |
|
| `art` | *string* | :heavy_minus_sign: | N/A | /:/resources/movie-fanart.jpg |
|
||||||
| `composite` | *string* | :heavy_minus_sign: | N/A | /library/sections/1/composite/1705615584 |
|
| `composite` | *string* | :heavy_minus_sign: | N/A | /library/sections/1/composite/1705615584 |
|
||||||
@@ -25,4 +25,4 @@
|
|||||||
| `directory` | *boolean* | :heavy_minus_sign: | N/A | true |
|
| `directory` | *boolean* | :heavy_minus_sign: | N/A | true |
|
||||||
| `contentChangedAt` | *number* | :heavy_minus_sign: | N/A | 3192854 |
|
| `contentChangedAt` | *number* | :heavy_minus_sign: | N/A | 3192854 |
|
||||||
| `hidden` | *number* | :heavy_minus_sign: | N/A | 0 |
|
| `hidden` | *number* | :heavy_minus_sign: | N/A | 0 |
|
||||||
| `location` | [operations.Location](../../models/operations/location.md)[] | :heavy_minus_sign: | N/A | [{"id":1,"path":"/movies"}] |
|
| `location` | [operations.GetLibrariesLocation](../../models/operations/getlibrarieslocation.md)[] | :heavy_minus_sign: | N/A | [{"id":1,"path":"/movies"}] |
|
||||||
9
docs/models/operations/getlibrarieslocation.md
Normal file
9
docs/models/operations/getlibrarieslocation.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# GetLibrariesLocation
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
|
| `id` | *number* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `path` | *string* | :heavy_minus_sign: | N/A | /movies |
|
||||||
9
docs/models/operations/getpinrequest.md
Normal file
9
docs/models/operations/getpinrequest.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# GetPinRequest
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `xPlexClientIdentifier` | *string* | :heavy_check_mark: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> |
|
||||||
|
| `strong` | *boolean* | :heavy_minus_sign: | Determines the kind of code returned by the API call<br/>Strong codes are used for Pin authentication flows<br/>Non-Strong codes are used for `Plex.tv/link`<br/> |
|
||||||
11
docs/models/operations/getpinresponse.md
Normal file
11
docs/models/operations/getpinresponse.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GetPinResponse
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
|
||||||
|
| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||||
|
| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||||
|
| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||||
|
| `object` | [operations.GetPinResponseBody](../../models/operations/getpinresponsebody.md) | :heavy_minus_sign: | The Pin |
|
||||||
21
docs/models/operations/getpinresponsebody.md
Normal file
21
docs/models/operations/getpinresponsebody.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# GetPinResponseBody
|
||||||
|
|
||||||
|
The Pin
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `id` | *number* | :heavy_minus_sign: | PinID for use with authentication | 1272322473 |
|
||||||
|
| `code` | *string* | :heavy_minus_sign: | N/A | 3patfx1a78ukcbr7x0n9bl26t |
|
||||||
|
| `product` | *string* | :heavy_minus_sign: | N/A | Plex Web |
|
||||||
|
| `trusted` | *boolean* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `qr` | *string* | :heavy_minus_sign: | a link to a QR code hosted on plex.tv <br/>The QR code redirects to the relevant `plex.tv/link` authentication page<br/>Which then prompts the user for the 4 Digit Link Pin<br/> | https://plex.tv/api/v2/pins/qr/3patfx1a78ukcbr7x0n9bl26t |
|
||||||
|
| `clientIdentifier` | *string* | :heavy_minus_sign: | N/A | Postman |
|
||||||
|
| `location` | [operations.Location](../../models/operations/location.md) | :heavy_minus_sign: | N/A | |
|
||||||
|
| `expiresIn` | *number* | :heavy_minus_sign: | N/A | 1800 |
|
||||||
|
| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A | 2023-04-12 17:00:03 +0000 UTC |
|
||||||
|
| `expiresAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A | 2023-04-12 17:30:03 +0000 UTC |
|
||||||
|
| `authToken` | *string* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `newRegistration` | *string* | :heavy_minus_sign: | N/A | |
|
||||||
@@ -4,6 +4,6 @@
|
|||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `size` | *number* | :heavy_minus_sign: | N/A | 161 |
|
| `size` | *number* | :heavy_minus_sign: | N/A | 161 |
|
||||||
| `setting` | *operations.Setting*[] | :heavy_minus_sign: | N/A | [{"advanced":false,"default":"","group":"general","hidden":false,"id":"FriendlyName","label":"Friendly name","summary":"This name will be used to identify this media server to other computers on your network. If you leave it blank, your computer's name will be used instead.","type":"text","value":"Hera"},{"advanced":false,"default":3600,"enumValues":"900:every 15 minutes\|1800:every 30 minutes\|3600:hourly\|7200:every 2 hours\|21600:every 6 hours\|43200:every 12 hours\|86400:daily","group":"library","hidden":false,"id":"ScheduledLibraryUpdateInterval","label":"Library scan interval","summary":"","type":"int","value":3600}] |
|
| `setting` | [operations.Setting](../../models/operations/setting.md)[] | :heavy_minus_sign: | N/A | [{"advanced":false,"default":false,"enumValues":"1:admin only\|2:everyone","group":"","hidden":true,"id":"EnableDatabaseTrace","label":"","summary":"","type":"bool","value":false}] |
|
||||||
12
docs/models/operations/getstatisticsdevice.md
Normal file
12
docs/models/operations/getstatisticsdevice.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# GetStatisticsDevice
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- |
|
||||||
|
| `id` | *number* | :heavy_minus_sign: | N/A | 208 |
|
||||||
|
| `name` | *string* | :heavy_minus_sign: | N/A | Roku Express |
|
||||||
|
| `platform` | *string* | :heavy_minus_sign: | N/A | Roku |
|
||||||
|
| `clientIdentifier` | *string* | :heavy_minus_sign: | N/A | 793095d235660625108ef785cc7646e9 |
|
||||||
|
| `createdAt` | *number* | :heavy_minus_sign: | N/A | 1706470556 |
|
||||||
@@ -1,17 +1,11 @@
|
|||||||
# Two
|
# GetStatisticsMediaContainer
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `id` | *string* | :heavy_minus_sign: | N/A | ScheduledLibraryUpdateInterval |
|
| `size` | *number* | :heavy_minus_sign: | N/A | 5497 |
|
||||||
| `label` | *string* | :heavy_minus_sign: | N/A | Library scan interval |
|
| `device` | [operations.GetStatisticsDevice](../../models/operations/getstatisticsdevice.md)[] | :heavy_minus_sign: | N/A | [{"clientIdentifier":"793095d235660625108ef785cc7646e9","createdAt":1706470556,"id":208,"name":"Roku Express","platform":"Roku"}] |
|
||||||
| `summary` | *string* | :heavy_minus_sign: | N/A | |
|
| `account` | [operations.Account](../../models/operations/account.md)[] | :heavy_minus_sign: | N/A | [{"autoSelectAudio":true,"defaultAudioLanguage":"en","defaultSubtitleLanguage":"en","id":238960586,"key":"/accounts/238960586","name":"Diane","subtitleMode":1,"thumb":"https://plex.tv/users/50d83634246da1de/avatar?c=1707110967"}] |
|
||||||
| `type` | *string* | :heavy_minus_sign: | N/A | int |
|
| `statisticsMedia` | [operations.StatisticsMedia](../../models/operations/statisticsmedia.md)[] | :heavy_minus_sign: | N/A | [{"accountID":1,"at":1707141600,"count":1,"deviceID":13,"duration":1555,"metadataType":4,"timespan":4}] |
|
||||||
| `default` | *number* | :heavy_minus_sign: | N/A | 3600 |
|
|
||||||
| `value` | *number* | :heavy_minus_sign: | N/A | 3600 |
|
|
||||||
| `hidden` | *boolean* | :heavy_minus_sign: | N/A | false |
|
|
||||||
| `advanced` | *boolean* | :heavy_minus_sign: | N/A | false |
|
|
||||||
| `group` | *string* | :heavy_minus_sign: | N/A | library |
|
|
||||||
| `enumValues` | *string* | :heavy_minus_sign: | N/A | 900:every 15 minutes\|1800:every 30 minutes\|3600:hourly\|7200:every 2 hours\|21600:every 6 hours\|43200:every 12 hours\|86400:daily |
|
|
||||||
8
docs/models/operations/getstatisticsrequest.md
Normal file
8
docs/models/operations/getstatisticsrequest.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# GetStatisticsRequest
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
||||||
|
| `timespan` | *number* | :heavy_minus_sign: | The timespan to retrieve statistics for<br/>the exact meaning of this parameter is not known<br/> |
|
||||||
11
docs/models/operations/getstatisticsresponse.md
Normal file
11
docs/models/operations/getstatisticsresponse.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# GetStatisticsResponse
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
||||||
|
| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
|
||||||
|
| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation |
|
||||||
|
| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
|
||||||
|
| `object` | [operations.GetStatisticsResponseBody](../../models/operations/getstatisticsresponsebody.md) | :heavy_minus_sign: | Media Statistics |
|
||||||
10
docs/models/operations/getstatisticsresponsebody.md
Normal file
10
docs/models/operations/getstatisticsresponsebody.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# GetStatisticsResponseBody
|
||||||
|
|
||||||
|
Media Statistics
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
||||||
|
| `mediaContainer` | [operations.GetStatisticsMediaContainer](../../models/operations/getstatisticsmediacontainer.md) | :heavy_minus_sign: | N/A |
|
||||||
9
docs/models/operations/gettokenrequest.md
Normal file
9
docs/models/operations/gettokenrequest.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# GetTokenRequest
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `pinID` | *string* | :heavy_check_mark: | The PinID to retrieve an access token for |
|
||||||
|
| `xPlexClientIdentifier` | *string* | :heavy_check_mark: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> |
|
||||||
10
docs/models/operations/gettokenresponse.md
Normal file
10
docs/models/operations/gettokenresponse.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# GetTokenResponse
|
||||||
|
|
||||||
|
|
||||||
|
## 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 |
|
||||||
@@ -4,6 +4,14 @@
|
|||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- |
|
||||||
| `id` | *number* | :heavy_minus_sign: | N/A | 1 |
|
| `code` | *string* | :heavy_minus_sign: | N/A | US |
|
||||||
| `path` | *string* | :heavy_minus_sign: | N/A | /movies |
|
| `europeanUnionMember` | *boolean* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `continentCode` | *string* | :heavy_minus_sign: | N/A | NA |
|
||||||
|
| `country` | *string* | :heavy_minus_sign: | N/A | United States |
|
||||||
|
| `city` | *string* | :heavy_minus_sign: | N/A | Austin |
|
||||||
|
| `timeZone` | *string* | :heavy_minus_sign: | N/A | America/Chicago |
|
||||||
|
| `postalCode` | *number* | :heavy_minus_sign: | N/A | 78732 |
|
||||||
|
| `inPrivacyRestrictedCountry` | *boolean* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `subdivisions` | *string* | :heavy_minus_sign: | N/A | Texas |
|
||||||
|
| `coordinates` | *string* | :heavy_minus_sign: | N/A | 30.3768 -97.8935 |
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
# One
|
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
|
||||||
|
|
||||||
| Field | Type | Required | Description | Example |
|
|
||||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
||||||
| `id` | *string* | :heavy_minus_sign: | N/A | FriendlyName |
|
|
||||||
| `label` | *string* | :heavy_minus_sign: | N/A | Friendly name |
|
|
||||||
| `summary` | *string* | :heavy_minus_sign: | N/A | This name will be used to identify this media server to other computers on your network. If you leave it blank, your computer's name will be used instead. |
|
|
||||||
| `type` | *string* | :heavy_minus_sign: | N/A | text |
|
|
||||||
| `default` | *string* | :heavy_minus_sign: | N/A | |
|
|
||||||
| `value` | *string* | :heavy_minus_sign: | N/A | Hera |
|
|
||||||
| `hidden` | *boolean* | :heavy_minus_sign: | N/A | false |
|
|
||||||
| `advanced` | *boolean* | :heavy_minus_sign: | N/A | false |
|
|
||||||
| `group` | *string* | :heavy_minus_sign: | N/A | general |
|
|
||||||
@@ -4,6 +4,6 @@
|
|||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
|
| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- |
|
||||||
| `sectionId` | *number* | :heavy_check_mark: | the Id of the library to query |
|
| `sectionId` | *number* | :heavy_check_mark: | the Id of the library to query |
|
||||||
| `type` | [operations.TypeT](../../models/operations/typet.md) | :heavy_check_mark: | Plex content type to search for |
|
| `type` | [operations.Type](../../models/operations/type.md) | :heavy_check_mark: | Plex content type to search for |
|
||||||
@@ -1,2 +1,17 @@
|
|||||||
# Setting
|
# Setting
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ----------------------- | ----------------------- | ----------------------- | ----------------------- | ----------------------- |
|
||||||
|
| `id` | *string* | :heavy_minus_sign: | N/A | EnableDatabaseTrace |
|
||||||
|
| `label` | *string* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `summary` | *string* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `type` | *string* | :heavy_minus_sign: | N/A | bool |
|
||||||
|
| `default` | *boolean* | :heavy_minus_sign: | N/A | false |
|
||||||
|
| `value` | *boolean* | :heavy_minus_sign: | N/A | false |
|
||||||
|
| `hidden` | *boolean* | :heavy_minus_sign: | N/A | true |
|
||||||
|
| `advanced` | *boolean* | :heavy_minus_sign: | N/A | false |
|
||||||
|
| `group` | *string* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `enumValues` | *string* | :heavy_minus_sign: | N/A | 1:admin only\|2:everyone |
|
||||||
14
docs/models/operations/statisticsmedia.md
Normal file
14
docs/models/operations/statisticsmedia.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# StatisticsMedia
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
|
| `accountID` | *number* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `deviceID` | *number* | :heavy_minus_sign: | N/A | 13 |
|
||||||
|
| `timespan` | *number* | :heavy_minus_sign: | N/A | 4 |
|
||||||
|
| `at` | *number* | :heavy_minus_sign: | N/A | 1707141600 |
|
||||||
|
| `metadataType` | *number* | :heavy_minus_sign: | N/A | 4 |
|
||||||
|
| `count` | *number* | :heavy_minus_sign: | N/A | 1 |
|
||||||
|
| `duration` | *number* | :heavy_minus_sign: | N/A | 1555 |
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# TypeT
|
# Type
|
||||||
|
|
||||||
Plex content type to search for
|
Plex content type to search for
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ async function run() {
|
|||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
accessToken: "<YOUR_API_KEY_HERE>",
|
||||||
});
|
});
|
||||||
|
|
||||||
const activityUUID = "string";
|
const activityUUID = "<value>";
|
||||||
|
|
||||||
const result = await sdk.activities.cancelServerActivities(activityUUID);
|
const result = await sdk.activities.cancelServerActivities(activityUUID);
|
||||||
|
|
||||||
|
|||||||
@@ -422,7 +422,7 @@ Each type in the library comes with a set of filters and sorts, aiding in buildi
|
|||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { PlexAPI } from "@lukehagar/plexjs";
|
import { PlexAPI } from "@lukehagar/plexjs";
|
||||||
import { TypeT } from "@lukehagar/plexjs/models/operations";
|
import { Type } from "@lukehagar/plexjs/models/operations";
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
const sdk = new PlexAPI({
|
const sdk = new PlexAPI({
|
||||||
@@ -430,7 +430,7 @@ async function run() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const sectionId = 933505;
|
const sectionId = 933505;
|
||||||
const type = TypeT.Four;
|
const type = Type.Four;
|
||||||
|
|
||||||
const result = await sdk.library.searchLibrary(sectionId, type);
|
const result = await sdk.library.searchLibrary(sectionId, type);
|
||||||
|
|
||||||
@@ -446,7 +446,7 @@ run();
|
|||||||
| Parameter | Type | Required | Description |
|
| Parameter | Type | Required | Description |
|
||||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
| `sectionId` | *number* | :heavy_check_mark: | the Id of the library to query |
|
| `sectionId` | *number* | :heavy_check_mark: | the Id of the library to query |
|
||||||
| `type` | [operations.TypeT](../../models/operations/typet.md) | :heavy_check_mark: | Plex content type to search for |
|
| `type` | [operations.Type](../../models/operations/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` | 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.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. |
|
||||||
|
|
||||||
|
|||||||
@@ -115,9 +115,9 @@ async function run() {
|
|||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
accessToken: "<YOUR_API_KEY_HERE>",
|
||||||
});
|
});
|
||||||
|
|
||||||
const key = "string";
|
const key = "<value>";
|
||||||
const time = 6900.91;
|
const time = 6900.91;
|
||||||
const state = "string";
|
const state = "<value>";
|
||||||
|
|
||||||
const result = await sdk.media.updatePlayProgress(key, time, state);
|
const result = await sdk.media.updatePlayProgress(key, time, state);
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ async function run() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const result = await sdk.playlists.createPlaylist({
|
const result = await sdk.playlists.createPlaylist({
|
||||||
title: "string",
|
title: "<value>",
|
||||||
type: QueryParamType.Photo,
|
type: QueryParamType.Photo,
|
||||||
smart: Smart.One,
|
smart: Smart.One,
|
||||||
uri: "https://inborn-brochure.biz",
|
uri: "https://inborn-brochure.biz",
|
||||||
@@ -226,8 +226,8 @@ async function run() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const playlistID = 3915;
|
const playlistID = 3915;
|
||||||
const title = "string";
|
const title = "<value>";
|
||||||
const summary = "string";
|
const summary = "<value>";
|
||||||
|
|
||||||
const result = await sdk.playlists.updatePlaylist(playlistID, title, summary);
|
const result = await sdk.playlists.updatePlaylist(playlistID, title, summary);
|
||||||
|
|
||||||
|
|||||||
106
docs/sdks/plex/README.md
Normal file
106
docs/sdks/plex/README.md
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
# Plex
|
||||||
|
(*plex*)
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
API Calls that perform operations directly against https://Plex.tv
|
||||||
|
|
||||||
|
|
||||||
|
### Available Operations
|
||||||
|
|
||||||
|
* [getPin](#getpin) - Get a Pin
|
||||||
|
* [getToken](#gettoken) - Get Access Token
|
||||||
|
|
||||||
|
## getPin
|
||||||
|
|
||||||
|
Retrieve a Pin from Plex.tv for authentication flows
|
||||||
|
|
||||||
|
### Example Usage
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { PlexAPI } from "@lukehagar/plexjs";
|
||||||
|
|
||||||
|
async function run() {
|
||||||
|
const sdk = new PlexAPI({
|
||||||
|
accessToken: "<YOUR_API_KEY_HERE>",
|
||||||
|
});
|
||||||
|
|
||||||
|
const xPlexClientIdentifier = "<value>";
|
||||||
|
const strong = false;
|
||||||
|
|
||||||
|
const result = await sdk.plex.getPin(xPlexClientIdentifier, strong);
|
||||||
|
|
||||||
|
// Handle the result
|
||||||
|
console.log(result)
|
||||||
|
}
|
||||||
|
|
||||||
|
run();
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Required | Description |
|
||||||
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
|
| `xPlexClientIdentifier` | *string* | :heavy_check_mark: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> |
|
||||||
|
| `strong` | *boolean* | :heavy_minus_sign: | Determines the kind of code returned by the API call<br/>Strong codes are used for Pin authentication flows<br/>Non-Strong codes are used for `Plex.tv/link`<br/> |
|
||||||
|
| `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.serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. |
|
||||||
|
|
||||||
|
|
||||||
|
### Response
|
||||||
|
|
||||||
|
**Promise<[operations.GetPinResponse](../../models/operations/getpinresponse.md)>**
|
||||||
|
### Errors
|
||||||
|
|
||||||
|
| Error Object | Status Code | Content Type |
|
||||||
|
| ------------------------- | ------------------------- | ------------------------- |
|
||||||
|
| errors.GetPinResponseBody | 400 | application/json |
|
||||||
|
| errors.SDKError | 4xx-5xx | */* |
|
||||||
|
|
||||||
|
## getToken
|
||||||
|
|
||||||
|
Retrieve an Access Token from Plex.tv after the Pin has already been authenticated
|
||||||
|
|
||||||
|
### Example Usage
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { PlexAPI } from "@lukehagar/plexjs";
|
||||||
|
|
||||||
|
async function run() {
|
||||||
|
const sdk = new PlexAPI({
|
||||||
|
accessToken: "<YOUR_API_KEY_HERE>",
|
||||||
|
});
|
||||||
|
|
||||||
|
const pinID = "<value>";
|
||||||
|
const xPlexClientIdentifier = "<value>";
|
||||||
|
|
||||||
|
const result = await sdk.plex.getToken(pinID, xPlexClientIdentifier);
|
||||||
|
|
||||||
|
// Handle the result
|
||||||
|
console.log(result)
|
||||||
|
}
|
||||||
|
|
||||||
|
run();
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Required | Description |
|
||||||
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
|
| `pinID` | *string* | :heavy_check_mark: | The PinID to retrieve an access token for |
|
||||||
|
| `xPlexClientIdentifier` | *string* | :heavy_check_mark: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> |
|
||||||
|
| `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.serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. |
|
||||||
|
|
||||||
|
|
||||||
|
### Response
|
||||||
|
|
||||||
|
**Promise<[operations.GetTokenResponse](../../models/operations/gettokenresponse.md)>**
|
||||||
|
### Errors
|
||||||
|
|
||||||
|
| Error Object | Status Code | Content Type |
|
||||||
|
| --------------------------- | --------------------------- | --------------------------- |
|
||||||
|
| errors.GetTokenResponseBody | 400 | application/json |
|
||||||
|
| errors.SDKError | 4xx-5xx | */* |
|
||||||
55
docs/sdks/statistics/README.md
Normal file
55
docs/sdks/statistics/README.md
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# Statistics
|
||||||
|
(*statistics*)
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
API Calls that perform operations with Plex Media Server Statistics
|
||||||
|
|
||||||
|
|
||||||
|
### Available Operations
|
||||||
|
|
||||||
|
* [getStatistics](#getstatistics) - Get Media Statistics
|
||||||
|
|
||||||
|
## getStatistics
|
||||||
|
|
||||||
|
This will return the media statistics for the server
|
||||||
|
|
||||||
|
### Example Usage
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { PlexAPI } from "@lukehagar/plexjs";
|
||||||
|
|
||||||
|
async function run() {
|
||||||
|
const sdk = new PlexAPI({
|
||||||
|
accessToken: "<YOUR_API_KEY_HERE>",
|
||||||
|
});
|
||||||
|
|
||||||
|
const timespan = 411769;
|
||||||
|
|
||||||
|
const result = await sdk.statistics.getStatistics(timespan);
|
||||||
|
|
||||||
|
// Handle the result
|
||||||
|
console.log(result)
|
||||||
|
}
|
||||||
|
|
||||||
|
run();
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Required | Description |
|
||||||
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
|
| `timespan` | *number* | :heavy_minus_sign: | The timespan to retrieve statistics for<br/>the exact meaning of this parameter is not known<br/> |
|
||||||
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
||||||
|
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
||||||
|
|
||||||
|
|
||||||
|
### Response
|
||||||
|
|
||||||
|
**Promise<[operations.GetStatisticsResponse](../../models/operations/getstatisticsresponse.md)>**
|
||||||
|
### Errors
|
||||||
|
|
||||||
|
| Error Object | Status Code | Content Type |
|
||||||
|
| -------------------------------- | -------------------------------- | -------------------------------- |
|
||||||
|
| errors.GetStatisticsResponseBody | 401 | application/json |
|
||||||
|
| errors.SDKError | 4xx-5xx | */* |
|
||||||
@@ -8,56 +8,8 @@ API Calls that perform operations with Plex Media Server Videos
|
|||||||
|
|
||||||
### Available Operations
|
### Available Operations
|
||||||
|
|
||||||
* [startUniversalTranscode](#startuniversaltranscode) - Start Universal Transcode
|
|
||||||
* [getTimeline](#gettimeline) - Get the timeline for a media item
|
* [getTimeline](#gettimeline) - Get the timeline for a media item
|
||||||
|
* [startUniversalTranscode](#startuniversaltranscode) - Start Universal Transcode
|
||||||
## startUniversalTranscode
|
|
||||||
|
|
||||||
Begin a Universal Transcode Session
|
|
||||||
|
|
||||||
### Example Usage
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
import { PlexAPI } from "@lukehagar/plexjs";
|
|
||||||
|
|
||||||
async function run() {
|
|
||||||
const sdk = new PlexAPI({
|
|
||||||
accessToken: "<YOUR_API_KEY_HERE>",
|
|
||||||
});
|
|
||||||
|
|
||||||
const result = await sdk.video.startUniversalTranscode({
|
|
||||||
hasMDE: 8924.99,
|
|
||||||
path: "/etc/mail",
|
|
||||||
mediaIndex: 9962.95,
|
|
||||||
partIndex: 1232.82,
|
|
||||||
protocol: "string",
|
|
||||||
});
|
|
||||||
|
|
||||||
// Handle the result
|
|
||||||
console.log(result)
|
|
||||||
}
|
|
||||||
|
|
||||||
run();
|
|
||||||
```
|
|
||||||
|
|
||||||
### Parameters
|
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
|
||||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
||||||
| `request` | [operations.StartUniversalTranscodeRequest](../../models/operations/startuniversaltranscoderequest.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. |
|
|
||||||
|
|
||||||
|
|
||||||
### Response
|
|
||||||
|
|
||||||
**Promise<[operations.StartUniversalTranscodeResponse](../../models/operations/startuniversaltranscoderesponse.md)>**
|
|
||||||
### Errors
|
|
||||||
|
|
||||||
| Error Object | Status Code | Content Type |
|
|
||||||
| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ |
|
|
||||||
| errors.StartUniversalTranscodeResponseBody | 401 | application/json |
|
|
||||||
| errors.SDKError | 4xx-5xx | */* |
|
|
||||||
|
|
||||||
## getTimeline
|
## getTimeline
|
||||||
|
|
||||||
@@ -81,7 +33,7 @@ async function run() {
|
|||||||
hasMDE: 7574.33,
|
hasMDE: 7574.33,
|
||||||
time: 3327.51,
|
time: 3327.51,
|
||||||
duration: 7585.39,
|
duration: 7585.39,
|
||||||
context: "string",
|
context: "<value>",
|
||||||
playQueueItemID: 1406.21,
|
playQueueItemID: 1406.21,
|
||||||
playBackTime: 2699.34,
|
playBackTime: 2699.34,
|
||||||
row: 3536.42,
|
row: 3536.42,
|
||||||
@@ -112,3 +64,51 @@ run();
|
|||||||
| ------------------------------ | ------------------------------ | ------------------------------ |
|
| ------------------------------ | ------------------------------ | ------------------------------ |
|
||||||
| errors.GetTimelineResponseBody | 401 | application/json |
|
| errors.GetTimelineResponseBody | 401 | application/json |
|
||||||
| errors.SDKError | 4xx-5xx | */* |
|
| errors.SDKError | 4xx-5xx | */* |
|
||||||
|
|
||||||
|
## startUniversalTranscode
|
||||||
|
|
||||||
|
Begin a Universal Transcode Session
|
||||||
|
|
||||||
|
### Example Usage
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { PlexAPI } from "@lukehagar/plexjs";
|
||||||
|
|
||||||
|
async function run() {
|
||||||
|
const sdk = new PlexAPI({
|
||||||
|
accessToken: "<YOUR_API_KEY_HERE>",
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = await sdk.video.startUniversalTranscode({
|
||||||
|
hasMDE: 8924.99,
|
||||||
|
path: "/etc/mail",
|
||||||
|
mediaIndex: 9962.95,
|
||||||
|
partIndex: 1232.82,
|
||||||
|
protocol: "<value>",
|
||||||
|
});
|
||||||
|
|
||||||
|
// Handle the result
|
||||||
|
console.log(result)
|
||||||
|
}
|
||||||
|
|
||||||
|
run();
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Required | Description |
|
||||||
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
|
| `request` | [operations.StartUniversalTranscodeRequest](../../models/operations/startuniversaltranscoderequest.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. |
|
||||||
|
|
||||||
|
|
||||||
|
### Response
|
||||||
|
|
||||||
|
**Promise<[operations.StartUniversalTranscodeResponse](../../models/operations/startuniversaltranscoderesponse.md)>**
|
||||||
|
### Errors
|
||||||
|
|
||||||
|
| Error Object | Status Code | Content Type |
|
||||||
|
| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ |
|
||||||
|
| errors.StartUniversalTranscodeResponseBody | 401 | application/json |
|
||||||
|
| errors.SDKError | 4xx-5xx | */* |
|
||||||
|
|||||||
9
gen.yaml
9
gen.yaml
@@ -7,8 +7,14 @@ generation:
|
|||||||
useClassNamesForArrayFields: true
|
useClassNamesForArrayFields: true
|
||||||
fixes:
|
fixes:
|
||||||
nameResolutionDec2023: false
|
nameResolutionDec2023: false
|
||||||
|
parameterOrderingFeb2024: false
|
||||||
|
requestResponseComponentNamesFeb2024: false
|
||||||
typescript:
|
typescript:
|
||||||
version: 0.5.3
|
version: 0.8.0
|
||||||
|
additionalDependencies:
|
||||||
|
dependencies: {}
|
||||||
|
devDependencies: {}
|
||||||
|
peerDependencies: {}
|
||||||
author: LukeHagar
|
author: LukeHagar
|
||||||
clientServerStatusCodesAsErrors: true
|
clientServerStatusCodesAsErrors: true
|
||||||
flattenGlobalSecurity: true
|
flattenGlobalSecurity: true
|
||||||
@@ -24,4 +30,5 @@ typescript:
|
|||||||
maxMethodParams: 4
|
maxMethodParams: 4
|
||||||
outputModelSuffix: output
|
outputModelSuffix: output
|
||||||
packageName: '@lukehagar/plexjs'
|
packageName: '@lukehagar/plexjs'
|
||||||
|
responseFormat: envelope
|
||||||
templateVersion: v2
|
templateVersion: v2
|
||||||
|
|||||||
3017
package-lock.json
generated
3017
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"type": "commonjs",
|
|
||||||
"name": "@lukehagar/plexjs",
|
"name": "@lukehagar/plexjs",
|
||||||
"version": "0.5.3",
|
"version": "0.8.0",
|
||||||
"author": "LukeHagar",
|
"author": "LukeHagar",
|
||||||
"main": "./index.js",
|
"main": "./index.js",
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
@@ -20,12 +19,12 @@
|
|||||||
"zod": ">= 3"
|
"zod": ">= 3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/jsonpath": "^0.2.4",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.13.2",
|
"@typescript-eslint/eslint-plugin": "^6.13.2",
|
||||||
"@typescript-eslint/parser": "^6.13.2",
|
"@typescript-eslint/parser": "^6.13.2",
|
||||||
"eslint": "^8.55.0",
|
"eslint": "^8.55.0",
|
||||||
"eslint-import-resolver-typescript": "^3.6.1",
|
"eslint-import-resolver-typescript": "^3.6.1",
|
||||||
"eslint-plugin-import": "^2.29.0",
|
"eslint-plugin-import": "^2.29.0",
|
||||||
"@types/jsonpath": "^0.2.4",
|
|
||||||
"typescript": "^5.3.3",
|
"typescript": "^5.3.3",
|
||||||
"zod": "^3.22.4"
|
"zod": "^3.22.4"
|
||||||
},
|
},
|
||||||
|
|||||||
85
src/hooks/hooks.ts
Normal file
85
src/hooks/hooks.ts
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
/*
|
||||||
|
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {
|
||||||
|
AfterErrorContext,
|
||||||
|
AfterErrorHook,
|
||||||
|
AfterSuccessContext,
|
||||||
|
AfterSuccessHook,
|
||||||
|
BeforeRequestContext,
|
||||||
|
BeforeRequestHook,
|
||||||
|
ClientInitHook,
|
||||||
|
Hooks,
|
||||||
|
} from "./types";
|
||||||
|
|
||||||
|
import { HTTPClient } from "../lib/http";
|
||||||
|
import { initHooks } from "./registration";
|
||||||
|
|
||||||
|
export class SDKHooks implements Hooks {
|
||||||
|
clientInitHooks: ClientInitHook[] = [];
|
||||||
|
beforeRequestHooks: BeforeRequestHook[] = [];
|
||||||
|
afterSuccessHooks: AfterSuccessHook[] = [];
|
||||||
|
afterErrorHooks: AfterErrorHook[] = [];
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
initHooks(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
registerClientInitHook(hook: ClientInitHook) {
|
||||||
|
this.clientInitHooks.push(hook);
|
||||||
|
}
|
||||||
|
|
||||||
|
registerBeforeRequestHook(hook: BeforeRequestHook) {
|
||||||
|
this.beforeRequestHooks.push(hook);
|
||||||
|
}
|
||||||
|
|
||||||
|
registerAfterSuccessHook(hook: AfterSuccessHook) {
|
||||||
|
this.afterSuccessHooks.push(hook);
|
||||||
|
}
|
||||||
|
|
||||||
|
registerAfterErrorHook(hook: AfterErrorHook) {
|
||||||
|
this.afterErrorHooks.push(hook);
|
||||||
|
}
|
||||||
|
|
||||||
|
clientInit(client: HTTPClient): HTTPClient {
|
||||||
|
return this.clientInitHooks.reduce((client, hook) => hook.clientInit(client), client);
|
||||||
|
}
|
||||||
|
|
||||||
|
async beforeRequest(hookCtx: BeforeRequestContext, request: Request): Promise<Request> {
|
||||||
|
let req = request;
|
||||||
|
|
||||||
|
for (const hook of this.beforeRequestHooks) {
|
||||||
|
req = await hook.beforeRequest(hookCtx, req);
|
||||||
|
}
|
||||||
|
|
||||||
|
return req;
|
||||||
|
}
|
||||||
|
|
||||||
|
async afterSuccess(hookCtx: AfterSuccessContext, response: Response): Promise<Response> {
|
||||||
|
let res = response;
|
||||||
|
|
||||||
|
for (const hook of this.afterSuccessHooks) {
|
||||||
|
res = await hook.afterSuccess(hookCtx, res);
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
async afterError(
|
||||||
|
hookCtx: AfterErrorContext,
|
||||||
|
response: Response | null,
|
||||||
|
error: unknown
|
||||||
|
): Promise<{ response: Response | null; error: unknown }> {
|
||||||
|
let res = response;
|
||||||
|
let err = error;
|
||||||
|
|
||||||
|
for (const hook of this.afterErrorHooks) {
|
||||||
|
const result = await hook.afterError(hookCtx, res, err);
|
||||||
|
res = result.response;
|
||||||
|
err = result.error;
|
||||||
|
}
|
||||||
|
|
||||||
|
return { response: res, error: err };
|
||||||
|
}
|
||||||
|
}
|
||||||
6
src/hooks/index.ts
Normal file
6
src/hooks/index.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
/*
|
||||||
|
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export * from "./types";
|
||||||
|
export * from "./hooks";
|
||||||
14
src/hooks/registration.ts
Normal file
14
src/hooks/registration.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { Hooks } from "./types";
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is only ever generated once on the first generation and then is free to be modified.
|
||||||
|
* Any hooks you wish to add should be registered in the initHooks function. Feel free to define them
|
||||||
|
* in this file or in separate files in the hooks folder.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// @ts-expect-error remove this line when you add your first hook and hooks is used
|
||||||
|
export function initHooks(hooks: Hooks) {
|
||||||
|
// Add hooks by calling hooks.register{ClientInit/BeforeRequest/AfterRequest/AfterError}Hook
|
||||||
|
// with an instance of a hook that implements that specific Hook interface
|
||||||
|
// Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance
|
||||||
|
}
|
||||||
68
src/hooks/types.ts
Normal file
68
src/hooks/types.ts
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { HTTPClient } from "../lib/http";
|
||||||
|
|
||||||
|
export type HookContext = {
|
||||||
|
operationID: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type Awaitable<T> = T | Promise<T>;
|
||||||
|
|
||||||
|
export type BeforeRequestContext = HookContext & {};
|
||||||
|
export type AfterSuccessContext = HookContext & {};
|
||||||
|
export type AfterErrorContext = HookContext & {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClientInitHook is called when the SDK is initializing the HTTP client. The
|
||||||
|
* hook can return a new HTTP client to be used by the SDK.
|
||||||
|
*/
|
||||||
|
export interface ClientInitHook {
|
||||||
|
clientInit: (client: HTTPClient) => HTTPClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BeforeRequestHook is called before the SDK sends a request. The hook can
|
||||||
|
* modify the request before it is sent or throw an error to stop the request
|
||||||
|
* from being sent.
|
||||||
|
*/
|
||||||
|
export interface BeforeRequestHook {
|
||||||
|
beforeRequest: (hookCtx: BeforeRequestContext, request: Request) => Awaitable<Request>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AfterSuccessHook is called after the SDK receives a response. The hook can
|
||||||
|
* modify the response before it is handled or throw an error to stop the
|
||||||
|
* response from being handled.
|
||||||
|
*/
|
||||||
|
export interface AfterSuccessHook {
|
||||||
|
afterSuccess: (hookCtx: AfterSuccessContext, response: Response) => Awaitable<Response>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AfterErrorHook is called after the SDK encounters an error, or a
|
||||||
|
* non-successful response. The hook can modify the response if available
|
||||||
|
* otherwise modify the error.
|
||||||
|
*/
|
||||||
|
export interface AfterErrorHook {
|
||||||
|
afterError: (
|
||||||
|
hookCtx: AfterErrorContext,
|
||||||
|
response: Response | null,
|
||||||
|
error: unknown
|
||||||
|
) => Awaitable<{
|
||||||
|
response: Response | null;
|
||||||
|
error: unknown;
|
||||||
|
}>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Hooks {
|
||||||
|
/** Registers a hook to be used by the SDK for client initialization. */
|
||||||
|
registerClientInitHook(hook: ClientInitHook): void;
|
||||||
|
/** Registers a hook to be used by the SDK for the before request event. */
|
||||||
|
registerBeforeRequestHook(hook: BeforeRequestHook): void;
|
||||||
|
/** Registers a hook to be used by the SDK for the after success event. */
|
||||||
|
registerAfterSuccessHook(hook: AfterSuccessHook): void;
|
||||||
|
/** Registers a hook to be used by the SDK for the after error event. */
|
||||||
|
registerAfterErrorHook(hook: AfterErrorHook): void;
|
||||||
|
}
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { HTTPClient } from "./http";
|
import { HTTPClient } from "./http";
|
||||||
import { pathToFunc } from "./url";
|
|
||||||
import { RetryConfig } from "./retries";
|
import { RetryConfig } from "./retries";
|
||||||
|
import { pathToFunc } from "./url";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains the list of servers available to the SDK
|
* Contains the list of servers available to the SDK
|
||||||
@@ -54,7 +54,7 @@ export type SDKOptions = {
|
|||||||
retryConfig?: RetryConfig;
|
retryConfig?: RetryConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function serverURLFromOptions(options: SDKOptions): URL {
|
export function serverURLFromOptions(options: SDKOptions): URL | null {
|
||||||
let serverURL = options.serverURL;
|
let serverURL = options.serverURL;
|
||||||
|
|
||||||
const serverParams = [
|
const serverParams = [
|
||||||
@@ -79,7 +79,7 @@ export function serverURLFromOptions(options: SDKOptions): URL {
|
|||||||
export const SDK_METADATA = Object.freeze({
|
export const SDK_METADATA = Object.freeze({
|
||||||
language: "typescript",
|
language: "typescript",
|
||||||
openapiDocVersion: "0.0.3",
|
openapiDocVersion: "0.0.3",
|
||||||
sdkVersion: "0.5.3",
|
sdkVersion: "0.8.0",
|
||||||
genVersion: "2.237.3",
|
genVersion: "2.269.0",
|
||||||
userAgent: "speakeasy-sdk/typescript 0.5.3 2.237.3 0.0.3 @lukehagar/plexjs",
|
userAgent: "speakeasy-sdk/typescript 0.8.0 2.269.0 0.0.3 @lukehagar/plexjs",
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -191,10 +191,29 @@ async function retryBackoff(
|
|||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
const d = Math.min(
|
let retryInterval = 0;
|
||||||
initialInterval * Math.pow(x, exponent) + Math.random() * 1000,
|
if (err instanceof TemporaryError && err.res && err.res.headers) {
|
||||||
maxInterval,
|
const retryVal = err.res.headers.get("retry-after") || "";
|
||||||
);
|
if (retryVal != "") {
|
||||||
|
const parsedNumber = Number(retryVal);
|
||||||
|
if (!isNaN(parsedNumber) && Number.isInteger(parsedNumber)) {
|
||||||
|
retryInterval = parsedNumber * 1000;
|
||||||
|
} else {
|
||||||
|
const parsedDate = Date.parse(retryVal);
|
||||||
|
if (!isNaN(parsedDate)) {
|
||||||
|
const deltaMS = parsedDate - Date.now();
|
||||||
|
retryInterval = deltaMS > 0 ? Math.ceil(deltaMS) : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (retryInterval == 0) {
|
||||||
|
retryInterval =
|
||||||
|
initialInterval * Math.pow(x, exponent) + Math.random() * 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
const d = Math.min(retryInterval, maxInterval);
|
||||||
|
|
||||||
await delay(d);
|
await delay(d);
|
||||||
x++;
|
x++;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { SecurityState, resolveSecurity, resolveGlobalSecurity } from "./securit
|
|||||||
import { pathToFunc } from "./url";
|
import { pathToFunc } from "./url";
|
||||||
import { encodeForm } from "./encodings";
|
import { encodeForm } from "./encodings";
|
||||||
import { stringToBase64 } from "./base64";
|
import { stringToBase64 } from "./base64";
|
||||||
|
import { SDKHooks, HookContext } from "../hooks";
|
||||||
|
|
||||||
export type RequestOptions = {
|
export type RequestOptions = {
|
||||||
fetchOptions?: Omit<RequestInit, "method" | "body">;
|
fetchOptions?: Omit<RequestInit, "method" | "body">;
|
||||||
@@ -15,6 +16,7 @@ export type RequestOptions = {
|
|||||||
type RequestConfig = {
|
type RequestConfig = {
|
||||||
method: string;
|
method: string;
|
||||||
path: string;
|
path: string;
|
||||||
|
context: HookContext;
|
||||||
baseURL?: string | URL;
|
baseURL?: string | URL;
|
||||||
query?: string;
|
query?: string;
|
||||||
body?: RequestInit["body"];
|
body?: RequestInit["body"];
|
||||||
@@ -24,20 +26,28 @@ type RequestConfig = {
|
|||||||
|
|
||||||
export class ClientSDK {
|
export class ClientSDK {
|
||||||
private readonly client: HTTPClient;
|
private readonly client: HTTPClient;
|
||||||
protected readonly baseURL: URL;
|
protected readonly baseURL: URL | null;
|
||||||
|
protected readonly hooks$: SDKHooks;
|
||||||
|
|
||||||
constructor(init: { client: HTTPClient; baseURL: URL }) {
|
constructor(init: { client: HTTPClient; baseURL: URL | null; hooks: SDKHooks }) {
|
||||||
const url = init.baseURL;
|
const url = init.baseURL;
|
||||||
|
if (url) {
|
||||||
url.pathname = url.pathname.replace(/\/+$/, "") + "/";
|
url.pathname = url.pathname.replace(/\/+$/, "") + "/";
|
||||||
|
}
|
||||||
|
|
||||||
this.client = init.client;
|
this.hooks$ = init.hooks;
|
||||||
|
this.client = this.hooks$.clientInit(init.client);
|
||||||
this.baseURL = url;
|
this.baseURL = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async fetch$(conf: RequestConfig, options?: RequestOptions) {
|
protected async createRequest$(conf: RequestConfig, options?: RequestOptions) {
|
||||||
const { method, path, query, headers: opHeaders, security } = conf;
|
const { context, method, path, query, headers: opHeaders, security } = conf;
|
||||||
|
|
||||||
const reqURL = new URL(conf.baseURL ?? this.baseURL);
|
const base = conf.baseURL ?? this.baseURL;
|
||||||
|
if (!base) {
|
||||||
|
throw new TypeError("No base URL provided for operation");
|
||||||
|
}
|
||||||
|
const reqURL = new URL(base);
|
||||||
const inputURL = new URL(path, reqURL);
|
const inputURL = new URL(path, reqURL);
|
||||||
|
|
||||||
if (path) {
|
if (path) {
|
||||||
@@ -92,7 +102,31 @@ export class ClientSDK {
|
|||||||
method,
|
method,
|
||||||
});
|
});
|
||||||
|
|
||||||
return this.client.request(req);
|
return this.hooks$.beforeRequest(context, req);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async do$(
|
||||||
|
req: Request,
|
||||||
|
options: {
|
||||||
|
context: HookContext;
|
||||||
|
errorCodes: number | string | (number | string)[];
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
const { context, errorCodes } = options;
|
||||||
|
|
||||||
|
let response = await this.client.request(req);
|
||||||
|
|
||||||
|
if (this.matchStatusCode(response, errorCodes)) {
|
||||||
|
const result = await this.hooks$.afterError(context, response, null);
|
||||||
|
if (result.error) {
|
||||||
|
throw result.error;
|
||||||
|
}
|
||||||
|
response = result.response || response;
|
||||||
|
} else {
|
||||||
|
response = await this.hooks$.afterSuccess(context, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected unpackHeaders = unpackHeaders;
|
protected unpackHeaders = unpackHeaders;
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class AddPlaylistContentsResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "AddPlaylistContentsResponseBody";
|
this.name = "AddPlaylistContentsResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class ApplyUpdatesResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "ApplyUpdatesResponseBody";
|
this.name = "ApplyUpdatesResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class CancelServerActivitiesResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "CancelServerActivitiesResponseBody";
|
this.name = "CancelServerActivitiesResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class CheckForUpdatesResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "CheckForUpdatesResponseBody";
|
this.name = "CheckForUpdatesResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class ClearPlaylistContentsResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "ClearPlaylistContentsResponseBody";
|
this.name = "ClearPlaylistContentsResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class CreatePlaylistResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "CreatePlaylistResponseBody";
|
this.name = "CreatePlaylistResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class DeleteLibraryResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "DeleteLibraryResponseBody";
|
this.name = "DeleteLibraryResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class DeletePlaylistResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "DeletePlaylistResponseBody";
|
this.name = "DeletePlaylistResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class EnablePaperTrailResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "EnablePaperTrailResponseBody";
|
this.name = "EnablePaperTrailResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetAvailableClientsResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetAvailableClientsResponseBody";
|
this.name = "GetAvailableClientsResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetButlerTasksResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetButlerTasksResponseBody";
|
this.name = "GetButlerTasksResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetDevicesResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetDevicesResponseBody";
|
this.name = "GetDevicesResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetFileHashResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetFileHashResponseBody";
|
this.name = "GetFileHashResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetGlobalHubsResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetGlobalHubsResponseBody";
|
this.name = "GetGlobalHubsResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetLibrariesResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetLibrariesResponseBody";
|
this.name = "GetLibrariesResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetLibraryResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetLibraryResponseBody";
|
this.name = "GetLibraryResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetLibraryHubsResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetLibraryHubsResponseBody";
|
this.name = "GetLibraryHubsResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetMetadataResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetMetadataResponseBody";
|
this.name = "GetMetadataResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetMetadataChildrenResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetMetadataChildrenResponseBody";
|
this.name = "GetMetadataChildrenResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetMyPlexAccountResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetMyPlexAccountResponseBody";
|
this.name = "GetMyPlexAccountResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetOnDeckResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetOnDeckResponseBody";
|
this.name = "GetOnDeckResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
144
src/models/errors/getpin.ts
Normal file
144
src/models/errors/getpin.ts
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
/*
|
||||||
|
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { z } from "zod";
|
||||||
|
|
||||||
|
export type GetPinErrors = {
|
||||||
|
code?: number | undefined;
|
||||||
|
message?: string | undefined;
|
||||||
|
status?: number | undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* X-Plex-Client-Identifier is missing
|
||||||
|
*/
|
||||||
|
export type GetPinResponseBodyData = {
|
||||||
|
errors?: Array<GetPinErrors> | undefined;
|
||||||
|
/**
|
||||||
|
* Raw HTTP response; suitable for custom response parsing
|
||||||
|
*/
|
||||||
|
rawResponse?: Response | undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* X-Plex-Client-Identifier is missing
|
||||||
|
*/
|
||||||
|
export class GetPinResponseBody extends Error {
|
||||||
|
errors?: Array<GetPinErrors> | undefined;
|
||||||
|
/**
|
||||||
|
* Raw HTTP response; suitable for custom response parsing
|
||||||
|
*/
|
||||||
|
rawResponse?: Response | undefined;
|
||||||
|
|
||||||
|
/** The original data that was passed to this error instance. */
|
||||||
|
data$: GetPinResponseBodyData;
|
||||||
|
|
||||||
|
constructor(err: GetPinResponseBodyData) {
|
||||||
|
super("");
|
||||||
|
this.data$ = err;
|
||||||
|
|
||||||
|
if (err.errors != null) {
|
||||||
|
this.errors = err.errors;
|
||||||
|
}
|
||||||
|
if (err.rawResponse != null) {
|
||||||
|
this.rawResponse = err.rawResponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.message =
|
||||||
|
"message" in err && typeof err.message === "string"
|
||||||
|
? err.message
|
||||||
|
: "API error occurred";
|
||||||
|
|
||||||
|
this.name = "GetPinResponseBody";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @internal */
|
||||||
|
export namespace GetPinErrors$ {
|
||||||
|
export type Inbound = {
|
||||||
|
code?: number | undefined;
|
||||||
|
message?: string | undefined;
|
||||||
|
status?: number | undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const inboundSchema: z.ZodType<GetPinErrors, z.ZodTypeDef, Inbound> = z
|
||||||
|
.object({
|
||||||
|
code: z.number().optional(),
|
||||||
|
message: z.string().optional(),
|
||||||
|
status: z.number().optional(),
|
||||||
|
})
|
||||||
|
.transform((v) => {
|
||||||
|
return {
|
||||||
|
...(v.code === undefined ? null : { code: v.code }),
|
||||||
|
...(v.message === undefined ? null : { message: v.message }),
|
||||||
|
...(v.status === undefined ? null : { status: v.status }),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
export type Outbound = {
|
||||||
|
code?: number | undefined;
|
||||||
|
message?: string | undefined;
|
||||||
|
status?: number | undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, GetPinErrors> = z
|
||||||
|
.object({
|
||||||
|
code: z.number().optional(),
|
||||||
|
message: z.string().optional(),
|
||||||
|
status: z.number().optional(),
|
||||||
|
})
|
||||||
|
.transform((v) => {
|
||||||
|
return {
|
||||||
|
...(v.code === undefined ? null : { code: v.code }),
|
||||||
|
...(v.message === undefined ? null : { message: v.message }),
|
||||||
|
...(v.status === undefined ? null : { status: v.status }),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @internal */
|
||||||
|
export namespace GetPinResponseBody$ {
|
||||||
|
export type Inbound = {
|
||||||
|
errors?: Array<GetPinErrors$.Inbound> | undefined;
|
||||||
|
RawResponse?: Response | undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const inboundSchema: z.ZodType<GetPinResponseBody, z.ZodTypeDef, Inbound> = z
|
||||||
|
.object({
|
||||||
|
errors: z.array(z.lazy(() => GetPinErrors$.inboundSchema)).optional(),
|
||||||
|
RawResponse: z.instanceof(Response).optional(),
|
||||||
|
})
|
||||||
|
.transform((v) => {
|
||||||
|
return new GetPinResponseBody({
|
||||||
|
...(v.errors === undefined ? null : { errors: v.errors }),
|
||||||
|
...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
export type Outbound = {
|
||||||
|
errors?: Array<GetPinErrors$.Outbound> | undefined;
|
||||||
|
RawResponse?: never | undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, GetPinResponseBody> = z
|
||||||
|
.instanceof(GetPinResponseBody)
|
||||||
|
.transform((v) => v.data$)
|
||||||
|
.pipe(
|
||||||
|
z
|
||||||
|
.object({
|
||||||
|
errors: z.array(z.lazy(() => GetPinErrors$.outboundSchema)).optional(),
|
||||||
|
rawResponse: z
|
||||||
|
.instanceof(Response)
|
||||||
|
.transform(() => {
|
||||||
|
throw new Error("Response cannot be serialized");
|
||||||
|
})
|
||||||
|
.optional(),
|
||||||
|
})
|
||||||
|
.transform((v) => {
|
||||||
|
return {
|
||||||
|
...(v.errors === undefined ? null : { errors: v.errors }),
|
||||||
|
...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -45,10 +45,10 @@ export class GetPlaylistResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetPlaylistResponseBody";
|
this.name = "GetPlaylistResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetPlaylistContentsResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetPlaylistContentsResponseBody";
|
this.name = "GetPlaylistContentsResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetPlaylistsResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetPlaylistsResponseBody";
|
this.name = "GetPlaylistsResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetRecentlyAddedResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetRecentlyAddedResponseBody";
|
this.name = "GetRecentlyAddedResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetResizedPhotoResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetResizedPhotoResponseBody";
|
this.name = "GetResizedPhotoResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetSearchResultsResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetSearchResultsResponseBody";
|
this.name = "GetSearchResultsResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetServerActivitiesResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetServerActivitiesResponseBody";
|
this.name = "GetServerActivitiesResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetServerCapabilitiesResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetServerCapabilitiesResponseBody";
|
this.name = "GetServerCapabilitiesResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetServerIdentityResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetServerIdentityResponseBody";
|
this.name = "GetServerIdentityResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetServerListResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetServerListResponseBody";
|
this.name = "GetServerListResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetServerPreferencesResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetServerPreferencesResponseBody";
|
this.name = "GetServerPreferencesResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetSessionHistoryResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetSessionHistoryResponseBody";
|
this.name = "GetSessionHistoryResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetSessionsResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetSessionsResponseBody";
|
this.name = "GetSessionsResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetSourceConnectionInformationResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetSourceConnectionInformationResponseBody";
|
this.name = "GetSourceConnectionInformationResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
144
src/models/errors/getstatistics.ts
Normal file
144
src/models/errors/getstatistics.ts
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
/*
|
||||||
|
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { z } from "zod";
|
||||||
|
|
||||||
|
export type GetStatisticsErrors = {
|
||||||
|
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 GetStatisticsResponseBodyData = {
|
||||||
|
errors?: Array<GetStatisticsErrors> | 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 GetStatisticsResponseBody extends Error {
|
||||||
|
errors?: Array<GetStatisticsErrors> | undefined;
|
||||||
|
/**
|
||||||
|
* Raw HTTP response; suitable for custom response parsing
|
||||||
|
*/
|
||||||
|
rawResponse?: Response | undefined;
|
||||||
|
|
||||||
|
/** The original data that was passed to this error instance. */
|
||||||
|
data$: GetStatisticsResponseBodyData;
|
||||||
|
|
||||||
|
constructor(err: GetStatisticsResponseBodyData) {
|
||||||
|
super("");
|
||||||
|
this.data$ = err;
|
||||||
|
|
||||||
|
if (err.errors != null) {
|
||||||
|
this.errors = err.errors;
|
||||||
|
}
|
||||||
|
if (err.rawResponse != null) {
|
||||||
|
this.rawResponse = err.rawResponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.message =
|
||||||
|
"message" in err && typeof err.message === "string"
|
||||||
|
? err.message
|
||||||
|
: "API error occurred";
|
||||||
|
|
||||||
|
this.name = "GetStatisticsResponseBody";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @internal */
|
||||||
|
export namespace GetStatisticsErrors$ {
|
||||||
|
export type Inbound = {
|
||||||
|
code?: number | undefined;
|
||||||
|
message?: string | undefined;
|
||||||
|
status?: number | undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const inboundSchema: z.ZodType<GetStatisticsErrors, z.ZodTypeDef, Inbound> = z
|
||||||
|
.object({
|
||||||
|
code: z.number().optional(),
|
||||||
|
message: z.string().optional(),
|
||||||
|
status: z.number().optional(),
|
||||||
|
})
|
||||||
|
.transform((v) => {
|
||||||
|
return {
|
||||||
|
...(v.code === undefined ? null : { code: v.code }),
|
||||||
|
...(v.message === undefined ? null : { message: v.message }),
|
||||||
|
...(v.status === undefined ? null : { status: v.status }),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
export type Outbound = {
|
||||||
|
code?: number | undefined;
|
||||||
|
message?: string | undefined;
|
||||||
|
status?: number | undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, GetStatisticsErrors> = z
|
||||||
|
.object({
|
||||||
|
code: z.number().optional(),
|
||||||
|
message: z.string().optional(),
|
||||||
|
status: z.number().optional(),
|
||||||
|
})
|
||||||
|
.transform((v) => {
|
||||||
|
return {
|
||||||
|
...(v.code === undefined ? null : { code: v.code }),
|
||||||
|
...(v.message === undefined ? null : { message: v.message }),
|
||||||
|
...(v.status === undefined ? null : { status: v.status }),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @internal */
|
||||||
|
export namespace GetStatisticsResponseBody$ {
|
||||||
|
export type Inbound = {
|
||||||
|
errors?: Array<GetStatisticsErrors$.Inbound> | undefined;
|
||||||
|
RawResponse?: Response | undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const inboundSchema: z.ZodType<GetStatisticsResponseBody, z.ZodTypeDef, Inbound> = z
|
||||||
|
.object({
|
||||||
|
errors: z.array(z.lazy(() => GetStatisticsErrors$.inboundSchema)).optional(),
|
||||||
|
RawResponse: z.instanceof(Response).optional(),
|
||||||
|
})
|
||||||
|
.transform((v) => {
|
||||||
|
return new GetStatisticsResponseBody({
|
||||||
|
...(v.errors === undefined ? null : { errors: v.errors }),
|
||||||
|
...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
export type Outbound = {
|
||||||
|
errors?: Array<GetStatisticsErrors$.Outbound> | undefined;
|
||||||
|
RawResponse?: never | undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, GetStatisticsResponseBody> = z
|
||||||
|
.instanceof(GetStatisticsResponseBody)
|
||||||
|
.transform((v) => v.data$)
|
||||||
|
.pipe(
|
||||||
|
z
|
||||||
|
.object({
|
||||||
|
errors: z.array(z.lazy(() => GetStatisticsErrors$.outboundSchema)).optional(),
|
||||||
|
rawResponse: z
|
||||||
|
.instanceof(Response)
|
||||||
|
.transform(() => {
|
||||||
|
throw new Error("Response cannot be serialized");
|
||||||
|
})
|
||||||
|
.optional(),
|
||||||
|
})
|
||||||
|
.transform((v) => {
|
||||||
|
return {
|
||||||
|
...(v.errors === undefined ? null : { errors: v.errors }),
|
||||||
|
...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -45,10 +45,10 @@ export class GetTimelineResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetTimelineResponseBody";
|
this.name = "GetTimelineResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
144
src/models/errors/gettoken.ts
Normal file
144
src/models/errors/gettoken.ts
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
/*
|
||||||
|
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { z } from "zod";
|
||||||
|
|
||||||
|
export type GetTokenErrors = {
|
||||||
|
code?: number | undefined;
|
||||||
|
message?: string | undefined;
|
||||||
|
status?: number | undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* X-Plex-Client-Identifier is missing
|
||||||
|
*/
|
||||||
|
export type GetTokenResponseBodyData = {
|
||||||
|
errors?: Array<GetTokenErrors> | undefined;
|
||||||
|
/**
|
||||||
|
* Raw HTTP response; suitable for custom response parsing
|
||||||
|
*/
|
||||||
|
rawResponse?: Response | undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* X-Plex-Client-Identifier is missing
|
||||||
|
*/
|
||||||
|
export class GetTokenResponseBody extends Error {
|
||||||
|
errors?: Array<GetTokenErrors> | undefined;
|
||||||
|
/**
|
||||||
|
* Raw HTTP response; suitable for custom response parsing
|
||||||
|
*/
|
||||||
|
rawResponse?: Response | undefined;
|
||||||
|
|
||||||
|
/** The original data that was passed to this error instance. */
|
||||||
|
data$: GetTokenResponseBodyData;
|
||||||
|
|
||||||
|
constructor(err: GetTokenResponseBodyData) {
|
||||||
|
super("");
|
||||||
|
this.data$ = err;
|
||||||
|
|
||||||
|
if (err.errors != null) {
|
||||||
|
this.errors = err.errors;
|
||||||
|
}
|
||||||
|
if (err.rawResponse != null) {
|
||||||
|
this.rawResponse = err.rawResponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.message =
|
||||||
|
"message" in err && typeof err.message === "string"
|
||||||
|
? err.message
|
||||||
|
: "API error occurred";
|
||||||
|
|
||||||
|
this.name = "GetTokenResponseBody";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @internal */
|
||||||
|
export namespace GetTokenErrors$ {
|
||||||
|
export type Inbound = {
|
||||||
|
code?: number | undefined;
|
||||||
|
message?: string | undefined;
|
||||||
|
status?: number | undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const inboundSchema: z.ZodType<GetTokenErrors, z.ZodTypeDef, Inbound> = z
|
||||||
|
.object({
|
||||||
|
code: z.number().optional(),
|
||||||
|
message: z.string().optional(),
|
||||||
|
status: z.number().optional(),
|
||||||
|
})
|
||||||
|
.transform((v) => {
|
||||||
|
return {
|
||||||
|
...(v.code === undefined ? null : { code: v.code }),
|
||||||
|
...(v.message === undefined ? null : { message: v.message }),
|
||||||
|
...(v.status === undefined ? null : { status: v.status }),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
export type Outbound = {
|
||||||
|
code?: number | undefined;
|
||||||
|
message?: string | undefined;
|
||||||
|
status?: number | undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, GetTokenErrors> = z
|
||||||
|
.object({
|
||||||
|
code: z.number().optional(),
|
||||||
|
message: z.string().optional(),
|
||||||
|
status: z.number().optional(),
|
||||||
|
})
|
||||||
|
.transform((v) => {
|
||||||
|
return {
|
||||||
|
...(v.code === undefined ? null : { code: v.code }),
|
||||||
|
...(v.message === undefined ? null : { message: v.message }),
|
||||||
|
...(v.status === undefined ? null : { status: v.status }),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @internal */
|
||||||
|
export namespace GetTokenResponseBody$ {
|
||||||
|
export type Inbound = {
|
||||||
|
errors?: Array<GetTokenErrors$.Inbound> | undefined;
|
||||||
|
RawResponse?: Response | undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const inboundSchema: z.ZodType<GetTokenResponseBody, z.ZodTypeDef, Inbound> = z
|
||||||
|
.object({
|
||||||
|
errors: z.array(z.lazy(() => GetTokenErrors$.inboundSchema)).optional(),
|
||||||
|
RawResponse: z.instanceof(Response).optional(),
|
||||||
|
})
|
||||||
|
.transform((v) => {
|
||||||
|
return new GetTokenResponseBody({
|
||||||
|
...(v.errors === undefined ? null : { errors: v.errors }),
|
||||||
|
...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
export type Outbound = {
|
||||||
|
errors?: Array<GetTokenErrors$.Outbound> | undefined;
|
||||||
|
RawResponse?: never | undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, GetTokenResponseBody> = z
|
||||||
|
.instanceof(GetTokenResponseBody)
|
||||||
|
.transform((v) => v.data$)
|
||||||
|
.pipe(
|
||||||
|
z
|
||||||
|
.object({
|
||||||
|
errors: z.array(z.lazy(() => GetTokenErrors$.outboundSchema)).optional(),
|
||||||
|
rawResponse: z
|
||||||
|
.instanceof(Response)
|
||||||
|
.transform(() => {
|
||||||
|
throw new Error("Response cannot be serialized");
|
||||||
|
})
|
||||||
|
.optional(),
|
||||||
|
})
|
||||||
|
.transform((v) => {
|
||||||
|
return {
|
||||||
|
...(v.errors === undefined ? null : { errors: v.errors }),
|
||||||
|
...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -45,10 +45,10 @@ export class GetTranscodeSessionsResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetTranscodeSessionsResponseBody";
|
this.name = "GetTranscodeSessionsResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetTransientTokenResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetTransientTokenResponseBody";
|
this.name = "GetTransientTokenResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class GetUpdateStatusResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "GetUpdateStatusResponseBody";
|
this.name = "GetUpdateStatusResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ export * from "./getmetadata";
|
|||||||
export * from "./getmetadatachildren";
|
export * from "./getmetadatachildren";
|
||||||
export * from "./getmyplexaccount";
|
export * from "./getmyplexaccount";
|
||||||
export * from "./getondeck";
|
export * from "./getondeck";
|
||||||
|
export * from "./getpin";
|
||||||
export * from "./getplaylist";
|
export * from "./getplaylist";
|
||||||
export * from "./getplaylistcontents";
|
export * from "./getplaylistcontents";
|
||||||
export * from "./getplaylists";
|
export * from "./getplaylists";
|
||||||
@@ -37,7 +38,9 @@ export * from "./getserverpreferences";
|
|||||||
export * from "./getsessionhistory";
|
export * from "./getsessionhistory";
|
||||||
export * from "./getsessions";
|
export * from "./getsessions";
|
||||||
export * from "./getsourceconnectioninformation";
|
export * from "./getsourceconnectioninformation";
|
||||||
|
export * from "./getstatistics";
|
||||||
export * from "./gettimeline";
|
export * from "./gettimeline";
|
||||||
|
export * from "./gettoken";
|
||||||
export * from "./gettranscodesessions";
|
export * from "./gettranscodesessions";
|
||||||
export * from "./gettransienttoken";
|
export * from "./gettransienttoken";
|
||||||
export * from "./getupdatestatus";
|
export * from "./getupdatestatus";
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class LogLineResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "LogLineResponseBody";
|
this.name = "LogLineResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class LogMultiLineResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "LogMultiLineResponseBody";
|
this.name = "LogMultiLineResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class MarkPlayedResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "MarkPlayedResponseBody";
|
this.name = "MarkPlayedResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class MarkUnplayedResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "MarkUnplayedResponseBody";
|
this.name = "MarkUnplayedResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class PerformSearchResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "PerformSearchResponseBody";
|
this.name = "PerformSearchResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class PerformVoiceSearchResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "PerformVoiceSearchResponseBody";
|
this.name = "PerformVoiceSearchResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class RefreshLibraryResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "RefreshLibraryResponseBody";
|
this.name = "RefreshLibraryResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,22 +3,20 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export class SDKError extends Error {
|
export class SDKError extends Error {
|
||||||
statusCode: number;
|
public readonly statusCode: number;
|
||||||
body: string;
|
|
||||||
rawResponse: Response;
|
|
||||||
|
|
||||||
constructor(message: string, response: Response, body: string = "") {
|
constructor(
|
||||||
const statusCode = response.status;
|
message: string,
|
||||||
|
public readonly rawResponse: Response,
|
||||||
let bodyString = "";
|
public readonly body: string = ""
|
||||||
if (body.length > 0) {
|
) {
|
||||||
bodyString = `\n${body}`;
|
const statusCode = rawResponse.status;
|
||||||
}
|
const bodyString = body.length > 0 ? `\n${body}` : "";
|
||||||
|
|
||||||
super(`${message}: Status ${statusCode}${bodyString}`);
|
super(`${message}: Status ${statusCode}${bodyString}`);
|
||||||
|
|
||||||
this.statusCode = statusCode;
|
this.statusCode = statusCode;
|
||||||
this.body = body;
|
|
||||||
this.rawResponse = response;
|
|
||||||
this.name = "SDKError";
|
this.name = "SDKError";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class StartAllTasksResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "StartAllTasksResponseBody";
|
this.name = "StartAllTasksResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ export class StartTaskResponseBody extends Error {
|
|||||||
this.rawResponse = err.rawResponse;
|
this.rawResponse = err.rawResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
this.message =
|
||||||
const { rawResponse, ...data } = err;
|
"message" in err && typeof err.message === "string"
|
||||||
const content = JSON.stringify(data);
|
? err.message
|
||||||
this.message = [msg, content].filter(Boolean).join("\n");
|
: "API error occurred";
|
||||||
|
|
||||||
this.name = "StartTaskResponseBody";
|
this.name = "StartTaskResponseBody";
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user