mirror of
https://github.com/LukeHagar/plexjs.git
synced 2025-12-07 20:47:49 +00:00
Automated build '' typescript-axios sdk: 4638889339
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
*/
|
||||
|
||||
|
||||
import { Configuration } from '../configuration';
|
||||
import { Configuration } from './configuration';
|
||||
import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
|
||||
// Some imports not used depending on template conditions
|
||||
// @ts-ignore
|
||||
@@ -409,6 +409,9 @@ export const ActivitiesApiAxiosParamCreator = function (configuration?: Configur
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication PlexToken required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@@ -439,6 +442,9 @@ export const ActivitiesApiAxiosParamCreator = function (configuration?: Configur
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication PlexToken required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@@ -588,6 +594,9 @@ export const ButlerApiAxiosParamCreator = function (configuration?: Configuratio
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication PlexToken required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@@ -618,6 +627,9 @@ export const ButlerApiAxiosParamCreator = function (configuration?: Configuratio
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication PlexToken required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@@ -652,6 +664,9 @@ export const ButlerApiAxiosParamCreator = function (configuration?: Configuratio
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication PlexToken required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@@ -682,6 +697,9 @@ export const ButlerApiAxiosParamCreator = function (configuration?: Configuratio
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication PlexToken required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@@ -904,6 +922,9 @@ export const LibraryApiAxiosParamCreator = function (configuration?: Configurati
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication PlexToken required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@@ -944,6 +965,9 @@ export const LibraryApiAxiosParamCreator = function (configuration?: Configurati
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication PlexToken required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
|
||||
|
||||
if (type !== undefined) {
|
||||
localVarQueryParameter['type'] = type;
|
||||
}
|
||||
@@ -1124,6 +1148,9 @@ export const LogApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication PlexToken required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@@ -1154,6 +1181,9 @@ export const LogApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication PlexToken required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@@ -1193,6 +1223,9 @@ export const LogApiAxiosParamCreator = function (configuration?: Configuration)
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication PlexToken required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
|
||||
|
||||
if (level !== undefined) {
|
||||
localVarQueryParameter['level'] = level;
|
||||
}
|
||||
@@ -1401,6 +1434,9 @@ export const SecurityApiAxiosParamCreator = function (configuration?: Configurat
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication PlexToken required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
|
||||
|
||||
if (source !== undefined) {
|
||||
localVarQueryParameter['source'] = source;
|
||||
}
|
||||
@@ -1441,6 +1477,9 @@ export const SecurityApiAxiosParamCreator = function (configuration?: Configurat
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication PlexToken required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
|
||||
|
||||
if (type !== undefined) {
|
||||
localVarQueryParameter['type'] = type;
|
||||
}
|
||||
@@ -1620,6 +1659,9 @@ export const ServerApiAxiosParamCreator = function (configuration?: Configuratio
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication PlexToken required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@@ -1720,6 +1762,9 @@ export const UpdaterApiAxiosParamCreator = function (configuration?: Configurati
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication PlexToken required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
|
||||
|
||||
if (tonight !== undefined) {
|
||||
localVarQueryParameter['tonight'] = tonight;
|
||||
}
|
||||
@@ -1759,6 +1804,9 @@ export const UpdaterApiAxiosParamCreator = function (configuration?: Configurati
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication PlexToken required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
|
||||
|
||||
if (download !== undefined) {
|
||||
localVarQueryParameter['download'] = download;
|
||||
}
|
||||
@@ -1793,6 +1841,9 @@ export const UpdaterApiAxiosParamCreator = function (configuration?: Configurati
|
||||
const localVarHeaderParameter = {} as any;
|
||||
const localVarQueryParameter = {} as any;
|
||||
|
||||
// authentication PlexToken required
|
||||
await setApiKeyToObject(localVarHeaderParameter, "X-Plex-Token", configuration)
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
*/
|
||||
|
||||
|
||||
import { Configuration } from "../configuration";
|
||||
import { Configuration } from "./configuration";
|
||||
// Some imports not used depending on template conditions
|
||||
// @ts-ignore
|
||||
import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
|
||||
@@ -52,7 +52,7 @@ export class BaseAPI {
|
||||
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
|
||||
if (configuration) {
|
||||
this.configuration = configuration;
|
||||
this.basePath = configuration.basePathV3 || this.basePath;
|
||||
this.basePath = configuration.basePath || this.basePath;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
*/
|
||||
|
||||
|
||||
import { Configuration } from "../configuration";
|
||||
import { Configuration } from "./configuration";
|
||||
import { RequiredError, RequestArgs } from "./base";
|
||||
import { AxiosInstance, AxiosResponse } from 'axios';
|
||||
import axiosRetry from "axios-retry";
|
||||
@@ -48,41 +48,6 @@ export const setApiKeyToObject = async function (object: any, keyParamName: stri
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
*/
|
||||
export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
|
||||
if (configuration && (configuration.username || configuration.password)) {
|
||||
object["auth"] = { username: configuration.username, password: configuration.password };
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
*/
|
||||
export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
|
||||
if (configuration && configuration.accessToken) {
|
||||
const accessToken = typeof configuration.accessToken === 'function'
|
||||
? await configuration.accessToken()
|
||||
: await configuration.accessToken;
|
||||
object["Authorization"] = "Bearer " + accessToken;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
*/
|
||||
export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
|
||||
if (configuration && configuration.accessToken) {
|
||||
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
||||
? await configuration.accessToken(name, scopes)
|
||||
: await configuration.accessToken;
|
||||
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -134,8 +99,7 @@ export const toPathString = function (url: URL) {
|
||||
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
|
||||
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
axiosRetry(globalAxios, configuration.retriesConfig)
|
||||
axiosArgs.axiosOptions.headers['X-SailPoint-SDK'] = 'typescript-0.0.1'
|
||||
const axiosRequestArgs = {...axiosArgs.axiosOptions, url: (configuration?.basePathV3 || basePath) + axiosArgs.url};
|
||||
const axiosRequestArgs = {...axiosArgs.axiosOptions, url: (configuration?.basePath || basePath) + axiosArgs.url};
|
||||
return axios.request<T, R>(axiosRequestArgs);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -12,15 +12,13 @@
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { IAxiosRetryConfig } from "axios-retry";
|
||||
|
||||
export interface ConfigurationParameters {
|
||||
|
||||
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
||||
username?: string;
|
||||
password?: string;
|
||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
||||
basePath?: string;
|
||||
baseOptions?: any;
|
||||
formDataCtor?: new () => any;
|
||||
|
||||
}
|
||||
|
||||
export class Configuration {
|
||||
@@ -30,27 +28,7 @@ export class Configuration {
|
||||
* @memberof Configuration
|
||||
*/
|
||||
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
||||
/**
|
||||
* parameter for basic security
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof Configuration
|
||||
*/
|
||||
username?: string;
|
||||
/**
|
||||
* parameter for basic security
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof Configuration
|
||||
*/
|
||||
password?: string;
|
||||
/**
|
||||
* parameter for oauth2 security
|
||||
* @param name security name
|
||||
* @param scopes oauth2 scope
|
||||
* @memberof Configuration
|
||||
*/
|
||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
||||
|
||||
/**
|
||||
* override base path
|
||||
*
|
||||
@@ -58,6 +36,7 @@ export class Configuration {
|
||||
* @memberof Configuration
|
||||
*/
|
||||
basePath?: string;
|
||||
|
||||
/**
|
||||
* base options for axios calls
|
||||
*
|
||||
@@ -65,6 +44,7 @@ export class Configuration {
|
||||
* @memberof Configuration
|
||||
*/
|
||||
baseOptions?: any;
|
||||
|
||||
/**
|
||||
* The FormData constructor that will be used to create multipart form data
|
||||
* requests. You can inject this here so that execution environments that
|
||||
@@ -74,14 +54,19 @@ export class Configuration {
|
||||
*/
|
||||
formDataCtor?: new () => any;
|
||||
|
||||
/**
|
||||
* axios retry configuration
|
||||
*
|
||||
* @type {IAxiosRetryConfig}
|
||||
* @memberof Configuration
|
||||
*/
|
||||
retriesConfig?: IAxiosRetryConfig
|
||||
|
||||
constructor(param: ConfigurationParameters = {}) {
|
||||
|
||||
this.apiKey = param.apiKey;
|
||||
this.username = param.username;
|
||||
this.password = param.password;
|
||||
this.accessToken = param.accessToken;
|
||||
this.basePath = param.basePath;
|
||||
this.baseOptions = param.baseOptions;
|
||||
this.formDataCtor = param.formDataCtor;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user