mirror of
https://github.com/LukeHagar/plexjs.git
synced 2025-12-09 12:37:46 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b07bac6999 | ||
|
|
dcddc72b18 | ||
|
|
591d498f7c | ||
|
|
b1b902eac3 | ||
|
|
ad603e2e66 |
@@ -1,45 +1,49 @@
|
||||
## plexjs@0.0.22
|
||||
# Plex API Client
|
||||
|
||||
This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
|
||||
[](https://discord.gg/HQTPSJnWhb)
|
||||
[](https://npmjs.com/package/@lukehagar/plexjs)
|
||||
[](https://GitHub.com/LukeHagar/plexjs/tags/)
|
||||
|
||||
Environment
|
||||
* Node.js
|
||||
* Webpack
|
||||
* Browserify
|
||||
## Description
|
||||
|
||||
Language level
|
||||
* ES5 - you must have a Promises/A+ library installed
|
||||
* ES6
|
||||
|
||||
Module system
|
||||
* CommonJS
|
||||
* ES6 module system
|
||||
|
||||
It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html))
|
||||
A typescript sdk for interacting with Plex.tv and Plex Media Server REST API's.
|
||||
|
||||
### Building
|
||||
Documentation for all of the available endpoints [can be found here](https://plexapi.dev/docs/plex)
|
||||
|
||||
To build and compile the typescript sources to javascript use:
|
||||
```
|
||||
npm install
|
||||
npm run build
|
||||
## Installation
|
||||
|
||||
npm
|
||||
```bash
|
||||
npm install @lukehagar/plexjs
|
||||
```
|
||||
|
||||
### Publishing
|
||||
|
||||
First build the package then run ```npm publish```
|
||||
|
||||
### Consuming
|
||||
|
||||
navigate to the folder of your consuming project and run one of the following commands.
|
||||
|
||||
_published:_
|
||||
|
||||
```
|
||||
npm install plexjs@0.0.22 --save
|
||||
yarn
|
||||
```bash
|
||||
yarn add @lukehagar/plexjs
|
||||
```
|
||||
|
||||
_unPublished (not recommended):_
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
import {
|
||||
Configuration,
|
||||
ServerApi,
|
||||
DevicesApi,
|
||||
UserApi,
|
||||
} from "@lukehagar/plexjs";
|
||||
import dotenv from "dotenv";
|
||||
dotenv.config();
|
||||
|
||||
const config = new Configuration({
|
||||
basePath: process.env.BASE_PATH,
|
||||
plexToken: process.env.PLEX_TOKEN,
|
||||
});
|
||||
|
||||
new ServerApi(config).getServerCapabilities().then((resp) => console.log(resp));
|
||||
|
||||
new DevicesApi(config).getDevices().then((resp) => console.log(resp));
|
||||
|
||||
new UserApi(config).getUserDetails().then((resp) => console.log(resp));
|
||||
```
|
||||
npm install PATH_TO_GENERATED_PACKAGE --save
|
||||
|
||||
4
plexjs/package-lock.json
generated
4
plexjs/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@lukehagar/plexjs",
|
||||
"version": "0.0.28",
|
||||
"version": "0.0.29",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@lukehagar/plexjs",
|
||||
"version": "0.0.28",
|
||||
"version": "0.0.29",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"axios": "^0.26.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lukehagar/plexjs",
|
||||
"version": "0.0.28",
|
||||
"version": "0.0.29",
|
||||
"description": "Community Made Plex JS/TS Module",
|
||||
"author": "Luke Hagar",
|
||||
"repository": {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## plexjs@0.0.28
|
||||
## plexjs@0.0.29
|
||||
|
||||
This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
|
||||
|
||||
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
|
||||
_published:_
|
||||
|
||||
```
|
||||
npm install plexjs@0.0.28 --save
|
||||
npm install plexjs@0.0.29 --save
|
||||
```
|
||||
|
||||
_unPublished (not recommended):_
|
||||
|
||||
@@ -137,9 +137,9 @@ export class Configuration {
|
||||
this.device = param.device || "plexjs";
|
||||
this.deviceName = param.deviceName || "plexjs";
|
||||
this.platform = param.platform || "plexjs";
|
||||
this.platformVersion = param.platformVersion || "0.0.28";
|
||||
this.platformVersion = param.platformVersion || "0.0.29";
|
||||
this.product = param.product || "plexjs";
|
||||
this.version = param.version || "0.0.28";
|
||||
this.version = param.version || "0.0.29";
|
||||
|
||||
this.apiKey = (header: string) => {
|
||||
switch (header) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lukehagar/plexjs",
|
||||
"version": "0.0.28",
|
||||
"version": "0.0.29",
|
||||
"description": "Community Made Plex JS/TS Module",
|
||||
"author": "Luke Hagar",
|
||||
"repository": {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## plexjs@0.0.28
|
||||
## plexjs@0.0.29
|
||||
|
||||
This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
|
||||
|
||||
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
|
||||
_published:_
|
||||
|
||||
```
|
||||
npm install plexjs@0.0.28 --save
|
||||
npm install plexjs@0.0.29 --save
|
||||
```
|
||||
|
||||
_unPublished (not recommended):_
|
||||
|
||||
@@ -137,9 +137,9 @@ export class Configuration {
|
||||
this.device = param.device || "plexjs";
|
||||
this.deviceName = param.deviceName || "plexjs";
|
||||
this.platform = param.platform || "plexjs";
|
||||
this.platformVersion = param.platformVersion || "0.0.28";
|
||||
this.platformVersion = param.platformVersion || "0.0.29";
|
||||
this.product = param.product || "plexjs";
|
||||
this.version = param.version || "0.0.28";
|
||||
this.version = param.version || "0.0.29";
|
||||
|
||||
this.apiKey = (header: string) => {
|
||||
switch (header) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lukehagar/plexjs",
|
||||
"version": "0.0.28",
|
||||
"version": "0.0.29",
|
||||
"description": "Community Made Plex JS/TS Module",
|
||||
"author": "Luke Hagar",
|
||||
"repository": {
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
# Plex API Client
|
||||
|
||||
[](https://discord.gg/HQTPSJnWhb)
|
||||
[](https://npmjs.com/package/@lukehagar/plexjs)
|
||||
[](https://GitHub.com/LukeHagar/plexjs/tags/)
|
||||
|
||||
## Description
|
||||
|
||||
|
||||
|
||||
A typescript sdk for interacting with Plex.tv and Plex Media Server REST API's.
|
||||
|
||||
Documentation for all of the available endpoints [can be found here](https://plexapi.dev/docs/plex)
|
||||
|
||||
@@ -5,7 +5,7 @@ files:
|
||||
destinationFilename: package.json
|
||||
npmName: plexjs
|
||||
npmRepository: lukehagar
|
||||
npmVersion: 0.0.28
|
||||
npmVersion: 0.0.29
|
||||
useSingleRequestParameter: true
|
||||
sortParamsByRequiredFlag: true
|
||||
gitUserID: lukehagar
|
||||
|
||||
@@ -5,7 +5,7 @@ files:
|
||||
destinationFilename: package.json
|
||||
npmName: plexjs
|
||||
npmRepository: lukehagar
|
||||
npmVersion: 0.0.28
|
||||
npmVersion: 0.0.29
|
||||
useSingleRequestParameter: true
|
||||
sortParamsByRequiredFlag: true
|
||||
gitUserID: lukehagar
|
||||
|
||||
Reference in New Issue
Block a user