upgrade api.

This commit is contained in:
Miroslav Šedivý
2023-09-30 15:17:59 +02:00
parent 28ec254ff6
commit 28e496a670
4 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -1 +1 @@
6.3.0-SNAPSHOT 7.1.0-SNAPSHOT
+3
View File
@@ -706,6 +706,7 @@ export class ConfigApi extends BaseAPI {
} }
/** /**
* DefaultApi - axios parameter creator * DefaultApi - axios parameter creator
* @export * @export
@@ -931,6 +932,7 @@ export class DefaultApi extends BaseAPI {
} }
/** /**
* RoomsApi - axios parameter creator * RoomsApi - axios parameter creator
* @export * @export
@@ -1632,3 +1634,4 @@ export class RoomsApi extends BaseAPI {
} }
+2 -2
View File
@@ -14,9 +14,9 @@
import type { Configuration } from './configuration'; import type { Configuration } from './configuration';
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
// Some imports not used depending on template conditions // Some imports not used depending on template conditions
// @ts-ignore // @ts-ignore
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
import globalAxios from 'axios'; import globalAxios from 'axios';
export const BASE_PATH = "https://virtserver.swaggerhub.com/m1k1o/neko-rooms/1.0.0".replace(/\/+$/, ""); export const BASE_PATH = "https://virtserver.swaggerhub.com/m1k1o/neko-rooms/1.0.0".replace(/\/+$/, "");
@@ -65,8 +65,8 @@ export class BaseAPI {
* @extends {Error} * @extends {Error}
*/ */
export class RequiredError extends Error { export class RequiredError extends Error {
name: "RequiredError" = "RequiredError";
constructor(public field: string, msg?: string) { constructor(public field: string, msg?: string) {
super(msg); super(msg);
this.name = "RequiredError"
} }
} }
+2 -1
View File
@@ -85,6 +85,7 @@ export const setOAuthToObject = async function (object: any, name: string, scope
} }
function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
if (parameter == null) return;
if (typeof parameter === "object") { if (typeof parameter === "object") {
if (Array.isArray(parameter)) { if (Array.isArray(parameter)) {
(parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
@@ -143,7 +144,7 @@ export const toPathString = function (url: URL) {
*/ */
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { 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) => { return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || axios.defaults.baseURL || basePath) + axiosArgs.url};
return axios.request<T, R>(axiosRequestArgs); return axios.request<T, R>(axiosRequestArgs);
}; };
} }