fix(typescript-angular): enable "exactOptionalPropertyTypes" and ensure assignments align with type definition (#20451)

* fix(typescript-angular): enable "exactOptionalPropertyTypes" and ensure assignments align with type definition

* fix(typescript-angular): update condition checks to explicitly compare with undefined

* chore(gradle): add autogenerated properties file for OpenAPI Generator
This commit is contained in:
jase
2025-04-23 14:08:21 +02:00
committed by GitHub
parent a7159f6bcb
commit dfbe985db3
71 changed files with 1251 additions and 878 deletions

View File

@@ -275,7 +275,8 @@ export class {{classname}} extends BaseService {
{{/isResponseFile}}
let localVarPath = `{{{path}}}`;
return this.httpClient.request{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}('{{httpMethod}}', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}('{{httpMethod}}', `${basePath}${localVarPath}`,
{
{{#httpContextInOptions}}
context: localVarHttpContext,
@@ -297,7 +298,7 @@ export class {{classname}} extends BaseService {
{{^isResponseFile}}
responseType: <any>responseType_,
{{/isResponseFile}}
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
{{#httpTransferCacheInOptions}}

View File

@@ -66,26 +66,30 @@ export class {{configurationClassName}} {
*/
credentials: {[ key: string ]: string | (() => string | undefined)};
constructor(configurationParameters: {{configurationParametersInterfaceName}} = {}) {
this.apiKeys = configurationParameters.apiKeys;
this.username = configurationParameters.username;
this.password = configurationParameters.password;
this.accessToken = configurationParameters.accessToken;
this.basePath = configurationParameters.basePath;
this.withCredentials = configurationParameters.withCredentials;
this.encoder = configurationParameters.encoder;
if (configurationParameters.encodeParam) {
this.encodeParam = configurationParameters.encodeParam;
constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: {{configurationParametersInterfaceName}} = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
else {
this.encodeParam = param => this.defaultEncodeParam(param);
if (username !== undefined) {
this.username = username;
}
if (configurationParameters.credentials) {
this.credentials = configurationParameters.credentials;
if (password !== undefined) {
this.password = password;
}
else {
this.credentials = {};
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
{{#authMethods}}
// init default {{name}} credential

View File

@@ -7,6 +7,8 @@
"module": "{{#supportsES6}}es6{{/supportsES6}}{{^supportsES6}}commonjs{{/supportsES6}}",
"moduleResolution": "node",
"removeComments": true,
"strictNullChecks": true,
"exactOptionalPropertyTypes": true,
"sourceMap": true,
"outDir": "./dist",
"noLib": false,

View File

@@ -70,11 +70,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/mapped`;
return this.httpClient.request<Array<PetWithMappedDiscriminatorModel>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<PetWithMappedDiscriminatorModel>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,

View File

@@ -66,26 +66,30 @@ export class Configuration {
*/
credentials: {[ key: string ]: string | (() => string | undefined)};
constructor(configurationParameters: ConfigurationParameters = {}) {
this.apiKeys = configurationParameters.apiKeys;
this.username = configurationParameters.username;
this.password = configurationParameters.password;
this.accessToken = configurationParameters.accessToken;
this.basePath = configurationParameters.basePath;
this.withCredentials = configurationParameters.withCredentials;
this.encoder = configurationParameters.encoder;
if (configurationParameters.encodeParam) {
this.encodeParam = configurationParameters.encodeParam;
constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
else {
this.encodeParam = param => this.defaultEncodeParam(param);
if (username !== undefined) {
this.username = username;
}
if (configurationParameters.credentials) {
this.credentials = configurationParameters.credentials;
if (password !== undefined) {
this.password = password;
}
else {
this.credentials = {};
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
}
/**

View File

@@ -70,11 +70,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/mapped`;
return this.httpClient.request<Array<PetWithMappedDiscriminatorModel>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<PetWithMappedDiscriminatorModel>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,

View File

@@ -66,26 +66,30 @@ export class Configuration {
*/
credentials: {[ key: string ]: string | (() => string | undefined)};
constructor(configurationParameters: ConfigurationParameters = {}) {
this.apiKeys = configurationParameters.apiKeys;
this.username = configurationParameters.username;
this.password = configurationParameters.password;
this.accessToken = configurationParameters.accessToken;
this.basePath = configurationParameters.basePath;
this.withCredentials = configurationParameters.withCredentials;
this.encoder = configurationParameters.encoder;
if (configurationParameters.encodeParam) {
this.encodeParam = configurationParameters.encodeParam;
constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
else {
this.encodeParam = param => this.defaultEncodeParam(param);
if (username !== undefined) {
this.username = username;
}
if (configurationParameters.credentials) {
this.credentials = configurationParameters.credentials;
if (password !== undefined) {
this.password = password;
}
else {
this.credentials = {};
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
}
/**

View File

@@ -68,11 +68,12 @@ export class DefaultService extends BaseService {
}
let localVarPath = `/`;
return this.httpClient.request<Fruit>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Fruit>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -122,12 +123,13 @@ export class DefaultService extends BaseService {
}
let localVarPath = `/`;
return this.httpClient.request<any>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -66,26 +66,30 @@ export class Configuration {
*/
credentials: {[ key: string ]: string | (() => string | undefined)};
constructor(configurationParameters: ConfigurationParameters = {}) {
this.apiKeys = configurationParameters.apiKeys;
this.username = configurationParameters.username;
this.password = configurationParameters.password;
this.accessToken = configurationParameters.accessToken;
this.basePath = configurationParameters.basePath;
this.withCredentials = configurationParameters.withCredentials;
this.encoder = configurationParameters.encoder;
if (configurationParameters.encodeParam) {
this.encodeParam = configurationParameters.encodeParam;
constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
else {
this.encodeParam = param => this.defaultEncodeParam(param);
if (username !== undefined) {
this.username = username;
}
if (configurationParameters.credentials) {
this.credentials = configurationParameters.credentials;
if (password !== undefined) {
this.password = password;
}
else {
this.credentials = {};
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
}
/**

View File

@@ -87,12 +87,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -144,11 +145,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -205,12 +207,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByStatus`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -268,12 +271,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByTags`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -324,11 +328,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Pet>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -386,12 +391,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<any>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -463,12 +469,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -544,12 +551,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`;
return this.httpClient.request<ApiResponse>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<ApiResponse>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -73,11 +73,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -123,11 +124,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/inventory`;
return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -175,11 +177,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Order>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -234,12 +237,13 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order`;
return this.httpClient.request<Order>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -81,12 +81,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -139,12 +140,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithArray`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -197,12 +199,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithList`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -248,11 +251,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -299,11 +303,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<User>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<User>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -360,12 +365,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/login`;
return this.httpClient.request<string>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<string>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -406,11 +412,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/logout`;
return this.httpClient.request<any>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -468,12 +475,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -66,26 +66,30 @@ export class Configuration {
*/
credentials: {[ key: string ]: string | (() => string | undefined)};
constructor(configurationParameters: ConfigurationParameters = {}) {
this.apiKeys = configurationParameters.apiKeys;
this.username = configurationParameters.username;
this.password = configurationParameters.password;
this.accessToken = configurationParameters.accessToken;
this.basePath = configurationParameters.basePath;
this.withCredentials = configurationParameters.withCredentials;
this.encoder = configurationParameters.encoder;
if (configurationParameters.encodeParam) {
this.encodeParam = configurationParameters.encodeParam;
constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
else {
this.encodeParam = param => this.defaultEncodeParam(param);
if (username !== undefined) {
this.username = username;
}
if (configurationParameters.credentials) {
this.credentials = configurationParameters.credentials;
if (password !== undefined) {
this.password = password;
}
else {
this.credentials = {};
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
// init default petstore_auth credential
if (!this.credentials['petstore_auth']) {

View File

@@ -87,12 +87,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -144,11 +145,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -205,12 +207,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByStatus`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -268,12 +271,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByTags`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -324,11 +328,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Pet>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -386,12 +391,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<any>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -463,12 +469,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -544,12 +551,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`;
return this.httpClient.request<ApiResponse>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<ApiResponse>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -73,11 +73,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -123,11 +124,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/inventory`;
return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -175,11 +177,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Order>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -234,12 +237,13 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order`;
return this.httpClient.request<Order>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -81,12 +81,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -139,12 +140,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithArray`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -197,12 +199,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithList`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -248,11 +251,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -299,11 +303,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<User>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<User>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -360,12 +365,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/login`;
return this.httpClient.request<string>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<string>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -406,11 +412,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/logout`;
return this.httpClient.request<any>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -468,12 +475,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -66,26 +66,30 @@ export class Configuration {
*/
credentials: {[ key: string ]: string | (() => string | undefined)};
constructor(configurationParameters: ConfigurationParameters = {}) {
this.apiKeys = configurationParameters.apiKeys;
this.username = configurationParameters.username;
this.password = configurationParameters.password;
this.accessToken = configurationParameters.accessToken;
this.basePath = configurationParameters.basePath;
this.withCredentials = configurationParameters.withCredentials;
this.encoder = configurationParameters.encoder;
if (configurationParameters.encodeParam) {
this.encodeParam = configurationParameters.encodeParam;
constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
else {
this.encodeParam = param => this.defaultEncodeParam(param);
if (username !== undefined) {
this.username = username;
}
if (configurationParameters.credentials) {
this.credentials = configurationParameters.credentials;
if (password !== undefined) {
this.password = password;
}
else {
this.credentials = {};
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
// init default petstore_auth credential
if (!this.credentials['petstore_auth']) {

View File

@@ -87,12 +87,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -144,11 +145,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -205,12 +207,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByStatus`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -268,12 +271,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByTags`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -324,11 +328,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Pet>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -386,12 +391,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<any>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -463,12 +469,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -544,12 +551,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`;
return this.httpClient.request<ApiResponse>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<ApiResponse>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -73,11 +73,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -123,11 +124,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/inventory`;
return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -175,11 +177,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Order>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -234,12 +237,13 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order`;
return this.httpClient.request<Order>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -81,12 +81,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -139,12 +140,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithArray`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -197,12 +199,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithList`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -248,11 +251,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -299,11 +303,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<User>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<User>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -360,12 +365,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/login`;
return this.httpClient.request<string>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<string>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -406,11 +412,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/logout`;
return this.httpClient.request<any>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -468,12 +475,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -66,26 +66,30 @@ export class Configuration {
*/
credentials: {[ key: string ]: string | (() => string | undefined)};
constructor(configurationParameters: ConfigurationParameters = {}) {
this.apiKeys = configurationParameters.apiKeys;
this.username = configurationParameters.username;
this.password = configurationParameters.password;
this.accessToken = configurationParameters.accessToken;
this.basePath = configurationParameters.basePath;
this.withCredentials = configurationParameters.withCredentials;
this.encoder = configurationParameters.encoder;
if (configurationParameters.encodeParam) {
this.encodeParam = configurationParameters.encodeParam;
constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
else {
this.encodeParam = param => this.defaultEncodeParam(param);
if (username !== undefined) {
this.username = username;
}
if (configurationParameters.credentials) {
this.credentials = configurationParameters.credentials;
if (password !== undefined) {
this.password = password;
}
else {
this.credentials = {};
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
// init default petstore_auth credential
if (!this.credentials['petstore_auth']) {

View File

@@ -7,6 +7,8 @@
"module": "commonjs",
"moduleResolution": "node",
"removeComments": true,
"strictNullChecks": true,
"exactOptionalPropertyTypes": true,
"sourceMap": true,
"outDir": "./dist",
"noLib": false,

View File

@@ -68,11 +68,12 @@ export class DefaultService extends BaseService {
}
let localVarPath = `/`;
return this.httpClient.request<Fruit>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Fruit>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -122,12 +123,13 @@ export class DefaultService extends BaseService {
}
let localVarPath = `/`;
return this.httpClient.request<any>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -66,26 +66,30 @@ export class Configuration {
*/
credentials: {[ key: string ]: string | (() => string | undefined)};
constructor(configurationParameters: ConfigurationParameters = {}) {
this.apiKeys = configurationParameters.apiKeys;
this.username = configurationParameters.username;
this.password = configurationParameters.password;
this.accessToken = configurationParameters.accessToken;
this.basePath = configurationParameters.basePath;
this.withCredentials = configurationParameters.withCredentials;
this.encoder = configurationParameters.encoder;
if (configurationParameters.encodeParam) {
this.encodeParam = configurationParameters.encodeParam;
constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
else {
this.encodeParam = param => this.defaultEncodeParam(param);
if (username !== undefined) {
this.username = username;
}
if (configurationParameters.credentials) {
this.credentials = configurationParameters.credentials;
if (password !== undefined) {
this.password = password;
}
else {
this.credentials = {};
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
}
/**

View File

@@ -87,12 +87,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -144,11 +145,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -205,12 +207,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByStatus`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -268,12 +271,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByTags`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -324,11 +328,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Pet>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -386,12 +391,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<any>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -463,12 +469,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -544,12 +551,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`;
return this.httpClient.request<ApiResponse>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<ApiResponse>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -73,11 +73,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -123,11 +124,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/inventory`;
return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -175,11 +177,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Order>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -234,12 +237,13 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order`;
return this.httpClient.request<Order>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -81,12 +81,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -139,12 +140,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithArray`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -197,12 +199,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithList`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -248,11 +251,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -299,11 +303,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<User>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<User>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -360,12 +365,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/login`;
return this.httpClient.request<string>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<string>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -406,11 +412,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/logout`;
return this.httpClient.request<any>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -468,12 +475,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: body,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -66,26 +66,30 @@ export class Configuration {
*/
credentials: {[ key: string ]: string | (() => string | undefined)};
constructor(configurationParameters: ConfigurationParameters = {}) {
this.apiKeys = configurationParameters.apiKeys;
this.username = configurationParameters.username;
this.password = configurationParameters.password;
this.accessToken = configurationParameters.accessToken;
this.basePath = configurationParameters.basePath;
this.withCredentials = configurationParameters.withCredentials;
this.encoder = configurationParameters.encoder;
if (configurationParameters.encodeParam) {
this.encodeParam = configurationParameters.encodeParam;
constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
else {
this.encodeParam = param => this.defaultEncodeParam(param);
if (username !== undefined) {
this.username = username;
}
if (configurationParameters.credentials) {
this.credentials = configurationParameters.credentials;
if (password !== undefined) {
this.password = password;
}
else {
this.credentials = {};
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
// init default petstore_auth credential
if (!this.credentials['petstore_auth']) {

View File

@@ -90,12 +90,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<Pet>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: pet,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -148,11 +149,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -209,12 +211,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByStatus`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -272,12 +275,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByTags`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -328,11 +332,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Pet>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -393,12 +398,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<Pet>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: pet,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -471,12 +477,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -553,12 +560,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`;
return this.httpClient.request<ApiResponse>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<ApiResponse>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -73,11 +73,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -123,11 +124,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/inventory`;
return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -175,11 +177,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Order>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -236,12 +239,13 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order`;
return this.httpClient.request<Order>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: order,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -85,12 +85,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -148,12 +149,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithArray`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -211,12 +213,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithList`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -265,11 +268,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -317,11 +321,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<User>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<User>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -379,12 +384,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/login`;
return this.httpClient.request<string>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<string>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -429,11 +435,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/logout`;
return this.httpClient.request<any>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -495,12 +502,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -66,26 +66,30 @@ export class Configuration {
*/
credentials: {[ key: string ]: string | (() => string | undefined)};
constructor(configurationParameters: ConfigurationParameters = {}) {
this.apiKeys = configurationParameters.apiKeys;
this.username = configurationParameters.username;
this.password = configurationParameters.password;
this.accessToken = configurationParameters.accessToken;
this.basePath = configurationParameters.basePath;
this.withCredentials = configurationParameters.withCredentials;
this.encoder = configurationParameters.encoder;
if (configurationParameters.encodeParam) {
this.encodeParam = configurationParameters.encodeParam;
constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
else {
this.encodeParam = param => this.defaultEncodeParam(param);
if (username !== undefined) {
this.username = username;
}
if (configurationParameters.credentials) {
this.credentials = configurationParameters.credentials;
if (password !== undefined) {
this.password = password;
}
else {
this.credentials = {};
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
// init default petstore_auth credential
if (!this.credentials['petstore_auth']) {

View File

@@ -90,12 +90,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<Pet>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: pet,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -148,11 +149,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -209,12 +211,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByStatus`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -272,12 +275,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByTags`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -328,11 +332,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Pet>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -393,12 +398,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<Pet>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: pet,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -471,12 +477,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -553,12 +560,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`;
return this.httpClient.request<ApiResponse>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<ApiResponse>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -73,11 +73,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -123,11 +124,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/inventory`;
return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -175,11 +177,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Order>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -236,12 +239,13 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order`;
return this.httpClient.request<Order>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: order,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -85,12 +85,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -148,12 +149,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithArray`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -211,12 +213,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithList`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -265,11 +268,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -317,11 +321,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<User>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<User>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -379,12 +384,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/login`;
return this.httpClient.request<string>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<string>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -429,11 +435,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/logout`;
return this.httpClient.request<any>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -495,12 +502,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -66,26 +66,30 @@ export class Configuration {
*/
credentials: {[ key: string ]: string | (() => string | undefined)};
constructor(configurationParameters: ConfigurationParameters = {}) {
this.apiKeys = configurationParameters.apiKeys;
this.username = configurationParameters.username;
this.password = configurationParameters.password;
this.accessToken = configurationParameters.accessToken;
this.basePath = configurationParameters.basePath;
this.withCredentials = configurationParameters.withCredentials;
this.encoder = configurationParameters.encoder;
if (configurationParameters.encodeParam) {
this.encodeParam = configurationParameters.encodeParam;
constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
else {
this.encodeParam = param => this.defaultEncodeParam(param);
if (username !== undefined) {
this.username = username;
}
if (configurationParameters.credentials) {
this.credentials = configurationParameters.credentials;
if (password !== undefined) {
this.password = password;
}
else {
this.credentials = {};
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
// init default petstore_auth credential
if (!this.credentials['petstore_auth']) {

View File

@@ -7,6 +7,8 @@
"module": "es6",
"moduleResolution": "node",
"removeComments": true,
"strictNullChecks": true,
"exactOptionalPropertyTypes": true,
"sourceMap": true,
"outDir": "./dist",
"noLib": false,

View File

@@ -90,12 +90,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<Pet>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: pet,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -148,11 +149,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -209,12 +211,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByStatus`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -272,12 +275,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByTags`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -328,11 +332,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Pet>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -393,12 +398,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<Pet>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: pet,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -471,12 +477,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -553,12 +560,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`;
return this.httpClient.request<ApiResponse>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<ApiResponse>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -73,11 +73,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -123,11 +124,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/inventory`;
return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -175,11 +177,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Order>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -236,12 +239,13 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order`;
return this.httpClient.request<Order>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: order,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -85,12 +85,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -148,12 +149,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithArray`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -211,12 +213,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithList`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -265,11 +268,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -317,11 +321,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<User>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<User>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -379,12 +384,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/login`;
return this.httpClient.request<string>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<string>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -429,11 +435,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/logout`;
return this.httpClient.request<any>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -495,12 +502,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -66,26 +66,30 @@ export class Configuration {
*/
credentials: {[ key: string ]: string | (() => string | undefined)};
constructor(configurationParameters: ConfigurationParameters = {}) {
this.apiKeys = configurationParameters.apiKeys;
this.username = configurationParameters.username;
this.password = configurationParameters.password;
this.accessToken = configurationParameters.accessToken;
this.basePath = configurationParameters.basePath;
this.withCredentials = configurationParameters.withCredentials;
this.encoder = configurationParameters.encoder;
if (configurationParameters.encodeParam) {
this.encodeParam = configurationParameters.encodeParam;
constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
else {
this.encodeParam = param => this.defaultEncodeParam(param);
if (username !== undefined) {
this.username = username;
}
if (configurationParameters.credentials) {
this.credentials = configurationParameters.credentials;
if (password !== undefined) {
this.password = password;
}
else {
this.credentials = {};
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
// init default petstore_auth credential
if (!this.credentials['petstore_auth']) {

View File

@@ -90,12 +90,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<Pet>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: pet,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -148,11 +149,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -209,12 +211,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByStatus`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -272,12 +275,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByTags`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -328,11 +332,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Pet>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -393,12 +398,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<Pet>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: pet,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -471,12 +477,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -553,12 +560,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`;
return this.httpClient.request<ApiResponse>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<ApiResponse>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -73,11 +73,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -123,11 +124,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/inventory`;
return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -175,11 +177,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Order>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -236,12 +239,13 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order`;
return this.httpClient.request<Order>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: order,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -85,12 +85,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -148,12 +149,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithArray`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -211,12 +213,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithList`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -265,11 +268,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -317,11 +321,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<User>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<User>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -379,12 +384,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/login`;
return this.httpClient.request<string>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<string>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -429,11 +435,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/logout`;
return this.httpClient.request<any>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -495,12 +502,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -66,26 +66,30 @@ export class Configuration {
*/
credentials: {[ key: string ]: string | (() => string | undefined)};
constructor(configurationParameters: ConfigurationParameters = {}) {
this.apiKeys = configurationParameters.apiKeys;
this.username = configurationParameters.username;
this.password = configurationParameters.password;
this.accessToken = configurationParameters.accessToken;
this.basePath = configurationParameters.basePath;
this.withCredentials = configurationParameters.withCredentials;
this.encoder = configurationParameters.encoder;
if (configurationParameters.encodeParam) {
this.encodeParam = configurationParameters.encodeParam;
constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
else {
this.encodeParam = param => this.defaultEncodeParam(param);
if (username !== undefined) {
this.username = username;
}
if (configurationParameters.credentials) {
this.credentials = configurationParameters.credentials;
if (password !== undefined) {
this.password = password;
}
else {
this.credentials = {};
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
// init default petstore_auth credential
if (!this.credentials['petstore_auth']) {

View File

@@ -90,12 +90,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<Pet>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: pet,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -148,11 +149,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -209,12 +211,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByStatus`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -272,12 +275,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByTags`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -328,11 +332,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Pet>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -393,12 +398,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<Pet>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: pet,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -471,12 +477,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -553,12 +560,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`;
return this.httpClient.request<ApiResponse>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<ApiResponse>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -73,11 +73,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -123,11 +124,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/inventory`;
return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -175,11 +177,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Order>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -236,12 +239,13 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order`;
return this.httpClient.request<Order>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: order,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -85,12 +85,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -148,12 +149,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithArray`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -211,12 +213,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithList`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -265,11 +268,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -317,11 +321,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<User>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<User>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -379,12 +384,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/login`;
return this.httpClient.request<string>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<string>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -429,11 +435,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/logout`;
return this.httpClient.request<any>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -495,12 +502,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -66,26 +66,30 @@ export class Configuration {
*/
credentials: {[ key: string ]: string | (() => string | undefined)};
constructor(configurationParameters: ConfigurationParameters = {}) {
this.apiKeys = configurationParameters.apiKeys;
this.username = configurationParameters.username;
this.password = configurationParameters.password;
this.accessToken = configurationParameters.accessToken;
this.basePath = configurationParameters.basePath;
this.withCredentials = configurationParameters.withCredentials;
this.encoder = configurationParameters.encoder;
if (configurationParameters.encodeParam) {
this.encodeParam = configurationParameters.encodeParam;
constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
else {
this.encodeParam = param => this.defaultEncodeParam(param);
if (username !== undefined) {
this.username = username;
}
if (configurationParameters.credentials) {
this.credentials = configurationParameters.credentials;
if (password !== undefined) {
this.password = password;
}
else {
this.credentials = {};
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
// init default petstore_auth credential
if (!this.credentials['petstore_auth']) {

View File

@@ -90,12 +90,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<Pet>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: pet,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -148,11 +149,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -209,12 +211,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByStatus`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -272,12 +275,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByTags`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -328,11 +332,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Pet>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -393,12 +398,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<Pet>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: pet,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -471,12 +477,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -553,12 +560,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`;
return this.httpClient.request<ApiResponse>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<ApiResponse>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -73,11 +73,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -123,11 +124,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/inventory`;
return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -175,11 +177,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Order>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -236,12 +239,13 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order`;
return this.httpClient.request<Order>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: order,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -85,12 +85,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -148,12 +149,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithArray`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -211,12 +213,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithList`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -265,11 +268,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -317,11 +321,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<User>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<User>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -379,12 +384,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/login`;
return this.httpClient.request<string>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<string>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -429,11 +435,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/logout`;
return this.httpClient.request<any>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
@@ -495,12 +502,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress

View File

@@ -66,26 +66,30 @@ export class Configuration {
*/
credentials: {[ key: string ]: string | (() => string | undefined)};
constructor(configurationParameters: ConfigurationParameters = {}) {
this.apiKeys = configurationParameters.apiKeys;
this.username = configurationParameters.username;
this.password = configurationParameters.password;
this.accessToken = configurationParameters.accessToken;
this.basePath = configurationParameters.basePath;
this.withCredentials = configurationParameters.withCredentials;
this.encoder = configurationParameters.encoder;
if (configurationParameters.encodeParam) {
this.encodeParam = configurationParameters.encodeParam;
constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
else {
this.encodeParam = param => this.defaultEncodeParam(param);
if (username !== undefined) {
this.username = username;
}
if (configurationParameters.credentials) {
this.credentials = configurationParameters.credentials;
if (password !== undefined) {
this.password = password;
}
else {
this.credentials = {};
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
// init default petstore_auth credential
if (!this.credentials['petstore_auth']) {

View File

@@ -92,12 +92,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<Pet>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: pet,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -153,11 +154,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -217,12 +219,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByStatus`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -283,12 +286,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByTags`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -342,11 +346,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Pet>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -410,12 +415,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<Pet>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: pet,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -491,12 +497,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -576,12 +583,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`;
return this.httpClient.request<ApiResponse>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<ApiResponse>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,

View File

@@ -75,11 +75,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -128,11 +129,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/inventory`;
return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -183,11 +185,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Order>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -247,12 +250,13 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order`;
return this.httpClient.request<Order>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: order,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,

View File

@@ -87,12 +87,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -153,12 +154,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithArray`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -219,12 +221,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithList`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -276,11 +279,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -331,11 +335,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<User>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<User>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -396,12 +401,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/login`;
return this.httpClient.request<string>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<string>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -449,11 +455,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/logout`;
return this.httpClient.request<any>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -518,12 +525,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,

View File

@@ -66,26 +66,30 @@ export class Configuration {
*/
credentials: {[ key: string ]: string | (() => string | undefined)};
constructor(configurationParameters: ConfigurationParameters = {}) {
this.apiKeys = configurationParameters.apiKeys;
this.username = configurationParameters.username;
this.password = configurationParameters.password;
this.accessToken = configurationParameters.accessToken;
this.basePath = configurationParameters.basePath;
this.withCredentials = configurationParameters.withCredentials;
this.encoder = configurationParameters.encoder;
if (configurationParameters.encodeParam) {
this.encodeParam = configurationParameters.encodeParam;
constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
else {
this.encodeParam = param => this.defaultEncodeParam(param);
if (username !== undefined) {
this.username = username;
}
if (configurationParameters.credentials) {
this.credentials = configurationParameters.credentials;
if (password !== undefined) {
this.password = password;
}
else {
this.credentials = {};
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
// init default petstore_auth credential
if (!this.credentials['petstore_auth']) {

View File

@@ -92,12 +92,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<Pet>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: pet,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -153,11 +154,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -217,12 +219,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByStatus`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -283,12 +286,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByTags`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -342,11 +346,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Pet>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -410,12 +415,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<Pet>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: pet,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -491,12 +497,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -576,12 +583,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`;
return this.httpClient.request<ApiResponse>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<ApiResponse>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,

View File

@@ -75,11 +75,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -128,11 +129,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/inventory`;
return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -183,11 +185,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Order>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -247,12 +250,13 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order`;
return this.httpClient.request<Order>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: order,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,

View File

@@ -87,12 +87,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -153,12 +154,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithArray`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -219,12 +221,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithList`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -276,11 +279,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -331,11 +335,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<User>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<User>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -396,12 +401,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/login`;
return this.httpClient.request<string>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<string>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -449,11 +455,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/logout`;
return this.httpClient.request<any>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -518,12 +525,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,

View File

@@ -66,26 +66,30 @@ export class Configuration {
*/
credentials: {[ key: string ]: string | (() => string | undefined)};
constructor(configurationParameters: ConfigurationParameters = {}) {
this.apiKeys = configurationParameters.apiKeys;
this.username = configurationParameters.username;
this.password = configurationParameters.password;
this.accessToken = configurationParameters.accessToken;
this.basePath = configurationParameters.basePath;
this.withCredentials = configurationParameters.withCredentials;
this.encoder = configurationParameters.encoder;
if (configurationParameters.encodeParam) {
this.encodeParam = configurationParameters.encodeParam;
constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
else {
this.encodeParam = param => this.defaultEncodeParam(param);
if (username !== undefined) {
this.username = username;
}
if (configurationParameters.credentials) {
this.credentials = configurationParameters.credentials;
if (password !== undefined) {
this.password = password;
}
else {
this.credentials = {};
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
// init default petstore_auth credential
if (!this.credentials['petstore_auth']) {

View File

@@ -92,12 +92,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<Pet>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: pet,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -153,11 +154,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -217,12 +219,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByStatus`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -283,12 +286,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByTags`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -342,11 +346,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Pet>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -410,12 +415,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<Pet>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: pet,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -491,12 +497,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -576,12 +583,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`;
return this.httpClient.request<ApiResponse>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<ApiResponse>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,

View File

@@ -75,11 +75,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -128,11 +129,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/inventory`;
return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -183,11 +185,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Order>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -247,12 +250,13 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order`;
return this.httpClient.request<Order>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: order,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,

View File

@@ -87,12 +87,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -153,12 +154,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithArray`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -219,12 +221,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithList`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -276,11 +279,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -331,11 +335,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<User>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<User>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -396,12 +401,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/login`;
return this.httpClient.request<string>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<string>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -449,11 +455,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/logout`;
return this.httpClient.request<any>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -518,12 +525,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,

View File

@@ -66,26 +66,30 @@ export class Configuration {
*/
credentials: {[ key: string ]: string | (() => string | undefined)};
constructor(configurationParameters: ConfigurationParameters = {}) {
this.apiKeys = configurationParameters.apiKeys;
this.username = configurationParameters.username;
this.password = configurationParameters.password;
this.accessToken = configurationParameters.accessToken;
this.basePath = configurationParameters.basePath;
this.withCredentials = configurationParameters.withCredentials;
this.encoder = configurationParameters.encoder;
if (configurationParameters.encodeParam) {
this.encodeParam = configurationParameters.encodeParam;
constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
else {
this.encodeParam = param => this.defaultEncodeParam(param);
if (username !== undefined) {
this.username = username;
}
if (configurationParameters.credentials) {
this.credentials = configurationParameters.credentials;
if (password !== undefined) {
this.password = password;
}
else {
this.credentials = {};
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
// init default petstore_auth credential
if (!this.credentials['petstore_auth']) {

View File

@@ -7,6 +7,8 @@
"module": "es6",
"moduleResolution": "node",
"removeComments": true,
"strictNullChecks": true,
"exactOptionalPropertyTypes": true,
"sourceMap": true,
"outDir": "./dist",
"noLib": false,

View File

@@ -92,12 +92,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<Pet>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: pet,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -153,11 +154,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -217,12 +219,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByStatus`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -283,12 +286,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/findByTags`;
return this.httpClient.request<Array<Pet>>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<Pet>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -342,11 +346,12 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Pet>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -410,12 +415,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet`;
return this.httpClient.request<Pet>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Pet>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: pet,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -491,12 +497,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -576,12 +583,13 @@ export class PetService extends BaseService {
}
let localVarPath = `/pet/${this.configuration.encodeParam({name: "petId", value: petId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/uploadImage`;
return this.httpClient.request<ApiResponse>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<ApiResponse>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,

View File

@@ -75,11 +75,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -128,11 +129,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/inventory`;
return this.httpClient.request<{ [key: string]: number; }>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<{ [key: string]: number; }>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -183,11 +185,12 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order/${this.configuration.encodeParam({name: "orderId", value: orderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`;
return this.httpClient.request<Order>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -247,12 +250,13 @@ export class StoreService extends BaseService {
}
let localVarPath = `/store/order`;
return this.httpClient.request<Order>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Order>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: order,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,

View File

@@ -87,12 +87,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -153,12 +154,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithArray`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -219,12 +221,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/createWithList`;
return this.httpClient.request<any>('post', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -276,11 +279,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('delete', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -331,11 +335,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<User>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<User>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -396,12 +401,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/login`;
return this.httpClient.request<string>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<string>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -449,11 +455,12 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/logout`;
return this.httpClient.request<any>('get', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,
@@ -518,12 +525,13 @@ export class UserService extends BaseService {
}
let localVarPath = `/user/${this.configuration.encodeParam({name: "username", value: username, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
return this.httpClient.request<any>('put', `${this.configuration.basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: user,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
transferCache: localVarTransferCache,

View File

@@ -66,26 +66,30 @@ export class Configuration {
*/
credentials: {[ key: string ]: string | (() => string | undefined)};
constructor(configurationParameters: ConfigurationParameters = {}) {
this.apiKeys = configurationParameters.apiKeys;
this.username = configurationParameters.username;
this.password = configurationParameters.password;
this.accessToken = configurationParameters.accessToken;
this.basePath = configurationParameters.basePath;
this.withCredentials = configurationParameters.withCredentials;
this.encoder = configurationParameters.encoder;
if (configurationParameters.encodeParam) {
this.encodeParam = configurationParameters.encodeParam;
constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
else {
this.encodeParam = param => this.defaultEncodeParam(param);
if (username !== undefined) {
this.username = username;
}
if (configurationParameters.credentials) {
this.credentials = configurationParameters.credentials;
if (password !== undefined) {
this.password = password;
}
else {
this.credentials = {};
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
// init default petstore_auth credential
if (!this.credentials['petstore_auth']) {

View File

@@ -7,6 +7,8 @@
"module": "es6",
"moduleResolution": "node",
"removeComments": true,
"strictNullChecks": true,
"exactOptionalPropertyTypes": true,
"sourceMap": true,
"outDir": "./dist",
"noLib": false,