11/* eslint-disable */
22/* tslint:disable */
3+ // @ts -nocheck
34/*
45 * ---------------------------------------------------------------
56 * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
@@ -34,12 +35,19 @@ export interface FeedValueResponse {
3435 data : FeedValueData ;
3536}
3637
37- import type { AxiosInstance , AxiosRequestConfig , AxiosResponse , HeadersDefaults , ResponseType } from "axios" ;
38+ import type {
39+ AxiosInstance ,
40+ AxiosRequestConfig ,
41+ AxiosResponse ,
42+ HeadersDefaults ,
43+ ResponseType ,
44+ } from "axios" ;
3845import axios from "axios" ;
3946
4047export type QueryParamsType = Record < string | number , any > ;
4148
42- export interface FullRequestParams extends Omit < AxiosRequestConfig , "data" | "params" | "url" | "responseType" > {
49+ export interface FullRequestParams
50+ extends Omit < AxiosRequestConfig , "data" | "params" | "url" | "responseType" > {
4351 /** set parameter to `true` for call `securityWorker` for this request */
4452 secure ?: boolean ;
4553 /** request path */
@@ -54,18 +62,23 @@ export interface FullRequestParams extends Omit<AxiosRequestConfig, "data" | "pa
5462 body ?: unknown ;
5563}
5664
57- export type RequestParams = Omit < FullRequestParams , "body" | "method" | "query" | "path" > ;
65+ export type RequestParams = Omit <
66+ FullRequestParams ,
67+ "body" | "method" | "query" | "path"
68+ > ;
5869
59- export interface ApiConfig < SecurityDataType = unknown > extends Omit < AxiosRequestConfig , "data" | "cancelToken" > {
70+ export interface ApiConfig < SecurityDataType = unknown >
71+ extends Omit < AxiosRequestConfig , "data" | "cancelToken" > {
6072 securityWorker ?: (
61- securityData : SecurityDataType | null
73+ securityData : SecurityDataType | null ,
6274 ) => Promise < AxiosRequestConfig | void > | AxiosRequestConfig | void ;
6375 secure ?: boolean ;
6476 format ?: ResponseType ;
6577}
6678
6779export enum ContentType {
6880 Json = "application/json" ,
81+ JsonApi = "application/vnd.api+json" ,
6982 FormData = "multipart/form-data" ,
7083 UrlEncoded = "application/x-www-form-urlencoded" ,
7184 Text = "text/plain" ,
@@ -78,8 +91,16 @@ export class HttpClient<SecurityDataType = unknown> {
7891 private secure ?: boolean ;
7992 private format ?: ResponseType ;
8093
81- constructor ( { securityWorker, secure, format, ...axiosConfig } : ApiConfig < SecurityDataType > = { } ) {
82- this . instance = axios . create ( { ...axiosConfig , baseURL : axiosConfig . baseURL || "" } ) ;
94+ constructor ( {
95+ securityWorker,
96+ secure,
97+ format,
98+ ...axiosConfig
99+ } : ApiConfig < SecurityDataType > = { } ) {
100+ this . instance = axios . create ( {
101+ ...axiosConfig ,
102+ baseURL : axiosConfig . baseURL || "" ,
103+ } ) ;
83104 this . secure = secure ;
84105 this . format = format ;
85106 this . securityWorker = securityWorker ;
@@ -89,15 +110,22 @@ export class HttpClient<SecurityDataType = unknown> {
89110 this . securityData = data ;
90111 } ;
91112
92- protected mergeRequestParams ( params1 : AxiosRequestConfig , params2 ?: AxiosRequestConfig ) : AxiosRequestConfig {
113+ protected mergeRequestParams (
114+ params1 : AxiosRequestConfig ,
115+ params2 ?: AxiosRequestConfig ,
116+ ) : AxiosRequestConfig {
93117 const method = params1 . method || ( params2 && params2 . method ) ;
94118
95119 return {
96120 ...this . instance . defaults ,
97121 ...params1 ,
98122 ...( params2 || { } ) ,
99123 headers : {
100- ...( ( method && this . instance . defaults . headers [ method . toLowerCase ( ) as keyof HeadersDefaults ] ) || { } ) ,
124+ ...( ( method &&
125+ this . instance . defaults . headers [
126+ method . toLowerCase ( ) as keyof HeadersDefaults
127+ ] ) ||
128+ { } ) ,
101129 ...( params1 . headers || { } ) ,
102130 ...( ( params2 && params2 . headers ) || { } ) ,
103131 } ,
@@ -113,13 +141,20 @@ export class HttpClient<SecurityDataType = unknown> {
113141 }
114142
115143 protected createFormData ( input : Record < string , unknown > ) : FormData {
144+ if ( input instanceof FormData ) {
145+ return input ;
146+ }
116147 return Object . keys ( input || { } ) . reduce ( ( formData , key ) => {
117148 const property = input [ key ] ;
118- const propertyContent : any [ ] = property instanceof Array ? property : [ property ] ;
149+ const propertyContent : any [ ] =
150+ property instanceof Array ? property : [ property ] ;
119151
120152 for ( const formItem of propertyContent ) {
121153 const isFileType = formItem instanceof Blob || formItem instanceof File ;
122- formData . append ( key , isFileType ? formItem : this . stringifyFormItem ( formItem ) ) ;
154+ formData . append (
155+ key ,
156+ isFileType ? formItem : this . stringifyFormItem ( formItem ) ,
157+ ) ;
123158 }
124159
125160 return formData ;
@@ -143,19 +178,29 @@ export class HttpClient<SecurityDataType = unknown> {
143178 const requestParams = this . mergeRequestParams ( params , secureParams ) ;
144179 const responseFormat = format || this . format || undefined ;
145180
146- if ( type === ContentType . FormData && body && body !== null && typeof body === "object" ) {
181+ if (
182+ type === ContentType . FormData &&
183+ body &&
184+ body !== null &&
185+ typeof body === "object"
186+ ) {
147187 body = this . createFormData ( body as Record < string , unknown > ) ;
148188 }
149189
150- if ( type === ContentType . Text && body && body !== null && typeof body !== "string" ) {
190+ if (
191+ type === ContentType . Text &&
192+ body &&
193+ body !== null &&
194+ typeof body !== "string"
195+ ) {
151196 body = JSON . stringify ( body ) ;
152197 }
153198
154199 return this . instance . request ( {
155200 ...requestParams ,
156201 headers : {
157202 ...( requestParams . headers || { } ) ,
158- ...( type && type !== ContentType . FormData ? { "Content-Type" : type } : { } ) ,
203+ ...( type ? { "Content-Type" : type } : { } ) ,
159204 } ,
160205 params : query ,
161206 responseType : responseFormat ,
@@ -172,7 +217,9 @@ export class HttpClient<SecurityDataType = unknown> {
172217 *
173218 * This server is used by the FTSO protocol data provider.
174219 */
175- export class Api < SecurityDataType extends unknown > extends HttpClient < SecurityDataType > {
220+ export class Api <
221+ SecurityDataType extends unknown ,
222+ > extends HttpClient < SecurityDataType > {
176223 feedValueProviderApi = {
177224 /**
178225 * No description
@@ -182,7 +229,11 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
182229 * @request POST:/feed-values/{votingRoundId}
183230 * @response `201` `FeedValuesResponse`
184231 */
185- getFeedValues : ( votingRoundId : number , data : FeedValuesRequest , params : RequestParams = { } ) =>
232+ getFeedValues : (
233+ votingRoundId : number ,
234+ data : FeedValuesRequest ,
235+ params : RequestParams = { } ,
236+ ) =>
186237 this . request < FeedValuesResponse , any > ( {
187238 path : `/feed-values/${ votingRoundId } ` ,
188239 method : "POST" ,
@@ -207,7 +258,7 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
207258 category : number ;
208259 name : string ;
209260 } ,
210- params : RequestParams = { }
261+ params : RequestParams = { } ,
211262 ) =>
212263 this . request < FeedValueResponse , any > ( {
213264 path : `/feed-value/${ votingRoundId } /${ feed } ` ,
0 commit comments