Bump version to 0.0.20

This commit is contained in:
LukeHagar
2023-04-18 21:13:34 +00:00
committed by github-actions[bot]
parent f87006d3e8
commit d638acb5d2
5 changed files with 111 additions and 10 deletions

View File

@@ -5,7 +5,7 @@ files:
destinationFilename: package.json
npmName: plexjs
npmRepository: lukehagar
npmVersion: 0.0.19
npmVersion: 0.0.20
useSingleRequestParameter: true
sortParamsByRequiredFlag: true
gitUserID: lukehagar

View File

@@ -1,4 +1,4 @@
## plexjs@0.0.19
## plexjs@0.0.20
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.19 --save
npm install plexjs@0.0.20 --save
```
_unPublished (not recommended):_

View File

@@ -15,13 +15,82 @@
import { IAxiosRetryConfig } from "axios-retry";
export interface ConfigurationParameters {
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
plexToken?: string;
clientIdentifier?: string;
device?: string;
deviceName?: string;
platform?: string;
platformVersion?: string;
product?: string;
version?: string;
basePath?: string;
}
export class Configuration {
/**
* Plex Media Server or Plex.TV Authentication token
*
* @type {string}
* @memberof Configuration
*/
plexToken?: string;
/**
* UUID, serial number, or other number unique per device
*
* @type {string}
* @memberof Configuration
*/
clientIdentifier?: string;
/**
* Device name and model number, eg iPhone3,2, Motorola XOOM™, LG5200TV
*
* @type {string}
* @memberof Configuration
*/
device?: string;
/**
* Customized Device Name
*
* @type {string}
* @memberof Configuration
*/
deviceName?: string;
/**
* Platform name, eg iOS, MacOSX, Android, LG, etc
*
* @type {string}
* @memberof Configuration
*/
platform?: string;
/**
* Operating system version, eg 4.3.1, 10.6.7, 3.2
*
* @type {string}
* @memberof Configuration
*/
platformVersion?: string;
/**
* Plex application name, eg Laika, Plex Media Server, Media Link
*
* @type {string}
* @memberof Configuration
*/
product?: string;
/**
* Plex application version number
*
* @type {string}
* @memberof Configuration
*/
version?: string;
/**
* parameter for apiKey security
* @param name security name
@@ -63,10 +132,42 @@ export class Configuration {
retriesConfig?: IAxiosRetryConfig
constructor(param: ConfigurationParameters = {}) {
this.plexToken = param.plexToken;
this.clientIdentifier = param.clientIdentifier || "Plexjs";
this.device = param.device || "Unspecified";
this.deviceName = param.deviceName || "Unspecified";
this.platform = param.platform || "Plexjs";
this.platformVersion = param.platformVersion || process.env.npm_package_version;
this.product = param.product || "Plexjs";
this.version = param.version || process.env.npm_package_version;
this.apiKey = param.apiKey;
this.apiKey = (header: string) => {
switch (header) {
case "X-Plex-Token":
return this.plexToken
case "X-Plex-Client-Identifier":
return this.clientIdentifier
case "X-Plex-Device-Name":
return this.deviceName
case "X-Plex-Device":
return this.device
case "X-Plex-Platform-Version":
return this.platformVersion
case "X-Plex-Platform":
return this.platform
case "X-Plex-Product":
return this.product
case "X-Plex-Version":
return this.version
default:
return "";
}
}
this.basePath = param.basePath;
}
public setAuthToken(token: string) {
this.plexToken = token
}
/**

View File

@@ -1,12 +1,12 @@
{
"name": "@lukehagar/plexjs",
"version": "0.0.19",
"version": "0.0.20",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@lukehagar/plexjs",
"version": "0.0.19",
"version": "0.0.20",
"license": "MIT",
"dependencies": {
"axios": "^0.26.1",

View File

@@ -1,6 +1,6 @@
{
"name": "@lukehagar/plexjs",
"version": "0.0.19",
"version": "0.0.20",
"description": "Community Made Plex JS/TS Module",
"author": "Luke Hagar",
"repository": {