Compare commits

...

10 Commits

Author SHA1 Message Date
speakeasybot
5b4a51bee7 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.267.2 2024-04-22 16:28:00 +00:00
Luke Hagar
b0cc884d46 Merge branch 'main' of https://github.com/LukeHagar/plexjs 2024-04-22 11:23:11 -05:00
Luke Hagar
a1dc07ae78 Updated generation to also publish to JSR 2024-04-22 11:22:58 -05:00
Luke Hagar
d100297e1d CodeSee is gone 2024-04-22 11:20:58 -05:00
Luke Hagar
14f7d530ec Updated workflow artifacts 2024-04-22 11:20:16 -05:00
Luke Hagar
622219b018 Removed legacy artifacts 2024-04-22 11:20:01 -05:00
speakeasybot
c4dd496e24 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.267.2 2024-04-22 16:16:50 +00:00
speakeasybot
cdda7f840f ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.267.0 2024-04-20 00:26:17 +00:00
speakeasybot
2c04752d88 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.260.6 2024-04-19 00:28:46 +00:00
speakeasybot
242d7d78f2 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.257.1 2024-04-18 00:28:19 +00:00
59 changed files with 333 additions and 712 deletions

View File

@@ -1,23 +0,0 @@
# This workflow was added by CodeSee. Learn more at https://codesee.io/
# This is v2.0 of this workflow file
on:
push:
branches:
- main
pull_request_target:
types: [opened, synchronize, reopened]
name: CodeSee
permissions: read-all
jobs:
codesee:
runs-on: ubuntu-latest
continue-on-error: true
name: Analyze the repo with CodeSee
steps:
- uses: Codesee-io/codesee-action@v2
with:
codesee-token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }}
codesee-url: https://app.codesee.io

View File

@@ -1,26 +1,39 @@
name: Generate name: Generate
permissions: permissions:
checks: write checks: write
contents: write contents: write
pull-requests: write pull-requests: write
statuses: write statuses: write
"on": "on":
workflow_dispatch: workflow_dispatch:
inputs: inputs:
force: force:
description: Force generation of SDKs description: Force generation of SDKs
type: boolean type: boolean
default: false default: false
schedule: schedule:
- cron: 0 0 * * * - cron: 0 0 * * *
jobs: jobs:
generate: generate:
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15 uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
with: with:
force: ${{ github.event.inputs.force }} force: ${{ github.event.inputs.force }}
mode: direct mode: direct
speakeasy_version: latest speakeasy_version: latest
secrets: secrets:
github_access_token: ${{ secrets.GITHUB_TOKEN }} github_access_token: ${{ secrets.GITHUB_TOKEN }}
npm_token: ${{ secrets.NPM_TOKEN }} npm_token: ${{ secrets.NPM_TOKEN }}
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
publish:
runs-on: ubuntu-latest
needs: generate
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Publish package
run: npx jsr publish

View File

@@ -1,5 +1,4 @@
/* **/*
/docs/**/*.md
!/**/*.ts !/**/*.ts
!/**/*.js !/**/*.js
!/**/*.map !/**/*.map

View File

@@ -1,12 +1,12 @@
lockVersion: 2.0.0 lockVersion: 2.0.0
id: 16f22cbf-f23f-4419-8924-3a4b06381947 id: 16f22cbf-f23f-4419-8924-3a4b06381947
management: management:
docChecksum: a91eaf9ec1e6a3a6f4bf0571f5b18bae docChecksum: 7a43cd3413d535205cfaee20a4b6a250
docVersion: 0.0.3 docVersion: 0.0.3
speakeasyVersion: 1.252.0 speakeasyVersion: 1.267.2
generationVersion: 2.306.0 generationVersion: 2.312.1
releaseVersion: 0.12.2 releaseVersion: 0.13.2
configChecksum: 0d4d85f9171a505af1cd904fb99d1391 configChecksum: 73e804b9b5ec062bed8d33ed8969587d
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
@@ -14,7 +14,7 @@ management:
features: features:
typescript: typescript:
constsAndDefaults: 0.1.5 constsAndDefaults: 0.1.5
core: 3.7.1 core: 3.8.0
flattening: 2.81.1 flattening: 2.81.1
globalSecurity: 2.82.9 globalSecurity: 2.82.9
globalServerURLs: 2.82.4 globalServerURLs: 2.82.4
@@ -42,6 +42,7 @@ generatedFiles:
- .eslintrc.js - .eslintrc.js
- .npmignore - .npmignore
- RUNTIMES.md - RUNTIMES.md
- jsr.json
- package.json - package.json
- src/index.ts - src/index.ts
- src/lib/base64.ts - src/lib/base64.ts

View File

@@ -12,11 +12,12 @@ generation:
auth: auth:
oAuth2ClientCredentialsEnabled: false oAuth2ClientCredentialsEnabled: false
typescript: typescript:
version: 0.12.2 version: 0.13.2
additionalDependencies: additionalDependencies:
dependencies: {} dependencies: {}
devDependencies: {} devDependencies: {}
peerDependencies: {} peerDependencies: {}
additionalPackageJSON: {}
author: LukeHagar author: LukeHagar
clientServerStatusCodesAsErrors: true clientServerStatusCodesAsErrors: true
enumFormat: enum enumFormat: enum

21
.speakeasy/workflow.lock Normal file
View File

@@ -0,0 +1,21 @@
speakeasyVersion: 1.267.2
sources:
my-source: {}
targets:
plexjs:
source: my-source
outLocation: /github/workspace/repo
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
sources:
my-source:
inputs:
- location: https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/plex-media-server-spec-dereferenced.yaml
targets:
plexjs:
target: typescript
source: my-source
publish:
npm:
token: $NPM_TOKEN

View File

@@ -1,4 +1,5 @@
workflowVersion: 1.0.0 workflowVersion: 1.0.0
speakeasyVersion: latest
sources: sources:
my-source: my-source:
inputs: inputs:

View File

@@ -1,26 +0,0 @@
.PHONY: *
all: speakeasy
speakeasy: check-speakeasy
speakeasy generate sdk --lang typescript -o . -s ./openapi.yaml
speakeasy-validate: check-speakeasy
speakeasy validate openapi -s ./openapi.yaml
openapi:
curl https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/plex-media-server-spec-dereferenced.yaml > ./openapi.yaml
# This will replace the generation source in your workflow file with your local schema path
generate-from-local:
@if ! which sed >/dev/null; then \
echo "sed is not installed. Please install it using the following command:"; \
echo "For Ubuntu/Debian: apt-get install sed"; \
echo "For macOS: sed is pre-installed"; \
exit 1; \
fi
@sed -i '' '/openapi_docs: |/{n;s|-.*|- ./openapi.yaml|;}' ./.github/workflows/speakeasy_sdk_generation.yml
check-speakeasy:
@command -v speakeasy >/dev/null 2>&1 || { echo >&2 "speakeasy CLI is not installed. Please install before continuing."; exit 1; }

View File

@@ -33,7 +33,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -176,7 +176,7 @@ import * as errors from "@lukehagar/plexjs/models/errors";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -228,7 +228,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
serverIdx: 0, serverIdx: 0,
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -259,7 +259,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
serverURL: "{protocol}://{ip}:{port}", serverURL: "{protocol}://{ip}:{port}",
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -280,12 +280,12 @@ The server URL can also be overridden on a per-operation basis, provided a serve
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
const strong = false; const strong = false;
const xPlexClientIdentifier = "<value>"; const xPlexClientIdentifier = "Postman";
const result = await plexAPI.plex.getPin(strong, xPlexClientIdentifier, { const result = await plexAPI.plex.getPin(strong, xPlexClientIdentifier, {
serverURL: "https://plex.tv/api/v2", serverURL: "https://plex.tv/api/v2",
@@ -366,7 +366,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -392,7 +392,7 @@ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
A parameter is configured globally. This parameter must be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed. A parameter is configured globally. This parameter must be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed.
For example, you can set `X-Plex-Client-Identifier` to `"<value>"` at SDK initialization and then you do not have to pass the same value on calls to operations like `getPin`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration. For example, you can set `X-Plex-Client-Identifier` to `"Postman"` at SDK initialization and then you do not have to pass the same value on calls to operations like `getPin`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
### Available Globals ### Available Globals
@@ -413,12 +413,12 @@ This is used to track the client application and its usage
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
const strong = false; const strong = false;
const xPlexClientIdentifier = "<value>"; const xPlexClientIdentifier = "Postman";
const result = await plexAPI.plex.getPin(strong, xPlexClientIdentifier); const result = await plexAPI.plex.getPin(strong, xPlexClientIdentifier);

View File

@@ -308,4 +308,54 @@ Based on:
### Generated ### Generated
- [typescript v0.12.2] . - [typescript v0.12.2] .
### Releases ### Releases
- [NPM v0.12.2] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.12.2 - . - [NPM v0.12.2] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.12.2 - .
## 2024-04-18 00:26:16
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.257.1 (2.308.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.12.3] .
### Releases
- [NPM v0.12.3] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.12.3 - .
## 2024-04-19 00:26:47
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.260.6 (2.311.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.13.0] .
### Releases
- [NPM v0.13.0] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.13.0 - .
## 2024-04-20 00:26:02
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.267.0 (2.312.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.13.0] .
### Releases
- [NPM v0.13.0] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.13.0 - .
## 2024-04-22 16:14:48
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.267.2 (2.312.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.13.1] .
### Releases
- [NPM v0.13.1] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.13.1 - .
## 2024-04-22 16:25:57
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.267.2 (2.312.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.13.2] .
### Releases
- [NPM v0.13.2] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.13.2 - .

View File

@@ -4,7 +4,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {

View File

@@ -3,7 +3,7 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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/> | | `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/> | |
| `xPlexClientIdentifier` | *string* | :heavy_minus_sign: | 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/> | | `xPlexClientIdentifier` | *string* | :heavy_minus_sign: | 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/> | Postman |

View File

@@ -3,7 +3,7 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `pinID` | *string* | :heavy_check_mark: | The PinID to retrieve an access token for | | `pinID` | *string* | :heavy_check_mark: | The PinID to retrieve an access token for | |
| `xPlexClientIdentifier` | *string* | :heavy_minus_sign: | 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/> | | `xPlexClientIdentifier` | *string* | :heavy_minus_sign: | 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/> | Postman |

View File

@@ -28,7 +28,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -70,7 +70,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {

View File

@@ -24,7 +24,7 @@ import { GetTransientTokenQueryParamType, Scope } from "@lukehagar/plexjs/models
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -73,7 +73,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {

View File

@@ -25,7 +25,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -72,7 +72,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -115,7 +115,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -163,7 +163,7 @@ import { TaskName } from "@lukehagar/plexjs/models/operations";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -210,7 +210,7 @@ import { PathParamTaskName } from "@lukehagar/plexjs/models/operations";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {

View File

@@ -23,7 +23,7 @@ import { OnlyTransient } from "@lukehagar/plexjs/models/operations";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -72,7 +72,7 @@ import { QueryParamOnlyTransient } from "@lukehagar/plexjs/models/operations";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {

View File

@@ -31,7 +31,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -79,7 +79,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -127,7 +127,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -209,7 +209,7 @@ import { IncludeDetails } from "@lukehagar/plexjs/models/operations";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -256,7 +256,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -322,7 +322,7 @@ import { Tag } from "@lukehagar/plexjs/models/operations";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -369,7 +369,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -433,7 +433,7 @@ import { Type } from "@lukehagar/plexjs/models/operations";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -480,7 +480,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -526,7 +526,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -572,7 +572,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {

View File

@@ -25,7 +25,7 @@ import { Level } from "@lukehagar/plexjs/models/operations";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -95,7 +95,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -141,7 +141,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {

View File

@@ -23,7 +23,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -68,7 +68,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -114,7 +114,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {

View File

@@ -36,7 +36,7 @@ import { QueryParamType, Smart } from "@lukehagar/plexjs/models/operations";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -85,7 +85,7 @@ import { PlaylistType, QueryParamSmart } from "@lukehagar/plexjs/models/operatio
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -134,7 +134,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -180,7 +180,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -226,7 +226,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -279,7 +279,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -327,7 +327,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -374,7 +374,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -425,7 +425,7 @@ import { Force } from "@lukehagar/plexjs/models/operations";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {

View File

@@ -21,12 +21,12 @@ Retrieve a Pin from Plex.tv for authentication flows
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
const strong = false; const strong = false;
const xPlexClientIdentifier = "<value>"; const xPlexClientIdentifier = "Postman";
const result = await plexAPI.plex.getPin(strong, xPlexClientIdentifier); const result = await plexAPI.plex.getPin(strong, xPlexClientIdentifier);
@@ -39,13 +39,13 @@ run();
### Parameters ### Parameters
| Parameter | Type | Required | Description | | Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `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/> | | `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/> | |
| `xPlexClientIdentifier` | *string* | :heavy_minus_sign: | 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/> | | `xPlexClientIdentifier` | *string* | :heavy_minus_sign: | 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/> | [object Object] |
| `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. | |
| `options.serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. | | `options.serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 |
### Response ### Response
@@ -68,12 +68,12 @@ Retrieve an Access Token from Plex.tv after the Pin has already been authenticat
import { PlexAPI } from "@lukehagar/plexjs"; import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
const pinID = "<value>"; const pinID = "<value>";
const xPlexClientIdentifier = "<value>"; const xPlexClientIdentifier = "Postman";
const result = await plexAPI.plex.getToken(pinID, xPlexClientIdentifier); const result = await plexAPI.plex.getToken(pinID, xPlexClientIdentifier);
@@ -86,13 +86,13 @@ run();
### Parameters ### Parameters
| Parameter | Type | Required | Description | | Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `pinID` | *string* | :heavy_check_mark: | The PinID to retrieve an access token for | | `pinID` | *string* | :heavy_check_mark: | The PinID to retrieve an access token for | |
| `xPlexClientIdentifier` | *string* | :heavy_minus_sign: | 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/> | | `xPlexClientIdentifier` | *string* | :heavy_minus_sign: | 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/> | [object Object] |
| `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. | |
| `options.serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. | | `options.serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 |
### Response ### Response

View File

@@ -35,7 +35,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -88,7 +88,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -137,7 +137,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {

View File

@@ -28,7 +28,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -70,7 +70,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -112,7 +112,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -154,7 +154,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -196,7 +196,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -238,7 +238,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -282,7 +282,7 @@ import { MinSize, Upscale } from "@lukehagar/plexjs/models/operations";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -333,7 +333,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {

View File

@@ -24,7 +24,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -66,7 +66,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -108,7 +108,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -150,7 +150,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {

View File

@@ -21,7 +21,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {

View File

@@ -24,7 +24,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -67,7 +67,7 @@ import { Download } from "@lukehagar/plexjs/models/operations";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -114,7 +114,7 @@ import { Skip, Tonight } from "@lukehagar/plexjs/models/operations";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {

View File

@@ -23,7 +23,7 @@ import { State } from "@lukehagar/plexjs/models/operations";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {
@@ -77,7 +77,7 @@ import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({ const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>", accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "<value>", xPlexClientIdentifier: "Postman",
}); });
async function run() { async function run() {

457
files.gen
View File

@@ -1,457 +0,0 @@
src/sdk/server.ts
src/sdk/media.ts
src/sdk/activities.ts
src/sdk/butler.ts
src/sdk/hubs.ts
src/sdk/search.ts
src/sdk/library.ts
src/sdk/log.ts
src/sdk/playlists.ts
src/sdk/security.ts
src/sdk/sessions.ts
src/sdk/updater.ts
src/sdk/video.ts
src/sdk/sdk.ts
.eslintrc.js
.npmignore
package-lock.json
package.json
src/index.ts
src/lib/base64.ts
src/lib/config.ts
src/lib/encodings.ts
src/lib/http.ts
src/lib/retries.ts
src/lib/sdks.ts
src/lib/security.ts
src/lib/url.ts
src/sdk/index.ts
src/models/errors/sdkerror.ts
src/types/blobs.ts
src/types/decimal.ts
src/types/index.ts
src/types/operations.ts
src/types/rfcdate.ts
tsconfig.json
src/models/operations/getservercapabilities.ts
src/models/operations/getserverpreferences.ts
src/models/operations/getavailableclients.ts
src/models/operations/getdevices.ts
src/models/operations/getserveridentity.ts
src/models/operations/getmyplexaccount.ts
src/models/operations/getresizedphoto.ts
src/models/operations/getserverlist.ts
src/models/operations/markplayed.ts
src/models/operations/markunplayed.ts
src/models/operations/updateplayprogress.ts
src/models/operations/getserveractivities.ts
src/models/operations/cancelserveractivities.ts
src/models/operations/getbutlertasks.ts
src/models/operations/startalltasks.ts
src/models/operations/stopalltasks.ts
src/models/operations/starttask.ts
src/models/operations/stoptask.ts
src/models/operations/getglobalhubs.ts
src/models/operations/getlibraryhubs.ts
src/models/operations/performsearch.ts
src/models/operations/performvoicesearch.ts
src/models/operations/getsearchresults.ts
src/models/operations/getfilehash.ts
src/models/operations/getrecentlyadded.ts
src/models/operations/getlibraries.ts
src/models/operations/getlibrary.ts
src/models/operations/deletelibrary.ts
src/models/operations/getlibraryitems.ts
src/models/operations/refreshlibrary.ts
src/models/operations/getlatestlibraryitems.ts
src/models/operations/getcommonlibraryitems.ts
src/models/operations/getmetadata.ts
src/models/operations/getmetadatachildren.ts
src/models/operations/getondeck.ts
src/models/operations/logline.ts
src/models/operations/logmultiline.ts
src/models/operations/enablepapertrail.ts
src/models/operations/createplaylist.ts
src/models/operations/getplaylists.ts
src/models/operations/getplaylist.ts
src/models/operations/deleteplaylist.ts
src/models/operations/updateplaylist.ts
src/models/operations/getplaylistcontents.ts
src/models/operations/clearplaylistcontents.ts
src/models/operations/addplaylistcontents.ts
src/models/operations/uploadplaylist.ts
src/models/operations/gettransienttoken.ts
src/models/operations/getsourceconnectioninformation.ts
src/models/operations/getsessions.ts
src/models/operations/getsessionhistory.ts
src/models/operations/gettranscodesessions.ts
src/models/operations/stoptranscodesession.ts
src/models/operations/getupdatestatus.ts
src/models/operations/checkforupdates.ts
src/models/operations/applyupdates.ts
src/models/operations/startuniversaltranscode.ts
src/models/operations/gettimeline.ts
src/models/errors/getservercapabilities.ts
src/models/errors/getserverpreferences.ts
src/models/errors/getavailableclients.ts
src/models/errors/getdevices.ts
src/models/errors/getserveridentity.ts
src/models/errors/getmyplexaccount.ts
src/models/errors/getresizedphoto.ts
src/models/errors/getserverlist.ts
src/models/errors/markplayed.ts
src/models/errors/markunplayed.ts
src/models/errors/updateplayprogress.ts
src/models/errors/getserveractivities.ts
src/models/errors/cancelserveractivities.ts
src/models/errors/getbutlertasks.ts
src/models/errors/startalltasks.ts
src/models/errors/stopalltasks.ts
src/models/errors/starttask.ts
src/models/errors/stoptask.ts
src/models/errors/getglobalhubs.ts
src/models/errors/getlibraryhubs.ts
src/models/errors/performsearch.ts
src/models/errors/performvoicesearch.ts
src/models/errors/getsearchresults.ts
src/models/errors/getfilehash.ts
src/models/errors/getrecentlyadded.ts
src/models/errors/getlibraries.ts
src/models/errors/getlibrary.ts
src/models/errors/deletelibrary.ts
src/models/errors/getlibraryitems.ts
src/models/errors/refreshlibrary.ts
src/models/errors/getlatestlibraryitems.ts
src/models/errors/getcommonlibraryitems.ts
src/models/errors/getmetadata.ts
src/models/errors/getmetadatachildren.ts
src/models/errors/getondeck.ts
src/models/errors/logline.ts
src/models/errors/logmultiline.ts
src/models/errors/enablepapertrail.ts
src/models/errors/createplaylist.ts
src/models/errors/getplaylists.ts
src/models/errors/getplaylist.ts
src/models/errors/deleteplaylist.ts
src/models/errors/updateplaylist.ts
src/models/errors/getplaylistcontents.ts
src/models/errors/clearplaylistcontents.ts
src/models/errors/addplaylistcontents.ts
src/models/errors/uploadplaylist.ts
src/models/errors/gettransienttoken.ts
src/models/errors/getsourceconnectioninformation.ts
src/models/errors/getsessions.ts
src/models/errors/getsessionhistory.ts
src/models/errors/gettranscodesessions.ts
src/models/errors/stoptranscodesession.ts
src/models/errors/getupdatestatus.ts
src/models/errors/checkforupdates.ts
src/models/errors/applyupdates.ts
src/models/errors/startuniversaltranscode.ts
src/models/errors/gettimeline.ts
src/models/components/security.ts
src/models/errors/index.ts
src/models/operations/index.ts
src/models/components/index.ts
docs/models/operations/directory.md
docs/models/operations/mediacontainer.md
docs/models/operations/getservercapabilitiesresponsebody.md
docs/models/operations/getservercapabilitiesresponse.md
docs/models/operations/getserverpreferencesresponse.md
docs/models/operations/server.md
docs/models/operations/getavailableclientsmediacontainer.md
docs/models/operations/responsebody.md
docs/models/operations/getavailableclientsresponse.md
docs/models/operations/device.md
docs/models/operations/getdevicesmediacontainer.md
docs/models/operations/getdevicesresponsebody.md
docs/models/operations/getdevicesresponse.md
docs/models/operations/getserveridentitymediacontainer.md
docs/models/operations/getserveridentityresponsebody.md
docs/models/operations/getserveridentityresponse.md
docs/models/operations/myplex.md
docs/models/operations/getmyplexaccountresponsebody.md
docs/models/operations/getmyplexaccountresponse.md
docs/models/operations/minsize.md
docs/models/operations/upscale.md
docs/models/operations/getresizedphotorequest.md
docs/models/operations/getresizedphotoresponse.md
docs/models/operations/getserverlistserver.md
docs/models/operations/getserverlistmediacontainer.md
docs/models/operations/getserverlistresponsebody.md
docs/models/operations/getserverlistresponse.md
docs/models/operations/markplayedrequest.md
docs/models/operations/markplayedresponse.md
docs/models/operations/markunplayedrequest.md
docs/models/operations/markunplayedresponse.md
docs/models/operations/updateplayprogressrequest.md
docs/models/operations/updateplayprogressresponse.md
docs/models/operations/context.md
docs/models/operations/activity.md
docs/models/operations/getserveractivitiesmediacontainer.md
docs/models/operations/getserveractivitiesresponsebody.md
docs/models/operations/getserveractivitiesresponse.md
docs/models/operations/cancelserveractivitiesrequest.md
docs/models/operations/cancelserveractivitiesresponse.md
docs/models/operations/butlertask.md
docs/models/operations/butlertasks.md
docs/models/operations/getbutlertasksresponsebody.md
docs/models/operations/getbutlertasksresponse.md
docs/models/operations/startalltasksresponse.md
docs/models/operations/stopalltasksresponse.md
docs/models/operations/taskname.md
docs/models/operations/starttaskrequest.md
docs/models/operations/starttaskresponse.md
docs/models/operations/pathparamtaskname.md
docs/models/operations/stoptaskrequest.md
docs/models/operations/stoptaskresponse.md
docs/models/operations/onlytransient.md
docs/models/operations/getglobalhubsrequest.md
docs/models/operations/getglobalhubsresponse.md
docs/models/operations/queryparamonlytransient.md
docs/models/operations/getlibraryhubsrequest.md
docs/models/operations/getlibraryhubsresponse.md
docs/models/operations/performsearchrequest.md
docs/models/operations/performsearchresponse.md
docs/models/operations/performvoicesearchrequest.md
docs/models/operations/performvoicesearchresponse.md
docs/models/operations/getsearchresultsrequest.md
docs/models/operations/getsearchresultspart.md
docs/models/operations/getsearchresultsmedia.md
docs/models/operations/getsearchresultsgenre.md
docs/models/operations/getsearchresultsdirector.md
docs/models/operations/getsearchresultswriter.md
docs/models/operations/getsearchresultscountry.md
docs/models/operations/getsearchresultsrole.md
docs/models/operations/getsearchresultsmetadata.md
docs/models/operations/provider.md
docs/models/operations/getsearchresultsmediacontainer.md
docs/models/operations/getsearchresultsresponsebody.md
docs/models/operations/getsearchresultsresponse.md
docs/models/operations/getfilehashrequest.md
docs/models/operations/getfilehashresponse.md
docs/models/operations/part.md
docs/models/operations/media.md
docs/models/operations/genre.md
docs/models/operations/director.md
docs/models/operations/writer.md
docs/models/operations/country.md
docs/models/operations/role.md
docs/models/operations/metadata.md
docs/models/operations/getrecentlyaddedmediacontainer.md
docs/models/operations/getrecentlyaddedresponsebody.md
docs/models/operations/getrecentlyaddedresponse.md
docs/models/operations/getlibrariesresponse.md
docs/models/operations/includedetails.md
docs/models/operations/getlibraryrequest.md
docs/models/operations/getlibraryresponse.md
docs/models/operations/deletelibraryrequest.md
docs/models/operations/deletelibraryresponse.md
docs/models/operations/getlibraryitemsrequest.md
docs/models/operations/getlibraryitemsresponse.md
docs/models/operations/refreshlibraryrequest.md
docs/models/operations/refreshlibraryresponse.md
docs/models/operations/getlatestlibraryitemsrequest.md
docs/models/operations/getlatestlibraryitemsresponse.md
docs/models/operations/getcommonlibraryitemsrequest.md
docs/models/operations/getcommonlibraryitemsresponse.md
docs/models/operations/getmetadatarequest.md
docs/models/operations/getmetadataresponse.md
docs/models/operations/getmetadatachildrenrequest.md
docs/models/operations/getmetadatachildrenresponse.md
docs/models/operations/stream.md
docs/models/operations/getondeckpart.md
docs/models/operations/getondeckmedia.md
docs/models/operations/guids.md
docs/models/operations/getondeckmetadata.md
docs/models/operations/getondeckmediacontainer.md
docs/models/operations/getondeckresponsebody.md
docs/models/operations/getondeckresponse.md
docs/models/operations/level.md
docs/models/operations/loglinerequest.md
docs/models/operations/loglineresponse.md
docs/models/operations/logmultilineresponse.md
docs/models/operations/enablepapertrailresponse.md
docs/models/operations/typet.md
docs/models/operations/smart.md
docs/models/operations/createplaylistrequest.md
docs/models/operations/createplaylistresponse.md
docs/models/operations/playlisttype.md
docs/models/operations/queryparamsmart.md
docs/models/operations/getplaylistsrequest.md
docs/models/operations/getplaylistsresponse.md
docs/models/operations/getplaylistrequest.md
docs/models/operations/getplaylistresponse.md
docs/models/operations/deleteplaylistrequest.md
docs/models/operations/deleteplaylistresponse.md
docs/models/operations/updateplaylistrequest.md
docs/models/operations/updateplaylistresponse.md
docs/models/operations/getplaylistcontentsrequest.md
docs/models/operations/getplaylistcontentsresponse.md
docs/models/operations/clearplaylistcontentsrequest.md
docs/models/operations/clearplaylistcontentsresponse.md
docs/models/operations/addplaylistcontentsrequest.md
docs/models/operations/addplaylistcontentsresponse.md
docs/models/operations/force.md
docs/models/operations/uploadplaylistrequest.md
docs/models/operations/uploadplaylistresponse.md
docs/models/operations/queryparamtype.md
docs/models/operations/scope.md
docs/models/operations/gettransienttokenrequest.md
docs/models/operations/gettransienttokenresponse.md
docs/models/operations/getsourceconnectioninformationrequest.md
docs/models/operations/getsourceconnectioninformationresponse.md
docs/models/operations/getsessionsresponse.md
docs/models/operations/getsessionhistoryresponse.md
docs/models/operations/transcodesession.md
docs/models/operations/gettranscodesessionsmediacontainer.md
docs/models/operations/gettranscodesessionsresponsebody.md
docs/models/operations/gettranscodesessionsresponse.md
docs/models/operations/stoptranscodesessionrequest.md
docs/models/operations/stoptranscodesessionresponse.md
docs/models/operations/getupdatestatusresponse.md
docs/models/operations/download.md
docs/models/operations/checkforupdatesrequest.md
docs/models/operations/checkforupdatesresponse.md
docs/models/operations/tonight.md
docs/models/operations/skip.md
docs/models/operations/applyupdatesrequest.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/getservercapabilitiesresponsebody.md
docs/models/errors/getserverpreferenceserrors.md
docs/models/errors/getserverpreferencesresponsebody.md
docs/models/errors/getavailableclientserrors.md
docs/models/errors/getavailableclientsresponsebody.md
docs/models/errors/getdeviceserrors.md
docs/models/errors/getdevicesresponsebody.md
docs/models/errors/getserveridentityerrors.md
docs/models/errors/getserveridentityresponsebody.md
docs/models/errors/getmyplexaccounterrors.md
docs/models/errors/getmyplexaccountresponsebody.md
docs/models/errors/getresizedphotoerrors.md
docs/models/errors/getresizedphotoresponsebody.md
docs/models/errors/getserverlisterrors.md
docs/models/errors/getserverlistresponsebody.md
docs/models/errors/markplayederrors.md
docs/models/errors/markplayedresponsebody.md
docs/models/errors/markunplayederrors.md
docs/models/errors/markunplayedresponsebody.md
docs/models/errors/updateplayprogresserrors.md
docs/models/errors/updateplayprogressresponsebody.md
docs/models/errors/getserveractivitieserrors.md
docs/models/errors/getserveractivitiesresponsebody.md
docs/models/errors/cancelserveractivitieserrors.md
docs/models/errors/cancelserveractivitiesresponsebody.md
docs/models/errors/getbutlertaskserrors.md
docs/models/errors/getbutlertasksresponsebody.md
docs/models/errors/startalltaskserrors.md
docs/models/errors/startalltasksresponsebody.md
docs/models/errors/stopalltaskserrors.md
docs/models/errors/stopalltasksresponsebody.md
docs/models/errors/starttaskerrors.md
docs/models/errors/starttaskresponsebody.md
docs/models/errors/stoptaskerrors.md
docs/models/errors/stoptaskresponsebody.md
docs/models/errors/getglobalhubserrors.md
docs/models/errors/getglobalhubsresponsebody.md
docs/models/errors/getlibraryhubserrors.md
docs/models/errors/getlibraryhubsresponsebody.md
docs/models/errors/performsearcherrors.md
docs/models/errors/performsearchresponsebody.md
docs/models/errors/performvoicesearcherrors.md
docs/models/errors/performvoicesearchresponsebody.md
docs/models/errors/getsearchresultserrors.md
docs/models/errors/getsearchresultsresponsebody.md
docs/models/errors/getfilehasherrors.md
docs/models/errors/getfilehashresponsebody.md
docs/models/errors/getrecentlyaddederrors.md
docs/models/errors/getrecentlyaddedresponsebody.md
docs/models/errors/getlibrarieserrors.md
docs/models/errors/getlibrariesresponsebody.md
docs/models/errors/getlibraryerrors.md
docs/models/errors/getlibraryresponsebody.md
docs/models/errors/deletelibraryerrors.md
docs/models/errors/deletelibraryresponsebody.md
docs/models/errors/getlibraryitemserrors.md
docs/models/errors/getlibraryitemsresponsebody.md
docs/models/errors/refreshlibraryerrors.md
docs/models/errors/refreshlibraryresponsebody.md
docs/models/errors/getlatestlibraryitemserrors.md
docs/models/errors/getlatestlibraryitemsresponsebody.md
docs/models/errors/getcommonlibraryitemserrors.md
docs/models/errors/getcommonlibraryitemsresponsebody.md
docs/models/errors/getmetadataerrors.md
docs/models/errors/getmetadataresponsebody.md
docs/models/errors/getmetadatachildrenerrors.md
docs/models/errors/getmetadatachildrenresponsebody.md
docs/models/errors/getondeckerrors.md
docs/models/errors/getondeckresponsebody.md
docs/models/errors/loglineerrors.md
docs/models/errors/loglineresponsebody.md
docs/models/errors/logmultilineerrors.md
docs/models/errors/logmultilineresponsebody.md
docs/models/errors/enablepapertrailerrors.md
docs/models/errors/enablepapertrailresponsebody.md
docs/models/errors/createplaylisterrors.md
docs/models/errors/createplaylistresponsebody.md
docs/models/errors/getplaylistserrors.md
docs/models/errors/getplaylistsresponsebody.md
docs/models/errors/getplaylisterrors.md
docs/models/errors/getplaylistresponsebody.md
docs/models/errors/deleteplaylisterrors.md
docs/models/errors/deleteplaylistresponsebody.md
docs/models/errors/updateplaylisterrors.md
docs/models/errors/updateplaylistresponsebody.md
docs/models/errors/getplaylistcontentserrors.md
docs/models/errors/getplaylistcontentsresponsebody.md
docs/models/errors/clearplaylistcontentserrors.md
docs/models/errors/clearplaylistcontentsresponsebody.md
docs/models/errors/addplaylistcontentserrors.md
docs/models/errors/addplaylistcontentsresponsebody.md
docs/models/errors/uploadplaylisterrors.md
docs/models/errors/uploadplaylistresponsebody.md
docs/models/errors/gettransienttokenerrors.md
docs/models/errors/gettransienttokenresponsebody.md
docs/models/errors/getsourceconnectioninformationerrors.md
docs/models/errors/getsourceconnectioninformationresponsebody.md
docs/models/errors/getsessionserrors.md
docs/models/errors/getsessionsresponsebody.md
docs/models/errors/getsessionhistoryerrors.md
docs/models/errors/getsessionhistoryresponsebody.md
docs/models/errors/gettranscodesessionserrors.md
docs/models/errors/gettranscodesessionsresponsebody.md
docs/models/errors/stoptranscodesessionerrors.md
docs/models/errors/stoptranscodesessionresponsebody.md
docs/models/errors/getupdatestatuserrors.md
docs/models/errors/getupdatestatusresponsebody.md
docs/models/errors/checkforupdateserrors.md
docs/models/errors/checkforupdatesresponsebody.md
docs/models/errors/applyupdateserrors.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/sdks/plexapi/README.md
docs/sdks/server/README.md
docs/sdks/media/README.md
docs/sdks/activities/README.md
docs/sdks/butler/README.md
docs/sdks/hubs/README.md
docs/sdks/search/README.md
docs/sdks/library/README.md
docs/sdks/log/README.md
docs/sdks/playlists/README.md
docs/sdks/security/README.md
docs/sdks/sessions/README.md
docs/sdks/updater/README.md
docs/sdks/video/README.md
USAGE.md
.gitattributes

26
jsr.json Normal file
View File

@@ -0,0 +1,26 @@
{
"name": "@lukehagar/plexjs",
"version": "0.13.2",
"exports": {
".": "./src/index.ts",
"./models/errors": "./src/models/errors/index.ts",
"./models/components": "./src/models/components/index.ts",
"./models/operations": "./src/models/operations/index.ts",
"./lib/config": "./src/lib/config.ts",
"./lib/http": "./src/lib/http.ts",
"./lib/retries": "./src/lib/retries.ts",
"./lib/sdks": "./src/lib/sdks.ts",
"./types": "./src/types/index.ts"
},
"publish": {
"include": [
"LICENSE",
"README.md",
"RUNTIMES.md",
"USAGE.md",
"src/**/*.ts"
]
}
}

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "@lukehagar/plexjs", "name": "@lukehagar/plexjs",
"version": "0.12.2", "version": "0.13.2",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lukehagar/plexjs", "name": "@lukehagar/plexjs",
"version": "0.12.2", "version": "0.13.2",
"devDependencies": { "devDependencies": {
"@types/jsonpath": "^0.2.4", "@types/jsonpath": "^0.2.4",
"@typescript-eslint/eslint-plugin": "^6.13.2", "@typescript-eslint/eslint-plugin": "^6.13.2",

View File

@@ -1,7 +1,7 @@
{ {
"name": "@lukehagar/plexjs", "name": "@lukehagar/plexjs",
"version": "0.12.2", "version": "0.13.2",
"author": "LukeHagar", "author": "LukeHagar",
"main": "./index.js", "main": "./index.js",
"sideEffects": false, "sideEffects": false,
"repository": { "repository": {
@@ -14,7 +14,6 @@
"build": "tsc", "build": "tsc",
"prepare": "npm run build" "prepare": "npm run build"
}, },
"keywords": [],
"peerDependencies": { "peerDependencies": {
"zod": ">= 3" "zod": ">= 3"
}, },

View File

@@ -4,7 +4,7 @@
import { HTTPClient } from "./http"; import { HTTPClient } from "./http";
import { RetryConfig } from "./retries"; import { RetryConfig } from "./retries";
import { pathToFunc } from "./url"; import { Params, pathToFunc } from "./url";
/** /**
* Contains the list of servers available to the SDK * Contains the list of servers available to the SDK
@@ -62,14 +62,14 @@ export type SDKOptions = {
export function serverURLFromOptions(options: SDKOptions): URL | null { export function serverURLFromOptions(options: SDKOptions): URL | null {
let serverURL = options.serverURL; let serverURL = options.serverURL;
const serverParams = [ const serverParams: Params[] = [
{ {
protocol: options.protocol?.toString() ?? "http", protocol: options.protocol ?? "http",
ip: options.ip?.toString() ?? "10.10.10.47", ip: options.ip ?? "10.10.10.47",
port: options.port?.toString() ?? "32400", port: options.port ?? "32400",
}, },
]; ];
let params: Record<string, string> = {}; let params: Params = {};
if (!serverURL) { if (!serverURL) {
const serverIdx = options.serverIdx ?? 0; const serverIdx = options.serverIdx ?? 0;
@@ -84,10 +84,10 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
return new URL(u); return new URL(u);
} }
export const SDK_METADATA = Object.freeze({ export const SDK_METADATA = {
language: "typescript", language: "typescript",
openapiDocVersion: "0.0.3", openapiDocVersion: "0.0.3",
sdkVersion: "0.12.2", sdkVersion: "0.13.2",
genVersion: "2.306.0", genVersion: "2.312.1",
userAgent: "speakeasy-sdk/typescript 0.12.2 2.306.0 0.0.3 @lukehagar/plexjs", userAgent: "speakeasy-sdk/typescript 0.13.2 2.312.1 0.0.3 @lukehagar/plexjs",
}); } as const;

View File

@@ -15,7 +15,7 @@ export function encodeMatrix(
key: string, key: string,
value: unknown, value: unknown,
options?: { explode?: boolean; charEncoding?: "percent" | "none" }, options?: { explode?: boolean; charEncoding?: "percent" | "none" },
) { ): string {
let out = ""; let out = "";
const pairs: [string, unknown][] = options?.explode const pairs: [string, unknown][] = options?.explode
? explode(key, value) ? explode(key, value)
@@ -65,7 +65,7 @@ export function encodeLabel(
key: string, key: string,
value: unknown, value: unknown,
options?: { explode?: boolean; charEncoding?: "percent" | "none" }, options?: { explode?: boolean; charEncoding?: "percent" | "none" },
) { ): string {
let out = ""; let out = "";
const pairs: [string, unknown][] = options?.explode const pairs: [string, unknown][] = options?.explode
? explode(key, value) ? explode(key, value)
@@ -100,7 +100,13 @@ export function encodeLabel(
return out; return out;
} }
function formEncoder(sep: string) { type FormEncoder = (
key: string,
value: unknown,
options?: { explode?: boolean; charEncoding?: "percent" | "none" },
) => string;
function formEncoder(sep: string): FormEncoder {
return ( return (
key: string, key: string,
value: unknown, value: unknown,
@@ -157,7 +163,7 @@ export function encodeBodyForm(
key: string, key: string,
value: unknown, value: unknown,
options?: { explode?: boolean; charEncoding?: "percent" | "none" }, options?: { explode?: boolean; charEncoding?: "percent" | "none" },
) { ): string {
let out = ""; let out = "";
const pairs: [string, unknown][] = options?.explode const pairs: [string, unknown][] = options?.explode
? explode(key, value) ? explode(key, value)
@@ -200,7 +206,7 @@ export function encodeDeepObject(
key: string, key: string,
value: unknown, value: unknown,
options?: { charEncoding?: "percent" | "none" }, options?: { charEncoding?: "percent" | "none" },
) { ): string {
if (value == null) { if (value == null) {
return ""; return "";
} }
@@ -247,7 +253,7 @@ export function encodeJSON(
key: string, key: string,
value: unknown, value: unknown,
options?: { explode?: boolean; charEncoding?: "percent" | "none" }, options?: { explode?: boolean; charEncoding?: "percent" | "none" },
) { ): string {
if (typeof value === "undefined") { if (typeof value === "undefined") {
return ""; return "";
} }
@@ -265,7 +271,7 @@ export const encodeSimple = (
key: string, key: string,
value: unknown, value: unknown,
options?: { explode?: boolean; charEncoding?: "percent" | "none" }, options?: { explode?: boolean; charEncoding?: "percent" | "none" },
) => { ): string => {
let out = ""; let out = "";
const pairs: [string, unknown][] = options?.explode const pairs: [string, unknown][] = options?.explode
? explode(key, value) ? explode(key, value)
@@ -337,7 +343,7 @@ function serializeValue(value: unknown): string {
return `${value}`; return `${value}`;
} }
function jsonReplacer(_: string, value: unknown) { function jsonReplacer(_: string, value: unknown): unknown {
if (value instanceof Uint8Array) { if (value instanceof Uint8Array) {
return bytesToBase64(value); return bytesToBase64(value);
} else { } else {

View File

@@ -7,7 +7,7 @@ export type Fetcher = (
init?: RequestInit, init?: RequestInit,
) => Promise<Response>; ) => Promise<Response>;
type Awaitable<T> = T | Promise<T>; export type Awaitable<T> = T | Promise<T>;
const DEFAULT_FETCHER: Fetcher = (input, init) => fetch(input, init); const DEFAULT_FETCHER: Fetcher = (input, init) => fetch(input, init);
@@ -15,9 +15,9 @@ export interface HTTPClientOptions {
fetcher?: Fetcher; fetcher?: Fetcher;
} }
type BeforeRequestHook = (req: Request) => Awaitable<Request | void>; export type BeforeRequestHook = (req: Request) => Awaitable<Request | void>;
type RequestErrorHook = (err: unknown, req: Request) => Awaitable<void>; export type RequestErrorHook = (err: unknown, req: Request) => Awaitable<void>;
type ResponseHook = (res: Response, req: Request) => Awaitable<void>; export type ResponseHook = (res: Response, req: Request) => Awaitable<void>;
export class HTTPClient { export class HTTPClient {
private fetcher: Fetcher; private fetcher: Fetcher;
@@ -100,7 +100,7 @@ export class HTTPClient {
| [hook: "beforeRequest", fn: BeforeRequestHook] | [hook: "beforeRequest", fn: BeforeRequestHook]
| [hook: "requestError", fn: RequestErrorHook] | [hook: "requestError", fn: RequestErrorHook]
| [hook: "response", fn: ResponseHook] | [hook: "response", fn: ResponseHook]
) { ): this {
let target: unknown[]; let target: unknown[];
if (args[0] === "beforeRequest") { if (args[0] === "beforeRequest") {
target = this.requestHooks; target = this.requestHooks;
@@ -120,7 +120,7 @@ export class HTTPClient {
return this; return this;
} }
clone() { clone(): HTTPClient {
const child = new HTTPClient(this.options); const child = new HTTPClient(this.options);
child.requestHooks = this.requestHooks.slice(); child.requestHooks = this.requestHooks.slice();
child.requestErrorHooks = this.requestErrorHooks.slice(); child.requestErrorHooks = this.requestErrorHooks.slice();
@@ -160,7 +160,7 @@ const codeRangeRE = new RegExp("^[0-9]xx$", "i");
export function matchStatusCode( export function matchStatusCode(
response: Response, response: Response,
codes: number | string | (number | string)[], codes: number | string | (number | string)[],
) { ): boolean {
const actual = `${response.status}`; const actual = `${response.status}`;
const expectedCodes = Array.isArray(codes) ? codes : [codes]; const expectedCodes = Array.isArray(codes) ? codes : [codes];
if (!expectedCodes.length) { if (!expectedCodes.length) {

View File

@@ -40,7 +40,7 @@ export class ClientSDK {
this.client = client; this.client = client;
} }
protected createRequest$(conf: RequestConfig, options?: RequestOptions) { protected createRequest$(conf: RequestConfig, options?: RequestOptions): Request {
const { method, path, query, headers: opHeaders, security } = conf; const { method, path, query, headers: opHeaders, security } = conf;
const base = conf.baseURL ?? this.baseURL; const base = conf.baseURL ?? this.baseURL;
@@ -109,7 +109,7 @@ export class ClientSDK {
context: HookContext; context: HookContext;
errorCodes: number | string | (number | string)[]; errorCodes: number | string | (number | string)[];
} }
) { ): Promise<Response> {
const { context, errorCodes } = options; const { context, errorCodes } = options;
let response = await this.client.request(await this.hooks$.beforeRequest(context, req)); let response = await this.client.request(await this.hooks$.beforeRequest(context, req));

View File

@@ -169,7 +169,9 @@ function applyBearer(
state.headers[spec.fieldName] = value; state.headers[spec.fieldName] = value;
} }
export function resolveGlobalSecurity(security: Partial<components.Security> | null | undefined) { export function resolveGlobalSecurity(
security: Partial<components.Security> | null | undefined
): SecurityState | null {
return resolveSecurity([ return resolveSecurity([
{ {
fieldName: "X-Plex-Token", fieldName: "X-Plex-Token",

View File

@@ -4,10 +4,12 @@
const hasOwn = Object.prototype.hasOwnProperty; const hasOwn = Object.prototype.hasOwnProperty;
export type Params = Partial<Record<string, string | number>>;
export function pathToFunc( export function pathToFunc(
pathPattern: string, pathPattern: string,
options?: { charEncoding?: "percent" | "none" }, options?: { charEncoding?: "percent" | "none" },
): (params?: Record<string, string | number>) => string { ): (params?: Params) => string {
const paramRE = /\{([a-zA-Z0-9_]+?)\}/g; const paramRE = /\{([a-zA-Z0-9_]+?)\}/g;
return function buildURLPath(params: Record<string, unknown> = {}): string { return function buildURLPath(params: Record<string, unknown> = {}): string {

View File

@@ -17,7 +17,7 @@ export class SDKValidationError extends Error {
this.rawValue = rawValue; this.rawValue = rawValue;
} }
public override toString() { public override toString(): string {
return `${this.message}: ${this.cause}`; return `${this.message}: ${this.cause}`;
} }
@@ -26,7 +26,7 @@ export class SDKValidationError extends Error {
* is a ZodError or some other recognized error type, otherwise return the * is a ZodError or some other recognized error type, otherwise return the
* default error message. * default error message.
*/ */
public pretty() { public pretty(): string {
if (this.cause instanceof z.ZodError) { if (this.cause instanceof z.ZodError) {
return `${this.message}\n${formatZodError(this.cause)}`; return `${this.message}\n${formatZodError(this.cause)}`;
} else { } else {

View File

@@ -47,10 +47,10 @@ export type ApplyUpdatesResponse = {
}; };
/** @internal */ /** @internal */
export const Tonight$ = z.nativeEnum(Tonight); export const Tonight$: z.ZodNativeEnum<typeof Tonight> = z.nativeEnum(Tonight);
/** @internal */ /** @internal */
export const Skip$ = z.nativeEnum(Skip); export const Skip$: z.ZodNativeEnum<typeof Skip> = z.nativeEnum(Skip);
/** @internal */ /** @internal */
export namespace ApplyUpdatesRequest$ { export namespace ApplyUpdatesRequest$ {

View File

@@ -35,7 +35,7 @@ export type CheckForUpdatesResponse = {
}; };
/** @internal */ /** @internal */
export const Download$ = z.nativeEnum(Download); export const Download$: z.ZodNativeEnum<typeof Download> = z.nativeEnum(Download);
/** @internal */ /** @internal */
export namespace CheckForUpdatesRequest$ { export namespace CheckForUpdatesRequest$ {

View File

@@ -95,10 +95,10 @@ export type CreatePlaylistResponse = {
}; };
/** @internal */ /** @internal */
export const QueryParamType$ = z.nativeEnum(QueryParamType); export const QueryParamType$: z.ZodNativeEnum<typeof QueryParamType> = z.nativeEnum(QueryParamType);
/** @internal */ /** @internal */
export const Smart$ = z.nativeEnum(Smart); export const Smart$: z.ZodNativeEnum<typeof Smart> = z.nativeEnum(Smart);
/** @internal */ /** @internal */
export namespace CreatePlaylistRequest$ { export namespace CreatePlaylistRequest$ {

View File

@@ -91,7 +91,7 @@ export type GetGlobalHubsResponse = {
}; };
/** @internal */ /** @internal */
export const OnlyTransient$ = z.nativeEnum(OnlyTransient); export const OnlyTransient$: z.ZodNativeEnum<typeof OnlyTransient> = z.nativeEnum(OnlyTransient);
/** @internal */ /** @internal */
export namespace GetGlobalHubsRequest$ { export namespace GetGlobalHubsRequest$ {

View File

@@ -128,7 +128,7 @@ export type GetLibraryResponse = {
}; };
/** @internal */ /** @internal */
export const IncludeDetails$ = z.nativeEnum(IncludeDetails); export const IncludeDetails$: z.ZodNativeEnum<typeof IncludeDetails> = z.nativeEnum(IncludeDetails);
/** @internal */ /** @internal */
export namespace GetLibraryRequest$ { export namespace GetLibraryRequest$ {

View File

@@ -170,7 +170,8 @@ export type GetLibraryHubsResponse = {
}; };
/** @internal */ /** @internal */
export const QueryParamOnlyTransient$ = z.nativeEnum(QueryParamOnlyTransient); export const QueryParamOnlyTransient$: z.ZodNativeEnum<typeof QueryParamOnlyTransient> =
z.nativeEnum(QueryParamOnlyTransient);
/** @internal */ /** @internal */
export namespace GetLibraryHubsRequest$ { export namespace GetLibraryHubsRequest$ {

View File

@@ -194,7 +194,7 @@ export type GetLibraryItemsResponse = {
}; };
/** @internal */ /** @internal */
export const Tag$ = z.nativeEnum(Tag); export const Tag$: z.ZodNativeEnum<typeof Tag> = z.nativeEnum(Tag);
/** @internal */ /** @internal */
export namespace GetLibraryItemsRequest$ { export namespace GetLibraryItemsRequest$ {

View File

@@ -83,10 +83,11 @@ export type GetPlaylistsResponse = {
}; };
/** @internal */ /** @internal */
export const PlaylistType$ = z.nativeEnum(PlaylistType); export const PlaylistType$: z.ZodNativeEnum<typeof PlaylistType> = z.nativeEnum(PlaylistType);
/** @internal */ /** @internal */
export const QueryParamSmart$ = z.nativeEnum(QueryParamSmart); export const QueryParamSmart$: z.ZodNativeEnum<typeof QueryParamSmart> =
z.nativeEnum(QueryParamSmart);
/** @internal */ /** @internal */
export namespace GetPlaylistsRequest$ { export namespace GetPlaylistsRequest$ {

View File

@@ -67,10 +67,10 @@ export type GetResizedPhotoResponse = {
}; };
/** @internal */ /** @internal */
export const MinSize$ = z.nativeEnum(MinSize); export const MinSize$: z.ZodNativeEnum<typeof MinSize> = z.nativeEnum(MinSize);
/** @internal */ /** @internal */
export const Upscale$ = z.nativeEnum(Upscale); export const Upscale$: z.ZodNativeEnum<typeof Upscale> = z.nativeEnum(Upscale);
/** @internal */ /** @internal */
export namespace GetResizedPhotoRequest$ { export namespace GetResizedPhotoRequest$ {

View File

@@ -72,7 +72,7 @@ export type GetTimelineResponse = {
}; };
/** @internal */ /** @internal */
export const State$ = z.nativeEnum(State); export const State$: z.ZodNativeEnum<typeof State> = z.nativeEnum(State);
/** @internal */ /** @internal */
export namespace GetTimelineRequest$ { export namespace GetTimelineRequest$ {

View File

@@ -45,10 +45,12 @@ export type GetTransientTokenResponse = {
}; };
/** @internal */ /** @internal */
export const GetTransientTokenQueryParamType$ = z.nativeEnum(GetTransientTokenQueryParamType); export const GetTransientTokenQueryParamType$: z.ZodNativeEnum<
typeof GetTransientTokenQueryParamType
> = z.nativeEnum(GetTransientTokenQueryParamType);
/** @internal */ /** @internal */
export const Scope$ = z.nativeEnum(Scope); export const Scope$: z.ZodNativeEnum<typeof Scope> = z.nativeEnum(Scope);
/** @internal */ /** @internal */
export namespace GetTransientTokenRequest$ { export namespace GetTransientTokenRequest$ {

View File

@@ -62,7 +62,7 @@ export type LogLineResponse = {
}; };
/** @internal */ /** @internal */
export const Level$ = z.nativeEnum(Level); export const Level$: z.ZodNativeEnum<typeof Level> = z.nativeEnum(Level);
/** @internal */ /** @internal */
export namespace LogLineRequest$ { export namespace LogLineRequest$ {

View File

@@ -91,7 +91,7 @@ export type SearchLibraryResponse = {
}; };
/** @internal */ /** @internal */
export const Type$ = z.nativeEnum(Type); export const Type$: z.ZodNativeEnum<typeof Type> = z.nativeEnum(Type);
/** @internal */ /** @internal */
export namespace SearchLibraryRequest$ { export namespace SearchLibraryRequest$ {

View File

@@ -47,7 +47,7 @@ export type StartTaskResponse = {
}; };
/** @internal */ /** @internal */
export const TaskName$ = z.nativeEnum(TaskName); export const TaskName$: z.ZodNativeEnum<typeof TaskName> = z.nativeEnum(TaskName);
/** @internal */ /** @internal */
export namespace StartTaskRequest$ { export namespace StartTaskRequest$ {

View File

@@ -47,7 +47,8 @@ export type StopTaskResponse = {
}; };
/** @internal */ /** @internal */
export const PathParamTaskName$ = z.nativeEnum(PathParamTaskName); export const PathParamTaskName$: z.ZodNativeEnum<typeof PathParamTaskName> =
z.nativeEnum(PathParamTaskName);
/** @internal */ /** @internal */
export namespace StopTaskRequest$ { export namespace StopTaskRequest$ {

View File

@@ -59,7 +59,7 @@ export type UploadPlaylistResponse = {
}; };
/** @internal */ /** @internal */
export const Force$ = z.nativeEnum(Force); export const Force$: z.ZodNativeEnum<typeof Force> = z.nativeEnum(Force);
/** @internal */ /** @internal */
export namespace UploadPlaylistRequest$ { export namespace UploadPlaylistRequest$ {

View File

@@ -50,77 +50,77 @@ export class PlexAPI extends ClientSDK {
} }
private _server?: Server; private _server?: Server;
get server() { get server(): Server {
return (this._server ??= new Server(this.options$)); return (this._server ??= new Server(this.options$));
} }
private _media?: Media; private _media?: Media;
get media() { get media(): Media {
return (this._media ??= new Media(this.options$)); return (this._media ??= new Media(this.options$));
} }
private _video?: Video; private _video?: Video;
get video() { get video(): Video {
return (this._video ??= new Video(this.options$)); return (this._video ??= new Video(this.options$));
} }
private _activities?: Activities; private _activities?: Activities;
get activities() { get activities(): Activities {
return (this._activities ??= new Activities(this.options$)); return (this._activities ??= new Activities(this.options$));
} }
private _butler?: Butler; private _butler?: Butler;
get butler() { get butler(): Butler {
return (this._butler ??= new Butler(this.options$)); return (this._butler ??= new Butler(this.options$));
} }
private _hubs?: Hubs; private _hubs?: Hubs;
get hubs() { get hubs(): Hubs {
return (this._hubs ??= new Hubs(this.options$)); return (this._hubs ??= new Hubs(this.options$));
} }
private _search?: Search; private _search?: Search;
get search() { get search(): Search {
return (this._search ??= new Search(this.options$)); return (this._search ??= new Search(this.options$));
} }
private _library?: Library; private _library?: Library;
get library() { get library(): Library {
return (this._library ??= new Library(this.options$)); return (this._library ??= new Library(this.options$));
} }
private _log?: Log; private _log?: Log;
get log() { get log(): Log {
return (this._log ??= new Log(this.options$)); return (this._log ??= new Log(this.options$));
} }
private _plex?: Plex; private _plex?: Plex;
get plex() { get plex(): Plex {
return (this._plex ??= new Plex(this.options$)); return (this._plex ??= new Plex(this.options$));
} }
private _playlists?: Playlists; private _playlists?: Playlists;
get playlists() { get playlists(): Playlists {
return (this._playlists ??= new Playlists(this.options$)); return (this._playlists ??= new Playlists(this.options$));
} }
private _authentication?: Authentication; private _authentication?: Authentication;
get authentication() { get authentication(): Authentication {
return (this._authentication ??= new Authentication(this.options$)); return (this._authentication ??= new Authentication(this.options$));
} }
private _statistics?: Statistics; private _statistics?: Statistics;
get statistics() { get statistics(): Statistics {
return (this._statistics ??= new Statistics(this.options$)); return (this._statistics ??= new Statistics(this.options$));
} }
private _sessions?: Sessions; private _sessions?: Sessions;
get sessions() { get sessions(): Sessions {
return (this._sessions ??= new Sessions(this.options$)); return (this._sessions ??= new Sessions(this.options$));
} }
private _updater?: Updater; private _updater?: Updater;
get updater() { get updater(): Updater {
return (this._updater ??= new Updater(this.options$)); return (this._updater ??= new Updater(this.options$));
} }
} }

View File

@@ -4,10 +4,11 @@
import * as z from "zod"; import * as z from "zod";
export const blobLikeSchema = z.custom<Blob>(isBlobLike, { export const blobLikeSchema: z.ZodType<Blob, z.ZodTypeDef, Blob> =
message: "expected a Blob, File or Blob-like object", z.custom<Blob>(isBlobLike, {
fatal: true, message: "expected a Blob, File or Blob-like object",
}); fatal: true,
});
export function isBlobLike(val: unknown): val is Blob { export function isBlobLike(val: unknown): val is Blob {
if (val instanceof Blob) { if (val instanceof Blob) {

View File

@@ -11,7 +11,7 @@ export type PageIterator<Result> = Result & {
export function createPageIterator<Result>( export function createPageIterator<Result>(
page: Result & { next: Paginator<Result> }, page: Result & { next: Paginator<Result> },
) { ): { [Symbol.asyncIterator]: () => AsyncIterableIterator<Result> } {
return { return {
[Symbol.asyncIterator]: async function* paginator() { [Symbol.asyncIterator]: async function* paginator() {
yield page; yield page;

View File

@@ -10,7 +10,7 @@ export class RFCDate {
/** /**
* Creates a new RFCDate instance using today's date. * Creates a new RFCDate instance using today's date.
*/ */
static today() { static today(): RFCDate {
return new RFCDate(new Date()); return new RFCDate(new Date());
} }