ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.484.1

This commit is contained in:
speakeasybot
2025-02-06 00:11:16 +00:00
parent 3152372037
commit 18b64727c3
42 changed files with 2394 additions and 49 deletions

View File

@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 16f22cbf-f23f-4419-8924-3a4b06381947
management:
docChecksum: c43b19369db7bd8d09eade562cd4268f
docChecksum: 36c9d80c203ab86cde2de03991949259
docVersion: 0.0.3
speakeasyVersion: 1.484.1
generationVersion: 2.503.2
releaseVersion: 0.32.4
configChecksum: 6c86c5fcb9c283a387bf93aaf260bee6
releaseVersion: 0.32.5
configChecksum: df3297b335ae5be90b5d2d5181fc74ed
repoURL: https://github.com/LukeHagar/plexjs.git
repoSubDirectory: .
installationURL: https://github.com/LukeHagar/plexjs
@@ -276,6 +276,10 @@ generatedFiles:
- docs/sdk/models/errors/getuserfriendserrors.md
- docs/sdk/models/errors/getuserfriendsplexerrors.md
- docs/sdk/models/errors/getuserfriendsunauthorized.md
- docs/sdk/models/errors/getusersbadrequest.md
- docs/sdk/models/errors/getuserserrors.md
- docs/sdk/models/errors/getusersunauthorized.md
- docs/sdk/models/errors/getusersuserserrors.md
- docs/sdk/models/errors/getwatchlistbadrequest.md
- docs/sdk/models/errors/getwatchlisterrors.md
- docs/sdk/models/errors/getwatchlistunauthorized.md
@@ -353,6 +357,12 @@ generatedFiles:
- docs/sdk/models/operations/addplaylistcontentsrequest.md
- docs/sdk/models/operations/addplaylistcontentsresponse.md
- docs/sdk/models/operations/addplaylistcontentsresponsebody.md
- docs/sdk/models/operations/alllibraries.md
- docs/sdk/models/operations/allowcameraupload.md
- docs/sdk/models/operations/allowchannels.md
- docs/sdk/models/operations/allowsubtitleadmin.md
- docs/sdk/models/operations/allowsync.md
- docs/sdk/models/operations/allowtuners.md
- docs/sdk/models/operations/applyupdatesrequest.md
- docs/sdk/models/operations/applyupdatesresponse.md
- docs/sdk/models/operations/autoselectsubtitle.md
@@ -715,6 +725,7 @@ generatedFiles:
- docs/sdk/models/operations/gettopwatchedcontentresponse.md
- docs/sdk/models/operations/gettopwatchedcontentresponsebody.md
- docs/sdk/models/operations/gettopwatchedcontentrole.md
- docs/sdk/models/operations/gettopwatchedcontentuser.md
- docs/sdk/models/operations/gettranscodesessionsmediacontainer.md
- docs/sdk/models/operations/gettranscodesessionsresponse.md
- docs/sdk/models/operations/gettranscodesessionsresponsebody.md
@@ -725,11 +736,17 @@ generatedFiles:
- docs/sdk/models/operations/getupdatestatusresponse.md
- docs/sdk/models/operations/getupdatestatusresponsebody.md
- docs/sdk/models/operations/getuserfriendsresponse.md
- docs/sdk/models/operations/getusersmediacontainer.md
- docs/sdk/models/operations/getusersrequest.md
- docs/sdk/models/operations/getusersresponse.md
- docs/sdk/models/operations/getusersresponsebody.md
- docs/sdk/models/operations/getusersserver.md
- docs/sdk/models/operations/getwatchlistrequest.md
- docs/sdk/models/operations/getwatchlistresponse.md
- docs/sdk/models/operations/getwatchlistresponsebody.md
- docs/sdk/models/operations/guids.md
- docs/sdk/models/operations/hasthumbnail.md
- docs/sdk/models/operations/home.md
- docs/sdk/models/operations/hub.md
- docs/sdk/models/operations/image.md
- docs/sdk/models/operations/includecollections.md
@@ -765,9 +782,11 @@ generatedFiles:
- docs/sdk/models/operations/onlytransient.md
- docs/sdk/models/operations/operator.md
- docs/sdk/models/operations/optimizedforstreaming.md
- docs/sdk/models/operations/owned.md
- docs/sdk/models/operations/part.md
- docs/sdk/models/operations/pastsubscription.md
- docs/sdk/models/operations/pathparamtaskname.md
- docs/sdk/models/operations/pending.md
- docs/sdk/models/operations/performsearchrequest.md
- docs/sdk/models/operations/performsearchresponse.md
- docs/sdk/models/operations/performvoicesearchrequest.md
@@ -795,6 +814,7 @@ generatedFiles:
- docs/sdk/models/operations/postuserssignindatauserprofile.md
- docs/sdk/models/operations/postuserssignindatawatchedindicator.md
- docs/sdk/models/operations/producer.md
- docs/sdk/models/operations/protected.md
- docs/sdk/models/operations/protocol.md
- docs/sdk/models/operations/provider.md
- docs/sdk/models/operations/queryparamfilter.md
@@ -808,6 +828,7 @@ generatedFiles:
- docs/sdk/models/operations/ratings.md
- docs/sdk/models/operations/release.md
- docs/sdk/models/operations/responsebody.md
- docs/sdk/models/operations/restricted.md
- docs/sdk/models/operations/role.md
- docs/sdk/models/operations/scope.md
- docs/sdk/models/operations/searchresult.md
@@ -873,6 +894,7 @@ generatedFiles:
- docs/sdks/sessions/README.md
- docs/sdks/statistics/README.md
- docs/sdks/updater/README.md
- docs/sdks/users/README.md
- docs/sdks/video/README.md
- docs/sdks/watchlist/README.md
- docs/types/rfcdate.md
@@ -955,6 +977,7 @@ generatedFiles:
- src/funcs/updaterApplyUpdates.ts
- src/funcs/updaterCheckForUpdates.ts
- src/funcs/updaterGetUpdateStatus.ts
- src/funcs/usersGetUsers.ts
- src/funcs/videoGetTimeline.ts
- src/funcs/videoStartUniversalTranscode.ts
- src/funcs/watchlistGetWatchList.ts
@@ -1045,6 +1068,7 @@ generatedFiles:
- src/sdk/models/errors/gettransienttoken.ts
- src/sdk/models/errors/getupdatestatus.ts
- src/sdk/models/errors/getuserfriends.ts
- src/sdk/models/errors/getusers.ts
- src/sdk/models/errors/getwatchlist.ts
- src/sdk/models/errors/httpclienterrors.ts
- src/sdk/models/errors/index.ts
@@ -1127,6 +1151,7 @@ generatedFiles:
- src/sdk/models/operations/gettransienttoken.ts
- src/sdk/models/operations/getupdatestatus.ts
- src/sdk/models/operations/getuserfriends.ts
- src/sdk/models/operations/getusers.ts
- src/sdk/models/operations/getwatchlist.ts
- src/sdk/models/operations/index.ts
- src/sdk/models/operations/logline.ts
@@ -1163,6 +1188,7 @@ generatedFiles:
- src/sdk/types/rfcdate.ts
- src/sdk/types/streams.ts
- src/sdk/updater.ts
- src/sdk/users.ts
- src/sdk/video.ts
- src/sdk/watchlist.ts
- tsconfig.json
@@ -2176,5 +2202,29 @@ examples:
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}]}
get-users:
"":
parameters:
header:
X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58"
X-Plex-Product: "Plex for Roku"
X-Plex-Device: "Roku 3"
X-Plex-Device-Name: "Chrome"
X-Plex-Device-Screen-Resolution: "1487x1165,2560x1440"
X-Plex-Version: "2.4.1"
X-Plex-Platform: "Roku"
X-Plex-Features: "external-media,indirect-media,hub-style-list"
X-Plex-Model: "4200X"
X-Plex-Session-Id: "97e136ef-4ddd-4ff3-89a7-a5820c96c2ca"
X-Plex-Language: "en"
X-Plex-Platform-Version: "4.3 build 1057"
X-Plex-Token: "CV5xoxjTpFKUzBTShsaf"
responses:
"200":
application/xml: "0xa9CdebeF9E"
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}, {"code": 1001, "message": "User could not be authenticated", "status": 401}]}
examplesVersion: 1.0.0
generatedTests: {}

View File

@@ -13,7 +13,7 @@ generation:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false
typescript:
version: 0.32.4
version: 0.32.5
additionalDependencies:
dependencies: {}
devDependencies: {}

View File

@@ -9,20 +9,20 @@ sources:
- main
plexapi:
sourceNamespace: plexapi
sourceRevisionDigest: sha256:0b88c8bfc41def63e19e91fdd4d51bab07cb947cc3d39d2b44e8523a209cec10
sourceBlobDigest: sha256:89d5b8427d4fb61b25751aebbaf71f9613958e9e91073fc084fed2c2ec62ce55
sourceRevisionDigest: sha256:e6ab335dd91a4165f4510e4a3af8a55819c6310b7e66251266d2384376f3ccae
sourceBlobDigest: sha256:89d1b1133e400c89f0d06efe5e5168f5ba25a413e1ab8380d442d6b233e2e5a9
tags:
- latest
- speakeasy-sdk-regen-1738714216
- speakeasy-sdk-regen-1738800605
- 0.0.3
targets:
plexjs:
source: plexapi
sourceNamespace: plexapi
sourceRevisionDigest: sha256:0b88c8bfc41def63e19e91fdd4d51bab07cb947cc3d39d2b44e8523a209cec10
sourceBlobDigest: sha256:89d5b8427d4fb61b25751aebbaf71f9613958e9e91073fc084fed2c2ec62ce55
sourceRevisionDigest: sha256:e6ab335dd91a4165f4510e4a3af8a55819c6310b7e66251266d2384376f3ccae
sourceBlobDigest: sha256:89d1b1133e400c89f0d06efe5e5168f5ba25a413e1ab8380d442d6b233e2e5a9
codeSamplesNamespace: code-samples-typescript-plexjs
codeSamplesRevisionDigest: sha256:df7e2100185ec86a48b4f65f568ed638af71b9f8a978161e67b8c21d3f90817b
codeSamplesRevisionDigest: sha256:214b9a57e050598b3c15f0f8504a591973e8399cad8b8be2917772c3f75861a9
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest

View File

@@ -243,6 +243,10 @@ run();
* [checkForUpdates](docs/sdks/updater/README.md#checkforupdates) - Checking for updates
* [applyUpdates](docs/sdks/updater/README.md#applyupdates) - Apply Updates
### [users](docs/sdks/users/README.md)
* [getUsers](docs/sdks/users/README.md#getusers) - Get list of all connected users
### [video](docs/sdks/video/README.md)
* [getTimeline](docs/sdks/video/README.md#gettimeline) - Get the timeline for a media item
@@ -564,6 +568,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
- [`updaterApplyUpdates`](docs/sdks/updater/README.md#applyupdates) - Apply Updates
- [`updaterCheckForUpdates`](docs/sdks/updater/README.md#checkforupdates) - Checking for updates
- [`updaterGetUpdateStatus`](docs/sdks/updater/README.md#getupdatestatus) - Querying status of updates
- [`usersGetUsers`](docs/sdks/users/README.md#getusers) - Get list of all connected users
- [`videoGetTimeline`](docs/sdks/video/README.md#gettimeline) - Get the timeline for a media item
- [`videoStartUniversalTranscode`](docs/sdks/video/README.md#startuniversaltranscode) - Start Universal Transcode
- [`watchlistGetWatchList`](docs/sdks/watchlist/README.md#getwatchlist) - Get User Watchlist

View File

@@ -1198,4 +1198,14 @@ Based on:
### Generated
- [typescript v0.32.4] .
### Releases
- [NPM v0.32.4] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.32.4 - .
- [NPM v0.32.4] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.32.4 - .
## 2025-02-06 00:09:46
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.484.1 (2.503.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.32.5] .
### Releases
- [NPM v0.32.5] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.32.5 - .

View File

@@ -1621,6 +1621,38 @@ actions:
console.log(result);
}
run();
- target: $["paths"]["/users"]["get"]
update:
x-codeSamples:
- lang: typescript
label: users
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI();
async function run() {
const result = await plexAPI.users.getUsers({
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
deviceNickname: "Roku 3",
deviceName: "Chrome",
deviceScreenResolution: "1487x1165,2560x1440",
clientVersion: "2.4.1",
platform: "Roku",
clientFeatures: "external-media,indirect-media,hub-style-list",
model: "4200X",
xPlexSessionId: "97e136ef-4ddd-4ff3-89a7-a5820c96c2ca",
xPlexLanguage: "en",
platformVersion: "4.3 build 1057",
xPlexToken: "CV5xoxjTpFKUzBTShsaf",
});
// Handle the result
console.log(result);
}
run();
- target: $["paths"]["/users/signin"]["post"]
update:

View File

@@ -0,0 +1,18 @@
# GetUsersBadRequest
Bad Request - A parameter was not specified, or was specified incorrectly.
## Example Usage
```typescript
import { GetUsersBadRequest } from "@lukehagar/plexjs/sdk/models/errors";
// No examples available for this model
```
## Fields
| Field | Type | Required | Description |
| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `errors` | [errors.GetUsersErrors](../../../sdk/models/errors/getuserserrors.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 |

View File

@@ -0,0 +1,21 @@
# GetUsersErrors
## Example Usage
```typescript
import { GetUsersErrors } from "@lukehagar/plexjs/sdk/models/errors";
let value: GetUsersErrors = {
code: 1000,
message: "X-Plex-Client-Identifier is missing",
status: 400,
};
```
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
| `code` | *number* | :heavy_minus_sign: | N/A | 1000 |
| `message` | *string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing |
| `status` | *number* | :heavy_minus_sign: | N/A | 400 |

View File

@@ -0,0 +1,18 @@
# GetUsersUnauthorized
Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
## Example Usage
```typescript
import { GetUsersUnauthorized } from "@lukehagar/plexjs/sdk/models/errors";
// No examples available for this model
```
## Fields
| Field | Type | Required | Description |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `errors` | [errors.GetUsersUsersErrors](../../../sdk/models/errors/getusersuserserrors.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 |

View File

@@ -0,0 +1,21 @@
# GetUsersUsersErrors
## Example Usage
```typescript
import { GetUsersUsersErrors } from "@lukehagar/plexjs/sdk/models/errors";
let value: GetUsersUsersErrors = {
code: 1001,
message: "User could not be authenticated",
status: 401,
};
```
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- |
| `code` | *number* | :heavy_minus_sign: | N/A | 1001 |
| `message` | *string* | :heavy_minus_sign: | N/A | User could not be authenticated |
| `status` | *number* | :heavy_minus_sign: | N/A | 401 |

View File

@@ -0,0 +1,18 @@
# AllLibraries
Indicates if the user has access to all libraries.
## Example Usage
```typescript
import { AllLibraries } from "@lukehagar/plexjs/sdk/models/operations";
let value: AllLibraries = AllLibraries.Enable;
```
## Values
| Name | Value |
| --------- | --------- |
| `Disable` | 0 |
| `Enable` | 1 |

View File

@@ -0,0 +1,18 @@
# AllowCameraUpload
Indicates if the user is allowed to upload from a camera.
## Example Usage
```typescript
import { AllowCameraUpload } from "@lukehagar/plexjs/sdk/models/operations";
let value: AllowCameraUpload = AllowCameraUpload.Enable;
```
## Values
| Name | Value |
| --------- | --------- |
| `Disable` | 0 |
| `Enable` | 1 |

View File

@@ -0,0 +1,18 @@
# AllowChannels
Indicates if the user has access to channels.
## Example Usage
```typescript
import { AllowChannels } from "@lukehagar/plexjs/sdk/models/operations";
let value: AllowChannels = AllowChannels.Enable;
```
## Values
| Name | Value |
| --------- | --------- |
| `Disable` | 0 |
| `Enable` | 1 |

View File

@@ -0,0 +1,18 @@
# AllowSubtitleAdmin
Indicates if the user can manage subtitles.
## Example Usage
```typescript
import { AllowSubtitleAdmin } from "@lukehagar/plexjs/sdk/models/operations";
let value: AllowSubtitleAdmin = AllowSubtitleAdmin.Enable;
```
## Values
| Name | Value |
| --------- | --------- |
| `Disable` | 0 |
| `Enable` | 1 |

View File

@@ -0,0 +1,18 @@
# AllowSync
Indicates if the user is allowed to sync media.
## Example Usage
```typescript
import { AllowSync } from "@lukehagar/plexjs/sdk/models/operations";
let value: AllowSync = AllowSync.Enable;
```
## Values
| Name | Value |
| --------- | --------- |
| `Disable` | 0 |
| `Enable` | 1 |

View File

@@ -0,0 +1,18 @@
# AllowTuners
Indicates if the user is allowed to use tuners.
## Example Usage
```typescript
import { AllowTuners } from "@lukehagar/plexjs/sdk/models/operations";
let value: AllowTuners = AllowTuners.Enable;
```
## Values
| Name | Value |
| --------- | --------- |
| `Disable` | 0 |
| `Enable` | 1 |

View File

@@ -108,4 +108,4 @@ let value: GetTopWatchedContentMetadata = {
| `country` | [operations.GetTopWatchedContentCountry](../../../sdk/models/operations/gettopwatchedcontentcountry.md)[] | :heavy_minus_sign: | N/A | |
| `guids` | [operations.GetTopWatchedContentGuids](../../../sdk/models/operations/gettopwatchedcontentguids.md)[] | :heavy_minus_sign: | N/A | |
| `role` | [operations.GetTopWatchedContentRole](../../../sdk/models/operations/gettopwatchedcontentrole.md)[] | :heavy_minus_sign: | N/A | |
| `user` | [operations.User](../../../sdk/models/operations/user.md)[] | :heavy_minus_sign: | N/A | |
| `user` | [operations.GetTopWatchedContentUser](../../../sdk/models/operations/gettopwatchedcontentuser.md)[] | :heavy_minus_sign: | N/A | |

View File

@@ -0,0 +1,17 @@
# GetTopWatchedContentUser
## Example Usage
```typescript
import { GetTopWatchedContentUser } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetTopWatchedContentUser = {
id: 220,
};
```
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `id` | *number* | :heavy_minus_sign: | N/A | 220 |

View File

@@ -0,0 +1,53 @@
# GetUsersMediaContainer
Container holding user and server details.
## Example Usage
```typescript
import { GetUsersMediaContainer } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetUsersMediaContainer = {
friendlyName: "myPlex",
identifier: "com.plexapp.plugins.myplex",
machineIdentifier: "3dff4c4da3b1229a649aa574a9e2b419a684a20e",
totalSize: 30,
size: 30,
user: [
{
id: 22526914,
title: "Plex User",
username: "zgfuc7krcqfimrmb9lsl5j",
email: "zgfuc7krcqfimrmb9lsl5j@protonmail.com",
recommendationsPlaylistId: "",
thumb: "https://plex.tv/users/3346028014e93acd/avatar?c=1731605021",
filterAll: "",
filterMovies: "",
filterMusic: "",
filterPhotos: "",
filterTelevision: "",
server: [
{
id: 907759180,
serverId: 9999999,
machineIdentifier: "fbb8aa6be6e0c997c6268bc2b4431c8807f70a3",
name: "ConnectedUserFlix",
lastSeenAt: 1556281940,
numLibraries: 16,
},
],
},
],
};
```
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
| `friendlyName` | *string* | :heavy_check_mark: | The friendly name of the Plex instance. | myPlex |
| `identifier` | *string* | :heavy_check_mark: | N/A | com.plexapp.plugins.myplex |
| `machineIdentifier` | *string* | :heavy_check_mark: | Unique Machine identifier of the Plex server. | 3dff4c4da3b1229a649aa574a9e2b419a684a20e |
| `totalSize` | *number* | :heavy_check_mark: | Total number of users. | 30 |
| `size` | *number* | :heavy_check_mark: | Number of users in the current response. | 30 |
| `user` | [operations.User](../../../sdk/models/operations/user.md)[] | :heavy_check_mark: | List of users with access to the Plex server. | |

View File

@@ -0,0 +1,41 @@
# GetUsersRequest
## Example Usage
```typescript
import { GetUsersRequest } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetUsersRequest = {
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
deviceNickname: "Roku 3",
deviceName: "Chrome",
deviceScreenResolution: "1487x1165,2560x1440",
clientVersion: "2.4.1",
platform: "Roku",
clientFeatures: "external-media,indirect-media,hub-style-list",
model: "4200X",
xPlexSessionId: "97e136ef-4ddd-4ff3-89a7-a5820c96c2ca",
xPlexLanguage: "en",
platformVersion: "4.3 build 1057",
xPlexToken: "CV5xoxjTpFKUzBTShsaf",
};
```
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `clientID` | *string* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 |
| `clientName` | *string* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku |
| `deviceNickname` | *string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 |
| `deviceName` | *string* | :heavy_minus_sign: | The name of the device the client application is running on. This is used to track the client application and its usage. (Chrome, Safari, etc.) | Chrome |
| `deviceScreenResolution` | *string* | :heavy_minus_sign: | The resolution of the device the client application is running on. This is used to track the client application and its usage. (1487x1165,2560x1440) | 1487x1165,2560x1440 |
| `clientVersion` | *string* | :heavy_minus_sign: | The version of the client application. | 2.4.1 |
| `platform` | *string* | :heavy_minus_sign: | The platform of the client application. | Roku |
| `clientFeatures` | *string* | :heavy_minus_sign: | The features of the client application. This is used to track the client application and its usage. (external-media,indirect-media,hub-style-list) | external-media,indirect-media,hub-style-list |
| `model` | *string* | :heavy_minus_sign: | A potentially less friendly identifier for the device model | 4200X |
| `xPlexSessionId` | *string* | :heavy_minus_sign: | The session ID of the client application. This is used to track the client application and its usage. (97e136ef-4ddd-4ff3-89a7-a5820c96c2ca) | 97e136ef-4ddd-4ff3-89a7-a5820c96c2ca |
| `xPlexLanguage` | *string* | :heavy_minus_sign: | The language of the client application. | en |
| `platformVersion` | *string* | :heavy_minus_sign: | The version of the platform | 4.3 build 1057 |
| `xPlexToken` | *string* | :heavy_check_mark: | An authentication token, obtained from plex.tv | CV5xoxjTpFKUzBTShsaf |

View File

@@ -0,0 +1,24 @@
# GetUsersResponse
## Example Usage
```typescript
import { GetUsersResponse } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetUsersResponse = {
contentType: "<value>",
statusCode: 101,
rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" },
}),
};
```
## Fields
| Field | Type | Required | Description |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation |
| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
| `body` | *Uint8Array* | :heavy_minus_sign: | N/A |

View File

@@ -0,0 +1,50 @@
# GetUsersResponseBody
Successful response with media container data in XML
## Example Usage
```typescript
import { GetUsersResponseBody } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetUsersResponseBody = {
mediaContainer: {
friendlyName: "myPlex",
identifier: "com.plexapp.plugins.myplex",
machineIdentifier: "3dff4c4da3b1229a649aa574a9e2b419a684a20e",
totalSize: 30,
size: 30,
user: [
{
id: 22526914,
title: "Plex User",
username: "zgfuc7krcqfimrmb9lsl5j",
email: "zgfuc7krcqfimrmb9lsl5j@protonmail.com",
recommendationsPlaylistId: "",
thumb: "https://plex.tv/users/3346028014e93acd/avatar?c=1731605021",
filterAll: "",
filterMovies: "",
filterMusic: "",
filterPhotos: "",
filterTelevision: "",
server: [
{
id: 907759180,
serverId: 9999999,
machineIdentifier: "fbb8aa6be6e0c997c6268bc2b4431c8807f70a3",
name: "ConnectedUserFlix",
lastSeenAt: 1556281940,
numLibraries: 16,
},
],
},
],
},
};
```
## Fields
| Field | Type | Required | Description |
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `mediaContainer` | [operations.GetUsersMediaContainer](../../../sdk/models/operations/getusersmediacontainer.md) | :heavy_minus_sign: | Container holding user and server details. |

View File

@@ -0,0 +1,30 @@
# GetUsersServer
## Example Usage
```typescript
import { GetUsersServer } from "@lukehagar/plexjs/sdk/models/operations";
let value: GetUsersServer = {
id: 907759180,
serverId: 9999999,
machineIdentifier: "fbb8aa6be6e0c997c6268bc2b4431c8807f70a3",
name: "ConnectedUserFlix",
lastSeenAt: 1556281940,
numLibraries: 16,
};
```
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `id` | *number* | :heavy_check_mark: | Unique ID of the server of the connected user | 907759180 |
| `serverId` | *number* | :heavy_check_mark: | ID of the actual Plex server. | 9999999 |
| `machineIdentifier` | *string* | :heavy_check_mark: | Machine identifier of the Plex server. | fbb8aa6be6e0c997c6268bc2b4431c8807f70a3 |
| `name` | *string* | :heavy_check_mark: | Name of the Plex server of the connected user. | ConnectedUserFlix |
| `lastSeenAt` | *number* | :heavy_check_mark: | N/A | 1556281940 |
| `numLibraries` | *number* | :heavy_check_mark: | Number of libraries in the server this user has access to. | 16 |
| `allLibraries` | [operations.AllLibraries](../../../sdk/models/operations/alllibraries.md) | :heavy_minus_sign: | N/A | 1 |
| `owned` | [operations.Owned](../../../sdk/models/operations/owned.md) | :heavy_minus_sign: | N/A | 1 |
| `pending` | [operations.Pending](../../../sdk/models/operations/pending.md) | :heavy_minus_sign: | N/A | 1 |

View File

@@ -0,0 +1,18 @@
# Home
Indicates if the user is part of a home group.
## Example Usage
```typescript
import { Home } from "@lukehagar/plexjs/sdk/models/operations";
let value: Home = Home.Enable;
```
## Values
| Name | Value |
| --------- | --------- |
| `Disable` | 0 |
| `Enable` | 1 |

View File

@@ -0,0 +1,18 @@
# Owned
Indicates if the user owns the server.
## Example Usage
```typescript
import { Owned } from "@lukehagar/plexjs/sdk/models/operations";
let value: Owned = Owned.Enable;
```
## Values
| Name | Value |
| --------- | --------- |
| `Disable` | 0 |
| `Enable` | 1 |

View File

@@ -0,0 +1,18 @@
# Pending
Indicates if the server is pending approval.
## Example Usage
```typescript
import { Pending } from "@lukehagar/plexjs/sdk/models/operations";
let value: Pending = Pending.Enable;
```
## Values
| Name | Value |
| --------- | --------- |
| `Disable` | 0 |
| `Enable` | 1 |

View File

@@ -0,0 +1,18 @@
# Protected
Indicates whether the account is protected.
## Example Usage
```typescript
import { Protected } from "@lukehagar/plexjs/sdk/models/operations";
let value: Protected = Protected.Enable;
```
## Values
| Name | Value |
| --------- | --------- |
| `Disable` | 0 |
| `Enable` | 1 |

View File

@@ -0,0 +1,18 @@
# Restricted
Indicates if the user has restricted access.
## Example Usage
```typescript
import { Restricted } from "@lukehagar/plexjs/sdk/models/operations";
let value: Restricted = Restricted.Enable;
```
## Values
| Name | Value |
| --------- | --------- |
| `Disable` | 0 |
| `Enable` | 1 |

View File

@@ -6,12 +6,51 @@
import { User } from "@lukehagar/plexjs/sdk/models/operations";
let value: User = {
id: 220,
id: 22526914,
title: "Plex User",
username: "zgfuc7krcqfimrmb9lsl5j",
email: "zgfuc7krcqfimrmb9lsl5j@protonmail.com",
recommendationsPlaylistId: "",
thumb: "https://plex.tv/users/3346028014e93acd/avatar?c=1731605021",
filterAll: "",
filterMovies: "",
filterMusic: "",
filterPhotos: "",
filterTelevision: "",
server: [
{
id: 907759180,
serverId: 9999999,
machineIdentifier: "fbb8aa6be6e0c997c6268bc2b4431c8807f70a3",
name: "ConnectedUserFlix",
lastSeenAt: 1556281940,
numLibraries: 16,
},
],
};
```
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `id` | *number* | :heavy_minus_sign: | N/A | 220 |
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `id` | *number* | :heavy_check_mark: | User's unique ID. | 22526914 |
| `title` | *string* | :heavy_check_mark: | User's display name. | Plex User |
| `username` | *string* | :heavy_check_mark: | User's username. | zgfuc7krcqfimrmb9lsl5j |
| `email` | *string* | :heavy_check_mark: | User's email address. | zgfuc7krcqfimrmb9lsl5j@protonmail.com |
| `recommendationsPlaylistId` | *string* | :heavy_minus_sign: | ID of the user's recommendation playlist. | |
| `thumb` | *string* | :heavy_check_mark: | URL to the user's avatar image. | https://plex.tv/users/3346028014e93acd/avatar?c=1731605021 |
| `protected` | [operations.Protected](../../../sdk/models/operations/protected.md) | :heavy_minus_sign: | N/A | 1 |
| `home` | [operations.Home](../../../sdk/models/operations/home.md) | :heavy_minus_sign: | N/A | 1 |
| `allowTuners` | [operations.AllowTuners](../../../sdk/models/operations/allowtuners.md) | :heavy_minus_sign: | N/A | 1 |
| `allowSync` | [operations.AllowSync](../../../sdk/models/operations/allowsync.md) | :heavy_minus_sign: | N/A | 1 |
| `allowCameraUpload` | [operations.AllowCameraUpload](../../../sdk/models/operations/allowcameraupload.md) | :heavy_minus_sign: | N/A | 1 |
| `allowChannels` | [operations.AllowChannels](../../../sdk/models/operations/allowchannels.md) | :heavy_minus_sign: | N/A | 1 |
| `allowSubtitleAdmin` | [operations.AllowSubtitleAdmin](../../../sdk/models/operations/allowsubtitleadmin.md) | :heavy_minus_sign: | N/A | 1 |
| `filterAll` | *string* | :heavy_minus_sign: | Filters applied for all content. | |
| `filterMovies` | *string* | :heavy_minus_sign: | Filters applied for movies. | |
| `filterMusic` | *string* | :heavy_minus_sign: | Filters applied for music. | |
| `filterPhotos` | *string* | :heavy_minus_sign: | Filters applied for photos. | |
| `filterTelevision` | *string* | :heavy_minus_sign: | Filters applied for television. | |
| `restricted` | [operations.Restricted](../../../sdk/models/operations/restricted.md) | :heavy_minus_sign: | N/A | 1 |
| `server` | [operations.GetUsersServer](../../../sdk/models/operations/getusersserver.md)[] | :heavy_check_mark: | List of servers owned by the user. | |

107
docs/sdks/users/README.md Normal file
View File

@@ -0,0 +1,107 @@
# Users
(*users*)
## Overview
### Available Operations
* [getUsers](#getusers) - Get list of all connected users
## getUsers
Get list of all users that are friends and have library access with the provided Plex authentication token
### Example Usage
```typescript
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI();
async function run() {
const result = await plexAPI.users.getUsers({
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
deviceNickname: "Roku 3",
deviceName: "Chrome",
deviceScreenResolution: "1487x1165,2560x1440",
clientVersion: "2.4.1",
platform: "Roku",
clientFeatures: "external-media,indirect-media,hub-style-list",
model: "4200X",
xPlexSessionId: "97e136ef-4ddd-4ff3-89a7-a5820c96c2ca",
xPlexLanguage: "en",
platformVersion: "4.3 build 1057",
xPlexToken: "CV5xoxjTpFKUzBTShsaf",
});
// Handle the result
console.log(result);
}
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { usersGetUsers } from "@lukehagar/plexjs/funcs/usersGetUsers.js";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore();
async function run() {
const res = await usersGetUsers(plexAPI, {
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
clientName: "Plex for Roku",
deviceNickname: "Roku 3",
deviceName: "Chrome",
deviceScreenResolution: "1487x1165,2560x1440",
clientVersion: "2.4.1",
platform: "Roku",
clientFeatures: "external-media,indirect-media,hub-style-list",
model: "4200X",
xPlexSessionId: "97e136ef-4ddd-4ff3-89a7-a5820c96c2ca",
xPlexLanguage: "en",
platformVersion: "4.3 build 1057",
xPlexToken: "CV5xoxjTpFKUzBTShsaf",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request` | [operations.GetUsersRequest](../../sdk/models/operations/getusersrequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
| `options.serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. |
### Response
**Promise\<[operations.GetUsersResponse](../../sdk/models/operations/getusersresponse.md)\>**
### Errors
| Error Type | Status Code | Content Type |
| --------------------------- | --------------------------- | --------------------------- |
| errors.GetUsersBadRequest | 400 | application/json |
| errors.GetUsersUnauthorized | 401 | application/json |
| errors.SDKError | 4XX, 5XX | \*/\* |

View File

@@ -2,7 +2,7 @@
{
"name": "@lukehagar/plexjs",
"version": "0.32.4",
"version": "0.32.5",
"exports": {
".": "./src/index.ts",
"./sdk/models/errors": "./src/sdk/models/errors/index.ts",

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@lukehagar/plexjs",
"version": "0.32.4",
"version": "0.32.5",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@lukehagar/plexjs",
"version": "0.32.4",
"version": "0.32.5",
"devDependencies": {
"@eslint/js": "^9.19.0",
"eslint": "^9.19.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@lukehagar/plexjs",
"version": "0.32.4",
"version": "0.32.5",
"author": "LukeHagar",
"main": "./index.js",
"sideEffects": false,

199
src/funcs/usersGetUsers.ts Normal file
View File

@@ -0,0 +1,199 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { PlexAPICore } from "../core.js";
import { encodeSimple } from "../lib/encodings.js";
import * as M from "../lib/matchers.js";
import { compactMap } from "../lib/primitives.js";
import { safeParse } from "../lib/schemas.js";
import { RequestOptions } from "../lib/sdks.js";
import { pathToFunc } from "../lib/url.js";
import {
ConnectionError,
InvalidRequestError,
RequestAbortedError,
RequestTimeoutError,
UnexpectedClientError,
} from "../sdk/models/errors/httpclienterrors.js";
import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import { GetUsersServerList } from "../sdk/models/operations/getusers.js";
import * as operations from "../sdk/models/operations/index.js";
import { Result } from "../sdk/types/fp.js";
/**
* Get list of all connected users
*
* @remarks
* Get list of all users that are friends and have library access with the provided Plex authentication token
*/
export async function usersGetUsers(
client: PlexAPICore,
request: operations.GetUsersRequest,
options?: RequestOptions,
): Promise<
Result<
operations.GetUsersResponse,
| errors.GetUsersBadRequest
| errors.GetUsersUnauthorized
| SDKError
| SDKValidationError
| UnexpectedClientError
| InvalidRequestError
| RequestAbortedError
| RequestTimeoutError
| ConnectionError
>
> {
const parsed = safeParse(
request,
(value) => operations.GetUsersRequest$outboundSchema.parse(value),
"Input validation failed",
);
if (!parsed.ok) {
return parsed;
}
const payload = parsed.value;
const body = null;
const baseURL = options?.serverURL
|| pathToFunc(GetUsersServerList[0], { charEncoding: "percent" })();
const path = pathToFunc("/users")();
const headers = new Headers(compactMap({
Accept: "application/xml",
"X-Plex-Features": encodeSimple("X-Plex-Features", payload.ClientFeatures, {
explode: false,
charEncoding: "none",
}),
"X-Plex-Client-Identifier": encodeSimple(
"X-Plex-Client-Identifier",
payload.ClientID,
{ explode: false, charEncoding: "none" },
),
"X-Plex-Product": encodeSimple("X-Plex-Product", payload.ClientName, {
explode: false,
charEncoding: "none",
}),
"X-Plex-Version": encodeSimple("X-Plex-Version", payload.ClientVersion, {
explode: false,
charEncoding: "none",
}),
"X-Plex-Device-Name": encodeSimple(
"X-Plex-Device-Name",
payload.DeviceName,
{ explode: false, charEncoding: "none" },
),
"X-Plex-Device": encodeSimple("X-Plex-Device", payload.DeviceNickname, {
explode: false,
charEncoding: "none",
}),
"X-Plex-Device-Screen-Resolution": encodeSimple(
"X-Plex-Device-Screen-Resolution",
payload.DeviceScreenResolution,
{ explode: false, charEncoding: "none" },
),
"X-Plex-Model": encodeSimple("X-Plex-Model", payload.Model, {
explode: false,
charEncoding: "none",
}),
"X-Plex-Platform": encodeSimple("X-Plex-Platform", payload.Platform, {
explode: false,
charEncoding: "none",
}),
"X-Plex-Platform-Version": encodeSimple(
"X-Plex-Platform-Version",
payload.PlatformVersion,
{ explode: false, charEncoding: "none" },
),
"X-Plex-Language": encodeSimple(
"X-Plex-Language",
payload["X-Plex-Language"],
{ explode: false, charEncoding: "none" },
),
"X-Plex-Session-Id": encodeSimple(
"X-Plex-Session-Id",
payload["X-Plex-Session-Id"],
{ explode: false, charEncoding: "none" },
),
"X-Plex-Token": encodeSimple("X-Plex-Token", payload["X-Plex-Token"], {
explode: false,
charEncoding: "none",
}),
}));
const context = {
operationID: "get-users",
oAuth2Scopes: [],
resolvedSecurity: null,
securitySource: null,
retryConfig: options?.retries
|| client._options.retryConfig
|| { strategy: "none" },
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
};
const requestRes = client._createRequest(context, {
method: "GET",
baseURL: baseURL,
path: path,
headers: headers,
body: body,
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
return requestRes;
}
const req = requestRes.value;
const doResult = await client._do(req, {
context,
errorCodes: ["400", "401", "4XX", "5XX"],
retryConfig: context.retryConfig,
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
return doResult;
}
const response = doResult.value;
const responseFields = {
ContentType: response.headers.get("content-type")
?? "application/octet-stream",
StatusCode: response.status,
RawResponse: response,
Headers: {},
};
const [result] = await M.match<
operations.GetUsersResponse,
| errors.GetUsersBadRequest
| errors.GetUsersUnauthorized
| SDKError
| SDKValidationError
| UnexpectedClientError
| InvalidRequestError
| RequestAbortedError
| RequestTimeoutError
| ConnectionError
>(
M.bytes(200, operations.GetUsersResponse$inboundSchema, {
ctype: "application/xml",
key: "Body",
}),
M.jsonErr(400, errors.GetUsersBadRequest$inboundSchema),
M.jsonErr(401, errors.GetUsersUnauthorized$inboundSchema),
M.fail("4XX"),
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
return result;
}
return result;
}

View File

@@ -90,7 +90,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "0.0.3",
sdkVersion: "0.32.4",
sdkVersion: "0.32.5",
genVersion: "2.503.2",
userAgent: "speakeasy-sdk/typescript 0.32.4 2.503.2 0.0.3 @lukehagar/plexjs",
userAgent: "speakeasy-sdk/typescript 0.32.5 2.503.2 0.0.3 @lukehagar/plexjs",
} as const;

View File

@@ -0,0 +1,326 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { remap as remap$ } from "../../../lib/primitives.js";
import { safeParse } from "../../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "./sdkvalidationerror.js";
export type GetUsersUsersErrors = {
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 GetUsersUnauthorizedData = {
errors?: Array<GetUsersUsersErrors> | 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 GetUsersUnauthorized extends Error {
errors?: Array<GetUsersUsersErrors> | undefined;
/**
* Raw HTTP response; suitable for custom response parsing
*/
rawResponse?: Response | undefined;
/** The original data that was passed to this error instance. */
data$: GetUsersUnauthorizedData;
constructor(err: GetUsersUnauthorizedData) {
const message = "message" in err && typeof err.message === "string"
? err.message
: `API error occurred: ${JSON.stringify(err)}`;
super(message);
this.data$ = err;
if (err.errors != null) this.errors = err.errors;
if (err.rawResponse != null) this.rawResponse = err.rawResponse;
this.name = "GetUsersUnauthorized";
}
}
export type GetUsersErrors = {
code?: number | undefined;
message?: string | undefined;
status?: number | undefined;
};
/**
* Bad Request - A parameter was not specified, or was specified incorrectly.
*/
export type GetUsersBadRequestData = {
errors?: Array<GetUsersErrors> | undefined;
/**
* Raw HTTP response; suitable for custom response parsing
*/
rawResponse?: Response | undefined;
};
/**
* Bad Request - A parameter was not specified, or was specified incorrectly.
*/
export class GetUsersBadRequest extends Error {
errors?: Array<GetUsersErrors> | undefined;
/**
* Raw HTTP response; suitable for custom response parsing
*/
rawResponse?: Response | undefined;
/** The original data that was passed to this error instance. */
data$: GetUsersBadRequestData;
constructor(err: GetUsersBadRequestData) {
const message = "message" in err && typeof err.message === "string"
? err.message
: `API error occurred: ${JSON.stringify(err)}`;
super(message);
this.data$ = err;
if (err.errors != null) this.errors = err.errors;
if (err.rawResponse != null) this.rawResponse = err.rawResponse;
this.name = "GetUsersBadRequest";
}
}
/** @internal */
export const GetUsersUsersErrors$inboundSchema: z.ZodType<
GetUsersUsersErrors,
z.ZodTypeDef,
unknown
> = z.object({
code: z.number().int().optional(),
message: z.string().optional(),
status: z.number().int().optional(),
});
/** @internal */
export type GetUsersUsersErrors$Outbound = {
code?: number | undefined;
message?: string | undefined;
status?: number | undefined;
};
/** @internal */
export const GetUsersUsersErrors$outboundSchema: z.ZodType<
GetUsersUsersErrors$Outbound,
z.ZodTypeDef,
GetUsersUsersErrors
> = z.object({
code: z.number().int().optional(),
message: z.string().optional(),
status: z.number().int().optional(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace GetUsersUsersErrors$ {
/** @deprecated use `GetUsersUsersErrors$inboundSchema` instead. */
export const inboundSchema = GetUsersUsersErrors$inboundSchema;
/** @deprecated use `GetUsersUsersErrors$outboundSchema` instead. */
export const outboundSchema = GetUsersUsersErrors$outboundSchema;
/** @deprecated use `GetUsersUsersErrors$Outbound` instead. */
export type Outbound = GetUsersUsersErrors$Outbound;
}
export function getUsersUsersErrorsToJSON(
getUsersUsersErrors: GetUsersUsersErrors,
): string {
return JSON.stringify(
GetUsersUsersErrors$outboundSchema.parse(getUsersUsersErrors),
);
}
export function getUsersUsersErrorsFromJSON(
jsonString: string,
): SafeParseResult<GetUsersUsersErrors, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetUsersUsersErrors$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetUsersUsersErrors' from JSON`,
);
}
/** @internal */
export const GetUsersUnauthorized$inboundSchema: z.ZodType<
GetUsersUnauthorized,
z.ZodTypeDef,
unknown
> = z.object({
errors: z.array(z.lazy(() => GetUsersUsersErrors$inboundSchema)).optional(),
RawResponse: z.instanceof(Response).optional(),
})
.transform((v) => {
const remapped = remap$(v, {
"RawResponse": "rawResponse",
});
return new GetUsersUnauthorized(remapped);
});
/** @internal */
export type GetUsersUnauthorized$Outbound = {
errors?: Array<GetUsersUsersErrors$Outbound> | undefined;
RawResponse?: never | undefined;
};
/** @internal */
export const GetUsersUnauthorized$outboundSchema: z.ZodType<
GetUsersUnauthorized$Outbound,
z.ZodTypeDef,
GetUsersUnauthorized
> = z.instanceof(GetUsersUnauthorized)
.transform(v => v.data$)
.pipe(
z.object({
errors: z.array(z.lazy(() => GetUsersUsersErrors$outboundSchema))
.optional(),
rawResponse: z.instanceof(Response).transform(() => {
throw new Error("Response cannot be serialized");
}).optional(),
}).transform((v) => {
return remap$(v, {
rawResponse: "RawResponse",
});
}),
);
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace GetUsersUnauthorized$ {
/** @deprecated use `GetUsersUnauthorized$inboundSchema` instead. */
export const inboundSchema = GetUsersUnauthorized$inboundSchema;
/** @deprecated use `GetUsersUnauthorized$outboundSchema` instead. */
export const outboundSchema = GetUsersUnauthorized$outboundSchema;
/** @deprecated use `GetUsersUnauthorized$Outbound` instead. */
export type Outbound = GetUsersUnauthorized$Outbound;
}
/** @internal */
export const GetUsersErrors$inboundSchema: z.ZodType<
GetUsersErrors,
z.ZodTypeDef,
unknown
> = z.object({
code: z.number().int().optional(),
message: z.string().optional(),
status: z.number().int().optional(),
});
/** @internal */
export type GetUsersErrors$Outbound = {
code?: number | undefined;
message?: string | undefined;
status?: number | undefined;
};
/** @internal */
export const GetUsersErrors$outboundSchema: z.ZodType<
GetUsersErrors$Outbound,
z.ZodTypeDef,
GetUsersErrors
> = z.object({
code: z.number().int().optional(),
message: z.string().optional(),
status: z.number().int().optional(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace GetUsersErrors$ {
/** @deprecated use `GetUsersErrors$inboundSchema` instead. */
export const inboundSchema = GetUsersErrors$inboundSchema;
/** @deprecated use `GetUsersErrors$outboundSchema` instead. */
export const outboundSchema = GetUsersErrors$outboundSchema;
/** @deprecated use `GetUsersErrors$Outbound` instead. */
export type Outbound = GetUsersErrors$Outbound;
}
export function getUsersErrorsToJSON(getUsersErrors: GetUsersErrors): string {
return JSON.stringify(GetUsersErrors$outboundSchema.parse(getUsersErrors));
}
export function getUsersErrorsFromJSON(
jsonString: string,
): SafeParseResult<GetUsersErrors, SDKValidationError> {
return safeParse(
jsonString,
(x) => GetUsersErrors$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetUsersErrors' from JSON`,
);
}
/** @internal */
export const GetUsersBadRequest$inboundSchema: z.ZodType<
GetUsersBadRequest,
z.ZodTypeDef,
unknown
> = z.object({
errors: z.array(z.lazy(() => GetUsersErrors$inboundSchema)).optional(),
RawResponse: z.instanceof(Response).optional(),
})
.transform((v) => {
const remapped = remap$(v, {
"RawResponse": "rawResponse",
});
return new GetUsersBadRequest(remapped);
});
/** @internal */
export type GetUsersBadRequest$Outbound = {
errors?: Array<GetUsersErrors$Outbound> | undefined;
RawResponse?: never | undefined;
};
/** @internal */
export const GetUsersBadRequest$outboundSchema: z.ZodType<
GetUsersBadRequest$Outbound,
z.ZodTypeDef,
GetUsersBadRequest
> = z.instanceof(GetUsersBadRequest)
.transform(v => v.data$)
.pipe(
z.object({
errors: z.array(z.lazy(() => GetUsersErrors$outboundSchema)).optional(),
rawResponse: z.instanceof(Response).transform(() => {
throw new Error("Response cannot be serialized");
}).optional(),
}).transform((v) => {
return remap$(v, {
rawResponse: "RawResponse",
});
}),
);
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace GetUsersBadRequest$ {
/** @deprecated use `GetUsersBadRequest$inboundSchema` instead. */
export const inboundSchema = GetUsersBadRequest$inboundSchema;
/** @deprecated use `GetUsersBadRequest$outboundSchema` instead. */
export const outboundSchema = GetUsersBadRequest$outboundSchema;
/** @deprecated use `GetUsersBadRequest$Outbound` instead. */
export type Outbound = GetUsersBadRequest$Outbound;
}

View File

@@ -62,6 +62,7 @@ export * from "./gettranscodesessions.js";
export * from "./gettransienttoken.js";
export * from "./getupdatestatus.js";
export * from "./getuserfriends.js";
export * from "./getusers.js";
export * from "./getwatchlist.js";
export * from "./httpclienterrors.js";
export * from "./logline.js";

View File

@@ -74,7 +74,7 @@ export type GetTopWatchedContentRole = {
thumb?: string | undefined;
};
export type User = {
export type GetTopWatchedContentUser = {
id?: number | undefined;
};
@@ -110,7 +110,7 @@ export type GetTopWatchedContentMetadata = {
country?: Array<GetTopWatchedContentCountry> | undefined;
guids?: Array<GetTopWatchedContentGuids> | undefined;
role?: Array<GetTopWatchedContentRole> | undefined;
user?: Array<User> | undefined;
user?: Array<GetTopWatchedContentUser> | undefined;
};
export type GetTopWatchedContentMediaContainer = {
@@ -475,46 +475,56 @@ export function getTopWatchedContentRoleFromJSON(
}
/** @internal */
export const User$inboundSchema: z.ZodType<User, z.ZodTypeDef, unknown> = z
.object({
id: z.number().int().optional(),
});
export const GetTopWatchedContentUser$inboundSchema: z.ZodType<
GetTopWatchedContentUser,
z.ZodTypeDef,
unknown
> = z.object({
id: z.number().int().optional(),
});
/** @internal */
export type User$Outbound = {
export type GetTopWatchedContentUser$Outbound = {
id?: number | undefined;
};
/** @internal */
export const User$outboundSchema: z.ZodType<User$Outbound, z.ZodTypeDef, User> =
z.object({
id: z.number().int().optional(),
});
export const GetTopWatchedContentUser$outboundSchema: z.ZodType<
GetTopWatchedContentUser$Outbound,
z.ZodTypeDef,
GetTopWatchedContentUser
> = z.object({
id: z.number().int().optional(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace User$ {
/** @deprecated use `User$inboundSchema` instead. */
export const inboundSchema = User$inboundSchema;
/** @deprecated use `User$outboundSchema` instead. */
export const outboundSchema = User$outboundSchema;
/** @deprecated use `User$Outbound` instead. */
export type Outbound = User$Outbound;
export namespace GetTopWatchedContentUser$ {
/** @deprecated use `GetTopWatchedContentUser$inboundSchema` instead. */
export const inboundSchema = GetTopWatchedContentUser$inboundSchema;
/** @deprecated use `GetTopWatchedContentUser$outboundSchema` instead. */
export const outboundSchema = GetTopWatchedContentUser$outboundSchema;
/** @deprecated use `GetTopWatchedContentUser$Outbound` instead. */
export type Outbound = GetTopWatchedContentUser$Outbound;
}
export function userToJSON(user: User): string {
return JSON.stringify(User$outboundSchema.parse(user));
export function getTopWatchedContentUserToJSON(
getTopWatchedContentUser: GetTopWatchedContentUser,
): string {
return JSON.stringify(
GetTopWatchedContentUser$outboundSchema.parse(getTopWatchedContentUser),
);
}
export function userFromJSON(
export function getTopWatchedContentUserFromJSON(
jsonString: string,
): SafeParseResult<User, SDKValidationError> {
): SafeParseResult<GetTopWatchedContentUser, SDKValidationError> {
return safeParse(
jsonString,
(x) => User$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'User' from JSON`,
(x) => GetTopWatchedContentUser$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'GetTopWatchedContentUser' from JSON`,
);
}
@@ -559,7 +569,8 @@ export const GetTopWatchedContentMetadata$inboundSchema: z.ZodType<
.optional(),
Role: z.array(z.lazy(() => GetTopWatchedContentRole$inboundSchema))
.optional(),
User: z.array(z.lazy(() => User$inboundSchema)).optional(),
User: z.array(z.lazy(() => GetTopWatchedContentUser$inboundSchema))
.optional(),
}).transform((v) => {
return remap$(v, {
"Genre": "genre",
@@ -603,7 +614,7 @@ export type GetTopWatchedContentMetadata$Outbound = {
Country?: Array<GetTopWatchedContentCountry$Outbound> | undefined;
Guid?: Array<GetTopWatchedContentGuids$Outbound> | undefined;
Role?: Array<GetTopWatchedContentRole$Outbound> | undefined;
User?: Array<User$Outbound> | undefined;
User?: Array<GetTopWatchedContentUser$Outbound> | undefined;
};
/** @internal */
@@ -648,7 +659,8 @@ export const GetTopWatchedContentMetadata$outboundSchema: z.ZodType<
.optional(),
role: z.array(z.lazy(() => GetTopWatchedContentRole$outboundSchema))
.optional(),
user: z.array(z.lazy(() => User$outboundSchema)).optional(),
user: z.array(z.lazy(() => GetTopWatchedContentUser$outboundSchema))
.optional(),
}).transform((v) => {
return remap$(v, {
genre: "Genre",

File diff suppressed because it is too large Load Diff

View File

@@ -63,6 +63,7 @@ export * from "./gettranscodesessions.js";
export * from "./gettransienttoken.js";
export * from "./getupdatestatus.js";
export * from "./getuserfriends.js";
export * from "./getusers.js";
export * from "./getwatchlist.js";
export * from "./logline.js";
export * from "./logmultiline.js";

View File

@@ -17,6 +17,7 @@ import { Server } from "./server.js";
import { Sessions } from "./sessions.js";
import { Statistics } from "./statistics.js";
import { Updater } from "./updater.js";
import { Users } from "./users.js";
import { Video } from "./video.js";
import { Watchlist } from "./watchlist.js";
@@ -100,4 +101,9 @@ export class PlexAPI extends ClientSDK {
get updater(): Updater {
return (this._updater ??= new Updater(this._options));
}
private _users?: Users;
get users(): Users {
return (this._users ??= new Users(this._options));
}
}

27
src/sdk/users.ts Normal file
View File

@@ -0,0 +1,27 @@
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { usersGetUsers } from "../funcs/usersGetUsers.js";
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import * as operations from "./models/operations/index.js";
import { unwrapAsync } from "./types/fp.js";
export class Users extends ClientSDK {
/**
* Get list of all connected users
*
* @remarks
* Get list of all users that are friends and have library access with the provided Plex authentication token
*/
async getUsers(
request: operations.GetUsersRequest,
options?: RequestOptions,
): Promise<operations.GetUsersResponse> {
return unwrapAsync(usersGetUsers(
this,
request,
options,
));
}
}