mirror of
https://github.com/m1k1o/neko-rooms.git
synced 2026-11-03 07:01:35 -06:00
upgrade api.
This commit is contained in:
@@ -1 +1 @@
|
||||
6.3.0-SNAPSHOT
|
||||
7.1.0-SNAPSHOT
|
||||
@@ -706,6 +706,7 @@ export class ConfigApi extends BaseAPI {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* DefaultApi - axios parameter creator
|
||||
* @export
|
||||
@@ -931,6 +932,7 @@ export class DefaultApi extends BaseAPI {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* RoomsApi - axios parameter creator
|
||||
* @export
|
||||
@@ -1632,3 +1634,4 @@ export class RoomsApi extends BaseAPI {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
|
||||
|
||||
import type { Configuration } from './configuration';
|
||||
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
|
||||
// Some imports not used depending on template conditions
|
||||
// @ts-ignore
|
||||
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
|
||||
import globalAxios from 'axios';
|
||||
|
||||
export const BASE_PATH = "https://virtserver.swaggerhub.com/m1k1o/neko-rooms/1.0.0".replace(/\/+$/, "");
|
||||
@@ -65,8 +65,8 @@ export class BaseAPI {
|
||||
* @extends {Error}
|
||||
*/
|
||||
export class RequiredError extends Error {
|
||||
name: "RequiredError" = "RequiredError";
|
||||
constructor(public field: string, msg?: string) {
|
||||
super(msg);
|
||||
this.name = "RequiredError"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,6 +85,7 @@ export const setOAuthToObject = async function (object: any, name: string, scope
|
||||
}
|
||||
|
||||
function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
|
||||
if (parameter == null) return;
|
||||
if (typeof parameter === "object") {
|
||||
if (Array.isArray(parameter)) {
|
||||
(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) {
|
||||
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);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user