Initial Commit

This commit is contained in:
Luke Hagar
2024-01-01 15:47:37 -06:00
parent 203c48ae7c
commit f91c1e6f54
4519 changed files with 88021 additions and 0 deletions

3
.commitlintrc.json Normal file
View File

@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-conventional"]
}

9
.editorconfig Normal file
View File

@@ -0,0 +1,9 @@
root = true
[*]
indent_style = space
indent_size = 2
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

86
.eslintrc Normal file
View File

@@ -0,0 +1,86 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/recommended",
"plugin:import/typescript",
"next",
"next/core-web-vitals",
"plugin:prettier/recommended"
],
"env": {
"node": true
},
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"import",
"simple-import-sort",
"unused-imports",
"prettier",
"@typescript-eslint/eslint-plugin"
],
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": {
"project": "./tsconfig.json",
"alwaysTryTypes": true
}
}
},
"parserOptions": {
"tsconfigRootDir": "./",
"sourceType": "module",
"ecmaVersion": 2019
},
"rules": {
"prettier/prettier": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_"
}
],
"import/no-unresolved": "error",
"no-shadow": 0,
"spaced-comment": ["error", "always"],
"arrow-body-style": "error",
"padding-line-between-statements": [
"error",
{
"blankLine": "always",
"prev": "*",
"next": ["return", "while", "switch", "block", "for"]
},
{
"blankLine": "always",
"prev": ["block", "while", "switch", "if", "for"],
"next": "*"
}
],
"no-console": [
"error",
{
"allow": ["warn", "error", "info"]
}
],
"no-duplicate-imports": "error",
"curly": "error",
"lines-between-class-members": ["error", "always"],
"@typescript-eslint/no-extra-semi": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@next/next/no-img-element": "off",
"no-case-declarations": "off",
"react-hooks/exhaustive-deps": "off"
},
"ignorePatterns": ["node_modules", "out", ".next", "next.config.js"]
}

34
.github/workflows/generate-docs.yaml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Generate Docs
permissions:
checks: write
contents: write
pull-requests: write
statuses: write
"on":
workflow_dispatch:
inputs:
force:
description: Force generation of SDKs
type: boolean
default: false
schedule:
- cron: 0 0 * * *
jobs:
generate:
uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-generation.yaml@v14
with:
force: ${{ github.event.inputs.force }}
languages: |
- docs
docs_languages: |
- python
- typescript
- go
- curl
mode: direct
openapi_docs: |
- https://{openapi_spec}.yaml
speakeasy_version: latest
secrets:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}

4
.gitignore vendored
View File

@@ -1,3 +1,7 @@
node_modules
.idea
/build/
/out/
# Logs
logs
*.log

2
.npmrc Normal file
View File

@@ -0,0 +1,2 @@
save-exact = true
strict-peer-dependencies=false

1
.nvmrc Normal file
View File

@@ -0,0 +1 @@
16

7
.prettierrc Normal file
View File

@@ -0,0 +1,7 @@
{
"arrowParens": "always",
"singleQuote": true,
"jsxSingleQuote": true,
"tabWidth": 2,
"semi": true
}

26
Dockerfile Normal file
View File

@@ -0,0 +1,26 @@
FROM golang:1.21-alpine as builder
WORKDIR /app
RUN go mod init server
# Copy the server.go file.
COPY server.go ./
# Copy the 'out' directory
COPY out/ ./out/
RUN go build -o /server
FROM gcr.io/distroless/base
WORKDIR /
COPY --from=builder /server /server
COPY --from=builder /app/out/ /out/
ENV PORT=8080
EXPOSE 8080
ENTRYPOINT ["/server"]

2
Makefile Normal file
View File

@@ -0,0 +1,2 @@
docs:
speakeasy generate docs --schema https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/plex-media-server-spec-dereferenced.yaml --out ./ --langs python,typescript,go,curl --compile

88
content/languages.tsx Normal file
View File

@@ -0,0 +1,88 @@
import React, {
ReactElement,
ReactNode,
useCallback,
useContext,
useMemo,
} from 'react';
import { Columns, RHS } from '@/src/components/Columns';
import {
Authentication,
Parameters,
Response,
} from '@/src/components/Parameters';
import { LanguageContext } from '@/src/utils/contexts/languageContext';
import { LinkableContext } from '@/src/utils/contexts/linkableContext';
import { usePathname } from 'next/navigation';
import { useSetPage } from '@/src/components/scrollManager';
export const Languages = ["python", "typescript", "go", "curl"];
export type Language = (typeof Languages)[number];
export const DefaultLanguage = 'typescript';
export const LanguageProvider = (props: { children: ReactNode }) => {
const slug = usePathname();
const setPage = useSetPage();
const language = useMemo(() => {
// slug is in the form "/typescript/installation" (or null)
const routeLang = slug?.split('/')[1];
return routeLang || DefaultLanguage;
}, [slug]);
const setLanguage = useCallback(
(newLanguage: string) => {
const langRoutePrefix = (lang: string) => `/${lang}/`;
// Using window.location.pathname because router.asPath often has [...rest] in it
const newPath = window.location.pathname.replace(
langRoutePrefix(language),
langRoutePrefix(newLanguage),
);
setPage(newPath);
},
[language, setPage],
);
const context = {
language,
setLanguage,
languages: Languages,
};
return (
<LanguageContext.Provider value={context}>
{props.children}
</LanguageContext.Provider>
);
};
export const LanguageSwitch = (props: {
langToContent: Partial<Record<Language, JSX.Element>>;
}) => {
const { language } = useContext(LanguageContext);
return (
<LinkableContext.Provider value={false}>
{props.langToContent[language]}
</LinkableContext.Provider>
);
};
export const LanguageOperation = (props: {
usage: ReactElement;
authentication?: ReactElement;
parameters: ReactElement;
response: ReactElement;
}) => (
<Columns>
{props.authentication ? (
<Authentication>{props.authentication}</Authentication>
) : null}
<Parameters>{props.parameters}</Parameters>
<Response>{props.response}</Response>
<RHS>{props.usage}</RHS>
</Columns>
);

View File

@@ -0,0 +1,5 @@
import SDKPicker from '/src/components/SDKPicker';
We offer native client SDKs in the following languages. Select a language to view documentation and usage examples for that language.
<SDKPicker />

View File

@@ -0,0 +1,3 @@
## Client SDKs
{/* render client_sdks */}

View File

@@ -0,0 +1,17 @@
# API and SDK reference
{/* Start Imports */}
import ClientSDKs from "./client_sdks/client_sdks.mdx";
import Resources from "./resources/resources.mdx";
{/* End Imports */}
{/* Start Sections */}
<ClientSDKs/>
---
<Resources/>
{/* End Sections */}

View File

@@ -0,0 +1,23 @@
import GetServerActivities from "./get_server_activities/get_server_activities.mdx";
import CancelServerActivities from "./cancel_server_activities/cancel_server_activities.mdx";
## Activities
Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real\-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.
Activities are associated with HTTP replies via a special `X\-Plex\-Activity` header which contains the UUID of the activity.
Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. Other details:
\- They can contain a `progress` (from 0 to 100) marking the percent completion of the activity.
\- They must contain an `type` which is used by clients to distinguish the specific activity.
\- They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.)
\- The may contain a `Response` object which attributes which represent the result of the asynchronous operation.
### Available Operations
* [Get Server Activities](/curl/activities/get_server_activities) - Get Server Activities
* [Cancel Server Activities](/curl/activities/cancel_server_activities) - Cancel Server Activities
---
<GetServerActivities />
---
<CancelServerActivities />

View File

@@ -0,0 +1,9 @@
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### API key _— in HTTP header_
Set your API key in a `X-Plex-Token` HTTP header.
Example: `<no value>`

View File

@@ -0,0 +1,7 @@
import OperationInfo from '/src/components/OperationInfo';
## Cancel Server Activities
<OperationInfo method='delete' path='/activities/{activityUUID}' />
Cancel Server Activities

View File

@@ -0,0 +1,5 @@
{/* Autogenerated DO NOT EDIT */}
##### `activityUUID` _string_
The UUID of the activity to cancel.

View File

@@ -0,0 +1,26 @@
{/* Autogenerated DO NOT EDIT */}
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
import { TabbedSection, Tab } from '@/src/components/TabbedSection';
import StatusCode from '@/src/components/StatusCode';
<TabbedSection tabLabel='Status Code'>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"200"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"400"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"401"} />}>
*JSON object*
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties} defaultOpen={true}>
##### `errors` _array (optional)_
</Collapsible>
</Tab>
</TabbedSection>

View File

@@ -0,0 +1,21 @@
<CH.Code>
```bash Example Request
curl http://10.10.10.47:32400/activities/string \
--header 'Accept: application/json' \
--header 'X-Plex-Token: YOUR_API_KEY_HERE'
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Activities*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,9 @@
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### API key _— in HTTP header_
Set your API key in a `X-Plex-Token` HTTP header.
Example: `<no value>`

View File

@@ -0,0 +1,7 @@
import OperationInfo from '/src/components/OperationInfo';
## Get Server Activities
<OperationInfo method='get' path='/activities' />
Get Server Activities

View File

@@ -0,0 +1,2 @@
{/* Autogenerated DO NOT EDIT */}

View File

@@ -0,0 +1,35 @@
{/* Autogenerated DO NOT EDIT */}
import GetServerActivitiesMediaContainer from "/content/types/operations/get_server_activities_media_container/curl.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
import { TabbedSection, Tab } from '@/src/components/TabbedSection';
import StatusCode from '@/src/components/StatusCode';
<TabbedSection tabLabel='Status Code'>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"200"} />}>
*JSON object*
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties} defaultOpen={true}>
##### `MediaContainer` _object (optional)_
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<GetServerActivitiesMediaContainer/>
</Collapsible>
</Collapsible>
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"400"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"401"} />}>
*JSON object*
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties} defaultOpen={true}>
##### `errors` _array (optional)_
</Collapsible>
</Tab>
</TabbedSection>

View File

@@ -0,0 +1,31 @@
<CH.Code>
```bash Example Request
curl http://10.10.10.47:32400/activities \
--header 'Accept: application/json' \
--header 'X-Plex-Token: YOUR_API_KEY_HERE'
```
---
```json Example Response
{
"MediaContainer": {
"size": 4375.87,
"Activity": [
{
"uuid": "string",
"type": "string",
"cancellable": false,
"userID": 2975.34,
"title": "string",
"subtitle": "string",
"progress": 8917.73,
"Context": {
"librarySectionID": "string"
}
}
]
}
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Activities*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,32 @@
import GetButlerTasks from "./get_butler_tasks/get_butler_tasks.mdx";
import StartAllTasks from "./start_all_tasks/start_all_tasks.mdx";
import StopAllTasks from "./stop_all_tasks/stop_all_tasks.mdx";
import StartTask from "./start_task/start_task.mdx";
import StopTask from "./stop_task/stop_task.mdx";
## Butler
Butler is the task manager of the Plex Media Server Ecosystem.
### Available Operations
* [Get Butler Tasks](/curl/butler/get_butler_tasks) - Get Butler tasks
* [Start All Tasks](/curl/butler/start_all_tasks) - Start all Butler tasks
* [Stop All Tasks](/curl/butler/stop_all_tasks) - Stop all Butler tasks
* [Start Task](/curl/butler/start_task) - Start a single Butler task
* [Stop Task](/curl/butler/stop_task) - Stop a single Butler task
---
<GetButlerTasks />
---
<StartAllTasks />
---
<StopAllTasks />
---
<StartTask />
---
<StopTask />

View File

@@ -0,0 +1,9 @@
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### API key _— in HTTP header_
Set your API key in a `X-Plex-Token` HTTP header.
Example: `<no value>`

View File

@@ -0,0 +1,7 @@
import OperationInfo from '/src/components/OperationInfo';
## Get Butler Tasks
<OperationInfo method='get' path='/butler' />
Returns a list of butler tasks

View File

@@ -0,0 +1,2 @@
{/* Autogenerated DO NOT EDIT */}

View File

@@ -0,0 +1,35 @@
{/* Autogenerated DO NOT EDIT */}
import ButlerTasks from "/content/types/operations/butler_tasks/curl.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
import { TabbedSection, Tab } from '@/src/components/TabbedSection';
import StatusCode from '@/src/components/StatusCode';
<TabbedSection tabLabel='Status Code'>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"200"} />}>
*JSON object*
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties} defaultOpen={true}>
##### `ButlerTasks` _object (optional)_
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<ButlerTasks/>
</Collapsible>
</Collapsible>
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"400"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"401"} />}>
*JSON object*
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties} defaultOpen={true}>
##### `errors` _array (optional)_
</Collapsible>
</Tab>
</TabbedSection>

View File

@@ -0,0 +1,26 @@
<CH.Code>
```bash Example Request
curl http://10.10.10.47:32400/butler \
--header 'Accept: application/json' \
--header 'X-Plex-Token: YOUR_API_KEY_HERE'
```
---
```json Example Response
{
"ButlerTasks": {
"ButlerTask": [
{
"name": "BackupDatabase",
"interval": 3,
"scheduleRandomized": false,
"enabled": false,
"title": "Backup Database",
"description": "Create a backup copy of the server's database in the configured backup directory"
}
]
}
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Butler*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,9 @@
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### API key _— in HTTP header_
Set your API key in a `X-Plex-Token` HTTP header.
Example: `<no value>`

View File

@@ -0,0 +1,12 @@
import OperationInfo from '/src/components/OperationInfo';
## Start All Tasks
<OperationInfo method='post' path='/butler' />
This endpoint will attempt to start all Butler tasks that are enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
1. Any tasks not scheduled to run on the current day will be skipped.
2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
4. If we are outside the configured window, the task will start immediately.

View File

@@ -0,0 +1,2 @@
{/* Autogenerated DO NOT EDIT */}

View File

@@ -0,0 +1,26 @@
{/* Autogenerated DO NOT EDIT */}
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
import { TabbedSection, Tab } from '@/src/components/TabbedSection';
import StatusCode from '@/src/components/StatusCode';
<TabbedSection tabLabel='Status Code'>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"200"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"400"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"401"} />}>
*JSON object*
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties} defaultOpen={true}>
##### `errors` _array (optional)_
</Collapsible>
</Tab>
</TabbedSection>

View File

@@ -0,0 +1,21 @@
<CH.Code>
```bash Example Request
curl http://10.10.10.47:32400/butler \
--header 'Accept: application/json' \
--header 'X-Plex-Token: YOUR_API_KEY_HERE'
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Butler*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,9 @@
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### API key _— in HTTP header_
Set your API key in a `X-Plex-Token` HTTP header.
Example: `<no value>`

View File

@@ -0,0 +1,12 @@
import OperationInfo from '/src/components/OperationInfo';
## Start Task
<OperationInfo method='post' path='/butler/{taskName}' />
This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
1. Any tasks not scheduled to run on the current day will be skipped.
2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
4. If we are outside the configured window, the task will start immediately.

View File

@@ -0,0 +1,12 @@
{/* Autogenerated DO NOT EDIT */}
import TaskName from "/content/types/operations/task_name/curl.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### `taskName` _enumeration_
the name of the task to be started.
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<TaskName/>
</Collapsible>

View File

@@ -0,0 +1,30 @@
{/* Autogenerated DO NOT EDIT */}
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
import { TabbedSection, Tab } from '@/src/components/TabbedSection';
import StatusCode from '@/src/components/StatusCode';
<TabbedSection tabLabel='Status Code'>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"200"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"202"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"400"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"401"} />}>
*JSON object*
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties} defaultOpen={true}>
##### `errors` _array (optional)_
</Collapsible>
</Tab>
</TabbedSection>

View File

@@ -0,0 +1,21 @@
<CH.Code>
```bash Example Request
curl http://10.10.10.47:32400/butler/{{taskName}} \
--header 'Accept: application/json' \
--header 'X-Plex-Token: YOUR_API_KEY_HERE'
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Butler*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,9 @@
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### API key _— in HTTP header_
Set your API key in a `X-Plex-Token` HTTP header.
Example: `<no value>`

View File

@@ -0,0 +1,8 @@
import OperationInfo from '/src/components/OperationInfo';
## Stop All Tasks
<OperationInfo method='delete' path='/butler' />
This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.

View File

@@ -0,0 +1,2 @@
{/* Autogenerated DO NOT EDIT */}

View File

@@ -0,0 +1,26 @@
{/* Autogenerated DO NOT EDIT */}
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
import { TabbedSection, Tab } from '@/src/components/TabbedSection';
import StatusCode from '@/src/components/StatusCode';
<TabbedSection tabLabel='Status Code'>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"200"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"400"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"401"} />}>
*JSON object*
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties} defaultOpen={true}>
##### `errors` _array (optional)_
</Collapsible>
</Tab>
</TabbedSection>

View File

@@ -0,0 +1,21 @@
<CH.Code>
```bash Example Request
curl http://10.10.10.47:32400/butler \
--header 'Accept: application/json' \
--header 'X-Plex-Token: YOUR_API_KEY_HERE'
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Butler*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,9 @@
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### API key _— in HTTP header_
Set your API key in a `X-Plex-Token` HTTP header.
Example: `<no value>`

View File

@@ -0,0 +1,8 @@
import OperationInfo from '/src/components/OperationInfo';
## Stop Task
<OperationInfo method='delete' path='/butler/{taskName}' />
This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists. See the section above for a list of task names for this endpoint.

View File

@@ -0,0 +1,12 @@
{/* Autogenerated DO NOT EDIT */}
import PathParamTaskName from "/content/types/operations/path_param_task_name/curl.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### `taskName` _enumeration_
The name of the task to be started.
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<PathParamTaskName/>
</Collapsible>

View File

@@ -0,0 +1,30 @@
{/* Autogenerated DO NOT EDIT */}
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
import { TabbedSection, Tab } from '@/src/components/TabbedSection';
import StatusCode from '@/src/components/StatusCode';
<TabbedSection tabLabel='Status Code'>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"200"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"400"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"404"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"401"} />}>
*JSON object*
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties} defaultOpen={true}>
##### `errors` _array (optional)_
</Collapsible>
</Tab>
</TabbedSection>

View File

@@ -0,0 +1,21 @@
<CH.Code>
```bash Example Request
curl http://10.10.10.47:32400/butler/{{taskName}} \
--header 'Accept: application/json' \
--header 'X-Plex-Token: YOUR_API_KEY_HERE'
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Butler*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,9 @@
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### API key _— in HTTP header_
Set your API key in a `X-Plex-Token` HTTP header.
Example: `<no value>`

View File

@@ -0,0 +1,7 @@
import OperationInfo from '/src/components/OperationInfo';
## Get Global Hubs
<OperationInfo method='get' path='/hubs' />
Get Global Hubs filtered by the parameters provided.

View File

@@ -0,0 +1,16 @@
{/* Autogenerated DO NOT EDIT */}
import OnlyTransient from "/content/types/operations/only_transient/curl.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### `count` _number (optional)_
The number of items to return with each hub.
---
##### `onlyTransient` _enumeration (optional)_
Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<OnlyTransient/>
</Collapsible>

View File

@@ -0,0 +1,26 @@
{/* Autogenerated DO NOT EDIT */}
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
import { TabbedSection, Tab } from '@/src/components/TabbedSection';
import StatusCode from '@/src/components/StatusCode';
<TabbedSection tabLabel='Status Code'>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"200"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"400"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"401"} />}>
*JSON object*
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties} defaultOpen={true}>
##### `errors` _array (optional)_
</Collapsible>
</Tab>
</TabbedSection>

View File

@@ -0,0 +1,21 @@
<CH.Code>
```bash Example Request
curl http://10.10.10.47:32400/hubs?count=567.13 \
--header 'Accept: application/json' \
--header 'X-Plex-Token: YOUR_API_KEY_HERE'
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Hubs*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,9 @@
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### API key _— in HTTP header_
Set your API key in a `X-Plex-Token` HTTP header.
Example: `<no value>`

View File

@@ -0,0 +1,8 @@
import OperationInfo from '/src/components/OperationInfo';
## Get Library Hubs
<OperationInfo method='get' path='/hubs/sections/{sectionId}' />
This endpoint will return a list of library specific hubs

View File

@@ -0,0 +1,20 @@
{/* Autogenerated DO NOT EDIT */}
import QueryParamOnlyTransient from "/content/types/operations/query_param_only_transient/curl.mdx"
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### `sectionId` _number_
the Id of the library to query
---
##### `count` _number (optional)_
The number of items to return with each hub.
---
##### `onlyTransient` _enumeration (optional)_
Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties}>
<QueryParamOnlyTransient/>
</Collapsible>

View File

@@ -0,0 +1,26 @@
{/* Autogenerated DO NOT EDIT */}
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
import { TabbedSection, Tab } from '@/src/components/TabbedSection';
import StatusCode from '@/src/components/StatusCode';
<TabbedSection tabLabel='Status Code'>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"200"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"400"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"401"} />}>
*JSON object*
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties} defaultOpen={true}>
##### `errors` _array (optional)_
</Collapsible>
</Tab>
</TabbedSection>

View File

@@ -0,0 +1,21 @@
<CH.Code>
```bash Example Request
curl http://10.10.10.47:32400/hubs/sections/9636.63?count=2726.56 \
--header 'Accept: application/json' \
--header 'X-Plex-Token: YOUR_API_KEY_HERE'
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Hubs*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,17 @@
import GetGlobalHubs from "./get_global_hubs/get_global_hubs.mdx";
import GetLibraryHubs from "./get_library_hubs/get_library_hubs.mdx";
## Hubs
Hubs are a structured two\-dimensional container for media, generally represented by multiple horizontal rows.
### Available Operations
* [Get Global Hubs](/curl/hubs/get_global_hubs) - Get Global Hubs
* [Get Library Hubs](/curl/hubs/get_library_hubs) - Get library specific hubs
---
<GetGlobalHubs />
---
<GetLibraryHubs />

View File

@@ -0,0 +1,9 @@
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### API key _— in HTTP header_
Set your API key in a `X-Plex-Token` HTTP header.
Example: `<no value>`

View File

@@ -0,0 +1,7 @@
import OperationInfo from '/src/components/OperationInfo';
## Delete Library
<OperationInfo method='delete' path='/library/sections/{sectionId}' />
Delate a library using a specific section

View File

@@ -0,0 +1,7 @@
{/* Autogenerated DO NOT EDIT */}
##### `sectionId` _number_
the Id of the library to query
<br/>
**Example:** `1000`

View File

@@ -0,0 +1,26 @@
{/* Autogenerated DO NOT EDIT */}
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
import { TabbedSection, Tab } from '@/src/components/TabbedSection';
import StatusCode from '@/src/components/StatusCode';
<TabbedSection tabLabel='Status Code'>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"200"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"400"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"401"} />}>
*JSON object*
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties} defaultOpen={true}>
##### `errors` _array (optional)_
</Collapsible>
</Tab>
</TabbedSection>

View File

@@ -0,0 +1,21 @@
<CH.Code>
```bash Example Request
curl http://10.10.10.47:32400/library/sections/1000 \
--header 'Accept: application/json' \
--header 'X-Plex-Token: YOUR_API_KEY_HERE'
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Library*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,9 @@
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### API key _— in HTTP header_
Set your API key in a `X-Plex-Token` HTTP header.
Example: `<no value>`

View File

@@ -0,0 +1,8 @@
import OperationInfo from '/src/components/OperationInfo';
## Get Common Library Items
<OperationInfo method='get' path='/library/sections/{sectionId}/common' />
Represents a "Common" item. It contains only the common attributes of the items selected by the provided filter

View File

@@ -0,0 +1,13 @@
{/* Autogenerated DO NOT EDIT */}
##### `sectionId` _number_
the Id of the library to query
---
##### `type` _number_
item type
---
##### `filter` _string (optional)_
the filter parameter

View File

@@ -0,0 +1,30 @@
{/* Autogenerated DO NOT EDIT */}
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
import { TabbedSection, Tab } from '@/src/components/TabbedSection';
import StatusCode from '@/src/components/StatusCode';
<TabbedSection tabLabel='Status Code'>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"200"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"400"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"404"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"401"} />}>
*JSON object*
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties} defaultOpen={true}>
##### `errors` _array (optional)_
</Collapsible>
</Tab>
</TabbedSection>

View File

@@ -0,0 +1,21 @@
<CH.Code>
```bash Example Request
curl http://10.10.10.47:32400/library/sections/8360.79/common?filter=string&type=710.36 \
--header 'Accept: application/json' \
--header 'X-Plex-Token: YOUR_API_KEY_HERE'
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Library*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,9 @@
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### API key _— in HTTP header_
Set your API key in a `X-Plex-Token` HTTP header.
Example: `<no value>`

View File

@@ -0,0 +1,7 @@
import OperationInfo from '/src/components/OperationInfo';
## Get File Hash
<OperationInfo method='get' path='/library/hashes' />
This resource returns hash values for local files

View File

@@ -0,0 +1,11 @@
{/* Autogenerated DO NOT EDIT */}
##### `url` _string_
This is the path to the local file, must be prefixed by `file://`
<br/>
**Example:** `file://C:\Image.png&type=13`
---
##### `type` _number (optional)_
Item type

View File

@@ -0,0 +1,26 @@
{/* Autogenerated DO NOT EDIT */}
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
import { TabbedSection, Tab } from '@/src/components/TabbedSection';
import StatusCode from '@/src/components/StatusCode';
<TabbedSection tabLabel='Status Code'>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"200"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"400"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"401"} />}>
*JSON object*
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties} defaultOpen={true}>
##### `errors` _array (optional)_
</Collapsible>
</Tab>
</TabbedSection>

View File

@@ -0,0 +1,21 @@
<CH.Code>
```bash Example Request
curl http://10.10.10.47:32400/library/hashes?type=8121.69&url=file%3A%2F%2FC%3A%5CImage.png%26type%3D13 \
--header 'Accept: application/json' \
--header 'X-Plex-Token: YOUR_API_KEY_HERE'
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Library*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,9 @@
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### API key _— in HTTP header_
Set your API key in a `X-Plex-Token` HTTP header.
Example: `<no value>`

View File

@@ -0,0 +1,8 @@
import OperationInfo from '/src/components/OperationInfo';
## Get Latest Library Items
<OperationInfo method='get' path='/library/sections/{sectionId}/latest' />
This endpoint will return a list of the latest library items filtered by the filter and type provided

View File

@@ -0,0 +1,13 @@
{/* Autogenerated DO NOT EDIT */}
##### `sectionId` _number_
the Id of the library to query
---
##### `type` _number_
item type
---
##### `filter` _string (optional)_
the filter parameter

View File

@@ -0,0 +1,26 @@
{/* Autogenerated DO NOT EDIT */}
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
import { TabbedSection, Tab } from '@/src/components/TabbedSection';
import StatusCode from '@/src/components/StatusCode';
<TabbedSection tabLabel='Status Code'>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"200"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"400"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"401"} />}>
*JSON object*
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties} defaultOpen={true}>
##### `errors` _array (optional)_
</Collapsible>
</Tab>
</TabbedSection>

View File

@@ -0,0 +1,21 @@
<CH.Code>
```bash Example Request
curl http://10.10.10.47:32400/library/sections/3927.85/latest?filter=string&type=9255.97 \
--header 'Accept: application/json' \
--header 'X-Plex-Token: YOUR_API_KEY_HERE'
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

View File

@@ -0,0 +1,12 @@
import CurlHeader from './_header.mdx';
import SDKHeader from './_header.mdx';
import OperationHeader from '/src/components/OperationHeader';
###### *Library*
<OperationHeader
sdkHeader={<SDKHeader />}
curlHeader={<CurlHeader />}
/>
{/* render operation */}

View File

@@ -0,0 +1,9 @@
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
##### API key _— in HTTP header_
Set your API key in a `X-Plex-Token` HTTP header.
Example: `<no value>`

View File

@@ -0,0 +1,13 @@
import OperationInfo from '/src/components/OperationInfo';
## Get Libraries
<OperationInfo method='get' path='/library/sections' />
A library section (commonly referred to as just a library) is a collection of media.
Libraries are typed, and depending on their type provide either a flat or a hierarchical view of the media.
For example, a music library has an artist > albums > tracks structure, whereas a movie library is flat.
Libraries have features beyond just being a collection of media; for starters, they include information about supported types, filters and sorts.
This allows a client to provide a rich interface around the media (e.g. allow sorting movies by release year).

View File

@@ -0,0 +1,2 @@
{/* Autogenerated DO NOT EDIT */}

View File

@@ -0,0 +1,26 @@
{/* Autogenerated DO NOT EDIT */}
import Collapsible from "/src/components/Collapsible";
import Labels from "/src/lib/labels";
import { TabbedSection, Tab } from '@/src/components/TabbedSection';
import StatusCode from '@/src/components/StatusCode';
<TabbedSection tabLabel='Status Code'>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"200"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"400"} />}>
_No response body._
</Tab>
{/* prettier-ignore */}
<Tab title={<StatusCode code={"401"} />}>
*JSON object*
<Collapsible openLabel={Labels.showProperties} closeLabel={Labels.hideProperties} defaultOpen={true}>
##### `errors` _array (optional)_
</Collapsible>
</Tab>
</TabbedSection>

View File

@@ -0,0 +1,21 @@
<CH.Code>
```bash Example Request
curl http://10.10.10.47:32400/library/sections \
--header 'Accept: application/json' \
--header 'X-Plex-Token: YOUR_API_KEY_HERE'
```
---
```json Example Response
{
"errors": [
{
"code": 1001,
"message": "User could not be authenticated",
"status": 401
}
]
}
```
</CH.Code>

Some files were not shown because too many files have changed in this diff Show More