mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
deps: open-api generator (#6655)
* deps: open-api generator * fix: unused sed/replace
This commit is contained in:
parent
78a2fa8569
commit
2e39243670
195 changed files with 1907 additions and 1545 deletions
|
|
@ -1 +1 @@
|
|||
6.5.0
|
||||
7.2.0
|
||||
1721
open-api/typescript-sdk/client/api.ts
generated
1721
open-api/typescript-sdk/client/api.ts
generated
File diff suppressed because it is too large
Load diff
20
open-api/typescript-sdk/client/base.ts
generated
20
open-api/typescript-sdk/client/base.ts
generated
|
|
@ -16,7 +16,7 @@
|
|||
import type { Configuration } from './configuration';
|
||||
// Some imports not used depending on template conditions
|
||||
// @ts-ignore
|
||||
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
|
||||
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
||||
import globalAxios from 'axios';
|
||||
|
||||
export const BASE_PATH = "/api".replace(/\/+$/, "");
|
||||
|
|
@ -39,7 +39,7 @@ export const COLLECTION_FORMATS = {
|
|||
*/
|
||||
export interface RequestArgs {
|
||||
url: string;
|
||||
options: AxiosRequestConfig;
|
||||
options: RawAxiosRequestConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -53,7 +53,7 @@ export class BaseAPI {
|
|||
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
|
||||
if (configuration) {
|
||||
this.configuration = configuration;
|
||||
this.basePath = configuration.basePath || this.basePath;
|
||||
this.basePath = configuration.basePath ?? basePath;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -70,3 +70,17 @@ export class RequiredError extends Error {
|
|||
this.name = "RequiredError"
|
||||
}
|
||||
}
|
||||
|
||||
interface ServerMap {
|
||||
[key: string]: {
|
||||
url: string,
|
||||
description: string,
|
||||
}[];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
*/
|
||||
export const operationServerMap: ServerMap = {
|
||||
}
|
||||
|
|
|
|||
2
open-api/typescript-sdk/client/common.ts
generated
2
open-api/typescript-sdk/client/common.ts
generated
|
|
@ -144,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: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
|
||||
return axios.request<T, R>(axiosRequestArgs);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
9
open-api/typescript-sdk/client/configuration.ts
generated
9
open-api/typescript-sdk/client/configuration.ts
generated
|
|
@ -19,6 +19,7 @@ export interface ConfigurationParameters {
|
|||
password?: string;
|
||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
||||
basePath?: string;
|
||||
serverIndex?: number;
|
||||
baseOptions?: any;
|
||||
formDataCtor?: new () => any;
|
||||
}
|
||||
|
|
@ -58,6 +59,13 @@ export class Configuration {
|
|||
* @memberof Configuration
|
||||
*/
|
||||
basePath?: string;
|
||||
/**
|
||||
* override server index
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof Configuration
|
||||
*/
|
||||
serverIndex?: number;
|
||||
/**
|
||||
* base options for axios calls
|
||||
*
|
||||
|
|
@ -80,6 +88,7 @@ export class Configuration {
|
|||
this.password = param.password;
|
||||
this.accessToken = param.accessToken;
|
||||
this.basePath = param.basePath;
|
||||
this.serverIndex = param.serverIndex;
|
||||
this.baseOptions = param.baseOptions;
|
||||
this.formDataCtor = param.formDataCtor;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue