mirror of
https://github.com/LukeHagar/plexjs.git
synced 2025-12-06 20:47:46 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3db513ac7d | ||
|
|
fe8f8f571b | ||
|
|
e65a0f1719 | ||
|
|
29ea6c0d75 | ||
|
|
c5d773bf41 | ||
|
|
35cf322f7b | ||
|
|
1d03f750b9 |
@@ -12,9 +12,9 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@lukehagar/plexjs": "^0.0.22",
|
"@lukehagar/plexjs": "^0.0.25",
|
||||||
"@types/jest": "^29.5.1",
|
"@types/jest": "^29.5.1",
|
||||||
"@types/node": "^18.6.1",
|
"@types/node": "^18.15.12",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.31.0",
|
"@typescript-eslint/eslint-plugin": "^5.31.0",
|
||||||
"@typescript-eslint/parser": "^5.31.0",
|
"@typescript-eslint/parser": "^5.31.0",
|
||||||
"dotenv": "^16.0.3",
|
"dotenv": "^16.0.3",
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
import {
|
import { Configuration, ServerApi, PlexTvApi } from "@lukehagar/plexjs";
|
||||||
Configuration,
|
|
||||||
ServerApi,
|
|
||||||
DevicesApi,
|
|
||||||
PlexTvApi,
|
|
||||||
} from "@lukehagar/plexjs";
|
|
||||||
import dotenv from "dotenv";
|
import dotenv from "dotenv";
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
|
||||||
@@ -12,10 +7,8 @@ const config = new Configuration({
|
|||||||
plexToken: process.env.PLEX_TOKEN,
|
plexToken: process.env.PLEX_TOKEN,
|
||||||
});
|
});
|
||||||
|
|
||||||
// new ServerApi(config).getServerCapabilities().then((resp) => console.log(resp));
|
new ServerApi(config).getServerCapabilities().then((resp) => console.log(resp));
|
||||||
|
|
||||||
// new DevicesApi(config).getDevices().then((resp) => console.log(resp));
|
new PlexTvApi(config).getDevices().then((resp) => console.log(resp));
|
||||||
|
|
||||||
new PlexTvApi(config)
|
new PlexTvApi(config).getUserDetails().then((resp) => console.log(resp));
|
||||||
.getUserDetails({ baseURL: "https://plex.tv/api/v2" })
|
|
||||||
.then((resp) => console.log(resp));
|
|
||||||
|
|||||||
@@ -592,10 +592,10 @@
|
|||||||
"@jridgewell/resolve-uri" "3.1.0"
|
"@jridgewell/resolve-uri" "3.1.0"
|
||||||
"@jridgewell/sourcemap-codec" "1.4.14"
|
"@jridgewell/sourcemap-codec" "1.4.14"
|
||||||
|
|
||||||
"@lukehagar/plexjs@^0.0.22":
|
"@lukehagar/plexjs@^0.0.25":
|
||||||
version "0.0.22"
|
version "0.0.25"
|
||||||
resolved "https://registry.yarnpkg.com/@lukehagar/plexjs/-/plexjs-0.0.22.tgz#a87b9df5efee2fd553ec1bb7fe6a2b71dfdd8c27"
|
resolved "https://registry.yarnpkg.com/@lukehagar/plexjs/-/plexjs-0.0.25.tgz#198708e8599328bec31e83c7b1e45523cbb24198"
|
||||||
integrity sha512-0XNjk4ocqULuNbA3tfqK0bIxBAeA64Dkk6jZUpDkI/CCji5ND+Ara38ZmDXBzT5fRioFoP35Lb2/zTLfpMc8wg==
|
integrity sha512-qzJCSbTNKnYOjU9enVRKKdhNxmLZNAXCeXiWF4f/PVujMEU5+pMKvyUoLWA/bTOob8AjjYujy33Ab9t8gpz9eQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
axios "^0.26.1"
|
axios "^0.26.1"
|
||||||
axios-retry "^3.4.0"
|
axios-retry "^3.4.0"
|
||||||
@@ -821,10 +821,10 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca"
|
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca"
|
||||||
integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==
|
integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==
|
||||||
|
|
||||||
"@types/node@*", "@types/node@>=13.7.0", "@types/node@^18.6.1":
|
"@types/node@*", "@types/node@>=13.7.0", "@types/node@^18.15.12":
|
||||||
version "18.15.11"
|
version "18.15.12"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.11.tgz#b3b790f09cb1696cffcec605de025b088fa4225f"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.12.tgz#833756634e78c829e1254db006468dadbb0c696b"
|
||||||
integrity sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==
|
integrity sha512-Wha1UwsB3CYdqUm2PPzh/1gujGCNtWVUYF0mB00fJFoR4gTyWTDPjSm+zBF787Ahw8vSGgBja90MkgFwvB86Dg==
|
||||||
|
|
||||||
"@types/node@^11.9.4":
|
"@types/node@^11.9.4":
|
||||||
version "11.15.54"
|
version "11.15.54"
|
||||||
|
|||||||
4
plexjs/package-lock.json
generated
4
plexjs/package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@lukehagar/plexjs",
|
"name": "@lukehagar/plexjs",
|
||||||
"version": "0.0.24",
|
"version": "0.0.26",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@lukehagar/plexjs",
|
"name": "@lukehagar/plexjs",
|
||||||
"version": "0.0.24",
|
"version": "0.0.26",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.26.1",
|
"axios": "^0.26.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@lukehagar/plexjs",
|
"name": "@lukehagar/plexjs",
|
||||||
"version": "0.0.24",
|
"version": "0.0.26",
|
||||||
"description": "Community Made Plex JS/TS Module",
|
"description": "Community Made Plex JS/TS Module",
|
||||||
"author": "Luke Hagar",
|
"author": "Luke Hagar",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
## plexjs@0.0.24
|
## plexjs@0.0.26
|
||||||
|
|
||||||
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:
|
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:_
|
_published:_
|
||||||
|
|
||||||
```
|
```
|
||||||
npm install plexjs@0.0.24 --save
|
npm install plexjs@0.0.26 --save
|
||||||
```
|
```
|
||||||
|
|
||||||
_unPublished (not recommended):_
|
_unPublished (not recommended):_
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export class BaseAPI {
|
|||||||
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
|
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
|
||||||
if (configuration) {
|
if (configuration) {
|
||||||
this.configuration = configuration;
|
this.configuration = configuration;
|
||||||
this.basePath = configuration.basePath || this.basePath;
|
this.basePath = "https://plex.tv/api/v2" || this.basePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -137,9 +137,9 @@ export class Configuration {
|
|||||||
this.device = param.device || "plexjs";
|
this.device = param.device || "plexjs";
|
||||||
this.deviceName = param.deviceName || "plexjs";
|
this.deviceName = param.deviceName || "plexjs";
|
||||||
this.platform = param.platform || "plexjs";
|
this.platform = param.platform || "plexjs";
|
||||||
this.platformVersion = param.platformVersion || "0.0.24";
|
this.platformVersion = param.platformVersion || "0.0.26";
|
||||||
this.product = param.product || "plexjs";
|
this.product = param.product || "plexjs";
|
||||||
this.version = param.version || "0.0.24";
|
this.version = param.version || "0.0.26";
|
||||||
|
|
||||||
this.apiKey = (header: string) => {
|
this.apiKey = (header: string) => {
|
||||||
switch (header) {
|
switch (header) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@lukehagar/plexjs",
|
"name": "@lukehagar/plexjs",
|
||||||
"version": "0.0.24",
|
"version": "0.0.26",
|
||||||
"description": "Community Made Plex JS/TS Module",
|
"description": "Community Made Plex JS/TS Module",
|
||||||
"author": "Luke Hagar",
|
"author": "Luke Hagar",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
## plexjs@0.0.24
|
## plexjs@0.0.26
|
||||||
|
|
||||||
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:
|
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:_
|
_published:_
|
||||||
|
|
||||||
```
|
```
|
||||||
npm install plexjs@0.0.24 --save
|
npm install plexjs@0.0.26 --save
|
||||||
```
|
```
|
||||||
|
|
||||||
_unPublished (not recommended):_
|
_unPublished (not recommended):_
|
||||||
|
|||||||
@@ -3362,6 +3362,260 @@ export class LogApi extends BaseAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MediaApi - axios parameter creator
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const MediaApiAxiosParamCreator = function (configuration?: Configuration) {
|
||||||
|
return {
|
||||||
|
/**
|
||||||
|
* This will mark the provided media key as Played.
|
||||||
|
* @summary Mark Media Played
|
||||||
|
* @param {any} key The media key to mark as played
|
||||||
|
* @param {*} [axiosOptions] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
markPlayed: async (key: any, axiosOptions: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
// verify required parameter 'key' is not null or undefined
|
||||||
|
assertParamExists('markPlayed', 'key', key)
|
||||||
|
const localVarPath = `/:/scrobble`;
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
|
let baseOptions;
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions};
|
||||||
|
const localVarHeaderParameter = {} as any;
|
||||||
|
const localVarQueryParameter = {} as any;
|
||||||
|
|
||||||
|
// authentication ClientIdentifier required
|
||||||
|
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration)
|
||||||
|
|
||||||
|
// authentication Device required
|
||||||
|
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device", configuration)
|
||||||
|
|
||||||
|
// authentication DeviceName required
|
||||||
|
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration)
|
||||||
|
|
||||||
|
// authentication Platform required
|
||||||
|
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Platform", configuration)
|
||||||
|
|
||||||
|
// authentication PlatformVersion required
|
||||||
|
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Platform-Version", configuration)
|
||||||
|
|
||||||
|
// authentication Product required
|
||||||
|
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Product", configuration)
|
||||||
|
|
||||||
|
// authentication Token required
|
||||||
|
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
|
||||||
|
|
||||||
|
// authentication Version required
|
||||||
|
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Version", configuration)
|
||||||
|
|
||||||
|
if (key !== undefined) {
|
||||||
|
localVarQueryParameter['key'] = key;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers};
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
axiosOptions: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* This will mark the provided media key as Unplayed.
|
||||||
|
* @summary Mark Media Unplayed
|
||||||
|
* @param {any} key The media key to mark as Unplayed
|
||||||
|
* @param {*} [axiosOptions] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
markUnplayed: async (key: any, axiosOptions: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
// verify required parameter 'key' is not null or undefined
|
||||||
|
assertParamExists('markUnplayed', 'key', key)
|
||||||
|
const localVarPath = `/:/unscrobble`;
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
|
let baseOptions;
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...axiosOptions};
|
||||||
|
const localVarHeaderParameter = {} as any;
|
||||||
|
const localVarQueryParameter = {} as any;
|
||||||
|
|
||||||
|
// authentication ClientIdentifier required
|
||||||
|
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Client-Identifier", configuration)
|
||||||
|
|
||||||
|
// authentication Device required
|
||||||
|
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device", configuration)
|
||||||
|
|
||||||
|
// authentication DeviceName required
|
||||||
|
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Device-Name", configuration)
|
||||||
|
|
||||||
|
// authentication Platform required
|
||||||
|
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Platform", configuration)
|
||||||
|
|
||||||
|
// authentication PlatformVersion required
|
||||||
|
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Platform-Version", configuration)
|
||||||
|
|
||||||
|
// authentication Product required
|
||||||
|
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Product", configuration)
|
||||||
|
|
||||||
|
// authentication Token required
|
||||||
|
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
|
||||||
|
|
||||||
|
// authentication Version required
|
||||||
|
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Version", configuration)
|
||||||
|
|
||||||
|
if (key !== undefined) {
|
||||||
|
localVarQueryParameter['key'] = key;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...axiosOptions.headers};
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
axiosOptions: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MediaApi - functional programming interface
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const MediaApiFp = function(configuration?: Configuration) {
|
||||||
|
const localVarAxiosParamCreator = MediaApiAxiosParamCreator(configuration)
|
||||||
|
return {
|
||||||
|
/**
|
||||||
|
* This will mark the provided media key as Played.
|
||||||
|
* @summary Mark Media Played
|
||||||
|
* @param {any} key The media key to mark as played
|
||||||
|
* @param {*} [axiosOptions] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async markPlayed(key: any, axiosOptions?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.markPlayed(key, axiosOptions);
|
||||||
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* This will mark the provided media key as Unplayed.
|
||||||
|
* @summary Mark Media Unplayed
|
||||||
|
* @param {any} key The media key to mark as Unplayed
|
||||||
|
* @param {*} [axiosOptions] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async markUnplayed(key: any, axiosOptions?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.markUnplayed(key, axiosOptions);
|
||||||
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MediaApi - factory interface
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const MediaApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||||
|
const localVarFp = MediaApiFp(configuration)
|
||||||
|
return {
|
||||||
|
/**
|
||||||
|
* This will mark the provided media key as Played.
|
||||||
|
* @summary Mark Media Played
|
||||||
|
* @param {any} key The media key to mark as played
|
||||||
|
* @param {*} [axiosOptions] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
markPlayed(key: any, axiosOptions?: any): AxiosPromise<void> {
|
||||||
|
return localVarFp.markPlayed(key, axiosOptions).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* This will mark the provided media key as Unplayed.
|
||||||
|
* @summary Mark Media Unplayed
|
||||||
|
* @param {any} key The media key to mark as Unplayed
|
||||||
|
* @param {*} [axiosOptions] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
markUnplayed(key: any, axiosOptions?: any): AxiosPromise<void> {
|
||||||
|
return localVarFp.markUnplayed(key, axiosOptions).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request parameters for markPlayed operation in MediaApi.
|
||||||
|
* @export
|
||||||
|
* @interface MediaApiMarkPlayedRequest
|
||||||
|
*/
|
||||||
|
export interface MediaApiMarkPlayedRequest {
|
||||||
|
/**
|
||||||
|
* The media key to mark as played
|
||||||
|
* @type {any}
|
||||||
|
* @memberof MediaApiMarkPlayed
|
||||||
|
*/
|
||||||
|
readonly key: any
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request parameters for markUnplayed operation in MediaApi.
|
||||||
|
* @export
|
||||||
|
* @interface MediaApiMarkUnplayedRequest
|
||||||
|
*/
|
||||||
|
export interface MediaApiMarkUnplayedRequest {
|
||||||
|
/**
|
||||||
|
* The media key to mark as Unplayed
|
||||||
|
* @type {any}
|
||||||
|
* @memberof MediaApiMarkUnplayed
|
||||||
|
*/
|
||||||
|
readonly key: any
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MediaApi - object-oriented interface
|
||||||
|
* @export
|
||||||
|
* @class MediaApi
|
||||||
|
* @extends {BaseAPI}
|
||||||
|
*/
|
||||||
|
export class MediaApi extends BaseAPI {
|
||||||
|
/**
|
||||||
|
* This will mark the provided media key as Played.
|
||||||
|
* @summary Mark Media Played
|
||||||
|
* @param {MediaApiMarkPlayedRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [axiosOptions] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof MediaApi
|
||||||
|
*/
|
||||||
|
public markPlayed(requestParameters: MediaApiMarkPlayedRequest, axiosOptions?: AxiosRequestConfig) {
|
||||||
|
return MediaApiFp(this.configuration).markPlayed(requestParameters.key, axiosOptions).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This will mark the provided media key as Unplayed.
|
||||||
|
* @summary Mark Media Unplayed
|
||||||
|
* @param {MediaApiMarkUnplayedRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [axiosOptions] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof MediaApi
|
||||||
|
*/
|
||||||
|
public markUnplayed(requestParameters: MediaApiMarkUnplayedRequest, axiosOptions?: AxiosRequestConfig) {
|
||||||
|
return MediaApiFp(this.configuration).markUnplayed(requestParameters.key, axiosOptions).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MyPlexApi - axios parameter creator
|
* MyPlexApi - axios parameter creator
|
||||||
* @export
|
* @export
|
||||||
|
|||||||
@@ -137,9 +137,9 @@ export class Configuration {
|
|||||||
this.device = param.device || "plexjs";
|
this.device = param.device || "plexjs";
|
||||||
this.deviceName = param.deviceName || "plexjs";
|
this.deviceName = param.deviceName || "plexjs";
|
||||||
this.platform = param.platform || "plexjs";
|
this.platform = param.platform || "plexjs";
|
||||||
this.platformVersion = param.platformVersion || "0.0.24";
|
this.platformVersion = param.platformVersion || "0.0.26";
|
||||||
this.product = param.product || "plexjs";
|
this.product = param.product || "plexjs";
|
||||||
this.version = param.version || "0.0.24";
|
this.version = param.version || "0.0.26";
|
||||||
|
|
||||||
this.apiKey = (header: string) => {
|
this.apiKey = (header: string) => {
|
||||||
switch (header) {
|
switch (header) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@lukehagar/plexjs",
|
"name": "@lukehagar/plexjs",
|
||||||
"version": "0.0.24",
|
"version": "0.0.26",
|
||||||
"description": "Community Made Plex JS/TS Module",
|
"description": "Community Made Plex JS/TS Module",
|
||||||
"author": "Luke Hagar",
|
"author": "Luke Hagar",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ files:
|
|||||||
destinationFilename: package.json
|
destinationFilename: package.json
|
||||||
npmName: plexjs
|
npmName: plexjs
|
||||||
npmRepository: lukehagar
|
npmRepository: lukehagar
|
||||||
npmVersion: 0.0.24
|
npmVersion: 0.0.26
|
||||||
useSingleRequestParameter: true
|
useSingleRequestParameter: true
|
||||||
sortParamsByRequiredFlag: true
|
sortParamsByRequiredFlag: true
|
||||||
gitUserID: lukehagar
|
gitUserID: lukehagar
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export class BaseAPI {
|
|||||||
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
|
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
|
||||||
if (configuration) {
|
if (configuration) {
|
||||||
this.configuration = configuration;
|
this.configuration = configuration;
|
||||||
this.basePath = configuration.basePath || this.basePath;
|
this.basePath = "https://plex.tv/api/v2" || this.basePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ files:
|
|||||||
destinationFilename: package.json
|
destinationFilename: package.json
|
||||||
npmName: plexjs
|
npmName: plexjs
|
||||||
npmRepository: lukehagar
|
npmRepository: lukehagar
|
||||||
npmVersion: 0.0.24
|
npmVersion: 0.0.26
|
||||||
useSingleRequestParameter: true
|
useSingleRequestParameter: true
|
||||||
sortParamsByRequiredFlag: true
|
sortParamsByRequiredFlag: true
|
||||||
gitUserID: lukehagar
|
gitUserID: lukehagar
|
||||||
|
|||||||
Reference in New Issue
Block a user